From 8cd2b82f04ec0aaff94baa2fdc9b880267497242 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Mon, 16 Dec 2024 09:28:26 +0800 Subject: [PATCH] =?UTF-8?q?wms=E5=86=B2=E9=94=80bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/RemoteSapService.java | 2 + .../api/factory/RemoteSapFallbackFactory.java | 5 ++ .../op/sap/service/impl/SapItemSyncImpl.java | 2 +- .../controller/WmsRawOrderInController.java | 5 ++ .../WmsSellOutEmbryoController.java | 2 +- .../wms/service/IOdsProcureOrderService.java | 2 + .../impl/OdsProcureOrderServiceImpl.java | 66 +++++++++++++++++++ 7 files changed, 82 insertions(+), 2 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java index 49ecc06a..c7fc7b7c 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java @@ -142,6 +142,8 @@ public interface RemoteSapService { public R handleUpdateSAP103(@RequestBody(required = false)List mapList); @PostMapping("/sap/handleUpdateSAP105") public R handleUpdateSAP105(@RequestBody(required = false)List mapList); + @PostMapping("/sap/handleUpdateSAP102") + R handleUpdateSAP102(List mapList); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java index 1d130973..f6ec47f1 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java @@ -163,6 +163,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory mapList) { + return R.fail("102的冲销失败" + throwable.getMessage()); + } + }; } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java index e2b998dd..2940ae06 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapItemSyncImpl.java @@ -1145,7 +1145,7 @@ public class SapItemSyncImpl implements SapItemSyncService { MESSAGE = func2.getExportParameterList().getString("L_MSG"); MATERIALDOCUMENT = func2.getExportParameterList().getString("MATERIALDOCUMENT"); MATDOCUMENTYEAR = func2.getExportParameterList().getString("MATDOCUMENTYEAR"); - log.info("103冲销结果结果-----" + RETCODE+"/" +MESSAGE+"/" +MATERIALDOCUMENT+"/" +MATDOCUMENTYEAR); + log.info("105冲销结果结果-----" + RETCODE+"/" +MESSAGE+"/" +MATERIALDOCUMENT+"/" +MATDOCUMENTYEAR); } if((Constants.FAIL).equals(Integer.parseInt(RETCODE))){ return R.fail(MESSAGE); diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsRawOrderInController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsRawOrderInController.java index 3cc9e3fd..dab56a67 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsRawOrderInController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsRawOrderInController.java @@ -116,4 +116,9 @@ public class WmsRawOrderInController extends BaseController { String result = odsProcureOrderService.handleUpdateSAP105(odsProcureOrder); return success(result); } + @PostMapping("/handleUpdateSAP102") + public AjaxResult handleUpdateSAP102(@RequestBody List odsProcureOrder) { + String result = odsProcureOrderService.handleUpdateSAP102(odsProcureOrder); + return success(result); + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java index 481d42ac..f80fdf82 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java @@ -143,7 +143,7 @@ public class WmsSellOutEmbryoController extends BaseController { - @PostMapping("addRE") + @PostMapping("/addRE") public AjaxResult addRE(@RequestBody List wmsSellOutEmbryoList) { return success(wmsSellOutEmbryoService.addRE(wmsSellOutEmbryoList)); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java index 2de0716f..167a24fb 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IOdsProcureOrderService.java @@ -153,4 +153,6 @@ public interface IOdsProcureOrderService { String addOrderCardXNew(OdsProcureOrder orderList); String upbatCardXNew(OdsProcureOrder order); + + String handleUpdateSAP102(List odsProcureOrder); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java index 86290bb7..6938a111 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java @@ -1566,6 +1566,72 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { return result; } + @Override + public String handleUpdateSAP102(List odsProcureOrders) { + String result="操作成功"; + for (OdsProcureOrder order: odsProcureOrders){ + OdsProcureOrder odsProcureOrder = order; + WmsRawOrderIn wmsRawOrderIn= wmsRawOrderInMapper.selectWmsRawOrderInByRawOrderInIdThress(odsProcureOrder.getID()); + //这个地方 + Map paramMap=new HashMap<>(); + List mapList = new ArrayList<>(); + paramMap.put("S_MBLNR",wmsRawOrderIn.getUserDefined1()); + paramMap.put("S_MJAHR",wmsRawOrderIn.getUserDefined2()); + paramMap.put("S_MATNR",wmsRawOrderIn.getMaterialCode()); + paramMap.put("incomeBatchNo",wmsRawOrderIn.getIncomeBatchNo()); //批次 + paramMap.put("ebelp",wmsRawOrderIn.getPoLine()); + paramMap.put("poNo",wmsRawOrderIn.getPoNo()); + mapList.add(paramMap); + R result2 = remoteSapService.handleUpdateSAP102(mapList); + if (result2.getCode()==200){ + Map map = new HashMap(); + map = (Map) result2.getData(); + String MATERIALDOCUMENT = (String) map.get("MATERIALDOCUMENT"); + String MATDOCUMENTYEAR = (String) map.get("MATDOCUMENTYEAR"); + //成功了--成功了,根据 + WmsRawOrderInSn wmsRawOrderInSn=new WmsRawOrderInSn(); + wmsRawOrderInSn.setUserDefined5(wmsRawOrderIn.getDnNo()); + wmsRawOrderInSn.setUserDefined1("1");//暂收 + + wmsRawOrderInSn.setUserDefined3(wmsRawOrderIn.getKem()); + List wmsRawOrderInSnList= wmsRawOrderInSnMapper.selectWmsRawOrderInSnList(wmsRawOrderInSn); + for (WmsRawOrderInSn wmsRawOrderInSn1: + wmsRawOrderInSnList) { + WmsOdsMateStorageNewsSn wmsRawOrderInNewsSn=new WmsOdsMateStorageNewsSn(); + wmsRawOrderInNewsSn.setMaterialCode(wmsRawOrderInSn1.getMaterialCode()); + wmsRawOrderInNewsSn.setWaCode(wmsRawOrderInSn1.getWaCode()); + wmsRawOrderInNewsSn.setWhCode(wmsRawOrderInSn1.getWhCode()); + wmsRawOrderInNewsSn.setWlCode(wmsRawOrderInSn1.getWlCode()); + wmsRawOrderInNewsSn.setUserDefined3("1"); + wmsOdsMateStorageNewsSnMapper.updateWmsOdsMateStorageNewsSnTWM(wmsRawOrderInNewsSn); + wmsRawOrderInSn1.setUserDefined1("2"); + wmsRawOrderInSnMapper.updateWmsRawOrderInSn(wmsRawOrderInSn1); + WmsOdsMateStorageNews wmsOdsMateStorageNews=new WmsOdsMateStorageNews(); + wmsOdsMateStorageNews.setMaterialCode(wmsRawOrderInSn1.getMaterialCode()); + wmsOdsMateStorageNews.setWaCode(wmsRawOrderInSn1.getWaCode()); + wmsOdsMateStorageNews.setWlCode(wmsRawOrderInSn1.getWlCode()); + wmsOdsMateStorageNews.setWhCode(wmsRawOrderInSn1.getWhCode()); + wmsOdsMateStorageNews.setStorageAmount(wmsRawOrderInSn1.getAmount()); + wmsOdsMateStorageNewsMapper.updateWmsOdsMateStorageNewsUpdateStorageAmount(wmsOdsMateStorageNews); + } + wmsRawOrderIn.setOrderStatus("1"); + wmsRawOrderIn.setAccountingTime(new Date()); + wmsRawOrderIn.setAccountingMessage(result2.getMsg()); + wmsRawOrderIn.setUserDefined4(MATERIALDOCUMENT); + wmsRawOrderIn.setUserDefined5(MATDOCUMENTYEAR); + wmsRawOrderInMapper.updateWmsRawOrderIn(wmsRawOrderIn); + + }else { + //失败了 + wmsRawOrderIn.setAccountingTime(new Date()); + wmsRawOrderIn.setAccountingMessage(result2.getMsg()); + wmsRawOrderInMapper.updateWmsRawOrderIn(wmsRawOrderIn); + + } + } + return result; + } + @Override @DS("#header.poolName") public String getIdCardListDA(OdsProcureOrder odsProcureOrder) {