From 99fe304cd74eb9076268689d835461baab9d41ae Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 26 Aug 2024 21:26:03 +0800 Subject: [PATCH 1/4] fix bug --- .../src/main/resources/mapper/material/AgreementInfoMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml index f6d67a8..ada1126 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/AgreementInfoMapper.xml @@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" auth_person, phone, update_by, - protocol, + protocol, update_time, remark, company_id, From 2a7961c72af6fcc532c3eb8d036157b17e66625a Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 27 Aug 2024 09:35:18 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=83=A8=E5=88=86=E9=80=80=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/base/api/domain/BackApplyInfo.java | 5 ++ sgzb-auth/src/main/resources/bootstrap.yml | 2 +- sgzb-gateway/src/main/resources/bootstrap.yml | 2 +- sgzb-modules/sgzb-material/pom.xml | 2 +- .../sgzb/app/mapper/BackReceiveMapper.java | 4 + .../service/impl/BackReceiveServiceImpl.java | 19 ++++- .../src/main/resources/bootstrap.yml | 2 +- .../mapper/app/BackReceiveMapper.xml | 78 +++++++++++++++++-- .../src/main/resources/bootstrap.yml | 2 +- 9 files changed, 102 insertions(+), 14 deletions(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java index e916f52..101a712 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/BackApplyInfo.java @@ -281,6 +281,11 @@ public class BackApplyInfo extends BaseEntity { @ApiModelProperty(value = "数量") private String num; + /** + * 已完成的退料数量 + */ + private String finishedBackNum; + @ApiModelProperty(value = "详情id和数量") private String detailsIdByNum; diff --git a/sgzb-auth/src/main/resources/bootstrap.yml b/sgzb-auth/src/main/resources/bootstrap.yml index 82f42c7..0117fe0 100644 --- a/sgzb-auth/src/main/resources/bootstrap.yml +++ b/sgzb-auth/src/main/resources/bootstrap.yml @@ -9,4 +9,4 @@ spring: name: sgzb-auth profiles: # 环境配置 - active: sgzb_cloud_local + active: sgzb_cq_local diff --git a/sgzb-gateway/src/main/resources/bootstrap.yml b/sgzb-gateway/src/main/resources/bootstrap.yml index 6ffe4e5..c26d13d 100644 --- a/sgzb-gateway/src/main/resources/bootstrap.yml +++ b/sgzb-gateway/src/main/resources/bootstrap.yml @@ -9,4 +9,4 @@ spring: name: sgzb-gateway profiles: # 环境配置 - active: sgzb_cloud_local + active: sgzb_cq_local diff --git a/sgzb-modules/sgzb-material/pom.xml b/sgzb-modules/sgzb-material/pom.xml index bb600d0..8f2647b 100644 --- a/sgzb-modules/sgzb-material/pom.xml +++ b/sgzb-modules/sgzb-material/pom.xml @@ -9,7 +9,7 @@ 4.0.0 - sgzb-modules-material-cq1.0 + sgzb-modules-material-common-3.0 sgzb-modules-material diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java index 3301dbf..f5113b0 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java @@ -32,6 +32,8 @@ public interface BackReceiveMapper { */ List receiveView(BackApplyInfo record); + List receiveView2(BackApplyInfo record); + /** * 添加接收数据back_check_details * @param record @@ -207,4 +209,6 @@ public interface BackReceiveMapper { List getCtList(BackApplyInfo record); List backReceiveRecordWebPt(BackApplyInfo record); + + int finishBackCheckDetails(BackApplyInfo record); } \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java index 1caf9e0..c90173f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java @@ -98,6 +98,10 @@ public class BackReceiveServiceImpl implements BackReceiveService { return res; } + private int finishBackCheckDetails(BackApplyInfo record) { + return backReceiveMapper.finishBackCheckDetails(record); + } + @Override @Transactional(rollbackFor = Exception.class) public int setCodeBack(BackApplyInfo record) { @@ -143,7 +147,7 @@ public class BackReceiveServiceImpl implements BackReceiveService { @Override @Transactional(rollbackFor = Exception.class) public int endBack(BackApplyInfo record) { - int res; + int res = 0; // try { int taskId = record.getTaskId(); int passNum = 0; @@ -163,9 +167,13 @@ public class BackReceiveServiceImpl implements BackReceiveService { throw new RuntimeException("该退料单已完成退料"); } //修改任务状态 - res = updateTaskStatus(taskId, 40); - if (res == 0) { - throw new RuntimeException("tm_task修改状态"); + List list = backReceiveMapper.receiveView2(record); + boolean allZeros = list.stream().allMatch(n -> Double.valueOf(n.getNum()).intValue() == 0); + if (allZeros) { + res = updateTaskStatus(taskId, 40); + if (res == 0) { + throw new RuntimeException("tm_task修改状态"); + } } //更加退料接收的数据创建下一步流程 //合格的插入入库记录input_apply_details,修改库存ma_type,修改机具状态 @@ -236,6 +244,9 @@ public class BackReceiveServiceImpl implements BackReceiveService { record.setPostStoreNum(postStoreNum); } + //完成退料的部分,更新 back_check_details 为 is_finished=1,此部分不支持撤回 + finishBackCheckDetails(record); + //库存日志 record.setBackNum(passNum+maintenanceNum+scrapNum); record.setPassNum(passNum); diff --git a/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml index d0a0f1e..34dca85 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml @@ -5,4 +5,4 @@ spring: name: sgzb-material profiles: # 环境配置 - active: sgzb_cloud_local \ No newline at end of file + active: sgzb_cq_local \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml index e9a59cb..a4047b9 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml @@ -578,8 +578,13 @@ status = '1' where id = #{info.id} + + + update back_check_details set is_finished = 1 where parent_id = #{parentId} and type_id = #{typeId} and (is_finished is null or is_finished != 1) + + - delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId} + delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId} and (is_finished is null or is_finished != 1) and ma_id = #{maId} @@ -669,6 +674,7 @@ bad.status as status, IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num, mt.manage_type as manageType, + bb.finished_back_num, mtk.user_id, CONCAT('NSJJ',mt.`code`,mt.model_code) as `code` FROM @@ -688,6 +694,16 @@ parent_id=#{id} GROUP BY type_id ) aa on aa.typeId=bad.type_id + LEFT JOIN ( + SELECT + type_id as typeId, + SUM(IFNULL(back_num,0)) as finished_back_num + FROM + back_check_details + WHERE + parent_id=#{id} and is_finished = 1 + GROUP BY type_id + ) bb on bb.typeId=bad.type_id WHERE bai.id=#{id} @@ -698,6 +714,58 @@ + + @@ -723,7 +791,7 @@ LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id WHERE parent_id=#{parentId} - and bcd.back_status='1' + and bcd.back_status='1' and (bcd.is_finished is null or bcd.is_finished != 1)