From 31747dcf41ce1f4f1a3d8a999c3d31379e04a9ec Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Wed, 13 Dec 2023 14:45:59 +0800 Subject: [PATCH] =?UTF-8?q?SAP=E9=A2=86=E6=96=99=E8=BF=87=E8=B4=A6?= =?UTF-8?q?=E5=92=8C=E8=AE=A2=E5=8D=95=E6=8E=A5=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/sap/controller/SapController.java | 22 ++- .../op/sap/domain/vo/SapMaterialPosting.java | 47 ++++- .../sap/domain/vo/SapOrderReceiptQuery.java | 81 ++++++++ .../op/sap/service/SapItemSyncService.java | 4 +- .../com/op/sap/service/SapOrderService.java | 3 + .../op/sap/service/impl/SapItemSyncImpl.java | 175 +++++++++--------- .../sap/service/impl/SapOrderServiceImpl.java | 99 +++++++++- .../service/impl/SapRouterServiceImpl.java | 14 +- 8 files changed, 331 insertions(+), 114 deletions(-) create mode 100644 op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapOrderReceiptQuery.java 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 27226621..b5c9636c 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 @@ -1,5 +1,6 @@ package com.op.sap.controller; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.R; import com.op.common.core.web.controller.BaseController; @@ -377,12 +378,18 @@ public class SapController extends BaseController { } + /** + * 退料的移动类型为 262 + * 领料的移动类型为 261 + * @param sapMaterialPostingList + * @return + */ @PostMapping("/sapMaterialPosting") @Log(title = "订单物料领料过账、原材料补料、订单物料退料过账接口(MB1A)", businessType = BusinessType.SAP) - public R sapMaterialPosting(@RequestBody SapMaterialPosting sapMaterialPosting){ - return sapItemSyncService.sapMaterialPosting(sapMaterialPosting); + public R sapMaterialPosting(@RequestBody List sapMaterialPostingList){ + return sapItemSyncService.sapMaterialPosting(sapMaterialPostingList); } @@ -396,6 +403,17 @@ public class SapController extends BaseController { return sapOrderService.sapPurchaseOrderSync(sapPurchaseOrderQuery); } + /** + * 智慧工厂101类型订单收货 + * 订单为母订单 + * @param sapOrderReceiptQuery + * @return + */ + @PostMapping("/sapOrderReceipt") + @Log(title = "智慧工厂101类型订单收货", businessType = BusinessType.SAP) + public R sapOrderReceipt(@RequestBody SapOrderReceiptQuery sapOrderReceiptQuery){ + return sapOrderService.sapOrderReceipt(sapOrderReceiptQuery); + } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapMaterialPosting.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapMaterialPosting.java index 078c47cc..bb5c9577 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapMaterialPosting.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapMaterialPosting.java @@ -3,14 +3,18 @@ package com.op.sap.domain.vo; //智慧工厂-订单物料领料过账、原材料补料、订单物料退料过账(MB1A) /** - * AUFNR 订单号 - * BWART 移动类型 - * PLANT 工厂 - * LGORT 库存地点 - * MATNR 物料 - * QUANTITY 数量 - * MEINS 单位 - * BATCH 批号(可为空) + AUFNR CHAR 12 0 订单号 必填 + BWART CHAR 3 0 移动类型(库存管理) 必填 + PLANT CHAR 4 0 工厂 必填 + GL_ACCOUNT CHAR 10 0 总帐科目编号 选填 + COSTCENTER CHAR 10 0 成本中心 选填 + GR_RCPT CHAR 12 0 收货方/运达方 选填 + LGORT CHAR 4 0 库存地点 必填 + MATNR CHAR 18 0 物料号 必填 + QUANTITY QUAN 13 3 数量 必填 + MEINS UNIT 3 0 基本计量单位 必填 + BATCH CHAR 10 0 批号 选填 + */ public class SapMaterialPosting { @@ -24,12 +28,39 @@ public class SapMaterialPosting { private String aufnr; private String bwart; private String plant; + private String gl_account; + private String costcenter; + private String gr_rcpt; private String lgort; private String matnr; private String quantity; private String meins; private String batch; + public String getGl_account() { + return gl_account; + } + + public void setGl_account(String gl_account) { + this.gl_account = gl_account; + } + + public String getCostcenter() { + return costcenter; + } + + public void setCostcenter(String costcenter) { + this.costcenter = costcenter; + } + + public String getGr_rcpt() { + return gr_rcpt; + } + + public void setGr_rcpt(String gr_rcpt) { + this.gr_rcpt = gr_rcpt; + } + public String getAufnr() { return aufnr; } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapOrderReceiptQuery.java b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapOrderReceiptQuery.java new file mode 100644 index 00000000..a07f4d17 --- /dev/null +++ b/op-modules/op-sap/src/main/java/com/op/sap/domain/vo/SapOrderReceiptQuery.java @@ -0,0 +1,81 @@ +package com.op.sap.domain.vo; + +/** + * AUFNR CHAR12 订单号 必填 + * LGORT CHAR4 库位 必填 + * ERFMG QUAN-13-3 数量 必填 + * CHARG CHAR10 批号 必填 + * HSDAT DATS8 生产日期 必填 + * ERFME UNIT 条目单位 + * auth YangWL + */ + +public class SapOrderReceiptQuery { + + private String aufnr; + private String lgort; + private String erfmg; + private String charg; + private String hsdat; + private String erfme; + + public String getAufnr() { + return aufnr; + } + + public void setAufnr(String aufnr) { + this.aufnr = aufnr; + } + + public String getLgort() { + return lgort; + } + + public void setLgort(String lgort) { + this.lgort = lgort; + } + + public String getErfmg() { + return erfmg; + } + + public void setErfmg(String erfmg) { + this.erfmg = erfmg; + } + + public String getCharg() { + return charg; + } + + public void setCharg(String charg) { + this.charg = charg; + } + + public String getHsdat() { + return hsdat; + } + + public void setHsdat(String hsdat) { + this.hsdat = hsdat; + } + + public String getErfme() { + return erfme; + } + + public void setErfme(String erfme) { + this.erfme = erfme; + } + + @Override + public String toString() { + return "SapOrderReceiptQuery{" + + "aufnr='" + aufnr + '\'' + + ", lgort='" + lgort + '\'' + + ", erfmg='" + erfmg + '\'' + + ", charg='" + charg + '\'' + + ", hsdat='" + hsdat + '\'' + + ", erfme='" + erfme + '\'' + + '}'; + } +} 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 2e3152bb..ca620649 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 @@ -21,11 +21,11 @@ public interface SapItemSyncService { /** * 订单物料领料过账、原材料补料、订单物料退料过账接口(MB1A) - * @param sapMaterialPosting + * @param sapMaterialPostingList * @return */ - R sapMaterialPosting(SapMaterialPosting sapMaterialPosting); + R sapMaterialPosting(List sapMaterialPostingList); R sapBackflushMP(List sapBackflushMPQueryList); } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java b/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java index 945ab3e6..b5454ca2 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java @@ -2,6 +2,7 @@ package com.op.sap.service; import com.op.common.core.domain.R; +import com.op.sap.domain.vo.SapOrderReceiptQuery; import com.op.sap.domain.vo.SapPurchaseOrderQuery; import com.op.system.api.domain.sap.SapCloseOrderQuery; import com.op.system.api.domain.sap.SapCreateOrder; @@ -50,4 +51,6 @@ public interface SapOrderService { R sapPurchaseOrderSync(SapPurchaseOrderQuery sapPurchaseOrderQuery); R shopUpdateSync(SapShopOrderQuery sapProOrder); + + R sapOrderReceipt(SapOrderReceiptQuery sapOrderReceiptQuery); } 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 caa23494..4a91b777 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 @@ -28,6 +28,7 @@ import org.springframework.stereotype.Service; import javax.validation.Validator; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -225,7 +226,7 @@ public class SapItemSyncImpl implements SapItemSyncService { } @Override - public R sapMaterialPosting(SapMaterialPosting sapMaterialPosting) { + public R sapMaterialPosting(List sapMaterialPostingList) { try { // 获取调用 RFC 函数对象 @@ -233,90 +234,71 @@ public class SapItemSyncImpl implements SapItemSyncService { // JCoDestination dest = SAPConnUtils.connect(); JCoRepository repository = dest.getRepository(); JCoFunction func = repository.getFunction("ZPPR_MES_GOODSMVT_CREATE"); + if (func == null) { + throw new RuntimeException("Function does not exist in SAP"); + } + log.info("订单物料开始过账----------------------------------------"); // 配置传入参数 - JCoTable jCoTable = func.getTableParameterList().getTable("L_ITEM"); - System.out.println(jCoTable); + JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM"); + + for (SapMaterialPosting smp:sapMaterialPostingList){ + L_ITEM.appendRow(); + //订单号 + L_ITEM.setValue("AUFNR",smp.getAufnr()); + //移动类型 + L_ITEM.setValue("BWART",smp.getBwart()); + //工厂 + L_ITEM.setValue("PLANT",smp.getPlant()); + //总帐科目编号 + L_ITEM.setValue("GL_ACCOUNT",smp.getGl_account()); + //成本中心 + L_ITEM.setValue("COSTCENTER",smp.getCostcenter()); + //收货方/运达方 + L_ITEM.setValue("GR_RCPT",smp.getGr_rcpt()); + //库存地点 + L_ITEM.setValue("LGORT",smp.getLgort()); + //物料号 + L_ITEM.setValue("MATNR",smp.getMatnr()); + //数量 + L_ITEM.setValue("QUANTITY",smp.getQuantity()); + //基本计量单位 + L_ITEM.setValue("MEINS",smp.getMeins()); + //批号 + L_ITEM.setValue("BATCH",smp.getBatch()); - JCoParameterList AUFNR = func.getImportParameterList(); - System.out.println(AUFNR); - //订单 - if (!StringUtils.isNull(sapMaterialPosting.getAufnr())){ - -// AUFNR.appendRow(); -// AUFNR.setValue(Constants.SIGN, "I"); -// AUFNR.setValue(Constants.OPTION, "EQ"); -// AUFNR.setValue(Constants.LOW, sapMaterialPosting.getAufnr()); } -// //移动类型 -// if (!StringUtils.isNull(sapMaterialPosting.getBwart())){ -// JCoTable S_MATNR = func.getTableParameterList().getTable("BWART"); -// S_MATNR.appendRow(); -// S_MATNR.setValue(Constants.SIGN, "I"); -// S_MATNR.setValue(Constants.OPTION, "EQ"); -// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getBwart()); -// } -// //工厂 -// if (!StringUtils.isNull(sapMaterialPosting.getPlant())){ -// JCoTable S_MATNR = func.getTableParameterList().getTable("PLANT"); -// S_MATNR.appendRow(); -// S_MATNR.setValue(Constants.SIGN, "I"); -// S_MATNR.setValue(Constants.OPTION, "EQ"); -// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getPlant()); -// } -// /** -// * 物料信息 -// */ -// if (!StringUtils.isNull(sapMaterialPosting.getMatnr())){ -// JCoTable S_MATNR = func.getTableParameterList().getTable("MATNR"); -// S_MATNR.appendRow(); -// S_MATNR.setValue(Constants.SIGN, "I"); -// S_MATNR.setValue(Constants.OPTION, "EQ"); -// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getMatnr()); -// } -// //数量 -// if (!StringUtils.isNull(sapMaterialPosting.getQuantity())){ -// JCoTable S_MATNR = func.getTableParameterList().getTable("QUANTITY"); -// S_MATNR.appendRow(); -// S_MATNR.setValue(Constants.SIGN, "I"); -// S_MATNR.setValue(Constants.OPTION, "EQ"); -// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getQuantity()); -// } -// //单位 -// if (!StringUtils.isNull(sapMaterialPosting.getMeins())){ -// JCoTable S_MATNR = func.getTableParameterList().getTable("MEINS"); -// S_MATNR.appendRow(); -// S_MATNR.setValue(Constants.SIGN, "I"); -// S_MATNR.setValue(Constants.OPTION, "EQ"); -// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getMeins()); -// } -// //批号 -// JCoTable S_MATNR = func.getTableParameterList().getTable("BATCH"); -// S_MATNR.appendRow(); -// S_MATNR.setValue(Constants.SIGN, "I"); -// S_MATNR.setValue(Constants.OPTION, "EQ"); -// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getBatch()); - - // 获取调用 RFC 函数对象 - func.execute(dest); - // 获取 内表 - ZMES_PRO - JCoTable maraTable = func.getTableParameterList().getTable("LT_RETURN"); - JCoRecordMetaData metaData = maraTable.getRecordMetaData(); - System.out.println("###" + metaData.toString()); - for (int i = 0; i < maraTable.getNumRows(); i++) { - maraTable.setRow(i); - String RETCODE = maraTable.getString("RETCODE"); - System.out.println(RETCODE); - } - -// JCoRecordMetaData metaData = maraTable.getRecordMetaData(); -// System.out.println("###" + metaData.toString()); - - - if (func == null) { - throw new RuntimeException("Function does not exist in SAP"); + func.execute(dest); + JCoTable maraTable = func.getTableParameterList().getTable("LT_RETURN"); + JCoRecordMetaData metaData = maraTable.getRecordMetaData(); + System.out.println("###" + metaData.toString()); + StringBuilder Msg = new StringBuilder(); + for (int i = 0; i < maraTable.getNumRows(); i++) { + maraTable.setRow(i); + String TYPE = maraTable.getString("TYPE"); + String MESSAGE = maraTable.getString("MESSAGE"); + Msg.append(MESSAGE+"/"); + System.out.println("TYPE:"+TYPE); + System.out.println("MESSAGE:"+MESSAGE); + } + String L_MSG= func.getExportParameterList().getString("L_MSG"); + String RETCODE= func.getExportParameterList().getString("RETCODE"); + String MATERIALDOCUMENT= func.getExportParameterList().getString("MATERIALDOCUMENT"); + String MATDOCUMENTYEAR= func.getExportParameterList().getString("MATDOCUMENTYEAR"); + System.out.println("L_MSG"+L_MSG); + + System.out.println("返回值:0-没有错误,1-有错误:"+RETCODE); + System.out.println("物料凭证编号"+MATERIALDOCUMENT); + System.out.println("物料凭证年度"+MATDOCUMENTYEAR); + if (!("0").equals(RETCODE)){ + return R.fail("",Msg.toString()); + }else { + Map map=new HashMap(); + map.put("MATERIALDOCUMENT",MATERIALDOCUMENT); + map.put("MATDOCUMENTYEAR",MATDOCUMENTYEAR); + return R.ok(map,Msg.toString()); } - return R.ok(); + }catch (Exception e){ return R.fail(e.getMessage()); } @@ -330,6 +312,7 @@ public class SapItemSyncImpl implements SapItemSyncService { @Override public R sapBackflushMP(List sapBackflushMPQueryList) { + try { JCoRepository repository = dest.getRepository(); JCoFunction func = repository.getFunction("ZPPR_MES_GOODSMVT_CREATE_B"); @@ -338,7 +321,7 @@ public class SapItemSyncImpl implements SapItemSyncService { } JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM"); - System.out.println(L_ITEM); + // System.out.println(L_ITEM); // // int successNum = 0; @@ -375,23 +358,37 @@ public class SapItemSyncImpl implements SapItemSyncService { JCoTable maraTable = func.getTableParameterList().getTable("LT_RETURN"); JCoRecordMetaData metaData = maraTable.getRecordMetaData(); System.out.println("###" + metaData.toString()); + StringBuilder Msg = new StringBuilder(); for (int i = 0; i < maraTable.getNumRows(); i++) { maraTable.setRow(i); String TYPE = maraTable.getString("TYPE"); - System.out.println(TYPE); + String MESSAGE = maraTable.getString("MESSAGE"); + Msg.append(MESSAGE+"/"); + System.out.println("TYPE:"+TYPE); + System.out.println("MESSAGE:"+MESSAGE); } String L_MSG= func.getExportParameterList().getString("L_MSG"); String RETCODE= func.getExportParameterList().getString("RETCODE"); String MATERIALDOCUMENT= func.getExportParameterList().getString("MATERIALDOCUMENT"); String MATDOCUMENTYEAR= func.getExportParameterList().getString("MATDOCUMENTYEAR"); + System.out.println("L_MSG"+L_MSG); + + System.out.println("返回值:0-没有错误,1-有错误:"+RETCODE); + System.out.println("物料凭证编号"+MATERIALDOCUMENT); + System.out.println("物料凭证年度"+MATDOCUMENTYEAR); + if (!("0").equals(RETCODE)){ + return R.fail("",Msg.toString()); + }else { + Map map=new HashMap(); + map.put("MATERIALDOCUMENT",MATERIALDOCUMENT); + map.put("MATDOCUMENTYEAR",MATDOCUMENTYEAR); + return R.ok(map,Msg.toString()); + } - - System.out.println(L_MSG); - System.out.println(RETCODE); - System.out.println(MATERIALDOCUMENT); - System.out.println(MATDOCUMENTYEAR); - - return R.ok(); +// System.out.println("MATERIALDOCUMENT"+MATERIALDOCUMENT); +// System.out.println("MATDOCUMENTYEAR"+MATDOCUMENTYEAR); +// +// return R.ok(); }catch (Exception e){ return R.fail(e.getMessage()); 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 b29676a6..846a660b 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 @@ -7,6 +7,8 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; +import com.op.sap.domain.vo.SapBackflushMPQuery; +import com.op.sap.domain.vo.SapOrderReceiptQuery; import com.op.sap.domain.vo.SapPurchaseOrderQuery; import com.op.sap.service.SapOrderService; @@ -59,6 +61,7 @@ public class SapOrderServiceImpl implements SapOrderService { // 配置传入参数 // S_WERKS(工厂) S_AUFNR(订单号) S_MATNR(物料号) S_ERDAT(创建日期) 例如:20230923 + if (!StringUtils.isNull(sapShopOrderQuery.getWerk())){ JCoTable S_WERKS = func.getTableParameterList().getTable("S_PWERK"); S_WERKS.appendRow(); @@ -183,13 +186,15 @@ public class SapOrderServiceImpl implements SapOrderService { jCoParameterList.setValue("P_DATEE",sapCreateOrder.getDatee()); func.execute(dest);//执行调用函数 JCoParameterList J= func.getExportParameterList(); - // System.out.println(J); + System.out.println(func.getExportParameterList()); L_MSG= func.getExportParameterList().getString("L_MSG"); - String LV_ORDER_NUMBER= func.getExportParameterList().getString("LV_ORDER_NUMBER"); - + // String RETCODE = func.getExportParameterList().getString("RETCODE"); + //String LV_ORDER_NUMBER= func.getExportParameterList().getString("LV_ORDER_NUMBER"); +// if (RETCODE.equals(Constants.FAIL)){ +// return R.fail(LV_ORDER_NUM_List,L_MSG); +// } JCoTable LT_ZGD=func.getTableParameterList().getTable("LT_ZGD"); - // System.out.println(LT_ZGD); - //DynamicDataSourceContextHolder.push("ds_1000");//controller已经完成切换 + for (int i = 0; i sapBackflushMPQueryList=new ArrayList<>(); +// SapBackflushMPQuery sapBackflushMPQuery=new SapBackflushMPQuery(); +// sapBackflushMPQuery.setMatnr("000000020000000280"); +// sapBackflushMPQuery.setPlant("1000"); +// sapBackflushMPQuery.setLgort("0013"); +// sapBackflushMPQuery.setQuantity("3600"); +// sapBackflushMPQuery.setMeins("ST"); +// sapBackflushMPQueryList.add(sapBackflushMPQuery); +// System.out.println(JSONObject.toJSONString(sapBackflushMPQueryList)); +// } } diff --git a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java index bd78ae0b..c0aaf965 100644 --- a/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java +++ b/op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapRouterServiceImpl.java @@ -13,6 +13,8 @@ import com.op.sap.service.SapRouterService; import com.op.sap.util.SAPConnUtils; import com.op.system.api.domain.sap.*; import com.sap.conn.jco.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; @@ -27,6 +29,7 @@ import java.util.stream.Collectors; @Component @Service public class SapRouterServiceImpl implements SapRouterService { + private static final Logger log = LoggerFactory.getLogger(SapOrderServiceImpl.class); private static final String END_DATE="99991231"; @Autowired private SapProProcessMapper sapProProcessMapper; @@ -70,6 +73,7 @@ public class SapRouterServiceImpl implements SapRouterService { S_AEDAT 更改日期 */ + log.info("工艺路线同步入参-------"+sapRouterQuery.toString()); if (!StringUtils.isNull(sapRouterQuery.getMatnr())){ JCoTable S_MATNR = func.getTableParameterList().getTable("S_MATNR"); S_MATNR.appendRow(); @@ -118,7 +122,7 @@ public class SapRouterServiceImpl implements SapRouterService { // 获取 内表 - ZMES_PRO JCoTable maraTable = func.getTableParameterList().getTable("LT_ROUTING"); JCoRecordMetaData metaData = maraTable.getRecordMetaData(); - System.out.println("###" + metaData.toString()); + // System.out.println("###" + metaData.toString()); List sapProRouteList=new ArrayList<>(); //DynamicDataSourceContextHolder.push("ds_1000");//controller已经完成切换 for (int i = 0; i 0) { - failureMsg.insert(0, "很抱歉,同步失败!共 " + failureNum + " 工艺路线异常,错误如下:"); + failureMsg.insert(0, "很抱歉,同步失败!共 " + failureNum + " 工艺路线异常"); + log.error(failureMsg.toString()); throw new ServiceException(failureMsg.toString()); } else { - successMsg.insert(0, "恭喜您,数据同步成功!共 " + successNum + " 条,数据如下:"); + successMsg.insert(0, "恭喜您,数据同步成功!共 " + successNum + " 条"); } }catch (Exception e){ + log.error(e.getMessage()); return R.fail(e.getMessage()); } return R.ok(successMsg);