From 136ffdaf3b3db2124da18131629867fc2dc40e46 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 23 Aug 2024 20:15:16 +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 --- .../sgzb/app/mapper/BackReceiveMapper.java | 2 + .../service/impl/BackReceiveServiceImpl.java | 12 +++-- .../mapper/app/BackReceiveMapper.xml | 52 +++++++++++++++++++ 3 files changed, 62 insertions(+), 4 deletions(-) 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 6a8ecac..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 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 4944bf8..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 @@ -147,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; @@ -167,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,修改机具状态 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 10bc92d..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 @@ -714,6 +714,58 @@ + +