后台修试管理代码提交
This commit is contained in:
parent
d53020f434
commit
1115686d36
|
|
@ -43,4 +43,6 @@ public interface LeaseApplyDetailsMapper {
|
||||||
int updateBatchSelective(List<LeaseApplyDetails> list);
|
int updateBatchSelective(List<LeaseApplyDetails> list);
|
||||||
|
|
||||||
int batchInsert(@Param("list") List<LeaseApplyDetails> list);
|
int batchInsert(@Param("list") List<LeaseApplyDetails> list);
|
||||||
|
|
||||||
|
List<LeaseApplyDetails> getByParentId(Integer parentId);
|
||||||
}
|
}
|
||||||
|
|
@ -46,4 +46,7 @@ public interface LeaseOutDetailsMapper {
|
||||||
*/
|
*/
|
||||||
int insertAgreementInfo(@Param("record") LeaseOutDetails leaseOutDetails);
|
int insertAgreementInfo(@Param("record") LeaseOutDetails leaseOutDetails);
|
||||||
|
|
||||||
|
String getTaskId(Integer parentId);
|
||||||
|
|
||||||
|
int updateTaskStatus(@Param("taskId") String taskId,@Param("status")int status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package com.bonus.sgzb.app.service.impl;
|
package com.bonus.sgzb.app.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper;
|
||||||
import com.bonus.sgzb.app.mapper.LeaseOutDetailsMapper;
|
import com.bonus.sgzb.app.mapper.LeaseOutDetailsMapper;
|
||||||
import com.bonus.sgzb.app.service.LeaseOutDetailsService;
|
import com.bonus.sgzb.app.service.LeaseOutDetailsService;
|
||||||
|
import com.bonus.sgzb.base.api.domain.LeaseApplyDetails;
|
||||||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||||
import com.bonus.sgzb.base.mapper.MaMachineMapper;
|
import com.bonus.sgzb.base.mapper.MaMachineMapper;
|
||||||
|
|
@ -11,6 +13,7 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description: 领料出库详情接口实现类
|
* Description: 领料出库详情接口实现类
|
||||||
|
|
@ -25,7 +28,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private LeaseOutDetailsMapper leaseOutDetailsMapper;
|
private LeaseOutDetailsMapper leaseOutDetailsMapper;
|
||||||
|
@Resource
|
||||||
|
private LeaseApplyDetailsMapper leaseApplyDetailsMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private MaMachineMapper maMachineMapper;
|
private MaMachineMapper maMachineMapper;
|
||||||
|
|
||||||
|
|
@ -69,6 +73,19 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
if (updateMaTypeStockNum > 0) {
|
if (updateMaTypeStockNum > 0) {
|
||||||
// if (updateMaMachineStatus > 0) {
|
// if (updateMaMachineStatus > 0) {
|
||||||
// if (insertAgreementInfo > 0) {
|
// if (insertAgreementInfo > 0) {
|
||||||
|
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId());
|
||||||
|
int i = 0;
|
||||||
|
for (LeaseApplyDetails bean : leaseApplyDetailsList){
|
||||||
|
if (Objects.equals(bean.getPreNum(), bean.getAlNum())){
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String taskId = leaseOutDetailsMapper.getTaskId(record.getParentId());
|
||||||
|
if (i == leaseApplyDetailsList.size()){
|
||||||
|
leaseOutDetailsMapper.updateTaskStatus(taskId,35);
|
||||||
|
}else {
|
||||||
|
leaseOutDetailsMapper.updateTaskStatus(taskId,34);
|
||||||
|
}
|
||||||
return AjaxResult.success("领料出库成功!");
|
return AjaxResult.success("领料出库成功!");
|
||||||
// }
|
// }
|
||||||
// return AjaxResult.error("领料出库失败,插入任务协议信息错误!");
|
// return AjaxResult.error("领料出库失败,插入任务协议信息错误!");
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,13 @@
|
||||||
from lease_apply_details
|
from lease_apply_details
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getByParentId" resultType="com.bonus.sgzb.base.api.domain.LeaseApplyDetails">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from lease_apply_details
|
||||||
|
where parennt_id = #{parentId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
delete from lease_apply_details
|
delete from lease_apply_details
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getTaskId" resultType="java.lang.String">
|
||||||
|
select task_id
|
||||||
|
from lease_apply_info
|
||||||
|
where id = #{parentId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateLeaseApplyDetailsOutNum">
|
<update id="updateLeaseApplyDetailsOutNum">
|
||||||
UPDATE
|
UPDATE
|
||||||
|
|
@ -121,6 +126,11 @@
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateTaskStatus">
|
||||||
|
update tm_task
|
||||||
|
set task_status = #{status}
|
||||||
|
where task_id = #{taskId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<insert id="insertAgreementInfo">
|
<insert id="insertAgreementInfo">
|
||||||
insert into tm_task_agreement
|
insert into tm_task_agreement
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
for (RepairAuditDetails repairAuditDetails : repairAuditDetailsList) {
|
for (RepairAuditDetails repairAuditDetails : repairAuditDetailsList) {
|
||||||
Long typeId = repairAuditDetails.getTypeId();
|
Long typeId = repairAuditDetails.getTypeId();
|
||||||
Long maId = repairAuditDetails.getMaId();
|
Long maId = repairAuditDetails.getMaId();
|
||||||
BigDecimal repairNum = repairAuditDetails.getRepairNum();
|
BigDecimal repairNum = repairAuditDetails.getRepairedNum();
|
||||||
BigDecimal b = new BigDecimal(0);
|
BigDecimal b = new BigDecimal(0);
|
||||||
// 创建修饰后入库任务
|
// 创建修饰后入库任务
|
||||||
if (repairNum.compareTo(b) > 0) {
|
if (repairNum.compareTo(b) > 0) {
|
||||||
|
|
@ -202,7 +202,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
repairInputDetails.setTaskId(task.getTaskId());
|
repairInputDetails.setTaskId(task.getTaskId());
|
||||||
repairInputDetails.setAuditId(repairAuditDetails.getId());
|
repairInputDetails.setAuditId(repairAuditDetails.getId());
|
||||||
repairInputDetails.setRepairId(repairAuditDetails.getRepairId());
|
repairInputDetails.setRepairId(repairAuditDetails.getRepairId());
|
||||||
repairInputDetails.setRepairNum(repairAuditDetails.getRepairNum());
|
repairInputDetails.setRepairNum(repairAuditDetails.getRepairedNum());
|
||||||
repairInputDetails.setTypeId(repairAuditDetails.getTypeId());
|
repairInputDetails.setTypeId(repairAuditDetails.getTypeId());
|
||||||
repairInputDetails.setMaId(repairAuditDetails.getMaId());
|
repairInputDetails.setMaId(repairAuditDetails.getMaId());
|
||||||
repairInputDetails.setStatus("0");
|
repairInputDetails.setStatus("0");
|
||||||
|
|
|
||||||
|
|
@ -32,19 +32,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectScrapApplyDetailsList" parameterType="com.bonus.sgzb.material.domain.ScrapApplyDetails" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
|
<select id="selectScrapApplyDetailsList" parameterType="com.bonus.sgzb.material.domain.ScrapApplyDetails" resultType="com.bonus.sgzb.material.vo.ScrapApplyDetailsVO">
|
||||||
select tk.code scrapNum,tk.task_status taskStatus, dic.name taskStatusName, bui.unit_name unitName,bpl.lot_name projectName,
|
SELECT
|
||||||
tk.create_by createBy, tk.create_time createTime, tk.remark ,tk1.code repairNum,tk.task_id taskId
|
tk.CODE scrapNum,
|
||||||
from tm_task tk
|
tk.task_status taskStatus,
|
||||||
left join tm_task_agreement tta on tk.task_id = tta.task_id
|
dic.NAME taskStatusName,
|
||||||
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
|
bui.unit_name unitName,
|
||||||
left join bm_project_lot bpl on bai.project_id = bpl.lot_id
|
bpl.lot_name projectName,
|
||||||
left join bm_unit_info bui on bai.unit_id = bui.unit_id
|
tk.create_by createBy,
|
||||||
left join scrap_apply_details sad on tk.task_id = sad.task_id
|
tk.create_time createTime,
|
||||||
left join tm_task tk1 on sad.parent_id = tk1.task_id
|
tk.remark,
|
||||||
left join (select id,p_id,name from sys_dic where p_id in (select id from sys_dic where value = 'bf_task')) dic on tk.task_status = dic.id
|
tk1.CODE repairNum,
|
||||||
left join ma_type mt on sad.type_id = mt.type_id
|
tk.task_id taskId
|
||||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
FROM
|
||||||
where sad.scrap_source in ('1','2') and tk.task_type = 57
|
tm_task tk
|
||||||
|
LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id
|
||||||
|
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
|
||||||
|
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
|
||||||
|
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id
|
||||||
|
LEFT JOIN scrap_apply_details sad ON tk.task_id = sad.task_id
|
||||||
|
LEFT JOIN tm_task tk1 ON sad.parent_id = tk1.task_id
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
p_id,
|
||||||
|
NAME
|
||||||
|
FROM
|
||||||
|
sys_dic
|
||||||
|
WHERE
|
||||||
|
p_id IN ( SELECT id FROM sys_dic WHERE VALUE = 'bf_task' )) dic ON tk.task_status = dic.id
|
||||||
|
LEFT JOIN ma_type mt ON sad.type_id = mt.type_id
|
||||||
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
|
WHERE
|
||||||
|
sad.scrap_source IN ( '1', '2' )
|
||||||
|
AND tk.task_type = 57
|
||||||
<if test="backUnit != null">
|
<if test="backUnit != null">
|
||||||
and bui.unit_id = #{backUnit}
|
and bui.unit_id = #{backUnit}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -60,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="backCode != null">
|
<if test="backCode != null">
|
||||||
and tk.code = #{backCode}
|
and tk.code = #{backCode}
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY tk.CODE
|
||||||
order by tk.create_time desc
|
order by tk.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<insert id="insertTmTaskAgreement" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement" useGeneratedKeys="true" keyProperty="taskId">
|
<insert id="insertTmTaskAgreement" parameterType="com.bonus.sgzb.material.domain.TmTaskAgreement" useGeneratedKeys="true" keyProperty="taskId">
|
||||||
insert into tm_task_agreement
|
insert into tm_task_agreement
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="task_id != null">task_id,</if>
|
||||||
<if test="agreementId != null">agreement_id,</if>
|
<if test="agreementId != null">agreement_id,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
create_time,
|
create_time,
|
||||||
|
|
@ -44,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="companyId != null">company_id,</if>
|
<if test="companyId != null">company_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="task_id != null">#{taskId},</if>
|
||||||
<if test="agreementId != null">#{agreementId},</if>
|
<if test="agreementId != null">#{agreementId},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
now(),
|
now(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue