From c454bbf94c73bc368655d8a3d54463c324436081 Mon Sep 17 00:00:00 2001 From: Kelvin Date: Thu, 5 Dec 2024 17:47:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=85=A5=E5=BA=93=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=AE=9E=E4=BD=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/InventoryBatchServiceImpl.java | 2 +- .../java/com/ktg/mes/wm/domain/WmsInPlan.java | 29 ++++++++++---- .../WmsInPlanDetailEntityServiceImpl.java | 2 +- .../wm/service/impl/WmsZdTaskServiceImpl.java | 4 +- .../resources/mapper/wm/WmsInPlanMapper.xml | 38 +++++++++++++++++-- 5 files changed, 61 insertions(+), 14 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java index 6890e91..c483292 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java @@ -189,7 +189,7 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService { // 获取当期入库明细数据 List> hashMapList = new ArrayList<>(); WmsInPlanDetailEntity entityQuery = new WmsInPlanDetailEntity(); - entityQuery.setPlanId(Long.parseLong(inTask.getPlanInId())); + entityQuery.setPlanId(inTask.getPlanInId()); // entityQuery.setKnifeId(Long.parseLong(inTask.getPlanInId())); List wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(entityQuery); wmsInPlanDetailEntityList.forEach(inPlanDetailEntity -> { diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java index f167e5c..c25e501 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java @@ -1,5 +1,6 @@ package com.ktg.mes.wm.domain; +import java.util.Date; import java.util.List; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -55,7 +56,7 @@ public class WmsInPlan extends BaseEntity { * 计划日期 */ @Excel(name = "计划日期") - private String expectDate; + private Date expectDate; /** * 发布人 @@ -150,8 +151,13 @@ public class WmsInPlan extends BaseEntity { /** * 入库类型 */ - @Excel(name = "入库类型") - private String planTypeId; + @Excel(name = "入库类型ID") + private Long planTypeId; + + /** + * 入库类型编码 + */ + private String planTypeCode; /** * 入库计划明细信息 @@ -206,11 +212,11 @@ public class WmsInPlan extends BaseEntity { return workOrderCode; } - public void setExpectDate(String expectDate) { + public void setExpectDate(Date expectDate) { this.expectDate = expectDate; } - public String getExpectDate() { + public Date getExpectDate() { return expectDate; } @@ -334,14 +340,22 @@ public class WmsInPlan extends BaseEntity { return planCode; } - public void setPlanTypeId(String planTypeId) { + public void setPlanTypeId(Long planTypeId) { this.planTypeId = planTypeId; } - public String getPlanTypeId() { + public Long getPlanTypeId() { return planTypeId; } + public String getPlanTypeCode() { + return planTypeCode; + } + + public void setPlanTypeCode(String planTypeCode) { + this.planTypeCode = planTypeCode; + } + public List getWmsInPlanDetailsList() { return wmsInPlanDetailsList; } @@ -381,6 +395,7 @@ public class WmsInPlan extends BaseEntity { .append("isDelete", getIsDelete()) .append("planCode", getPlanCode()) .append("planTypeId", getPlanTypeId()) + .append("planTypeCode", getPlanTypeCode()) .append("wmsInPlanDetailsList", getWmsInPlanDetailsList()) .toString(); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java index 9182d82..bdf379c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java @@ -68,7 +68,7 @@ public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityS // 获取入库计划信息 WmsInPlan wmsInPlan = wmsInPlanMapper.selectWmsInPlanByPlanId(entity.getPlanId().toString()); // 获取入库计划 - WmsBusinessType wmsBusinessType = wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsInPlan.getPlanTypeId()); + WmsBusinessType wmsBusinessType = wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsInPlan.getPlanTypeId().toString()); for (WmsInPlanDetails detail : wmsInPlan.getWmsInPlanDetailsList()) { // 匹配入库明细 diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java index f26db5b..1088187 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java @@ -385,7 +385,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService wmsInPlanTemp.setCellCode(wmStorageArea.getAreaCode()); wmsInPlanTemp.setPlanCode(zdTask.getCode()); wmsInPlanTemp.setRelBillCode("组装单据"); - wmsInPlanTemp.setPlanTypeId("13"); + wmsInPlanTemp.setPlanTypeId(13L); wmsInPlanTemp.setCreateBy(getUsername()); wmsInPlanTemp.setCreateTime(DateUtils.getNowDate()); @@ -431,7 +431,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService // 生成任务号 String taskInCode = MultiModuleCodeGenerator.generateTaskCode("RKT"); wmsInTask.setTaskInCode(taskInCode); - wmsInTask.setPlanInId(wmsInPlan.getPlanId().toString()); + wmsInTask.setPlanInId(wmsInPlan.getPlanId()); wmsInTask.setPlanInCode(wmsInPlan.getPlanCode()); wmsInTask.setMaterialCode(mdItem.getItemCode()); wmsInTask.setTaskInQuantity(zdTask.getProductIdQty()); diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml index bb1025f..72d2672 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml @@ -33,6 +33,7 @@ + @@ -54,7 +55,25 @@ - + + + + + + + + + + + + + + + + + + + @@ -86,7 +105,8 @@ IS_ACTIVE, IS_DELETE, PLAN_CODE, - PLAN_TYPE_ID + PLAN_TYPE_ID, + PLAN_TYPE_CODE from WMS_IN_PLAN @@ -122,11 +142,12 @@ and IS_DELETE = #{isDelete} and PLAN_CODE = #{planCode} and PLAN_TYPE_ID = #{planTypeId} + and PLAN_TYPE_CODE = #{planTypeCode} order by CREATE_TIME desc - select a.PLAN_ID, a.STATE, a.SOURCE_TYPE, @@ -155,6 +176,7 @@ a.IS_DELETE, a.PLAN_CODE, a.PLAN_TYPE_ID, + a.PLAN_TYPE_CODE, b.DETAILS_ID as sub_DETAILS_ID, b.PLAN_ID as sub_PLAN_ID, b.MATERIAL_ID as sub_MATERIAL_ID, @@ -204,6 +226,7 @@ a.IS_DELETE, a.PLAN_CODE, a.PLAN_TYPE_ID, + a.PLAN_TYPE_CODE, b.DETAILS_ID as sub_DETAILS_ID, b.PLAN_ID as sub_PLAN_ID, b.MATERIAL_ID as sub_MATERIAL_ID, @@ -254,6 +277,7 @@ IS_DELETE, PLAN_CODE, PLAN_TYPE_ID, + PLAN_TYPE_CODE, #{state}, @@ -283,6 +307,7 @@ #{isDelete}, #{planCode}, #{planTypeId}, + #{planTypeCode}, @@ -316,6 +341,7 @@ IS_DELETE = #{isDelete}, PLAN_CODE = #{planCode}, PLAN_TYPE_ID = #{planTypeId}, + PLAN_TYPE_CODE = #{planTypeCode}, where PLAN_ID = #{planId} @@ -361,4 +387,10 @@ FROM WMS_IN_PLAN WHERE PLAN_CODE = #{value} + + \ No newline at end of file