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 438913ef..f8d1304f 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 @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import java.util.List; +import java.util.Map; /** * Api Controller,提供给其他Module调用使用 @@ -246,7 +247,12 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeInventoryInformationToERP")) public AjaxResult synchronizeInventoryInformationToERP() { - return toAjax(wmsErpScheduledTaskService.synchronizeInventoryInformationToERP()); + int result = 0; + Map> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeInventoryInformationToERP(); + for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) { + wmsErpScheduledTaskService.syncInventoryInformation(purchaseOrderIdMap, purchaseOrderId, result); + } + return toAjax(1); } /** @@ -256,7 +262,17 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP")) public AjaxResult synchronizeRawMaterialDeliveryInformationToERP() { - return toAjax(wmsErpScheduledTaskService.synchronizeRawMaterialDeliveryInformationToERP()); + Map> otherMaterialIdMap = wmsErpScheduledTaskService.synchronizeOtherMaterialDeliveryInformationToERP(); + for (Long materialId : otherMaterialIdMap.keySet()) { + wmsErpScheduledTaskService.syncOutstockInformation(otherMaterialIdMap, materialId, ""); + } + + Map> returnMaterialIdMap = wmsErpScheduledTaskService.synchronizeReturnMaterialDeliveryInformationToERP(); + for (Long materialId : returnMaterialIdMap.keySet()) { + wmsErpScheduledTaskService.syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK); + } + + return toAjax(1); } @@ -267,7 +283,12 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeRawReturnInformationToERP")) public AjaxResult synchronizeRawReturnInformationToERP() { - return toAjax(wmsErpScheduledTaskService.synchronizeRawReturnInformationToERP()); + Map> purchaseOrderIdMap = wmsErpScheduledTaskService.synchronizeRawReturnInformationToERP(); + int result= 0; + for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) { + wmsErpScheduledTaskService.syncRawReturnInformation(purchaseOrderIdMap, purchaseOrderId, result); + } + return toAjax(1); } /** @@ -278,7 +299,12 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeProductInstockInformationToERP/{days}")) public AjaxResult synchronizeProductInstockInformationToERP(@PathVariable Integer days) { - return toAjax(wmsErpScheduledTaskService.synchronizeProductInstockInformationToERP(days)); + Map> productIdMap = wmsErpScheduledTaskService.synchronizeProductInstockInformationToERP(days); + int result = 0; + for (Long productId : productIdMap.keySet()) { + wmsErpScheduledTaskService.syncProductInstockInformation(productIdMap, productId, result); + } + return toAjax(1); } /** @@ -289,7 +315,12 @@ public class WmsApiController extends BaseController { */ @PostMapping(("/synchronizeProductOutstockInformationToERP/{days}")) public AjaxResult synchronizeProductOutstockInformationToERP(@PathVariable Integer days) { - return toAjax(wmsErpScheduledTaskService.synchronizeProductOutstockInformationToERP(days)); + Map> productIdMap = wmsErpScheduledTaskService.synchronizeProductOutstockInformationToERP(days); + int result = 0; + for (Long productId : productIdMap.keySet()) { + wmsErpScheduledTaskService.syncProductOutstockInformation(productIdMap, productId, result); + } + return toAjax(1); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsErpScheduledTaskService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsErpScheduledTaskService.java index 407a4867..489177e1 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsErpScheduledTaskService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsErpScheduledTaskService.java @@ -1,6 +1,10 @@ package com.hw.wms.service; +import com.hw.wms.domain.*; + +import java.util.List; +import java.util.Map; /** * erp定时任务Service业务层处理 @@ -14,33 +18,54 @@ public interface IWmsErpScheduledTaskService { * 定时同步入库信息给ERP * @return */ - int synchronizeInventoryInformationToERP(); + Map> synchronizeInventoryInformationToERP(); + + public void syncInventoryInformation(Map> purchaseOrderIdMap, Long purchaseOrderId, int result); /** * 定时同步原材料出库信息给ERP + * * @return */ - int synchronizeRawMaterialDeliveryInformationToERP(); + public Map> synchronizeOtherMaterialDeliveryInformationToERP(); + + + /** + * 定时同步原材料退货出库信息给ERP + * + * @return + */ + public Map> synchronizeReturnMaterialDeliveryInformationToERP(); + + + public int syncOutstockInformation(Map> materialIdMap, Long materialId, String taskType); + /** * 定时同步退库信息给ERP * * @return */ - public int synchronizeRawReturnInformationToERP(); + public Map> synchronizeRawReturnInformationToERP(); + + public void syncRawReturnInformation(Map> purchaseOrderIdMap, Long purchaseOrderId, int result); + /** * 定时同步成品入库信息给ERP * @param days 同步days天前数据 * @return */ - int synchronizeProductInstockInformationToERP(Integer days); + Map> synchronizeProductInstockInformationToERP(Integer days); + + public void syncProductInstockInformation(Map> productIdMap, Long productId, int result); /** * 定时同步成品出库信息给ERP * @param days 同步days天前数据 * @return */ - int synchronizeProductOutstockInformationToERP(Integer days); + Map> synchronizeProductOutstockInformationToERP(Integer days); + public void syncProductOutstockInformation(Map> productIdMap, Long productId, int result); } 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 d803b63b..efe950fa 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 @@ -65,6 +65,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi @Autowired private WmsConfig wmsConfig; + public int i=0; //仓库编码 // private String FStockId = "CK050"; @@ -74,20 +75,18 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi * @return */ @Override - @Transactional - public int synchronizeInventoryInformationToERP() { +// @Transactional + public Map> synchronizeInventoryInformationToERP() { WmsRawInstock wmsRawInstock = new WmsRawInstock(); int result = 0; List inStockList = wmsRawInstockMapper.selectWmsRawInstockERPNotSynchronized(wmsRawInstock); Map> purchaseOrderIdMap = inStockList.stream().collect(Collectors.groupingBy(WmsRawInstock::getPurchaseOrderId)); - for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) { - syncInventoryInformation(purchaseOrderIdMap, purchaseOrderId, result); - } - return result; + return purchaseOrderIdMap; } - @Transactional(propagation = Propagation.REQUIRES_NEW) + @Transactional(rollbackFor = Exception.class) + @Override public void syncInventoryInformation(Map> purchaseOrderIdMap, Long purchaseOrderId, int result) { R purchaseOrderData = remoteMesService.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId, SecurityConstants.INNER); MesPurchaseOrder mesPurchaseOrder = null; @@ -116,7 +115,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi String specificationParameter = instock.getSpecificationParameter(); if(StringUtils.isEmpty(specificationParameter)){ - specificationParameter = instock.getMaterialSpec(); + specificationParameter = instock.getMaterialSpec(); } if(StringUtils.isEmpty(specificationParameter)){ @@ -143,11 +142,11 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi log.info("synchronizeInventoryInformationToERP同步原材料入库成功:" + paramsResult.toString()); } else { log.error("synchronizeInventoryInformationToERP同步原材料入库失败:" + paramsResult.toString()); - throw new RuntimeException("同步原材料入库失败" + paramsResult.toString()); + throw new ServiceException("同步原材料入库失败" + paramsResult.toString()); } } catch (Exception e) { log.error("同步原材料入库失败" + e.getMessage()); - throw new RuntimeException("同步原材料入库失败" + e.getMessage()); + throw new ServiceException("同步原材料入库失败" + e.getMessage()); } } @@ -158,8 +157,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi * @return */ @Override - @Transactional - public int synchronizeRawMaterialDeliveryInformationToERP() { + public Map> synchronizeOtherMaterialDeliveryInformationToERP() { int result = 0; //领料 WmsRawOutstockDetail otherRawOutstockDetail = new WmsRawOutstockDetail(); @@ -167,22 +165,102 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_AUTO_OUTSTOCK + "," + WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER); List otherRawOutstockDetailList = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailERPNotSynchronized(otherRawOutstockDetail); Map> otherMaterialIdMap = otherRawOutstockDetailList.stream().collect(Collectors.groupingBy(WmsRawOutstockDetail::getMaterialId)); - for (Long materialId : otherMaterialIdMap.keySet()) { - result += syncOutstockInformation(otherMaterialIdMap, materialId, ""); - } + return otherMaterialIdMap; + } + + + /** + * 定时同步原材料退货出库信息给ERP + * + * @return + */ + @Override + public Map> synchronizeReturnMaterialDeliveryInformationToERP() { + int result = 0; //退货出库 WmsRawOutstockDetail returnRawOutstockDetail = new WmsRawOutstockDetail(); returnRawOutstockDetail.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK); List returnRawOutstockDetailList = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailERPNotSynchronized(returnRawOutstockDetail); Map> returnMaterialIdMap = returnRawOutstockDetailList.stream().collect(Collectors.groupingBy(WmsRawOutstockDetail::getMaterialId)); - for (Long materialId : returnMaterialIdMap.keySet()) { - result += syncOutstockInformation(returnMaterialIdMap, materialId, WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK); + + return returnMaterialIdMap; + } + + + + @Transactional(rollbackFor = Exception.class) + @Override + public int syncOutstockInformation(Map> materialIdMap, Long materialId, String taskType) { + int result = 0; + List wmsRawOutstockDetailList = materialIdMap.get(materialId); + JSONObject data = new JSONObject(); + double FRealQty = wmsRawOutstockDetailList.stream().mapToDouble(item -> item.getOutstockAmount().subtract(item.getErpAmount()).doubleValue()).sum(); + WmsRawOutstockDetail outstockDetail = wmsRawOutstockDetailList.get(0); + for (WmsRawOutstockDetail wmsRawOutstockDetail : wmsRawOutstockDetailList) { + if (wmsRawOutstockDetail.getPlanAmount().equals(wmsRawOutstockDetail.getOutstockAmount())) { + wmsRawOutstockDetail.setErpStatus("1");//同步ERP状态(0:失败,1成功,2同步中) + } else { + wmsRawOutstockDetail.setErpStatus("2");//同步ERP状态(0:失败,1成功,2同步中) + } + wmsRawOutstockDetail.setErpAmount(wmsRawOutstockDetail.getOutstockAmount()); + wmsRawOutstockDetail.setUpdateDate(DateUtils.getNowDate()); + wmsRawOutstockDetailMapper.updateWmsRawOutstockDetail(wmsRawOutstockDetail); + } + + if (StringUtils.isNotEmpty(taskType) && taskType.equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK)) { + data.put("FTONDCombo", "售后服务"); + } else { + data.put("FTONDCombo", "一般领料"); + } +// model.put("F_TOND_Combo", "一般领料"); //领料类型(必填项) + + String fdate = DateUtils.getTime(); + if (outstockDetail.getOutstockTime() != null) { + fdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, outstockDetail.getOutstockTime()); + } + + String barcodeSpec = outstockDetail.getBarcodeSpec(); + String materialSpec = outstockDetail.getMaterialSpec(); + if(StringUtils.isEmpty(barcodeSpec)){ + if(StringUtils.isNotEmpty(materialSpec)){ + barcodeSpec = materialSpec; + }else{ + barcodeSpec = "无"; + } + } + + data.put("FDate", fdate); + data.put("FMaterialId", outstockDetail.getMaterialCode()); + data.put("FAuxPropId", barcodeSpec); + data.put("FUnitID", outstockDetail.getUnitCode()); + data.put("FQty", FRealQty); + data.put("FPrice", outstockDetail.getPrice()); + data.put("FStockId", wmsConfig.getfStockId()); + + 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"); + if (isSuccess) { + result++; + log.info("synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult.toString()); + } else { + log.error("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString()); + throw new ServiceException("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString()); + } + return result; + } catch (Exception e) { + log.error("synchronizeRawMaterialDeliveryInformationToERP失败:" + e.getMessage()); + throw new ServiceException("synchronizeRawMaterialDeliveryInformationToERP失败:" + e.getMessage()); } - return result; } + + /** * 定时同步退库信息给ERP * @@ -190,20 +268,18 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi */ @Override @Transactional - public int synchronizeRawReturnInformationToERP() { + public Map> synchronizeRawReturnInformationToERP() { WmsRawReturnDetail wmsRawReturnDetail = new WmsRawReturnDetail(); int result = 0; List returnDetailList = wmsRawReturnDetailMapper.selectWmsRawReturnDetailERPNotSynchronized(wmsRawReturnDetail); Map> purchaseOrderIdMap = returnDetailList.stream().collect(Collectors.groupingBy(WmsRawReturnDetail::getPurchaseOrderId)); - for (Long purchaseOrderId : purchaseOrderIdMap.keySet()) { - syncRawReturnInformation(purchaseOrderIdMap, purchaseOrderId, result); - } - return result; + return purchaseOrderIdMap; } - @Transactional(propagation = Propagation.REQUIRES_NEW) + @Transactional(rollbackFor = Exception.class) + @Override public void syncRawReturnInformation(Map> purchaseOrderIdMap, Long purchaseOrderId, int result) { R purchaseOrderData = remoteMesService.selectPurchaseOrderJoinSupplierProjectByOrderId(purchaseOrderId, SecurityConstants.INNER); MesPurchaseOrder mesPurchaseOrder = null; @@ -267,74 +343,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi } - @Transactional(propagation = Propagation.REQUIRES_NEW) - public int syncOutstockInformation(Map> materialIdMap, Long materialId, String taskType) { - int result = 0; - List wmsRawOutstockDetailList = materialIdMap.get(materialId); - JSONObject data = new JSONObject(); - double FRealQty = wmsRawOutstockDetailList.stream().mapToDouble(item -> item.getOutstockAmount().subtract(item.getErpAmount()).doubleValue()).sum(); - WmsRawOutstockDetail outstockDetail = wmsRawOutstockDetailList.get(0); - for (WmsRawOutstockDetail wmsRawOutstockDetail : wmsRawOutstockDetailList) { - if (wmsRawOutstockDetail.getPlanAmount().equals(wmsRawOutstockDetail.getOutstockAmount())) { - wmsRawOutstockDetail.setErpStatus("1");//同步ERP状态(0:失败,1成功,2同步中) - } else { - wmsRawOutstockDetail.setErpStatus("2");//同步ERP状态(0:失败,1成功,2同步中) - } - wmsRawOutstockDetail.setErpAmount(wmsRawOutstockDetail.getOutstockAmount()); - wmsRawOutstockDetail.setUpdateDate(DateUtils.getNowDate()); - wmsRawOutstockDetailMapper.updateWmsRawOutstockDetail(wmsRawOutstockDetail); - } - - if (StringUtils.isNotEmpty(taskType) && taskType.equals(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK)) { - data.put("FTONDCombo", "售后服务"); - } else { - data.put("FTONDCombo", "一般领料"); - } -// model.put("F_TOND_Combo", "一般领料"); //领料类型(必填项) - String fdate = DateUtils.getTime(); - if (outstockDetail.getOutstockTime() != null) { - fdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, outstockDetail.getOutstockTime()); - } - - String barcodeSpec = outstockDetail.getBarcodeSpec(); - String materialSpec = outstockDetail.getMaterialSpec(); - if(StringUtils.isEmpty(barcodeSpec)){ - if(StringUtils.isNotEmpty(materialSpec)){ - barcodeSpec = materialSpec; - }else{ - barcodeSpec = "无"; - } - } - - data.put("FDate", fdate); - data.put("FMaterialId", outstockDetail.getMaterialCode()); - data.put("FAuxPropId", barcodeSpec); - data.put("FUnitID", outstockDetail.getUnitCode()); - data.put("FQty", FRealQty); - data.put("FPrice", outstockDetail.getPrice()); - data.put("FStockId", wmsConfig.getfStockId()); - - 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"); - if (isSuccess) { - result++; - log.info("synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult.toString()); - } else { - log.error("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString()); - throw new RuntimeException("synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult.toString()); - } - return result; - } catch (Exception e) { - log.error("synchronizeRawMaterialDeliveryInformationToERP失败:" + e.getMessage()); - throw new RuntimeException("synchronizeRawMaterialDeliveryInformationToERP失败:" + e.getMessage()); - } - - } /** * 定时同步成品入库信息给ERP @@ -343,8 +352,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi * @return */ @Override - @Transactional - public int synchronizeProductInstockInformationToERP(Integer days) { + public Map> synchronizeProductInstockInformationToERP(Integer days) { int result = 0; WmsProductInstock wmsProductInstock = new WmsProductInstock(); HashMap paramMap = new HashMap<>(); @@ -354,13 +362,12 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi wmsProductInstock.setParams(paramMap); List productInstockList = wmsProductInstockMapper.selectWmsProductInstockERPNotSynchronized(wmsProductInstock); Map> productIdMap = productInstockList.stream().collect(Collectors.groupingBy(WmsProductInstock::getProductId)); - for (Long productId : productIdMap.keySet()) { - syncProductInstockInformation(productIdMap, productId, result); - } - return result; + + return productIdMap; } - @Transactional(propagation = Propagation.REQUIRES_NEW) + @Transactional(rollbackFor = Exception.class) + @Override public void syncProductInstockInformation(Map> productIdMap, Long productId, int result) { List wmsProductInstockList = productIdMap.get(productId); JSONObject data = new JSONObject(); @@ -402,12 +409,12 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi log.info("synchronizeProductInstockInformationToERP成功:" + paramsResult.toString()); } else { log.error("synchronizeProductInstockInformationToERP失败:" + paramsResult.toString()); - throw new RuntimeException("synchronizeProductInstockInformationToERP失败:" + paramsResult.toString()); + throw new ServiceException("synchronizeProductInstockInformationToERP失败:" + paramsResult.toString()); } } catch (Exception e) { log.error("synchronizeProductInstockInformationToERP失败:" + e.getMessage()); - throw new RuntimeException("synchronizeProductInstockInformationToERP失败:" + e.getMessage()); + throw new ServiceException("synchronizeProductInstockInformationToERP失败:" + e.getMessage()); } } @@ -418,8 +425,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi * @return */ @Override - @Transactional - public int synchronizeProductOutstockInformationToERP(Integer days) { + public Map> synchronizeProductOutstockInformationToERP(Integer days) { int result = 0; WmsProductOutstock wmsProductOutstock = new WmsProductOutstock(); HashMap paramMap = new HashMap<>(); @@ -429,13 +435,12 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi wmsProductOutstock.setParams(paramMap); List productOutstockList = wmsProductOutstockMapper.selectWmsProductOutstockERPNotSynchronized(wmsProductOutstock); Map> productIdMap = productOutstockList.stream().collect(Collectors.groupingBy(WmsProductOutstock::getProductId)); - for (Long productId : productIdMap.keySet()) { - syncProductOutstockInformation(productIdMap, productId, result); - } - return result; + + return productIdMap; } - @Transactional(propagation = Propagation.REQUIRES_NEW) + @Transactional(rollbackFor = Exception.class) + @Override public void syncProductOutstockInformation(Map> productIdMap, Long productId, int result) { List wmsProductOutstockList = productIdMap.get(productId); JSONObject data = new JSONObject(); @@ -479,12 +484,12 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi log.info("synchronizeProductOutstockInformationToERP成功:" + paramsResult.toString()); } else { log.error("synchronizeProductOutstockInformationToERP失败:" + paramsResult.toString()); - throw new RuntimeException("synchronizeProductOutstockInformationToERP失败:" + paramsResult.toString()); + throw new ServiceException("synchronizeProductOutstockInformationToERP失败:" + paramsResult.toString()); } } catch (Exception e) { log.error("synchronizeProductOutstockInformationToERP失败:" + e.getMessage()); - throw new RuntimeException("synchronizeProductOutstockInformationToERP失败:" + e.getMessage()); + throw new ServiceException("synchronizeProductOutstockInformationToERP失败:" + e.getMessage()); } }