diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java index 9aae9a9..d1dda0c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java @@ -206,6 +206,30 @@ public class WmsInTaskController extends BaseController { baseKnifeService.insertBaseKnife(baseKnife); }); mdItemService.updateMdItem(mbbBdMrlMitm); + } else if (Objects.equals(wmsInTask.getPlanTypeCode(), "CGRK")) { + wmsInPlanDetailEntityList.forEach(planDetailEntity -> { + BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId()); + // 设置状态为 解锁 + baseKnife.setIsLocked(0); + // 设置工具状态 已入库 + baseKnife.setKnifeFineState(1); + // 状态为生效 + baseKnife.setIsValid(0); + // 更新台账状态 + baseKnifeService.updateBaseKnife(baseKnife); + }); + } else if (Objects.equals(wmsInTask.getPlanTypeCode(), "GJHK")) { + wmsInPlanDetailEntityList.forEach(planDetailEntity -> { + BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId()); + // 设置状态为 解锁 + baseKnife.setIsLocked(0); + // 设置工具状态 已入库 + baseKnife.setKnifeFineState(1); + // 状态为生效 + baseKnife.setIsValid(0); + // 更新台账状态 + baseKnifeService.updateBaseKnife(baseKnife); + }); } else { for (int i = 0; i < wmsInTask.getActualInQuantity(); i++) { // 生成台账 diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java index 00eeafe..83a0ffb 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java @@ -31,7 +31,7 @@ public class WmsInTask extends BaseEntity { * 入库计划id */ @Excel(name = "入库计划id") - private String planInId; + private Long planInId; /** * 任务数量 @@ -134,6 +134,11 @@ public class WmsInTask extends BaseEntity { @Excel(name = "入库明细ID") private Long detailInId; + /** + * 计划类型编码 + */ + private String planTypeCode; + private List wmsInPlanDetailEntityList; public void setId(Long id) { @@ -152,11 +157,11 @@ public class WmsInTask extends BaseEntity { return taskInCode; } - public void setPlanInId(String planInId) { + public void setPlanInId(Long planInId) { this.planInId = planInId; } - public String getPlanInId() { + public Long getPlanInId() { return planInId; } @@ -328,6 +333,14 @@ public class WmsInTask extends BaseEntity { this.wmsInPlanDetailEntityList = wmsInPlanDetailEntityList; } + public String getPlanTypeCode() { + return planTypeCode; + } + + public void setPlanTypeCode(String planTypeCode) { + this.planTypeCode = planTypeCode; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) @@ -353,6 +366,7 @@ public class WmsInTask extends BaseEntity { .append("batch", getBatch()) .append("materialId", getMaterialId()) .append("planTypeId", getPlanTypeId()) + .append("planTypeCode", getPlanTypeCode()) .append("planInStatus", getPlanInStatus()) .append("planInCode", getPlanInCode()) .append("materialCode", getMaterialCode()) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java index 45d6f1c..1ed2fdf 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInTaskMapper.java @@ -3,6 +3,7 @@ package com.ktg.mes.wm.mapper; import java.util.List; import com.ktg.mes.wm.domain.WmsInTask; import com.ktg.mes.wm.domain.WmsZdTask; +import org.apache.ibatis.annotations.Mapper; /** * 入库任务Mapper接口 @@ -10,7 +11,8 @@ import com.ktg.mes.wm.domain.WmsZdTask; * @author yinjinlu * @date 2024-11-01 */ -public interface WmsInTaskMapper +@Mapper +public interface WmsInTaskMapper { /** * 查询入库任务 diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml index 25319a7..8dc5dc1 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml @@ -24,6 +24,7 @@ + @@ -50,6 +51,7 @@ a.BATCH, a.MATERIAL_ID, a.PLAN_TYPE_ID, + a.PLAN_TYPE_CODE, a.PLAN_IN_STATUS, a.PLAN_IN_CODE, a.MATERIAL_CODE, @@ -84,6 +86,7 @@ and BATCH like concat('%', #{batch}, '%') and MATERIAL_ID = #{materialId} and PLAN_TYPE_ID = #{planTypeId} + and PLAN_TYPE_CODE = #{planTypeCode} and PLAN_IN_STATUS = #{planInStatus} and PLAN_IN_CODE = #{planInCode} and MATERIAL_CODE like concat('%', #{materialCode}, '%') @@ -116,6 +119,7 @@ BATCH, MATERIAL_ID, PLAN_TYPE_ID, + PLAN_TYPE_CODE, PLAN_IN_STATUS, PLAN_IN_CODE, MATERIAL_CODE, @@ -138,6 +142,7 @@ #{batch}, #{materialId}, #{planTypeId}, + #{planTypeCode}, #{planInStatus}, #{planInCode}, #{materialCode}, @@ -164,6 +169,7 @@ BATCH = #{batch}, MATERIAL_ID = #{materialId}, PLAN_TYPE_ID = #{planTypeId}, + PLAN_TYPE_CODE = #{planTypeCode}, PLAN_IN_STATUS = #{planInStatus}, PLAN_IN_CODE = #{planInCode}, MATERIAL_CODE = #{materialCode},