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 dc289e0b..19b3033e 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 @@ -1786,15 +1786,28 @@ public class PartInformationServiceImpl extends ServiceImpl().eq("site", inData.getFromPartSite()).eq("part_no", inData.getFromPartNo())); // copy - temporaryCopyPart(inData, fromPart); + Server srv = getIfsServer(inData.getCreateBy()); + try { + temporaryCopyPart(inData, fromPart, srv); + } catch (Exception e) { + // 删除库存件关联信息 + PartIfsInventory partIfsInventory = new PartIfsInventory(); + partIfsInventory.setContract(inData.getSite()); + partIfsInventory.setPartNo(inData.getPartNo()); + Map deleteInventoryPartResponse = inventoryServiceBean.removeInventoryPartRelationInfo(srv, partIfsInventory); + if (!"200".equals(deleteInventoryPartResponse.get("resultCode"))) { + throw new RuntimeException(e.getMessage() + "; IFS删除库存件关联信息异常:" + deleteInventoryPartResponse.get("resultMsg")); + } + throw new RuntimeException(e.getMessage()); + } + } /** * 临时物料的copy part */ @Transactional - public void temporaryCopyPart(PartInformationVo inData, PartInformationEntity fromPart) { - Server srv = getIfsServer(inData.getCreateBy()); + public void temporaryCopyPart(PartInformationVo inData, PartInformationEntity fromPart, Server srv) { // 正式物料则调用ifs copy part 接口 if (dataUrl && "Y".equals(fromPart.getStatus())) { CopyPart copyPart = new CopyPart();