diff --git a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java index a1a6029c..a00e23b4 100644 --- a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java @@ -814,43 +814,53 @@ public class PartInformationServiceImpl extends ServiceImpl ifsProperty) { Server srv = getIfsServer(data.getUpdateBy()); - PartIfsInventory partIfsInventory = getPartIfsInventory(data); // 主表对象 - PartIfsInventoryConfig partIfsInventoryConfig = getPartIfsInventoryConfig(data); // costs对象 - PartIfsInventoryManufacture partIfsInventoryManufacture = getPartIfsInventoryManufacture(data); // Manufacturing对象 - PartIfsInventoryPlan partIfsInventoryPlan = getPartIfsInventoryPlan(data); // planning对象 - PartIfsInventoryModel partIfsInventoryModel = new PartIfsInventoryModel(); // 物料模板对象 - partIfsInventoryModel.setContract(data.getSite()); - partIfsInventoryModel.setPartNo(data.getPartNo()); - - // 同步主表数据 - Map updateInventoryPartResponse = inventoryServiceBean.modifyInventoryPart(srv, partIfsInventory); - if (!"200".equals(updateInventoryPartResponse.get("resultCode"))) { - throw new RuntimeException("ifs 库存件修改异常信息:" + updateInventoryPartResponse.get("resultMsg")); - } - // 同步Costs表数据 - Map addInventoryPartCostsResponse = inventoryServiceBean.modifyInventoryPartCost(srv, partIfsInventoryConfig); - if (!"200".equals(addInventoryPartCostsResponse.get("resultCode"))) { - throw new RuntimeException("ifs 库存件Costs修改异常信息:" + addInventoryPartCostsResponse.get("resultMsg")); - } - // 同步Manufacturing表数据 - Map addInventoryPartManufacturingResponse = inventoryServiceBean.modifyInventoryPartManufacture(srv, partIfsInventoryManufacture); - if (!"200".equals(addInventoryPartManufacturingResponse.get("resultCode"))) { - throw new RuntimeException("ifs 库存件Manufacturing修改异常信息:" + addInventoryPartManufacturingResponse.get("resultMsg")); - } - // 同步Planning表数据 - Map addInventoryPartPlanningResponse = inventoryServiceBean.modifyInventoryPartPlan(srv, partIfsInventoryPlan); - if (!"200".equals(addInventoryPartPlanningResponse.get("resultCode"))) { - throw new RuntimeException("ifs 库存件Planning修改异常信息:" + addInventoryPartPlanningResponse.get("resultMsg")); - } - // 同步物料属性, 先删除再新增 - Map deleteInventoryPartPropertyResponse = inventoryServiceBean.removeInventoryPartCharacteristicsByPartNo(srv, partIfsInventoryModel); - if (!"200".equals(deleteInventoryPartPropertyResponse.get("resultCode"))) { - throw new RuntimeException("IFS库存件属性删除异常:" + deleteInventoryPartPropertyResponse.get("resultMsg")); - } - if (!ifsProperty.isEmpty()) { - Map addInventoryPartPropertyResponse = inventoryServiceBean.syncInventoryPartCharacteristics(srv, ifsProperty); - if (!"200".equals(addInventoryPartPropertyResponse.get("resultCode"))) { - throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.get("resultMsg")); + + if (data.getMainInfoFlag()) { + PartIfsInventory partIfsInventory = getPartIfsInventory(data); // 主表对象 + // 同步主表数据 + Map updateInventoryPartResponse = inventoryServiceBean.modifyInventoryPart(srv, partIfsInventory); + if (!"200".equals(updateInventoryPartResponse.get("resultCode"))) { + throw new RuntimeException("ifs 库存件修改异常信息:" + updateInventoryPartResponse.get("resultMsg")); + } + } + if (data.getCostsInfoFlag()) { + PartIfsInventoryConfig partIfsInventoryConfig = getPartIfsInventoryConfig(data); // costs对象 + // 同步Costs表数据 + Map addInventoryPartCostsResponse = inventoryServiceBean.modifyInventoryPartCost(srv, partIfsInventoryConfig); + if (!"200".equals(addInventoryPartCostsResponse.get("resultCode"))) { + throw new RuntimeException("ifs 库存件Costs修改异常信息:" + addInventoryPartCostsResponse.get("resultMsg")); + } + } + if (data.getManufacturingInfoFlag()) { + PartIfsInventoryManufacture partIfsInventoryManufacture = getPartIfsInventoryManufacture(data); // Manufacturing对象 + // 同步Manufacturing表数据 + Map addInventoryPartManufacturingResponse = inventoryServiceBean.modifyInventoryPartManufacture(srv, partIfsInventoryManufacture); + if (!"200".equals(addInventoryPartManufacturingResponse.get("resultCode"))) { + throw new RuntimeException("ifs 库存件Manufacturing修改异常信息:" + addInventoryPartManufacturingResponse.get("resultMsg")); + } + } + if (data.getPlanningInfoFlag()) { + PartIfsInventoryPlan partIfsInventoryPlan = getPartIfsInventoryPlan(data); // planning对象 + // 同步Planning表数据 + Map addInventoryPartPlanningResponse = inventoryServiceBean.modifyInventoryPartPlan(srv, partIfsInventoryPlan); + if (!"200".equals(addInventoryPartPlanningResponse.get("resultCode"))) { + throw new RuntimeException("ifs 库存件Planning修改异常信息:" + addInventoryPartPlanningResponse.get("resultMsg")); + } + } + if (data.getPartItemInfoFlag()) { + PartIfsInventoryModel partIfsInventoryModel = new PartIfsInventoryModel(); // 物料模板对象 + partIfsInventoryModel.setContract(data.getSite()); + partIfsInventoryModel.setPartNo(data.getPartNo()); + // 同步物料属性, 先删除再新增 + Map deleteInventoryPartPropertyResponse = inventoryServiceBean.removeInventoryPartCharacteristicsByPartNo(srv, partIfsInventoryModel); + if (!"200".equals(deleteInventoryPartPropertyResponse.get("resultCode"))) { + throw new RuntimeException("IFS库存件属性删除异常:" + deleteInventoryPartPropertyResponse.get("resultMsg")); + } + if (!ifsProperty.isEmpty()) { + Map addInventoryPartPropertyResponse = inventoryServiceBean.syncInventoryPartCharacteristics(srv, ifsProperty); + if (!"200".equals(addInventoryPartPropertyResponse.get("resultCode"))) { + throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.get("resultMsg")); + } } } } diff --git a/src/main/java/com/spring/modules/part/vo/PartInformationVo.java b/src/main/java/com/spring/modules/part/vo/PartInformationVo.java index d7a7971c..18de4116 100644 --- a/src/main/java/com/spring/modules/part/vo/PartInformationVo.java +++ b/src/main/java/com/spring/modules/part/vo/PartInformationVo.java @@ -167,8 +167,11 @@ public class PartInformationVo extends PartInformationEntity { private String fromPartNo; private String fromPartDesc; private String copyFlag; - private String virtualPartNo; - private String ifHasPeifang; + private Boolean mainInfoFlag; + private Boolean costsInfoFlag; + private Boolean manufacturingInfoFlag; + private Boolean planningInfoFlag; + private Boolean partItemInfoFlag; }