From 31370e80c4a9e8b18eece8f0f41ada80a8034e3b Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Wed, 3 Apr 2024 14:53:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?wms=E6=88=90=E5=93=81=E8=BD=AC=E5=82=A8?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B930?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/wms/service/impl/WmsProductPutServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6b1e50c3..a294539a 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 @@ -1011,7 +1011,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { wmsFpStorageNews2.setAmount(amountAdd); wmsFpStorageNewsMapper.updateWmsFpStorageNews(wmsFpStorageNews2); } else { - wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews); + wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews1); } return result1; } From f32a40142a2790fbab3de1246761503887e84b82 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 3 Apr 2024 15:39:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?2024-4-3=20=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=AE=A1=E7=90=86-=E4=BC=98=E5=8C=96SQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml | 2 +- .../op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml | 2 +- .../src/main/resources/mapper/wms/BaseWarehouseMapper.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml index acefd746..c51f16bf 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseAreaMapper.xml @@ -212,7 +212,7 @@ diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml index c8562b4d..63d319a7 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseBomMapper.xml @@ -267,7 +267,7 @@ - select count(*) + select count(1) from base_warehouse and del_flag = '0' From 35e453de09bd8a535a02dde6e541656d74bcffc0 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Wed, 3 Apr 2024 16:18:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=88=90=E5=93=81=E5=A4=87=E8=B4=A7?= =?UTF-8?q?=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/RemoteSapService.java | 6 ++ .../api/factory/RemoteSapFallbackFactory.java | 5 ++ .../com/op/sap/controller/SapController.java | 8 ++ .../op/sap/service/SapItemSyncService.java | 2 + .../op/sap/service/impl/SapItemSyncImpl.java | 83 ++++++++++++++++++- 5 files changed, 103 insertions(+), 1 deletion(-) 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 4e304fbc..f300bfec 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 @@ -113,4 +113,10 @@ public interface RemoteSapService { @PostMapping("/sap/sapOrderReceipt") public R sapOrderReceipt(@RequestBody(required = false) List> mapList); + /** + * 成品备货单 + */ + @PostMapping("/sap/FPinventory") + public R FPinventory(@RequestBody(required = false) 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 2ceb5036..88d65ae5 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 @@ -124,6 +124,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory> mapList) { + return R.fail("成品备货单获取失败" + throwable.getMessage()); + } + }; } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java index 1d80b017..05d50143 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/controller/SapController.java @@ -480,5 +480,13 @@ public class SapController extends BaseController { return sapItemSyncService.FPinventory(mapList); } + /** + * 智慧工厂105移动类型(来料库存转换) + */ + @PostMapping("/incomingConversion") + @Log(title = "来料库存转换接口", businessType = BusinessType.SAP) + public R incomingConversion(@RequestBody(required = false) Map mapList) { + return sapItemSyncService.incomingConversion(mapList); + } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java index f6fcb886..3bf189a3 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapItemSyncService.java @@ -34,4 +34,6 @@ public interface SapItemSyncService { R inComingCheck(Map mapList); R FPinventory(Map mapList); + + R incomingConversion(Map mapList); } 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 41400e15..040a4d2e 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 @@ -444,6 +444,85 @@ public class SapItemSyncImpl implements SapItemSyncService { @Override public R FPinventory(Map mapList) { + try { + JCoRepository repository = dest.getRepository(); + JCoFunction func = repository.getFunction("ZMES_ZSDR29"); + if (func == null) { + throw new RuntimeException("Function does not exist in SAP"); + } + log.info("成品备货单参数-------" + mapList.toString()); + JCoTable S_TDDAT = func.getTableParameterList().getTable("S_TDDAT"); + JCoTable S_MATNR = func.getTableParameterList().getTable("S_MATNR"); + System.out.println(S_TDDAT); + System.out.println(S_MATNR); + if (mapList==null || mapList.size()==0) + { + return R.fail("参数不能为空"); + } + if (StringUtils.isNotEmpty(mapList.get("S_MATNR").toString())){ + S_TDDAT.appendRow(); + S_TDDAT.setValue(Constants.SIGN, "I"); + S_TDDAT.setValue(Constants.OPTION, "BT"); + S_TDDAT.setValue(Constants.LOW, mapList.get("S_MATNR").toString()); + } + if (StringUtils.isNotEmpty(mapList.get("S_TDDAT").toString())){ + S_TDDAT.appendRow(); + S_TDDAT.setValue(Constants.SIGN, "I"); + S_TDDAT.setValue(Constants.OPTION, "BT"); + S_TDDAT.setValue(Constants.LOW, mapList.get("S_TDDAT").toString()); + S_TDDAT.setValue(Constants.HIGH, END_DATE); + } + func.execute(dest);//执行调用函数 + String RETCODE=func.getExportParameterList().getString("RETCODE"); + String MSG=func.getExportParameterList().getString("MSG"); + JCoTable maraTable = func.getTableParameterList().getTable("LT_CP"); + List> mapResult=new ArrayList<>(); + for (int i = 0; i < maraTable.getNumRows(); i++) { + maraTable.setRow(i); + Map map=new HashMap(); + String MATNR=maraTable.getString("MATNR");//物料号 + String MAKTX=maraTable.getString("MAKTX");//物料描述 + String VBELN=maraTable.getString("VBELN");//交货单 + String VBELN_VA=maraTable.getString("VBELN_VA");//销售单 + String MENGE=maraTable.getString("MENGE");//数量 + String MEINS=maraTable.getString("MEINS");//单位 + String TDDAT=maraTable.getString("TDDAT");//计划日期 + String KUNNR=maraTable.getString("KUNNR");//送达方 + String KUNNR_NM=maraTable.getString("KUNNR_NM");//送达方描述 + String LIFNR=maraTable.getString("LIFNR");//货运代理 + String LIFNR_NM=maraTable.getString("LIFNR_NM");//货运代理描述 + String ZSAREA=maraTable.getString("ZSAREA");//销售大区 + String BZTXT1=maraTable.getString("BZTXT1");//销售大区描述 + log.info("物料号"+MATNR+"物料描述"+MAKTX+"交货单"+VBELN+"销售单"+VBELN_VA+ + "数量"+MENGE+"单位"+MEINS+"计划日期"+TDDAT+"送达方"+KUNNR+"送达方描述"+KUNNR_NM+"货运代理"+LIFNR+ + "货运代理描述"+LIFNR_NM+"销售大区"+ZSAREA+"销售大区描述"+BZTXT1); + map.put("MATNR",MATNR); + map.put("MAKTX",MAKTX); + map.put("VBELN",VBELN); + map.put("VBELN_VA",VBELN_VA); + map.put("MENGE",MENGE); + map.put("MEINS",MEINS); + map.put("TDDAT",TDDAT); + map.put("KUNNR",KUNNR); + map.put("KUNNR_NM",KUNNR_NM); + map.put("LIFNR",LIFNR); + map.put("LIFNR_NM",LIFNR_NM); + map.put("ZSAREA",ZSAREA); + map.put("BZTXT1",BZTXT1); + mapResult.add(map); + } + if ((Constants.FAIL).equals(Integer.parseInt(RETCODE))){ + return R.fail(MSG); + } + return R.ok(mapResult,MSG); + } catch (Exception e) { + log.error(e.getMessage()); + return R.fail(e.getMessage()); + } + } + + @Override + public R incomingConversion(Map mapList) { try { JCoRepository repository = dest.getRepository(); JCoFunction func = repository.getFunction("ZMES_ZSDR29"); @@ -456,7 +535,7 @@ public class SapItemSyncImpl implements SapItemSyncService { S_TDDAT.appendRow(); S_TDDAT.setValue(Constants.SIGN, "I"); S_TDDAT.setValue(Constants.OPTION, "BT"); - S_TDDAT.setValue(Constants.LOW, "20231201"); + S_TDDAT.setValue(Constants.LOW, "20240301"); S_TDDAT.setValue("HIGH", END_DATE); System.out.println(S_TDDAT); System.out.println(S_MATNR); @@ -479,4 +558,6 @@ public class SapItemSyncImpl implements SapItemSyncService { return R.fail(e.getMessage()); } } + + }