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 917933fd..330d280f 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 @@ -627,6 +627,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { lthw.setMaterial(consume.getMaterialCode());//物料编码 if(StringUtils.isNotBlank(consume.getRspos())){//自主加的物料 lthw.setRspos(consume.getRspos());//sap物料项目凭证 + }else{ + int xhnumber = Integer.parseInt(consumes.get(0).getRspos())+1; + String paddedNumber = String.format("%04d", xhnumber); + lthw.setRspos(paddedNumber);//sap物料项目凭证(手动添加的,系统进行累加) } lt_hwList.add(lthw); } @@ -933,4 +937,9 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { return R.fail("班次交接最后一车数据修正:完成"); } + public static void main(String args[]){ + int xhnumber = Integer.parseInt("005")+1; + String paddedNumber = String.format("%04d", xhnumber); + System.out.println(paddedNumber); + } } 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 3cca0d89..fb7f539a 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,6 +187,7 @@ 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