|
|
|
@ -280,8 +280,13 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo |
|
|
|
// 判断是否为正式物料 |
|
|
|
if ("Y".equals(masterPartInformation.getOfficialFlag())) { |
|
|
|
if (dataUrl) { |
|
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
|
SysUserEntity ifsUser = sysUserDao.selectOne(new QueryWrapper<SysUserEntity>().eq("username", data.getUpdateBy())); |
|
|
|
if (ifsUser == null || !org.apache.commons.lang3.StringUtils.isNotBlank(ifsUser.getIfsUsername()) || !org.apache.commons.lang3.StringUtils.isNotBlank(ifsUser.getIfsPassword())) { |
|
|
|
throw new RuntimeException("请维护IFS账号和密码!"); |
|
|
|
} |
|
|
|
Server srv = ifsServer.getIfsServer(ifsUser.getIfsUsername(), ifsUser.getIfsPassword()); |
|
|
|
PartIfsCatalog partIfsCatalog = getPartIfsCatalog(data); |
|
|
|
partIfsCatalog.setIfsUsername(ifsUser.getIfsUsername()); |
|
|
|
Map<String, String> updateResponse = masterServiceBean.modifyPartCatalog(srv, partIfsCatalog); |
|
|
|
if (!"200".equals(updateResponse.get("resultCode"))) { |
|
|
|
throw new RuntimeException("IFS 物料件编辑异常信息:" + updateResponse.get("resultMsg")); |
|
|
|
@ -375,10 +380,15 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo |
|
|
|
valueData.setRecordType("MP"); |
|
|
|
arrayList.add(valueData); |
|
|
|
} |
|
|
|
|
|
|
|
// 物料模板 |
|
|
|
partInformationMapper.savePartSubPropertiesValueHeader(data); |
|
|
|
// 物料属性 |
|
|
|
partInformationMapper.savePartSubPropertiesValues(arrayList); |
|
|
|
// 如果同步过来的模板编码和plm不同,以ifs为准 |
|
|
|
if (!masterPart.getCodeNo().equals(ifsItems.get(0).getTechnicalClass())) { |
|
|
|
masterPartInformationMapper.updateCodeNoByPartNo(data.getPartNo(), ifsItems.get(0).getTechnicalClass()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (checkValueHeaderData.isEmpty()) { |
|
|
|
// 初次或修改物料模板则重新加载模板 |
|
|
|
|