From aa2397126b3e91f6c45c1bbda4a1fbc93da44e3c Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 8 Jul 2025 17:10:44 +0800 Subject: [PATCH] =?UTF-8?q?2025-07-08=20copyPart=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=90=8E=E8=B0=83=E7=94=A8=E5=88=A0=E9=99=A4=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E8=BE=BE=E5=88=B0=E4=B8=A4=E8=BE=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PartInformationServiceImpl.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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();