From 180c9cb675d1c8de0b4d0ebf9a45c9deb7fbd004 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 22 May 2025 14:53:54 +0800 Subject: [PATCH] =?UTF-8?q?2025-05-22=20BOM=20Routing=20retire=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../part/mapper/RoutingManagementMapper.java | 6 +++ .../impl/BomManagementServiceImpl.java | 3 +- .../impl/PartInformationServiceImpl.java | 40 +++++++++++++++++- .../impl/RoutingManagementServiceImpl.java | 3 +- .../mapper/part/RoutingManagementMapper.xml | 41 +++++++++++++++++-- 5 files changed, 86 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/spring/modules/part/mapper/RoutingManagementMapper.java b/src/main/java/com/spring/modules/part/mapper/RoutingManagementMapper.java index 429492ca..e4076683 100644 --- a/src/main/java/com/spring/modules/part/mapper/RoutingManagementMapper.java +++ b/src/main/java/com/spring/modules/part/mapper/RoutingManagementMapper.java @@ -219,4 +219,10 @@ public interface RoutingManagementMapper extends BaseMapper void deleteWorkCenterCostAll(); List queryLaborClassByWorkCenterNo(PersonnelLevel data); + + void updateIfsRowKeyAndRevision2(RoutingIfsItem ifsItem); + + void updateIfsGuidelineRowKeyAndRevision2(RoutingIfsGuideLine ifsGuideline); + + void updateIfsToolRowKeyAndRevision2(RoutingIfsTool ifsTool); } diff --git a/src/main/java/com/spring/modules/part/service/impl/BomManagementServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/BomManagementServiceImpl.java index 4f52a24d..4019f35b 100644 --- a/src/main/java/com/spring/modules/part/service/impl/BomManagementServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/BomManagementServiceImpl.java @@ -449,7 +449,8 @@ public class BomManagementServiceImpl extends ServiceImpl routingResponse = routingServiceBean.getRoutingItemsWithCopyPart(srv, routingData); + if (!"200".equals(routingResponse.get("resultCode"))) { + throw new RuntimeException("获取Routing关键字异常:" + routingResponse.get("resultMsg")); + } + s = String.valueOf(routingResponse.get("obj")); + List ifsItems = JSON.parseArray(s, RoutingIfsItem.class); + for (RoutingIfsItem ifsItem : ifsItems) { // 修改ifs关键字 + routingManagementMapper.updateIfsRowKeyAndRevision2(ifsItem); + } + // routing Guideline关键字接口 + Map routingGuidelineResponse = routingServiceBean.getRoutingGuideLinesWithCopyPart(srv, routingData); + if (!"200".equals(routingGuidelineResponse.get("resultCode"))) { + throw new RuntimeException("获取Routing Guideline关键字异常:" + routingGuidelineResponse.get("resultMsg")); + } + s = String.valueOf(routingGuidelineResponse.get("obj")); + List ifsGuidelines = JSON.parseArray(s, RoutingIfsGuideLine.class); + for (RoutingIfsGuideLine ifsGuideline : ifsGuidelines) { + routingManagementMapper.updateIfsGuidelineRowKeyAndRevision2(ifsGuideline); + } + // routing Tool关键字接口 + Map routingToolResponse = routingServiceBean.getRoutingToolsWithCopyPart(srv, routingData); + if (!"200".equals(routingToolResponse.get("resultCode"))) { + throw new RuntimeException("获取Routing Tool关键字异常:" + routingToolResponse.get("resultMsg")); + } + s = String.valueOf(routingToolResponse.get("obj")); + List ifsTools = JSON.parseArray(s, RoutingIfsTool.class); + for (RoutingIfsTool ifsTool : ifsTools) { // 修改ifs关键字 + routingManagementMapper.updateIfsToolRowKeyAndRevision2(ifsTool); + } + } } public PartInformationEntity createCopyToPart(PartInformationVo inData, PartInformationEntity fromPart) { diff --git a/src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java index 87995339..bd72e582 100644 --- a/src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java @@ -417,7 +417,8 @@ public class RoutingManagementServiceImpl extends ServiceImpl updateAlternativeStatus(RoutingDetailEntity data) { // 如果是Retire,则校验失效日期 - if ("Buildable".equals(data.getStatus())) { + // 2025-05-22 如果alternativeNo 不是 * ,那么不校验PhaseOutDate,但是如果是alternativeNo = *,那么必须要先填写phaseOutDate,然后才可以retired 且phaseOutDate 要小于当天 + if ("Buildable".equals(data.getStatus()) && "*".equals(data.getAlternativeNo())) { RoutingHeaderEntity routingHeader = routingManagementMapper.selectOne(new QueryWrapper().eq("site", data.getSite()).eq("part_no", data.getPartNo()).eq("routing_revision", data.getRoutingRevision()).eq("routing_type", data.getRoutingType())); if (routingHeader.getPhaseOutDate() == null) { throw new RuntimeException("失效日期不能为空!"); diff --git a/src/main/resources/mapper/part/RoutingManagementMapper.xml b/src/main/resources/mapper/part/RoutingManagementMapper.xml index f309e423..65da6676 100644 --- a/src/main/resources/mapper/part/RoutingManagementMapper.xml +++ b/src/main/resources/mapper/part/RoutingManagementMapper.xml @@ -938,13 +938,26 @@ - + update routing_tool set ifs_row_id = #{ifsRowId}, ifs_row_version = #{ifsRowVersion} where id = #{id} + + + update + a + set a.ifs_row_id = #{ifsRowId}, + a.ifs_row_version = #{ifsRowVersion} from + routing_tool a, plm_routing_component b + where a.site = b.site and a.part_no = b.part_no and a.routing_revision = b.routing_revision and a.routing_type = b.routing_type and a.alternative_no = b.alternative_no + and a.operation_id = b.operation_id + and a.site = #{contract} and a.part_no = #{partNo} and a.routing_revision = #{routingRevision} and a.routing_type = #{routingType} and a.alternative_no = #{alternativeNo} + and a.tool_id = #{toolId} and b.operation_no = #{operationNo} + + - + update plm_routing_work_guide set ifs_row_id = #{ifsRowId}, ifs_row_version = #{ifsRowVersion} where id = #{id} + + + update + a + set a.ifs_row_id = #{ifsRowId}, + a.ifs_row_version = #{ifsRowVersion} from + plm_routing_work_guide a, plm_routing_component b + where a.site = b.site and a.part_no = b.part_no and a.routing_revision = b.routing_revision and a.routing_type = b.routing_type and a.alternative_no = b.alternative_no + and a.operation_id = b.operation_id + and a.site = #{contract} and a.part_no = #{partNo} and a.routing_revision = #{routingRevision} and a.routing_type = #{routingType} and a.alternative_no = #{alternativeNo} and a.guideline_seq = #{guidelineSeq} and b.operation_no = #{operationNo} + + - SELECT a.id, a.site as contract, @@ -1047,13 +1072,21 @@ - + update plm_routing_component set ifs_row_id = #{ifsRowId}, ifs_row_version = #{ifsRowVersion} where site = #{contract} and part_no = #{partNo} and routing_type = #{routingType} and routing_revision = #{routingRevision} and alternative_no = #{alternativeNo} and operation_id = #{operationId} + + + update plm_routing_component + set ifs_row_id = #{ifsRowId}, + ifs_row_version = #{ifsRowVersion} + where site = #{contract} and part_no = #{partNo} and routing_type = #{routingType} and routing_revision = #{routingRevision} and alternative_no = #{alternativeNo} and operation_no = #{operationNo} + + update routing_tool