From 0e973d74c15888d6e41ca145399ef270fc093095 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 25 Jun 2024 09:25:58 +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=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/mes/service/impl/IWCInterfaceServiceImpl.java | 9 +++++++++ .../resources/mapper/mes/MesReportWorkConsumeMapper.xml | 1 + 2 files changed, 10 insertions(+) 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