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 + +