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 f5113b0..6f35191 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 @@ -30,9 +30,9 @@ public interface BackReceiveMapper { * @param record 查询条件 * @return List */ - List receiveView(BackApplyInfo record); + List receiveView4FrontEnd(BackApplyInfo record); - List receiveView2(BackApplyInfo record); + List receiveView4Backend(BackApplyInfo record); /** * 添加接收数据back_check_details 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 2e706d0..2c8bf27 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 @@ -44,7 +44,7 @@ public class BackReceiveServiceImpl implements BackReceiveService { @Override public List receiveView(BackApplyInfo record) { - List backApplyInfoList = backReceiveMapper.receiveView(record); + List backApplyInfoList = backReceiveMapper.receiveView4FrontEnd(record); int count1 = 0; int count2 = 0; for (BackApplyInfo backApplyInfo : backApplyInfoList) { @@ -169,7 +169,7 @@ public class BackReceiveServiceImpl implements BackReceiveService { throw new RuntimeException("该退料单已完成退料"); } //修改任务状态 - List list = backReceiveMapper.receiveView2(record); + List list = backReceiveMapper.receiveView4Backend(record); if (!CollectionUtils.isEmpty(list)) { for (BackApplyInfo backApplyInfo : list) { maxBackNum += (int) backApplyInfo.getMaxBackNum(); 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 5930e32..d688661 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 @@ -659,7 +659,7 @@ bai.create_time DESC - SELECT bai.id, bai.task_id as taskId, @@ -672,7 +672,7 @@ bad.pre_num as preNum, bad.audit_num as auditNum, bad.status as status, - IFNULL(sai.num, 0)-IFNULL(aa.back_num,0) as max_back_num, + CASE WHEN (IFNULL(sai.num, 0)-IFNULL(aa.back_num,0)) < 0 THEN 0 ELSE (IFNULL(sai.num, 0)-IFNULL(aa.back_num,0)) END as max_back_num, IFNULL(aa.back_num,0) as in_completed_back_num, IFNULL(bb.finished_back_num, 0) as finished_back_num, mt.manage_type as manageType, @@ -717,7 +717,7 @@ - SELECT bai.id, bai.task_id as taskId, @@ -730,7 +730,7 @@ bad.pre_num as preNum, bad.audit_num as auditNum, bad.status as status, - IFNULL(sai.num, 0)-IFNULL(aa.back_num,0) as max_back_num, + IFNULL(sai.num, 0) as max_back_num, IFNULL(aa.back_num,0) as in_completed_back_num, IFNULL(bb.finished_back_num, 0) as finished_back_num, mt.manage_type as manageType,