|
|
@ -132,6 +132,12 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
@Autowired |
|
|
@Autowired |
|
|
private RoutingServiceBean routingServiceBean; |
|
|
private RoutingServiceBean routingServiceBean; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private MasterServiceBean masterServiceBean; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private TechnicalClassBean technicalClassBean; |
|
|
|
|
|
|
|
|
@Value("${sys-file.file-path}") |
|
|
@Value("${sys-file.file-path}") |
|
|
private String filePath; |
|
|
private String filePath; |
|
|
|
|
|
|
|
|
@ -147,6 +153,9 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
@Value("${ifs-control.ifs-password}") |
|
|
@Value("${ifs-control.ifs-password}") |
|
|
private String ifsPassword; |
|
|
private String ifsPassword; |
|
|
|
|
|
|
|
|
|
|
|
private final String luName = "PartCatalog"; |
|
|
|
|
|
private final String technicalSpecNo = "0"; |
|
|
|
|
|
private final String okYesNo = "Not Approved"; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获得物料件对象 |
|
|
* 获得物料件对象 |
|
|
@ -2820,7 +2829,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
masterPartInformation.setPartNo(ifsPart.getPartNo()); |
|
|
masterPartInformation.setPartNo(ifsPart.getPartNo()); |
|
|
masterPartInformation.setPlmPartNo(data.getPartNo()); |
|
|
masterPartInformation.setPlmPartNo(data.getPartNo()); |
|
|
masterPartInformation.setUpdateBy(data.getUpdateBy()); |
|
|
masterPartInformation.setUpdateBy(data.getUpdateBy()); |
|
|
masterPartInformationService.toBecomeOfficialMasterPart(masterPartInformation); |
|
|
|
|
|
|
|
|
toBecomeOfficialMasterPart(masterPartInformation); |
|
|
|
|
|
|
|
|
// 获取ifsServer |
|
|
// 获取ifsServer |
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
@ -4133,6 +4142,74 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
return bomManufStructCostDistribVoList; |
|
|
return bomManufStructCostDistribVoList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 转正式物料 |
|
|
|
|
|
* @param inData |
|
|
|
|
|
*/ |
|
|
|
|
|
@Transactional |
|
|
|
|
|
public void toBecomeOfficialMasterPart(MasterPartInformationEntity inData) { |
|
|
|
|
|
// 校验ifsPartNo是否已存在 |
|
|
|
|
|
MasterPartInformationEntity masterPart = masterPartInformationMapper.selectOne(new QueryWrapper<MasterPartInformationEntity>().eq("part_no", inData.getPartNo())); |
|
|
|
|
|
if (masterPart == null) { |
|
|
|
|
|
MasterPartInformationEntity plmMasterPart = masterPartInformationMapper.selectOne(new QueryWrapper<MasterPartInformationEntity>().eq("part_no", inData.getPlmPartNo())); |
|
|
|
|
|
|
|
|
|
|
|
// 创建IFS物料 |
|
|
|
|
|
MasterPartInformationEntity ifsPart = new MasterPartInformationEntity(); |
|
|
|
|
|
BeanUtils.copyProperties(plmMasterPart, ifsPart); |
|
|
|
|
|
ifsPart.setPartNo(inData.getPartNo()); |
|
|
|
|
|
ifsPart.setPlmPartNo(inData.getPlmPartNo()); |
|
|
|
|
|
ifsPart.setCreateBy(inData.getUpdateBy()); |
|
|
|
|
|
ifsPart.setOfficialFlag("Y"); |
|
|
|
|
|
masterPartInformationMapper.insert(ifsPart); |
|
|
|
|
|
|
|
|
|
|
|
if (dataUrl) { // 正式库 |
|
|
|
|
|
SysUserEntity ifsUser = sysUserDao.selectOne(new QueryWrapper<SysUserEntity>().eq("username", inData.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()); |
|
|
|
|
|
// 获取ifs PartCatalog 对象 |
|
|
|
|
|
PartIfsCatalog partIfsCatalog = getPartIfsCatalog(ifsPart); |
|
|
|
|
|
// 判断ifs是否已存在物料件 |
|
|
|
|
|
Map<String, String> queryResponse = masterServiceBean.getMasterPart(srv, partIfsCatalog); |
|
|
|
|
|
if ("200".equals(queryResponse.get("resultCode"))) { // 物料件已存在,调用修改接口 |
|
|
|
|
|
Map<String, String> updateResponse = masterServiceBean.modifyPartCatalog(srv, partIfsCatalog); |
|
|
|
|
|
if (!"200".equals(updateResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("IFS物料件修改异常:" + updateResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
} else { // 调用新增接口 |
|
|
|
|
|
Map<String, String> addResponse = masterServiceBean.syncPartCatalog(srv, partIfsCatalog); |
|
|
|
|
|
if (!"200".equals(addResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("IFS物料件新增异常:" + addResponse.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()); |
|
|
|
|
|
List<PartIfsCatalogProperty> propertyList = partInformationMapper.getMasterPartPropertyList("*", ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象 |
|
|
|
|
|
Map<String, String> addMasterPartModelResponse = technicalClassBean.syncTechnicalClass(srv, partIfsCatalogModel); |
|
|
|
|
|
if (!"200".equals(addMasterPartModelResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
if (!propertyList.isEmpty()) { |
|
|
|
|
|
Map<String, String> addMasterPartPropertyResponse = technicalClassBean.modifyTechnicalClassAttributes(srv, propertyList); |
|
|
|
|
|
if (!"200".equals(addMasterPartPropertyResponse.get("resultCode"))) { |
|
|
|
|
|
throw new RuntimeException("IFS 物料件属性新增异常:" + addMasterPartPropertyResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|