From 42aeb647a7150be45ea48da2110796f97b9e4651 Mon Sep 17 00:00:00 2001 From: yinq Date: Tue, 22 Apr 2025 08:44:58 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E5=8E=9F=E6=9D=90=E6=96=99?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E9=87=91=E8=9D=B6=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=E6=BA=90=E5=8D=95=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E5=86=85=E7=A0=81=E3=80=81=E6=BA=90=E5=8D=95=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E8=A1=8C=E5=86=85=E7=A0=81=E3=80=81=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/KingdeeErpSyncController.java | 71 +++++++++---------- .../service/impl/KingdeeErpService.java | 17 +++-- .../hw/wms/controller/WmsApiController.java | 21 +++--- .../java/com/hw/wms/domain/WmsRawInstock.java | 40 +++++++++++ .../impl/WmsErpScheduledTaskServiceImpl.java | 58 +++++++++++---- .../mapper/wms/WmsRawInstockMapper.xml | 11 ++- 6 files changed, 152 insertions(+), 66 deletions(-) diff --git a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java index 62b9d3d4..af6f915c 100644 --- a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java +++ b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/controller/KingdeeErpSyncController.java @@ -1,9 +1,8 @@ package com.hw.jindie.controller; import com.alibaba.fastjson2.JSONObject; +import com.hw.common.core.domain.R; import com.hw.common.core.web.domain.AjaxResult; -import com.hw.common.log.annotation.Log; -import com.hw.common.log.enums.BusinessType; import com.hw.common.security.annotation.InnerAuth; import com.hw.jindie.api.domain.vo.ErpSyncInfoVo; import com.hw.jindie.service.IKingdeeErpSyncService; @@ -53,12 +52,12 @@ public class KingdeeErpSyncController { @PostMapping("/syncUnitInfoFromErp") // @Log(title = "ERP单位信息", businessType = BusinessType.INSERT) // @InnerAuth - public AjaxResult syncUnitInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { + public R syncUnitInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { try { - return AjaxResult.success(kingdeeErpSyncService.syncUnitInfoFromErp(0, erpSyncInfoVo)); + return R.ok(AjaxResult.success(kingdeeErpSyncService.syncUnitInfoFromErp(0, erpSyncInfoVo))); } catch (Exception e) { logger.error("同步单位信息错误:" + e.getMessage()); - return AjaxResult.error(e.getMessage()); + return R.ok(AjaxResult.error(e.getMessage())); } } @@ -68,12 +67,12 @@ public class KingdeeErpSyncController { @PostMapping("/syncSupplierInfoFromErp") // @Log(title = "ERP供应商信息", businessType = BusinessType.INSERT) @InnerAuth - public AjaxResult syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { + public R syncSupplierInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { try { - return AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0, erpSyncInfoVo)); + return R.ok(AjaxResult.success(kingdeeErpSyncService.syncSupplierInfoFromErp(0, erpSyncInfoVo))); } catch (Exception e) { logger.error("同步供应商信息错误:" + e.getMessage()); - return AjaxResult.error(e.getMessage()); + return R.ok(AjaxResult.error(e.getMessage())); } } @@ -83,12 +82,12 @@ public class KingdeeErpSyncController { // @Log(title = "ERP物料信息", businessType = BusinessType.INSERT) @PostMapping(("/syncMaterialInfoFromErp")) // @InnerAuth - public AjaxResult syncMaterialInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { + public R syncMaterialInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { try { - return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0, erpSyncInfoVo)); + return R.ok(AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp(0, erpSyncInfoVo))); } catch (Exception e) { logger.error("同步物料信息错误:" + e.getMessage()); - return AjaxResult.error(e.getMessage()); + return R.ok(AjaxResult.error(e.getMessage())); } } @@ -100,12 +99,12 @@ public class KingdeeErpSyncController { @PostMapping("/syncProjectInfoFromErp") // @Log(title = "ERP项目信息", businessType = BusinessType.INSERT) @InnerAuth - public AjaxResult syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { + public R syncProjectInfoFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { try { - return AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0, erpSyncInfoVo)); + return R.ok(AjaxResult.success(kingdeeErpSyncService.syncProjectInfoFromErp(0, erpSyncInfoVo))); } catch (Exception e) { logger.error("同步项目信息错误:" + e.getMessage()); - return AjaxResult.error(e.getMessage()); + return R.ok(AjaxResult.error(e.getMessage())); } } @@ -115,12 +114,12 @@ public class KingdeeErpSyncController { @PostMapping("/syncSaleOrderFromErp") // @Log(title = "ERP销售订单", businessType = BusinessType.INSERT) // @InnerAuth - public AjaxResult syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { + public R syncSaleOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { try { - return AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0, erpSyncInfoVo)); + return R.ok(AjaxResult.success(kingdeeErpSyncService.syncSaleOrderFromErp(0, erpSyncInfoVo))); } catch (Exception e) { logger.error("同步销售订单信息错误:" + e.getMessage()); - return AjaxResult.error(e.getMessage()); + return R.ok(AjaxResult.error(e.getMessage())); } } @@ -131,27 +130,27 @@ public class KingdeeErpSyncController { @PostMapping("/syncPurchaseOrderFromErp") // @Log(title = "ERP采购订单", businessType = BusinessType.INSERT) @InnerAuth - public AjaxResult syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { + public R syncPurchaseOrderFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { try { - return AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0, erpSyncInfoVo)); + return R.ok(AjaxResult.success(kingdeeErpSyncService.syncPurchaseOrderFromErp(0, erpSyncInfoVo))); } catch (Exception e) { logger.error("同步采购订单信息错误:" + e.getMessage()); - return AjaxResult.error(e.getMessage()); + return R.ok(AjaxResult.error(e.getMessage())); } } /** - * 从ERP中同步采购订单信息到MES + * 从ERP中同步收料通知单到MES */ @PostMapping("/syncPurchaseReceiveBillFromErp") // @Log(title = "ERP采购收料单", businessType = BusinessType.INSERT) // @InnerAuth - public AjaxResult syncPurchaseReceiveBillFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { + public R syncPurchaseReceiveBillFromErp(@RequestBody ErpSyncInfoVo erpSyncInfoVo) { try { - return AjaxResult.success(kingdeeErpSyncService.syncPurchaseReceiveBillFromErp(0, erpSyncInfoVo)); + return R.ok(AjaxResult.success(kingdeeErpSyncService.syncPurchaseReceiveBillFromErp(0, erpSyncInfoVo))); } catch (Exception e) { logger.error("同步采购收料单信息错误:" + e.getMessage()); - return AjaxResult.error(e.getMessage()); + return R.ok(AjaxResult.error(e.getMessage())); } } @@ -165,11 +164,11 @@ public class KingdeeErpSyncController { @PostMapping(("/singleSavePurchaseRequisition")) // @Log(title = "ERP采购申请单", businessType = BusinessType.INSERT) @InnerAuth - public AjaxResult singleSavePurchaseRequisition(@RequestBody String params) { + public R singleSavePurchaseRequisition(@RequestBody String params) { try { - return AjaxResult.success(kingdeeErpService.singleSavePurchaseRequisition(params)); + return R.ok(AjaxResult.success(kingdeeErpService.singleSavePurchaseRequisition(params))); } catch (Exception e) { - return AjaxResult.error(e.toString()); + return R.ok(AjaxResult.error(e.toString())); } } @@ -183,11 +182,11 @@ public class KingdeeErpSyncController { * } */ @PostMapping(("/savePurchaseStorage")) - public AjaxResult savePurchaseStorage(@RequestBody String params) { + public R savePurchaseStorage(@RequestBody String params) { try { - return AjaxResult.success(kingdeeErpService.savePurchaseStorage(params)); + return R.ok(AjaxResult.success(kingdeeErpService.savePurchaseStorage(params))); } catch (Exception e) { - return AjaxResult.error(e.toString()); + return R.ok(AjaxResult.error(e.toString())); } } @@ -198,11 +197,11 @@ public class KingdeeErpSyncController { * @return {"msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"116470\",\"Number\":\"QTCK004153\",\"DIndex\":0}]}","code": 200} */ @PostMapping(("/saveOtherOutStorage")) - public AjaxResult saveOtherOutStorage(@RequestBody String params) { + public R saveOtherOutStorage(@RequestBody String params) { try { - return AjaxResult.success(kingdeeErpService.saveOtherOutStorage(params)); + return R.ok(AjaxResult.success(kingdeeErpService.saveOtherOutStorage(params))); } catch (Exception e) { - return AjaxResult.error(e.toString()); + return R.ok(AjaxResult.error(e.toString())); } } @@ -214,11 +213,11 @@ public class KingdeeErpSyncController { * @return { "msg": "{\"IsSuccess\":true,\"Errors\":[],\"SuccessEntitys\":[{\"Id\":\"100418\",\"Number\":\"QTRK000352\",\"DIndex\":0}]}", "code": 200} */ @PostMapping(("/saveOtherInStorage")) - public AjaxResult saveOtherInStorage(@RequestBody String params) { + public R saveOtherInStorage(@RequestBody String params) { try { - return AjaxResult.success(kingdeeErpService.saveOtherInStorage(params)); + return R.ok(AjaxResult.success(kingdeeErpService.saveOtherInStorage(params))); } catch (Exception e) { - return AjaxResult.error(e.toString()); + return R.ok(AjaxResult.error(e.toString())); } } diff --git a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java index 407b0686..cd80f602 100644 --- a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java +++ b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpService.java @@ -228,6 +228,9 @@ public class KingdeeErpService { String FStockId = (String) objectParams.get("FStockId");//仓库 String F_TOND_Base = (String) objectParams.get("FTondBase");//京源项目 String supplierCode = (String) objectParams.get("FSupplierCode");//供应商编码 + String FSBillId = (String) objectParams.get("FSBillId");//源单单据内码(上游单据:单据内码) + String FSId = (String) objectParams.get("FSId");//源单单据行内码(上游单据:单据行内码) + String FPOOrderNo = (String) objectParams.get("FPOOrderNo");//采购订单号 supplierCode = StringUtils.isEmpty(supplierCode)?"VEN04520":supplierCode; @@ -257,16 +260,18 @@ public class KingdeeErpService { FAuxPropIdObject.put("FAUXPROPID__FF100001", FAuxPropId); } FEntity.put("FAuxPropId", FAuxPropIdObject); //辅助属性 + FEntity.put("FPOOrderNo", FPOOrderNo);//采购订单号 + FEntity.put("FSRCBILLTYPEID", "PUR_ReceiveBill");//(明细信息)源单类型 FEntity.put("FSrcBillNo", FSrcBillNo); //源单编号 -/* ArrayList linkList = new ArrayList<>(); + ArrayList linkList = new ArrayList<>(); JSONObject linkObject = new JSONObject(); - linkObject.put("FInStockEntry_Link_FRuleId", "PUR_PurchaseOrder-STK_InStock"); //上游单据和下游单据之间的转换规则 - linkObject.put("FInStockEntry_Link_FSTableName", "t_PUR_POOrderEntry"); //源单(上游单据:对应的数据库表名称) - linkObject.put("FInStockEntry_Link_FSBillId", "108022"); //源单单据内码(上游单据:单据内码) - linkObject.put("FInStockEntry_Link_FSId", "165252"); //源单单据行内码(上游单据:单据行内码) + linkObject.put("FInStockEntry_Link_FRuleId", "PUR_ReceiveBill-STK_InStock"); //上游单据和下游单据之间的转换规则 + linkObject.put("FInStockEntry_Link_FSTableName", "T_PUR_ReceiveEntry"); //源单(上游单据:对应的数据库表名称) + linkObject.put("FInStockEntry_Link_FSBillId", FSBillId); //源单单据内码(上游单据:单据内码) + linkObject.put("FInStockEntry_Link_FSId", FSId); //源单单据行内码(上游单据:单据行内码) linkList.add(linkObject); - FEntity.put("FInStockEntry_Link", linkList);*/ + FEntity.put("FInStockEntry_Link", linkList); ArrayList entityList = new ArrayList<>(); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java index e4a26fc1..38488046 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java @@ -2,6 +2,7 @@ package com.hw.wms.controller; import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.constant.WmsConstants; +import com.hw.common.core.domain.R; import com.hw.common.core.utils.StringUtils; import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.domain.AjaxResult; @@ -247,13 +248,13 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeInventoryInformationToERP")) @Log(title = "同步原材料入库信息", businessType = BusinessType.INSERT) - public AjaxResult synchronizeInventoryInformationToERP() { + public R synchronizeInventoryInformationToERP() { int result = 0; Map> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeInventoryInformationToERP(); for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) { wmsErpScheduledTaskService.syncInventoryInformation(purchaseOrderIdMap, purchaseOrderId, result); } - return toAjax(1); + return R.ok(); } /** @@ -263,7 +264,7 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP")) @Log(title = "同步原材料出库信息", businessType = BusinessType.INSERT) - public AjaxResult synchronizeRawMaterialDeliveryInformationToERP() { + public R synchronizeRawMaterialDeliveryInformationToERP() { Map> otherMaterialIdMap = wmsErpScheduledTaskService.synchronizeOtherMaterialDeliveryInformationToERP(); for (Long materialId : otherMaterialIdMap.keySet()) { wmsErpScheduledTaskService.syncOutstockInformation(otherMaterialIdMap, materialId, ""); @@ -274,7 +275,7 @@ public class WmsApiController extends BaseController { wmsErpScheduledTaskService.syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK); } - return toAjax(1); + return R.ok(); } @@ -285,13 +286,13 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeRawReturnInformationToERP")) @Log(title = "同步原材料退库信息", businessType = BusinessType.INSERT) - public AjaxResult synchronizeRawReturnInformationToERP() { + public R synchronizeRawReturnInformationToERP() { Map> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeRawReturnInformationToERP(); int result= 0; for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) { wmsErpScheduledTaskService.syncRawReturnInformation(purchaseOrderIdMap, purchaseOrderId, result); } - return toAjax(1); + return R.ok(); } /** @@ -302,13 +303,13 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeProductInstockInformationToERP/{days}")) @Log(title = "同步成品入库信息", businessType = BusinessType.INSERT) - public AjaxResult synchronizeProductInstockInformationToERP(@PathVariable Integer days) { + public R synchronizeProductInstockInformationToERP(@PathVariable Integer days) { Map> productIdMap = wmsErpScheduledTaskService.synchronizeProductInstockInformationToERP(days); int result = 0; for (Long productId : productIdMap.keySet()) { wmsErpScheduledTaskService.syncProductInstockInformation(productIdMap, productId, result); } - return toAjax(1); + return R.ok(); } /** @@ -319,13 +320,13 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeProductOutstockInformationToERP/{days}")) @Log(title = "同步成品出库信息", businessType = BusinessType.INSERT) - public AjaxResult synchronizeProductOutstockInformationToERP(@PathVariable Integer days) { + public R synchronizeProductOutstockInformationToERP(@PathVariable Integer days) { Map> productIdMap = wmsErpScheduledTaskService.synchronizeProductOutstockInformationToERP(days); int result = 0; for (Long productId : productIdMap.keySet()) { wmsErpScheduledTaskService.syncProductOutstockInformation(productIdMap, productId, result); } - return toAjax(1); + return R.ok(); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java index f9f804a8..f8e7dd4c 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsRawInstock.java @@ -136,10 +136,50 @@ public class WmsRawInstock extends BaseEntity /** 规格参数 */ private String specificationParameter; + /** 源单编号,采购订单FSrcBillNo */ private String srcBillNo; private String unitName; + /** + * 源单单据内码(上游单据:单据内码) + */ + private String fsBillId; + + /** + * 源单单据行内码(上游单据:单据行内码) + */ + private String fsId; + + /** + * 收料单据号 + */ + private String billNo; + + public String getBillNo() { + return billNo; + } + + public void setBillNo(String billNo) { + this.billNo = billNo; + } + + public String getFsBillId() { + return fsBillId; + } + + public void setFsBillId(String fsBillId) { + this.fsBillId = fsBillId; + } + + public String getFsId() { + return fsId; + } + + public void setFsId(String fsId) { + this.fsId = fsId; + } + public String getSpecificationParameter() { return specificationParameter; } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java index a31fbe46..f6f4afcf 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsErpScheduledTaskServiceImpl.java @@ -128,12 +128,15 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi data.put("FDate", fdate); data.put("FMaterialId", instock.getMaterialCode()); data.put("FAuxPropId", specificationParameter); - data.put("FSrcBillNo", instock.getSrcBillNo()); + data.put("FSrcBillNo", instock.getBillNo());//源单编号,采购收料通知单的单据编号 data.put("FUnitID", instock.getUnitCode()); data.put("FRealQty", FRealQty); data.put("FStockId", wmsConfig.getfStockId()); data.put("FSupplierCode", supplierCode); data.put("FTondBase", projectNo); + data.put("FSBillId", instock.getFsBillId()); + data.put("FSId", instock.getFsId()); + data.put("FPOOrderNo", instock.getPoNo());//采购订单的FBillNo String params = data.toJSONString(); try { R paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER); @@ -175,6 +178,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi rawInstock.setErpAmount(rawInstock.getInstockAmount()); rawInstock.setUpdateDate(DateUtils.getNowDate()); wmsRawInstockMapper.updateWmsRawInstock(rawInstock); + log.info("updateWmsRawInStockWithoutRollback原材料入库单失败状态:" + rawInstock.getRawInstockId()); } } @@ -268,9 +272,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi String params = data.toJSONString(); try { R paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER); - String paramsResultData = paramsResult.getMsg(); - JSONObject jsonObject = JSONObject.parseObject(paramsResultData); - Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); + Gson gson = new Gson(); + String paramsResulJson = gson.toJson(paramsResult); + log.info("+++++++++paramsResult+++++++" + paramsResulJson); + ObjectMapper mapper = new ObjectMapper(); + JsonNode rootNode = mapper.readTree(paramsResulJson); + String msgStr = rootNode.path("data").path("msg").asText(); + log.info("+++++++++msgStr+++++++" + msgStr); + JsonNode msgNode = mapper.readTree(msgStr); + boolean isSuccess = msgNode.path("IsSuccess").asBoolean(); + log.info("+++++++++isSuccess+++++++" + isSuccess); if (isSuccess) { result++; log.info("synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult.toString()); @@ -351,9 +362,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi String params = data.toJSONString(); try { R paramsResult = remoteJindieService.savePurchaseStorage(params, SecurityConstants.INNER); - String paramsResultData = paramsResult.getMsg(); - JSONObject jsonObject = JSONObject.parseObject(paramsResultData); - Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); + Gson gson = new Gson(); + String paramsResulJson = gson.toJson(paramsResult); + log.info("+++++++++paramsResult+++++++" + paramsResulJson); + ObjectMapper mapper = new ObjectMapper(); + JsonNode rootNode = mapper.readTree(paramsResulJson); + String msgStr = rootNode.path("data").path("msg").asText(); + log.info("+++++++++msgStr+++++++" + msgStr); + JsonNode msgNode = mapper.readTree(msgStr); + boolean isSuccess = msgNode.path("IsSuccess").asBoolean(); + log.info("+++++++++isSuccess+++++++" + isSuccess); if (isSuccess) { result++; log.info("synchronizeInventoryInformationToERP同步原材料退库成功:" + paramsResult.toString()); @@ -428,9 +446,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi String params = data.toJSONString(); try { R paramsResult = remoteJindieService.saveOtherInStorage(params, SecurityConstants.INNER); - String paramsResultData = paramsResult.getMsg(); - JSONObject jsonObject = JSONObject.parseObject(paramsResultData); - Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); + Gson gson = new Gson(); + String paramsResulJson = gson.toJson(paramsResult); + log.info("+++++++++paramsResult+++++++" + paramsResulJson); + ObjectMapper mapper = new ObjectMapper(); + JsonNode rootNode = mapper.readTree(paramsResulJson); + String msgStr = rootNode.path("data").path("msg").asText(); + log.info("+++++++++msgStr+++++++" + msgStr); + JsonNode msgNode = mapper.readTree(msgStr); + boolean isSuccess = msgNode.path("IsSuccess").asBoolean(); + log.info("+++++++++isSuccess+++++++" + isSuccess); if (isSuccess) { result++; log.info("synchronizeProductInstockInformationToERP成功:" + paramsResult.toString()); @@ -502,9 +527,16 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi String params = data.toJSONString(); try { R paramsResult = remoteJindieService.saveOtherOutStorage(params, SecurityConstants.INNER); - String paramsResultData = paramsResult.getMsg(); - JSONObject jsonObject = JSONObject.parseObject(paramsResultData); - Boolean isSuccess = (Boolean) jsonObject.get("IsSuccess"); + Gson gson = new Gson(); + String paramsResulJson = gson.toJson(paramsResult); + log.info("+++++++++paramsResult+++++++" + paramsResulJson); + ObjectMapper mapper = new ObjectMapper(); + JsonNode rootNode = mapper.readTree(paramsResulJson); + String msgStr = rootNode.path("data").path("msg").asText(); + log.info("+++++++++msgStr+++++++" + msgStr); + JsonNode msgNode = mapper.readTree(msgStr); + boolean isSuccess = msgNode.path("IsSuccess").asBoolean(); + log.info("+++++++++isSuccess+++++++" + isSuccess); if (isSuccess) { result++; diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml index 3a876648..8f9a68a0 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml @@ -41,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -224,12 +227,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mbui.unit_code, wri.instock_amount, if(wri.erp_amount is null, 0, wri.erp_amount) erp_amount, - wri.erp_status + wri.erp_status, + wri.material_barcode, + mprb.bill_no, + mprb.erp_id fs_bill_id, + mprb.fentry_id fs_id from wms_raw_instock wri left join wms_base_warehouse wbw on wbw.warehouse_id = wri.warehouse_id left join mes_base_material_info mbmi on mbmi.material_id = wri.material_id left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_purchase_order mpo on wri.purchase_order_id = mpo.purchase_order_id + left join mes_base_barcode_info mbbi on mbbi.barcode_info = wri.material_barcode + left join mes_purchase_receive_bill mprb on mprb.receive_bill_id = mbbi.receive_bill_id where wri.execute_status = 2 and (wri.erp_status != 1 or wri.erp_status is null) and wri.instock_type in (1, 3, 4)