|
|
|
@ -1805,10 +1805,11 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
masterPartInformation.setPlmPartNo(data.getPartNo()); |
|
|
|
masterPartInformationService.toBecomeOfficialMasterPart(masterPartInformation); |
|
|
|
|
|
|
|
// 同步数据到 IFS |
|
|
|
if (dataUrl) { |
|
|
|
// 1、库存件 |
|
|
|
PartIfsInventory partIfsInventory = getPartIfsInventory(ifsPart); // 主表对象 |
|
|
|
try { |
|
|
|
// 同步数据到 IFS |
|
|
|
if (dataUrl) { |
|
|
|
PartIfsInventoryConfig partIfsInventoryConfig = getPartIfsInventoryConfig(ifsPart); // costs对象 |
|
|
|
PartIfsInventoryManufacture partIfsInventoryManufacture = getPartIfsInventoryManufacture(ifsPart); // Manufacturing对象 |
|
|
|
PartIfsInventoryPlan partIfsInventoryPlan = getPartIfsInventoryPlan(ifsPart); // planning对象 |
|
|
|
@ -1821,7 +1822,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
} |
|
|
|
|
|
|
|
// 1.1 库存件主表数据 |
|
|
|
String getInventoryPartURL = apiUrl + "/part/ifs/getInventoryPartToIfs"; |
|
|
|
String getInventoryPartURL = apiUrl + "/part/ifs/getInventoryPart"; |
|
|
|
ResponseData getInventoryPartResponse = HttpClientUtil.doPostByRawWithPLM(getInventoryPartURL, partIfsInventory); |
|
|
|
if (!"200".equals(getInventoryPartResponse.getCode())) { // 新增 |
|
|
|
String addInventoryPartURL = apiUrl + "/part/ifs/syncInventoryPartToIfs"; |
|
|
|
@ -1864,7 +1865,19 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
if (!"200".equals(savePartRevisionResponse.getCode())) { |
|
|
|
throw new RuntimeException("IFS库存件版本新增异常:" + savePartRevisionResponse.getMsg()); |
|
|
|
} |
|
|
|
} else { // 修改 |
|
|
|
} else { |
|
|
|
// // 删除再新增 |
|
|
|
// String deletePartRevisionURL = apiUrl + "/part/ifs/removeInventoryPartRevisionToIfs"; |
|
|
|
// ResponseData deletePartRevisionResponse = HttpClientUtil.doPostByRawWithPLM(deletePartRevisionURL, revision); |
|
|
|
// if (!"200".equals(deletePartRevisionResponse.getCode())) { |
|
|
|
// throw new RuntimeException("IFS库存件版本删除异常:" + deletePartRevisionResponse.getMsg()); |
|
|
|
// } |
|
|
|
// String savePartRevisionURL = apiUrl + "/part/ifs/syncInventoryPartRevisionToIfs"; |
|
|
|
// ResponseData savePartRevisionResponse = HttpClientUtil.doPostByRawWithPLM(savePartRevisionURL, revision); |
|
|
|
// if (!"200".equals(savePartRevisionResponse.getCode())) { |
|
|
|
// throw new RuntimeException("IFS库存件版本新增异常:" + savePartRevisionResponse.getMsg()); |
|
|
|
// } |
|
|
|
// 修改 |
|
|
|
String updatePartRevisionURL = apiUrl + "/part/ifs/modifyInventoryPartRevisionToIfs"; |
|
|
|
ResponseData updatePartRevisionResponse = HttpClientUtil.doPostByRawWithPLM(updatePartRevisionURL, revision); |
|
|
|
if (!"200".equals(updatePartRevisionResponse.getCode())) { |
|
|
|
@ -2243,6 +2256,15 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
partInformationMapper.savePartFile(ifsFiles); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
// 删除inventoryPart |
|
|
|
String deleteInventoryPartURL = apiUrl + "/part/ifs/removeInventoryPartToIfs"; |
|
|
|
ResponseData deleteInventoryPartResponse = HttpClientUtil.doPostByRawWithPLM(deleteInventoryPartURL, partIfsInventory); |
|
|
|
if (!"200".equals(deleteInventoryPartResponse.getCode())) { |
|
|
|
throw new RuntimeException("IFS库存件删除异常:" + deleteInventoryPartResponse.getMsg()); |
|
|
|
} |
|
|
|
throw new RuntimeException(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|