diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index 9319aa94..91c0d014 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -729,6 +729,7 @@ company_audit_by = #{record.companyAuditBy}, company_audit_time = now(), company_audit_remark = #{record.companyAuditRemark}, + status = #{record.status}, dept_audit_by = #{record.companyAuditBy}, diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java index 7f4d782f..89e8c99f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java @@ -20,6 +20,9 @@ public class BackApplyInfo extends BaseEntity { /** 退料ID */ @ApiModelProperty(value = "退料ID") private Long id; + /** 退料ID */ + @ApiModelProperty(value = "预报废列表审核旧taskId") + private Long oldTaskId; @ApiModelProperty(value="工程id") private Long projectId; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ScrapApplyDetailsMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ScrapApplyDetailsMapper.java index 886ce88e..80996ac2 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ScrapApplyDetailsMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/ScrapApplyDetailsMapper.java @@ -192,7 +192,7 @@ public interface ScrapApplyDetailsMapper { int updateMaStatus(@Param("maId") int maId, @Param("maStatus") String maStatus); - int selectNumByTypeId(@Param("parentId") String parentId, @Param("typeId") String typeId); + int selectNumByTypeId(@Param("parentId") String parentId, @Param("typeId") String typeId, @Param("taskId") Integer taskId); int selectCodeByMaIdAndTaskId(@Param("maId") Integer maId, @Param("taskId") Integer taskId); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java index 1900bda2..886059b0 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapApplyDetailsServiceImpl.java @@ -486,7 +486,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { if (arr.length > 0) { for (int i = 0; i < arr.length; i++) { //判断是否超出审核数量 - int re = scrapApplyDetailsMapper.selectNumByTypeId(arr[i].getParentId(), arr[i].getTypeId()); + int re = scrapApplyDetailsMapper.selectNumByTypeId(arr[i].getParentId(), arr[i].getTypeId(),record.getTaskId()); if (re <= 0) { res = -2; break; @@ -564,7 +564,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { } @Override -// @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = Exception.class) public int endback(ScrapAudit scrapAudit) { int res = 0; //参数校验 后期可以考虑写一个校验的工具类 @@ -821,6 +821,7 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService { BackApplyInfo[] arr = record.getArr(); if (arr.length > 0) { for (int i = 0; i < arr.length; i++) { + arr[i].setTaskId(record.getTaskId()); res = scrapApplyDetailsMapper.insertCheckDetails(arr[i]); String manageType = arr[i].getManageType(); if ("0".equals(manageType)) { diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckServiceCenterMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckServiceCenterMapper.xml index fc7ccb88..c2b1caff 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckServiceCenterMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckServiceCenterMapper.xml @@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -983,7 +988,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" scrap_apply_details bad WHERE bad.parent_id = #{parentId} - AND bad.type_id = #{typeId} UNION + AND bad.type_id = #{typeId} and bad.task_id = #{taskId} UNION SELECT 0 AS auditNum, SUM( @@ -992,7 +997,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" scrap_check_details bcd WHERE bcd.parent_id = #{parentId} - AND bcd.type_id = #{typeId} + AND bcd.type_id = #{typeId} and bcd.old_task_id = #{taskId} ) res HAVING backNum > -1 @@ -1001,7 +1006,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" COUNT(*) FROM scrap_check_details bcd - LEFT JOIN scrap_apply_details sad ON bcd.parent_id = sad.parent_id + LEFT JOIN scrap_apply_details sad ON bcd.parent_id = sad.parent_id and bcd.old_task_id = sad.task_id WHERE bcd.ma_id = #{maId} AND sad.task_id = #{taskId} @@ -1029,6 +1034,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE scd.parent_id = #{parentId} AND scd.type_id = #{typeId} + AND scd.old_task_id = #{taskId} GROUP BY scd.type_id ORDER BY @@ -1051,6 +1057,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE scd.parent_id = #{parentId} AND scd.type_id = #{typeId} + AND scd.old_task_id = #{taskId} and mm.ma_code like concat('%', #{maCode}, '%') @@ -1077,7 +1084,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM scrap_check_details scd1 LEFT JOIN scrap_apply_details sad1 ON scd1.parent_id = sad1.parent_id - AND scd1.type_id = sad1.type_id + AND scd1.type_id = sad1.type_id and scd1.old_task_id = sad1.task_id WHERE sad1.task_id = #{taskId} GROUP BY scd1.parent_id, @@ -1114,6 +1121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id WHERE bai.task_id = #{taskId} + AND bcd.old_task_id = bai.task_id AND bcd.back_status = '1'