From c97e3fc817038aa1017ca3a3ef4f7205ff965d17 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 25 Jun 2024 11:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=B7=A5-=E8=87=AA=E5=8A=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A1=B9=E7=9B=AE=E7=BC=96=E7=A0=812?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/mes/mapper/MesReportWorkConsumeMapper.java | 2 ++ .../mes/service/impl/IWCInterfaceServiceImpl.java | 2 +- .../mapper/mes/MesReportWorkConsumeMapper.xml | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java index ab8fa790..a45a914b 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java @@ -83,4 +83,6 @@ public interface MesReportWorkConsumeMapper { MesReportWorkConsume getNewConsumeInfo(String workorderCode); List getSumConsumeList(MesReportWorkConsume consumeqo); + + int getSumConsumeListNum(MesReportWorkConsume consumeqo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 330d280f..76b7cb7a 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -628,7 +628,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { if(StringUtils.isNotBlank(consume.getRspos())){//自主加的物料 lthw.setRspos(consume.getRspos());//sap物料项目凭证 }else{ - int xhnumber = Integer.parseInt(consumes.get(0).getRspos())+1; + int xhnumber = mesReportWorkConsumeMapper.getSumConsumeListNum(consumeqo);; String paddedNumber = String.format("%04d", xhnumber); lthw.setRspos(paddedNumber);//sap物料项目凭证(手动添加的,系统进行累加) } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml index fb7f539a..0c98d05d 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml @@ -187,7 +187,20 @@ and mrwc.workorder_code = #{workorderCode} and mrw.machine_code = #{machineCode} and mrwc.recoil = #{recoil} ) t group by t.materialCode,t.rspos - order by t.rspos desc + +