Browse Source

2025-05-22

BOM Routing retire 优化
master
fengyuan_yang 1 year ago
parent
commit
180c9cb675
  1. 6
      src/main/java/com/spring/modules/part/mapper/RoutingManagementMapper.java
  2. 3
      src/main/java/com/spring/modules/part/service/impl/BomManagementServiceImpl.java
  3. 40
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java
  4. 3
      src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java
  5. 41
      src/main/resources/mapper/part/RoutingManagementMapper.xml

6
src/main/java/com/spring/modules/part/mapper/RoutingManagementMapper.java

@ -219,4 +219,10 @@ public interface RoutingManagementMapper extends BaseMapper<RoutingHeaderEntity>
void deleteWorkCenterCostAll(); void deleteWorkCenterCostAll();
List<PersonnelLevel> queryLaborClassByWorkCenterNo(PersonnelLevel data); List<PersonnelLevel> queryLaborClassByWorkCenterNo(PersonnelLevel data);
void updateIfsRowKeyAndRevision2(RoutingIfsItem ifsItem);
void updateIfsGuidelineRowKeyAndRevision2(RoutingIfsGuideLine ifsGuideline);
void updateIfsToolRowKeyAndRevision2(RoutingIfsTool ifsTool);
} }

3
src/main/java/com/spring/modules/part/service/impl/BomManagementServiceImpl.java

