From a3fc3d3890462f30589b90a65cbf269a8e1d7b9f Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Thu, 22 Aug 2024 18:31:49 +0800 Subject: [PATCH] =?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 --- .../bonus/sgzb/app/mapper/BackReceiveMapper.java | 2 ++ .../app/service/impl/BackReceiveServiceImpl.java | 7 +++++++ .../resources/mapper/app/BackReceiveMapper.xml | 16 ++++++++++++++++ 3 files changed, 25 insertions(+) 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..6a8ecac 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 @@ -207,4 +207,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..4944bf8 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) { @@ -236,6 +240,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/mapper/app/BackReceiveMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/BackReceiveMapper.xml index e9a59cb..a25c478 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,6 +578,11 @@ status = '1' where id = #{info.id} + + + update back_check_details set is_finished = 1 where parent_id = #{parentId} and type_id = #{typeId} + + delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId} @@ -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}