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 c759af50..48c953f7 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 @@ -4191,30 +4191,29 @@ public class PartInformationServiceImpl extends ServiceImpl propertyList = partInformationMapper.getMasterPartPropertyList("*", ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象 - Map addMasterPartModelResponse = technicalClassBean.syncTechnicalClass(srv, partIfsCatalogModel); - if (!"200".equals(addMasterPartModelResponse.get("resultCode"))) { - throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg")); - } - if (!propertyList.isEmpty()) { - Map addMasterPartPropertyResponse = technicalClassBean.modifyTechnicalClassAttributes(srv, propertyList); - if (!"200".equals(addMasterPartPropertyResponse.get("resultCode"))) { - throw new RuntimeException("IFS 物料件属性新增异常:" + addMasterPartPropertyResponse.get("resultMsg")); + // 同步物料件属性 + if (org.apache.commons.lang3.StringUtils.isNotBlank(ifsPart.getCodeNo())) { + PartIfsCatalogModel partIfsCatalogModel = new PartIfsCatalogModel(); // 模板对象 + partIfsCatalogModel.setLuName(luName); + partIfsCatalogModel.setKeyRef("PART_NO=" + ifsPart.getPartNo() + "^"); // 物料编码 + partIfsCatalogModel.setTechnicalSpecNo(technicalSpecNo); + partIfsCatalogModel.setTechnicalClass(ifsPart.getCodeNo()); // 模板编码 + partIfsCatalogModel.setOkYesNo(okYesNo); + partIfsCatalogModel.setOkSign(ifsUser.getIfsUsername()); + partIfsCatalogModel.setDtOk(DateUtils.getStringNow2()); + Map addMasterPartModelResponse = technicalClassBean.syncTechnicalClass(srv, partIfsCatalogModel); + if (!"200".equals(addMasterPartModelResponse.get("resultCode"))) { + throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg")); } } } + List propertyList = partInformationMapper.getMasterPartPropertyList("*", ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象 + if (!propertyList.isEmpty()) { + Map addMasterPartPropertyResponse = technicalClassBean.modifyTechnicalClassAttributes(srv, propertyList); + if (!"200".equals(addMasterPartPropertyResponse.get("resultCode"))) { + throw new RuntimeException("IFS 物料件属性新增异常:" + addMasterPartPropertyResponse.get("resultMsg")); + } + } } } }