@ -449,7 +449,8 @@ public class BomManagementServiceImpl extends ServiceImpl<BomManagementMapper, B
} }
// 如果是Retire,则校验失效日期 // 如果是Retire,则校验失效日期
if ("Buildable".equals(data.getStatus())) {
// 2025-05-22 如果alternativeNo 不是 * 那么不校验PhaseOutDate但是如果是alternativeNo = *那么必须要先填写phaseOutDate然后才可以retired 且phaseOutDate 要小于当天
if ("Buildable".equals(data.getStatus()) && "*".equals(data.getAlternativeNo())) {
if (bomHeader.getEffPhaseOutDate() == null) { if (bomHeader.getEffPhaseOutDate() == null) {
throw new RuntimeException("失效日期不能为空!"); throw new RuntimeException("失效日期不能为空!");
} }

40
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -1758,9 +1758,9 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
*/ */
@Transactional @Transactional
public void temporaryCopyPart(PartInformationVo inData, PartInformationEntity fromPart) { public void temporaryCopyPart(PartInformationVo inData, PartInformationEntity fromPart) {
Server srv = getIfsServer(inData.getCreateBy());
// 正式物料则调用ifs copy part 接口 // 正式物料则调用ifs copy part 接口
if (dataUrl && "Y".equals(fromPart.getStatus())) { if (dataUrl && "Y".equals(fromPart.getStatus())) {
Server srv = getIfsServer(inData.getCreateBy());
CopyPart copyPart = new CopyPart(); CopyPart copyPart = new CopyPart();
copyPart.setOriContract(fromPart.getSite()); copyPart.setOriContract(fromPart.getSite());
copyPart.setOriPartNo(fromPart.getPartNo()); copyPart.setOriPartNo(fromPart.getPartNo());
@ -1905,6 +1905,44 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
// 反刷项目物料的finalPartNo // 反刷项目物料的finalPartNo
partInformationMapper.updateProjectFinalPart2(inData.getPreviousVersion().getSite(), inData.getPreviousVersion().getPartNo(), inData.getPartNo(), inData.getCreateBy()); partInformationMapper.updateProjectFinalPart2(inData.getPreviousVersion().getSite(), inData.getPreviousVersion().getPartNo(), inData.getPartNo(), inData.getCreateBy());
} }
// 2025-05-22 调用接口同步routing相关表的ifsRowId ifsRowRevision
if (dataUrl && "Y".equals(fromPart.getStatus())) {
String s = "";
RoutingIfsHeader routingData = new RoutingIfsHeader();
routingData.setContract(inData.getSite());
routingData.setPartNo(inData.getPartNo());
// routing关键字接口
Map<String, String> 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<RoutingIfsItem> ifsItems = JSON.parseArray(s, RoutingIfsItem.class);
for (RoutingIfsItem ifsItem : ifsItems) { // 修改ifs关键字
routingManagementMapper.updateIfsRowKeyAndRevision2(ifsItem);
}
// routing Guideline关键字接口
Map<String, String> 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<RoutingIfsGuideLine> ifsGuidelines = JSON.parseArray(s, RoutingIfsGuideLine.class);
for (RoutingIfsGuideLine ifsGuideline : ifsGuidelines) {
routingManagementMapper.updateIfsGuidelineRowKeyAndRevision2(ifsGuideline);
}
// routing Tool关键字接口
Map<String, String> 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<RoutingIfsTool> ifsTools = JSON.parseArray(s, RoutingIfsTool.class);
for (RoutingIfsTool ifsTool : ifsTools) { // 修改ifs关键字
routingManagementMapper.updateIfsToolRowKeyAndRevision2(ifsTool);
}
}
} }
public PartInformationEntity createCopyToPart(PartInformationVo inData, PartInformationEntity fromPart) { public PartInformationEntity createCopyToPart(PartInformationVo inData, PartInformationEntity fromPart) {

3
src/main/java/com/spring/modules/part/service/impl/RoutingManagementServiceImpl.java

@ -417,7 +417,8 @@ public class RoutingManagementServiceImpl extends ServiceImpl<RoutingManagementM
@Transactional @Transactional
public Map<String, Object> updateAlternativeStatus(RoutingDetailEntity data) { public Map<String, Object> updateAlternativeStatus(RoutingDetailEntity data) {
// 如果是Retire,则校验失效日期 // 如果是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<RoutingHeaderEntity>().eq("site", data.getSite()).eq("part_no", data.getPartNo()).eq("routing_revision", data.getRoutingRevision()).eq("routing_type", data.getRoutingType())); RoutingHeaderEntity routingHeader = routingManagementMapper.selectOne(new QueryWrapper<RoutingHeaderEntity>().eq("site", data.getSite()).eq("part_no", data.getPartNo()).eq("routing_revision", data.getRoutingRevision()).eq("routing_type", data.getRoutingType()));
if (routingHeader.getPhaseOutDate() == null) { if (routingHeader.getPhaseOutDate() == null) {
throw new RuntimeException("失效日期不能为空!"); throw new RuntimeException("失效日期不能为空!");

41
src/main/resources/mapper/part/RoutingManagementMapper.xml

@ -938,13 +938,26 @@
</select> </select>
<!-- 修改工序Tool的 rowKey rowRevision --> <!-- 修改工序Tool的 rowKey rowRevision -->
<update id="updateIfsToolRowKeyAndRevision" parameterType="RoutingIfsTool">
<update id="updateIfsToolRowKeyAndRevision" parameterType="com.spring.modules.part.entity.APIEntity.RoutingIfsTool">
update routing_tool update routing_tool
set ifs_row_id = #{ifsRowId}, set ifs_row_id = #{ifsRowId},
ifs_row_version = #{ifsRowVersion} ifs_row_version = #{ifsRowVersion}
where id = #{id} where id = #{id}
</update> </update>
<!-- 修改工序Tool的 rowKey rowRevision -->
<update id="updateIfsToolRowKeyAndRevision2" parameterType="com.spring.modules.part.entity.APIEntity.RoutingIfsTool">
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>
<!-- 获取该替代的全部guideLine --> <!-- 获取该替代的全部guideLine -->
<select id="getGuideLineByOperation" parameterType="RoutingComponentEntity" resultType="WorkGuidelineEntity"> <select id="getGuideLineByOperation" parameterType="RoutingComponentEntity" resultType="WorkGuidelineEntity">
SELECT SELECT
@ -966,15 +979,27 @@
</select> </select>
<!-- 修改工序Guideline的 rowKey rowRevision --> <!-- 修改工序Guideline的 rowKey rowRevision -->
<update id="updateIfsGuidelineRowKeyAndRevision" parameterType="RoutingIfsGuideLine">
<update id="updateIfsGuidelineRowKeyAndRevision" parameterType="com.spring.modules.part.entity.APIEntity.RoutingIfsGuideLine">
update plm_routing_work_guide update plm_routing_work_guide
set ifs_row_id = #{ifsRowId}, set ifs_row_id = #{ifsRowId},
ifs_row_version = #{ifsRowVersion} ifs_row_version = #{ifsRowVersion}
where id = #{id} where id = #{id}
</update> </update>
<!-- 修改工序Guideline的 rowKey rowRevision -->
<update id="updateIfsGuidelineRowKeyAndRevision2" parameterType="com.spring.modules.part.entity.APIEntity.RoutingIfsGuideLine">
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}
</update>
<!-- 获取该工序的Tool(ifs) --> <!-- 获取该工序的Tool(ifs) -->
<select id="getRoutingGuidelineByOperationToIfs" resultType="RoutingIfsGuideLine">
<select id="getRoutingGuidelineByOperationToIfs" resultType="com.spring.modules.part.entity.APIEntity.RoutingIfsGuideLine">
SELECT SELECT
a.id, a.id,
a.site as contract, a.site as contract,
@ -1047,13 +1072,21 @@
</select> </select>
<!-- 修改工序的 rowKey rowRevision --> <!-- 修改工序的 rowKey rowRevision -->
<update id="updateIfsRowKeyAndRevision" parameterType="RoutingIfsItem">
<update id="updateIfsRowKeyAndRevision" parameterType="com.spring.modules.part.entity.APIEntity.RoutingIfsItem">
update plm_routing_component update plm_routing_component
set ifs_row_id = #{ifsRowId}, set ifs_row_id = #{ifsRowId},
ifs_row_version = #{ifsRowVersion} 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} where site = #{contract} and part_no = #{partNo} and routing_type = #{routingType} and routing_revision = #{routingRevision} and alternative_no = #{alternativeNo} and operation_id = #{operationId}
</update> </update>
<!-- 修改工序的 rowKey rowRevision -->
<update id="updateIfsRowKeyAndRevision2" parameterType="com.spring.modules.part.entity.APIEntity.RoutingIfsItem">
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>
<!-- 修改工具的 rowKey rowRevision --> <!-- 修改工具的 rowKey rowRevision -->
<update id="updateRoutingToolIfsRow" parameterType="com.spring.modules.part.vo.RoutingToolVo"> <update id="updateRoutingToolIfsRow" parameterType="com.spring.modules.part.vo.RoutingToolVo">
update routing_tool update routing_tool

Loading…
Cancel
Save