From 5ca685d78ec2d2df4e1a0ee89ff534197de9c3b6 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Tue, 23 Apr 2024 11:52:14 +0800 Subject: [PATCH] =?UTF-8?q?wms=E6=88=90=E5=93=81=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B932?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WmsProductPutServiceImpl.java | 39 +++++++++++++++---- .../mapper/wms/WmsProductPutMapper.xml | 6 +++ 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java index 6e08d1d2..a55ef425 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java @@ -340,6 +340,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { String formattedDate = dateFormat.format(date);//批次 //List wmsProductPutList= new ArrayList<>(); List wmsReportWorkList = new ArrayList<>(); + List wmsReportWorkListTWO = new ArrayList<>(); List wmsReportWorkListRk = new ArrayList<>(); List wmsReportWorkListagain = new ArrayList<>(); //获取当前所选工厂 @@ -362,12 +363,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsProductPutk.setStatus("1"); wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit()); wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// - wmsProductPutk.setSapStatus("2");//过账失败的 + // wmsProductPutk.setSapStatus("2");//过账失败的 List wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); if (wmsProductPutList.size() > 0) { String id = wmsProductPutList.get(0).getId(); mesReportWork.setId(id); - wmsReportWorkList.add(mesReportWork);//已经插入过并且过账失败的 + wmsReportWorkList.add(mesReportWork);//已经插入 } else { wmsReportWorkListRk.add(mesReportWork);//第一次的 } @@ -387,11 +388,33 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { // wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit()); // wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// // wmsProductPutk.setSapStatus("2"); - // List wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); - // if (wmsProductPutList.size() > 0) { +// List wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); +// if (wmsProductPutList.size() > 0) {//已经插入 wmsReportWorkListagain.add(mesReportWork);// - // } +// } } + for (wmsReportWork mesReportWork : + wmsReportWorkList) { + WmsProductPut wmsProductPutk = new WmsProductPut(); + wmsProductPutk.setWorkOrder(mesReportWork.getReportCode()); + wmsProductPutk.setFactoryCode(factoryCode); + wmsProductPutk.setWhCode(mesReportWork.getWhCode());//仓库编码 + wmsProductPutk.setProductName(mesReportWork.getProductName()); + wmsProductPutk.setProductCode(mesReportWork.getProductCode()); + wmsProductPutk.setProductOrder(mesReportWork.getWorkorderCodeSap()); + wmsProductPutk.setPlanQuantity(mesReportWork.getQuantityFeedback()); + wmsProductPutk.setPutQuantity(mesReportWork.getQuantityQualified()); + wmsProductPutk.setStatus("1"); + wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit()); + wmsProductPutk.setBatchNumber(mesReportWork.getBatch());// + wmsProductPutk.setSapStatus("2"); + List wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk); + if (wmsProductPutList.size() > 0) {//已经插入且失败的 + wmsReportWorkListTWO.add(mesReportWork);// + } + } + + //先屏蔽起来 for (wmsReportWork mesReportWork : wmsReportWorkListRk) { @@ -494,10 +517,10 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsProductPutMapper.updateWmsProductPut(wmsProductPut2); } } - if (wmsReportWorkList.size() > 0) { + if (wmsReportWorkListTWO.size() > 0) { List> mapList = new ArrayList<>(); for (wmsReportWork mesReportWork : - wmsReportWorkList) { + wmsReportWorkListTWO) { Map map = new HashMap<>(); map.put("AUFNR", mesReportWork.getWorkorderCodeSap()); map.put("WERKS", factoryCode); @@ -515,7 +538,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { int code = result.getCode(); String msg = result.getMsg(); for (wmsReportWork mesReportWork : - wmsReportWorkList) { + wmsReportWorkListTWO) { WmsProductPut wmsProductPut2 = new WmsProductPut(); wmsProductPut2.setId(mesReportWork.getId()); wmsProductPut2.setSapMessage(msg); diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsProductPutMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsProductPutMapper.xml index 3b3be85e..80963fd3 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsProductPutMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsProductPutMapper.xml @@ -81,6 +81,7 @@ and attr9 = #{attr9} and attr10 = #{attr10} + ORDER BY create_time DESC + + + +