|
|
|
@ -258,18 +258,16 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo |
|
|
|
MasterPartInformationEntity masterPartInformation = masterPartInformationMapper.selectOne(new QueryWrapper<MasterPartInformationEntity>().eq("part_no", data.getPartNo())); |
|
|
|
// 检查物料模板 |
|
|
|
List<PartSubPropertiesValueData> mpData = masterPartInformationMapper.queryCodeNo(data); |
|
|
|
if (!mpData.isEmpty()) { |
|
|
|
if (mpData.isEmpty() || !mpData.get(0).getCodeNo().equals(data.getCodeNo())) { |
|
|
|
// 修改了物料模板 |
|
|
|
if (!mpData.get(0).getCodeNo().equals(data.getCodeNo())) { |
|
|
|
PartSubPropertiesValueData valueData = new PartSubPropertiesValueData(); |
|
|
|
BeanUtils.copyProperties(data,valueData); |
|
|
|
// 删除物料的属性和属性值 |
|
|
|
partInformationMapper.deletePartSubPropertiesValueHeader(valueData); |
|
|
|
partInformationMapper.deletePartSubPropertiesValue(valueData); |
|
|
|
// 重新加载属性和属性值 |
|
|
|
partInformationMapper.savePartSubPropertiesValueHeader(valueData); |
|
|
|
partInformationMapper.savePartSubPropertiesValue(valueData); |
|
|
|
} |
|
|
|
PartSubPropertiesValueData valueData = new PartSubPropertiesValueData(); |
|
|
|
BeanUtils.copyProperties(data,valueData); |
|
|
|
// 删除物料的属性和属性值 |
|
|
|
partInformationMapper.deletePartSubPropertiesValueHeader(valueData); |
|
|
|
partInformationMapper.deletePartSubPropertiesValue(valueData); |
|
|
|
// 重新加载属性和属性值 |
|
|
|
partInformationMapper.savePartSubPropertiesValueHeader(valueData); |
|
|
|
partInformationMapper.savePartSubPropertiesValue(valueData); |
|
|
|
} |
|
|
|
// 修改物料 |
|
|
|
masterPartInformationMapper.masterPartInformationEdit(data); |
|
|
|
@ -298,7 +296,8 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo |
|
|
|
} |
|
|
|
|
|
|
|
// 2025-06-03 如果修改了模板 则调用技术等级修改接口 |
|
|
|
if (!mpData.isEmpty() && !mpData.get(0).getCodeNo().equals(data.getCodeNo())) { |
|
|
|
if (mpData.isEmpty() || !mpData.get(0).getCodeNo().equals(data.getCodeNo())) { |
|
|
|
// 先调用查询 有则修改 无则新增 |
|
|
|
PartIfsCatalogModel partIfsCatalogModel = new PartIfsCatalogModel(); // 模板对象 |
|
|
|
partIfsCatalogModel.setLuName(luName); |
|
|
|
partIfsCatalogModel.setKeyRef("PART_NO=" + data.getPartNo() + "^"); // 物料编码 |
|
|
|
@ -307,10 +306,21 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo |
|
|
|
partIfsCatalogModel.setOkYesNo(okYesNo); |
|
|
|
partIfsCatalogModel.setOkSign(ifsUser.getIfsUsername()); |
|
|
|
partIfsCatalogModel.setDtOk(DateUtils.getStringNow2()); |
|
|
|
Map<String, String> addMasterPartModelResponse = technicalClassBean.modifyTechnicalClass(srv, partIfsCatalogModel); |
|
|
|
if (!"200".equals(addMasterPartModelResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg")); |
|
|
|
Map<String, String> getMasterPartModelResponse = technicalClassBean.getTechnicalClass(srv, partIfsCatalogModel); |
|
|
|
if (!"200".equals(getMasterPartModelResponse.get("resultCode"))) { |
|
|
|
// 新增 |
|
|
|
Map<String, String> addMasterPartModelResponse = technicalClassBean.syncTechnicalClass(srv, partIfsCatalogModel); |
|
|
|
if (!"200".equals(addMasterPartModelResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg")); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 修改 |
|
|
|
Map<String, String> updateMasterPartModelResponse = technicalClassBean.modifyTechnicalClass(srv, partIfsCatalogModel); |
|
|
|
if (!"200".equals(updateMasterPartModelResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("IFS 物料件模板修改异常:" + updateMasterPartModelResponse.get("resultMsg")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|