SAP接口更改【订单同步、退货单输出】

master
Yangwl 7 months ago
parent 6bb5390cd3
commit 4aeedab8a0

@ -1,9 +1,10 @@
package com.op.system.api.domain.sap; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
public class SapShopOrderQuery { public class SapShopOrderQuery extends BaseEntity {
// S_AUFNR订单号 S_MATNR物料号 S_ERDAT(创建日期) // S_AUFNR订单号 S_MATNR物料号 S_ERDAT(创建日期)
private String aufnr; private String aufnr;
@ -13,6 +14,8 @@ public class SapShopOrderQuery {
private String quantity; private String quantity;
public String getQuantity() { public String getQuantity() {
return quantity; return quantity;
} }

@ -461,7 +461,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
if (func == null) { if (func == null) {
throw new RuntimeException("Function does not exist in SAP"); 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"); JCoTable S_TDDAT = func.getTableParameterList().getTable("S_TDDAT");
//物料号 //物料号
@ -474,28 +474,28 @@ public class SapItemSyncImpl implements SapItemSyncService {
{ {
return R.fail("参数不能为空"); 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.appendRow();
S_TDDAT.setValue(Constants.SIGN, "I"); S_TDDAT.setValue(Constants.SIGN, "I");
S_TDDAT.setValue(Constants.OPTION, "BT"); S_TDDAT.setValue(Constants.OPTION, "BT");
S_TDDAT.setValue(Constants.LOW, mapList.get("S_TDDAT").toString()); S_TDDAT.setValue(Constants.LOW, mapList.get("S_TDDAT").toString());
S_TDDAT.setValue(Constants.HIGH, END_DATE); 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.appendRow();
S_MATNR.setValue(Constants.SIGN, "I"); S_MATNR.setValue(Constants.SIGN, "I");
S_MATNR.setValue(Constants.OPTION, "BT"); S_MATNR.setValue(Constants.OPTION, "BT");
S_MATNR.setValue(Constants.LOW, mapList.get("S_MATNR").toString()); S_MATNR.setValue(Constants.LOW, mapList.get("S_MATNR").toString());
S_MATNR.setValue(Constants.HIGH, 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.appendRow();
S_VBELN.setValue(Constants.SIGN, "I"); S_VBELN.setValue(Constants.SIGN, "I");
S_VBELN.setValue(Constants.OPTION, "BT"); S_VBELN.setValue(Constants.OPTION, "BT");
S_VBELN.setValue(Constants.LOW, mapList.get("S_VBELN").toString()); S_VBELN.setValue(Constants.LOW, mapList.get("S_VBELN").toString());
S_VBELN.setValue(Constants.HIGH, 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.appendRow();
S_AUART.setValue(Constants.SIGN, "I"); S_AUART.setValue(Constants.SIGN, "I");
S_AUART.setValue(Constants.OPTION, "EQ"); S_AUART.setValue(Constants.OPTION, "EQ");

@ -60,6 +60,7 @@ public class SapOrderServiceImpl implements SapOrderService {
// System.out.println(jCoParameterList); // System.out.println(jCoParameterList);
// 配置传入参数 // 配置传入参数
// S_WERKS(工厂) S_AUFNR订单号 S_MATNR物料号 S_ERDAT(创建日期) 例如20230923 // S_WERKS(工厂) S_AUFNR订单号 S_MATNR物料号 S_ERDAT(创建日期) 例如20230923
//S_GSTRP(基本开始时间)
if (!StringUtils.isNull(sapShopOrderQuery.getWerk())) { if (!StringUtils.isNull(sapShopOrderQuery.getWerk())) {
JCoTable S_WERKS = func.getTableParameterList().getTable("S_PWERK"); 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.LOW, sapShopOrderQuery.getErdat());
S_ERDAT.setValue(Constants.HIGH, END_DATE); 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);//执行调用函数 func.execute(dest);//执行调用函数
// 获取 内表 - ZMES_PRO // 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO"); JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");

Loading…
Cancel
Save