Browse Source

2025-06-26

IFS同步时速度比较慢,设置监听 哪里修改改哪里
master
fengyuan_yang 7 months ago
parent
commit
5e478a7202
  1. 84
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java
  2. 7
      src/main/java/com/spring/modules/part/vo/PartInformationVo.java

84
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -814,43 +814,53 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
@Transactional
public void updateIfsPartInfo(PartInformationVo data, List<PartIfsInventoryProperty> 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<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"));
}
}
}
}

7
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;
}
Loading…
Cancel
Save