From e918caa8b861f167006c210a294df6f8a5c049c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Fri, 8 Aug 2025 14:47:19 +0800 Subject: [PATCH] =?UTF-8?q?SAP=E6=8E=A5=E5=8F=A3ZIM=5F001=5FQUERY=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BAZWM3A05=EF=BC=8CZIM=5F001=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=BAZWM3A06?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OutPurchaseController.java | 4 ++-- .../nflg/wms/admin/service/SapService.java | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutPurchaseController.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutPurchaseController.java index e57dda81..d9d377e8 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutPurchaseController.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutPurchaseController.java @@ -60,7 +60,7 @@ public class OutPurchaseController extends BaseController { */ @GetMapping("getForOut") public ApiResult getForOut(String orderNo){ - Zim001QueryResultDTO result = sapService.zim001query(orderNo); + Zim001QueryResultDTO result = sapService.zwm3A05(orderNo, null, null); result.getItem1().parallelStream().forEach(it->{ it.setBinNos(binService.getBinNos(it.getMATNR(),it.getWERKS(),it.getLGORT())); }); @@ -119,7 +119,7 @@ public class OutPurchaseController extends BaseController { VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(errors)).throwMessage("以下物料的批次号不符合要求:"+StrUtil.join(",",errors)); //扣减库存 inventoryService.out(inventories); - sapService.zim001(request); + sapService.zwm3A06(request); return ApiResult.success(); } diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java index 63e3d9e8..4cd43929 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java @@ -111,15 +111,19 @@ public class SapService { /** * 查询采购单退库信息 * @param orderNo 采购单号 + * @param supplierNo 供应商编号 + * @param materialNo 物料编号 */ - public Zim001QueryResultDTO zim001query(String orderNo) { + public Zim001QueryResultDTO zwm3A05(String orderNo, String supplierNo, String materialNo) { Map parameters = new HashMap<>(); - parameters.put("EBELN", orderNo); + parameters.put("I_EBELN", orderNo); + parameters.put("I_LIFNR", supplierNo); + parameters.put("I_MATNR", materialNo); Zim001QueryResultDTO result=new Zim001QueryResultDTO(); - JCoFunction function = exec("ZIM_001_QUERY", parameters, null); + JCoFunction function = exec("ZWM3A05", parameters, null); - JCoStructure structure = function.getExportParameterList().getStructure("OUTPUT"); + JCoStructure structure = function.getExportParameterList().getStructure("E_RETURN"); VUtil.trueThrowBusinessError(!StrUtil.equals(structure.getString("TYPE"), "S")) .throwMessage("SAP错误:" + structure.getString("MSG")); @@ -162,7 +166,10 @@ public class SapService { return result; } - public void zim001(Zim001QueryResultDTO dto){ + public void zwm3A06(Zim001QueryResultDTO dto) { + Map parameters = new HashMap<>(); + parameters.put("I_EBELN", dto.getItem1().get(0).getEBELN()); + Map>> tables = new HashMap<>(); List> list1 = new ArrayList<>(); dto.getItem1().forEach(item -> { @@ -194,7 +201,7 @@ public class SapService { }); tables.put("INPUT2", list2); - JCoParameterList jparameters = execReturnParameter("ZIM_001", null, tables); + JCoParameterList jparameters = execReturnParameter("ZWM3A06", parameters, tables); JCoStructure structure=jparameters.getStructure("OUTPUT"); VUtil.trueThrowBusinessError(!StrUtil.equals(structure.getString("TYPE"), "S")) .throwMessage("SAP错误:" + structure.getString("MSG"));