From 4aeedab8a0c71beb3bac2699e9b3e3ded5b8c500 Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Wed, 12 Jun 2024 11:49:02 +0800 Subject: [PATCH] =?UTF-8?q?SAP=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E3=80=90=E8=AE=A2=E5=8D=95=E5=90=8C=E6=AD=A5=E3=80=81=E9=80=80?= =?UTF-8?q?=E8=B4=A7=E5=8D=95=E8=BE=93=E5=87=BA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/system/api/domain/sap/SapShopOrderQuery.java | 5 ++++- .../java/com/op/sap/service/impl/SapItemSyncImpl.java | 10 +++++----- .../com/op/sap/service/impl/SapOrderServiceImpl.java | 11 +++++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapShopOrderQuery.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapShopOrderQuery.java index 3b9e0f50..448f4be0 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapShopOrderQuery.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapShopOrderQuery.java @@ -1,9 +1,10 @@ package com.op.system.api.domain.sap; +import com.op.common.core.web.domain.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -public class SapShopOrderQuery { +public class SapShopOrderQuery extends BaseEntity { // S_AUFNR(订单号) S_MATNR(物料号) S_ERDAT(创建日期) private String aufnr; @@ -13,6 +14,8 @@ public class SapShopOrderQuery { private String quantity; + + public String getQuantity() { return quantity; } 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 9d38ce9e..3eefe63d 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 @@ -461,7 +461,7 @@ public class SapItemSyncImpl implements SapItemSyncService { if (func == null) { throw new RuntimeException("Function does not exist in SAP"); } - log.info("成品备货单参数-------" + mapList.toString()); + log.info("订单出参数-------" + mapList.toString()); //计划运输日期 JCoTable S_TDDAT = func.getTableParameterList().getTable("S_TDDAT"); //物料号 @@ -474,28 +474,28 @@ public class SapItemSyncImpl implements SapItemSyncService { { return R.fail("参数不能为空"); } - if (StringUtils.isNotEmpty(mapList.get("S_TDDAT").toString())){ + if (mapList.get("S_TDDAT")!=null&&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); } - if (StringUtils.isNotEmpty(mapList.get("S_MATNR").toString())){ + if (mapList.get("S_MATNR")!=null&&StringUtils.isNotEmpty(mapList.get("S_MATNR").toString())){ S_MATNR.appendRow(); S_MATNR.setValue(Constants.SIGN, "I"); S_MATNR.setValue(Constants.OPTION, "BT"); S_MATNR.setValue(Constants.LOW, mapList.get("S_MATNR").toString()); S_MATNR.setValue(Constants.HIGH, mapList.get("S_MATNR").toString()); } - if (StringUtils.isNotEmpty(mapList.get("S_VBELN").toString())){ + if (mapList.get("S_VBELN")!=null&&StringUtils.isNotEmpty(mapList.get("S_VBELN").toString())){ S_VBELN.appendRow(); S_VBELN.setValue(Constants.SIGN, "I"); S_VBELN.setValue(Constants.OPTION, "BT"); S_VBELN.setValue(Constants.LOW, mapList.get("S_VBELN").toString()); S_VBELN.setValue(Constants.HIGH, mapList.get("S_VBELN").toString()); } - if (StringUtils.isNotEmpty(mapList.get("S_AUART").toString())){ + if (mapList.get("S_AUART")!=null&&StringUtils.isNotEmpty(mapList.get("S_AUART").toString())){ S_AUART.appendRow(); S_AUART.setValue(Constants.SIGN, "I"); S_AUART.setValue(Constants.OPTION, "EQ"); diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java index dc8bf72c..6637997e 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java @@ -60,6 +60,7 @@ public class SapOrderServiceImpl implements SapOrderService { // System.out.println(jCoParameterList); // 配置传入参数 // S_WERKS(工厂) S_AUFNR(订单号) S_MATNR(物料号) S_ERDAT(创建日期) 例如:20230923 + //S_GSTRP(基本开始时间) if (!StringUtils.isNull(sapShopOrderQuery.getWerk())) { JCoTable S_WERKS = func.getTableParameterList().getTable("S_PWERK"); @@ -91,8 +92,14 @@ public class SapOrderServiceImpl implements SapOrderService { S_ERDAT.setValue(Constants.LOW, sapShopOrderQuery.getErdat()); S_ERDAT.setValue(Constants.HIGH, END_DATE); } - - + if (sapShopOrderQuery.getParams().size()!=0&&sapShopOrderQuery.getParams()!=null) { + JCoTable S_GSTRP = func.getTableParameterList().getTable("S_GSTRP"); + S_GSTRP.appendRow(); + S_GSTRP.setValue(Constants.SIGN, "I"); + S_GSTRP.setValue(Constants.OPTION, "BT"); + S_GSTRP.setValue(Constants.LOW, sapShopOrderQuery.getParams().get("planDateStart")); + S_GSTRP.setValue(Constants.HIGH, sapShopOrderQuery.getParams().get("planDateEnd")); + } func.execute(dest);//执行调用函数 // 获取 内表 - ZMES_PRO JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");