|
|
@ -814,43 +814,53 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
@Transactional |
|
|
@Transactional |
|
|
public void updateIfsPartInfo(PartInformationVo data, List<PartIfsInventoryProperty> ifsProperty) { |
|
|
public void updateIfsPartInfo(PartInformationVo data, List<PartIfsInventoryProperty> ifsProperty) { |
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
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<String, String> updateInventoryPartResponse = inventoryServiceBean.modifyInventoryPart(srv, partIfsInventory); |
|
|
|
|
|
if (!"200".equals(updateInventoryPartResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("ifs 库存件修改异常信息:" + updateInventoryPartResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
// 同步Costs表数据 |
|
|
|
|
|
Map<String, String> addInventoryPartCostsResponse = inventoryServiceBean.modifyInventoryPartCost(srv, partIfsInventoryConfig); |
|
|
|
|
|
if (!"200".equals(addInventoryPartCostsResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("ifs 库存件Costs修改异常信息:" + addInventoryPartCostsResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
// 同步Manufacturing表数据 |
|
|
|
|
|
Map<String, String> addInventoryPartManufacturingResponse = inventoryServiceBean.modifyInventoryPartManufacture(srv, partIfsInventoryManufacture); |
|
|
|
|
|
if (!"200".equals(addInventoryPartManufacturingResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("ifs 库存件Manufacturing修改异常信息:" + addInventoryPartManufacturingResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
// 同步Planning表数据 |
|
|
|
|
|
Map<String, String> addInventoryPartPlanningResponse = inventoryServiceBean.modifyInventoryPartPlan(srv, partIfsInventoryPlan); |
|
|
|
|
|
if (!"200".equals(addInventoryPartPlanningResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("ifs 库存件Planning修改异常信息:" + addInventoryPartPlanningResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
// 同步物料属性, 先删除再新增 |
|
|
|
|
|
Map<String, String> deleteInventoryPartPropertyResponse = inventoryServiceBean.removeInventoryPartCharacteristicsByPartNo(srv, partIfsInventoryModel); |
|
|
|
|
|
if (!"200".equals(deleteInventoryPartPropertyResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("IFS库存件属性删除异常:" + deleteInventoryPartPropertyResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
if (!ifsProperty.isEmpty()) { |
|
|
|
|
|
Map<String, String> 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<String, String> 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<String, String> 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<String, String> 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<String, String> 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<String, String> deleteInventoryPartPropertyResponse = inventoryServiceBean.removeInventoryPartCharacteristicsByPartNo(srv, partIfsInventoryModel); |
|
|
|
|
|
if (!"200".equals(deleteInventoryPartPropertyResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("IFS库存件属性删除异常:" + deleteInventoryPartPropertyResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
if (!ifsProperty.isEmpty()) { |
|
|
|
|
|
Map<String, String> addInventoryPartPropertyResponse = inventoryServiceBean.syncInventoryPartCharacteristics(srv, ifsProperty); |
|
|
|
|
|
if (!"200".equals(addInventoryPartPropertyResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("IFS库存件属性新增异常:" + addInventoryPartPropertyResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|