From fbe60c4e2546741f95b75e3b46e038d6a6e29567 Mon Sep 17 00:00:00 2001 From: Kelvin Date: Fri, 3 Jan 2025 16:03:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=87=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8C=E8=AE=BE=E7=BD=AElombok=EF=BC=9B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=B9=E6=8D=AE=E7=BC=96=E7=A0=81=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=B1=BB=E5=9E=8Bservice=EF=BC=9BtypeID=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ktg/mes/md/domain/WmsBusinessType.java | 190 +----------------- .../mes/md/mapper/WmsBusinessTypeMapper.java | 19 +- .../md/service/IWmsBusinessTypeService.java | 8 + .../impl/WmsBusinessTypeServiceImpl.java | 52 ++--- .../service/impl/WmsOutPlanServiceImpl.java | 6 +- 5 files changed, 55 insertions(+), 220 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsBusinessType.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsBusinessType.java index bfc5115..35c3c62 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsBusinessType.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsBusinessType.java @@ -1,5 +1,7 @@ package com.ktg.mes.md.domain; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ktg.common.annotation.Excel; @@ -11,13 +13,15 @@ import com.ktg.common.core.domain.BaseEntity; * @author yinjinlu * @date 2024-10-31 */ +@Getter +@Setter public class WmsBusinessType extends BaseEntity { private static final long serialVersionUID = 1L; /** * 主键 */ - private String typeId; + private Long typeId; /** * 修改日期 @@ -120,190 +124,6 @@ public class WmsBusinessType extends BaseEntity { @Excel(name = "是否记录入库时间:0否;1是") private String isRecordInboundTime; - public void setTypeId(String typeId) { - this.typeId = typeId; - } - - public String getTypeId() { - return typeId; - } - - public void setModifyDate(String modifyDate) { - this.modifyDate = modifyDate; - } - - public String getModifyDate() { - return modifyDate; - } - - public void setIsActive(String isActive) { - this.isActive = isActive; - } - - public String getIsActive() { - return isActive; - } - - public void setIsDelete(String isDelete) { - this.isDelete = isDelete; - } - - public String getIsDelete() { - return isDelete; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCode() { - return code; - } - - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setFlag(String flag) { - this.flag = flag; - } - - public String getFlag() { - return flag; - } - - public void setType(String type) { - this.type = type; - } - - public String getType() { - return type; - } - - public void setIsDefault(String isDefault) { - this.isDefault = isDefault; - } - - public String getIsDefault() { - return isDefault; - } - - public void setIsGlobal(String isGlobal) { - this.isGlobal = isGlobal; - } - - public String getIsGlobal() { - return isGlobal; - } - - public void setIsNeedUp(String isNeedUp) { - this.isNeedUp = isNeedUp; - } - - public String getIsNeedUp() { - return isNeedUp; - } - - public void setQualityType(String qualityType) { - this.qualityType = qualityType; - } - - public String getQualityType() { - return qualityType; - } - - public void setIsOutboundReview(String isOutboundReview) { - this.isOutboundReview = isOutboundReview; - } - - public String getIsOutboundReview() { - return isOutboundReview; - } - - public void setWaveStrategy(String waveStrategy) { - this.waveStrategy = waveStrategy; - } - - public String getWaveStrategy() { - return waveStrategy; - } - - public void setIsMultipleAllowed(String isMultipleAllowed) { - this.isMultipleAllowed = isMultipleAllowed; - } - - public String getIsMultipleAllowed() { - return isMultipleAllowed; - } - - public void setIsShortageAllowed(String isShortageAllowed) { - this.isShortageAllowed = isShortageAllowed; - } - - public String getIsShortageAllowed() { - return isShortageAllowed; - } - - public void setIsExcessAllowed(String isExcessAllowed) { - this.isExcessAllowed = isExcessAllowed; - } - - public String getIsExcessAllowed() { - return isExcessAllowed; - } - - public void setIsWholeOrderPost(String isWholeOrderPost) { - this.isWholeOrderPost = isWholeOrderPost; - } - - public String getIsWholeOrderPost() { - return isWholeOrderPost; - } - - public void setIsManuallyCreate(String isManuallyCreate) { - this.isManuallyCreate = isManuallyCreate; - } - - public String getIsManuallyCreate() { - return isManuallyCreate; - } - - public void setIsNoTask(String isNoTask) { - this.isNoTask = isNoTask; - } - - public String getIsNoTask() { - return isNoTask; - } - - public void setIsNegativeInv(String isNegativeInv) { - this.isNegativeInv = isNegativeInv; - } - - public String getIsNegativeInv() { - return isNegativeInv; - } - - public void setIsCheckSafetyStock(String isCheckSafetyStock) { - this.isCheckSafetyStock = isCheckSafetyStock; - } - - public String getIsCheckSafetyStock() { - return isCheckSafetyStock; - } - - public void setIsRecordInboundTime(String isRecordInboundTime) { - this.isRecordInboundTime = isRecordInboundTime; - } - - public String getIsRecordInboundTime() { - return isRecordInboundTime; - } - @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsBusinessTypeMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsBusinessTypeMapper.java index d839555..10dfc53 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsBusinessTypeMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsBusinessTypeMapper.java @@ -1,21 +1,22 @@ package com.ktg.mes.md.mapper; import com.ktg.mes.md.domain.WmsBusinessType; +import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 出入库类型Mapper接口 - * + * * @author yinjinlu * @date 2024-10-31 */ -public interface WmsBusinessTypeMapper -{ +@Mapper +public interface WmsBusinessTypeMapper { /** * 查询出入库类型 - * + * * @param typeId 出入库类型主键 * @return 出入库类型 */ @@ -31,7 +32,7 @@ public interface WmsBusinessTypeMapper /** * 查询出入库类型列表 - * + * * @param wmsBusinessType 出入库类型 * @return 出入库类型集合 */ @@ -39,7 +40,7 @@ public interface WmsBusinessTypeMapper /** * 新增出入库类型 - * + * * @param wmsBusinessType 出入库类型 * @return 结果 */ @@ -47,7 +48,7 @@ public interface WmsBusinessTypeMapper /** * 修改出入库类型 - * + * * @param wmsBusinessType 出入库类型 * @return 结果 */ @@ -55,7 +56,7 @@ public interface WmsBusinessTypeMapper /** * 删除出入库类型 - * + * * @param typeId 出入库类型主键 * @return 结果 */ @@ -63,7 +64,7 @@ public interface WmsBusinessTypeMapper /** * 批量删除出入库类型 - * + * * @param typeIds 需要删除的数据主键集合 * @return 结果 */ diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsBusinessTypeService.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsBusinessTypeService.java index b9f18a7..0e04965 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsBusinessTypeService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsBusinessTypeService.java @@ -19,6 +19,14 @@ public interface IWmsBusinessTypeService */ public WmsBusinessType selectWmsBusinessTypeByTypeId(String typeId); + /** + * 查询出入库类型 + * + * @param code 出入库类型编码 + * @return 出入库类型 + */ + public WmsBusinessType selectWmsBusinessTypeByCode(String code); + /** * 查询出入库类型列表 * diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsBusinessTypeServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsBusinessTypeServiceImpl.java index 04848df..f95cb75 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsBusinessTypeServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsBusinessTypeServiceImpl.java @@ -1,7 +1,9 @@ package com.ktg.mes.md.service.impl; import java.util.List; + import com.ktg.common.utils.DateUtils; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ktg.mes.md.mapper.WmsBusinessTypeMapper; @@ -10,86 +12,90 @@ import com.ktg.mes.md.service.IWmsBusinessTypeService; /** * 出入库类型Service业务层处理 - * + * * @author yinjinlu * @date 2024-10-31 */ @Service -public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService -{ - @Autowired - private WmsBusinessTypeMapper wmsBusinessTypeMapper; +@RequiredArgsConstructor +public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService { + private final WmsBusinessTypeMapper wmsBusinessTypeMapper; /** * 查询出入库类型 - * + * * @param typeId 出入库类型主键 * @return 出入库类型 */ @Override - public WmsBusinessType selectWmsBusinessTypeByTypeId(String typeId) - { + public WmsBusinessType selectWmsBusinessTypeByTypeId(String typeId) { return wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(typeId); } + /** + * 查询出入库类型 + * + * @param code 出入库类型编码 + * @return 出入库类型 + */ + @Override + public WmsBusinessType selectWmsBusinessTypeByCode(String code) { + return wmsBusinessTypeMapper.selectWmsBusinessTypeByCode(code); + } + /** * 查询出入库类型列表 - * + * * @param wmsBusinessType 出入库类型 * @return 出入库类型 */ @Override - public List selectWmsBusinessTypeList(WmsBusinessType wmsBusinessType) - { + public List selectWmsBusinessTypeList(WmsBusinessType wmsBusinessType) { return wmsBusinessTypeMapper.selectWmsBusinessTypeList(wmsBusinessType); } /** * 新增出入库类型 - * + * * @param wmsBusinessType 出入库类型 * @return 结果 */ @Override - public int insertWmsBusinessType(WmsBusinessType wmsBusinessType) - { + public int insertWmsBusinessType(WmsBusinessType wmsBusinessType) { wmsBusinessType.setCreateTime(DateUtils.getNowDate()); return wmsBusinessTypeMapper.insertWmsBusinessType(wmsBusinessType); } /** * 修改出入库类型 - * + * * @param wmsBusinessType 出入库类型 * @return 结果 */ @Override - public int updateWmsBusinessType(WmsBusinessType wmsBusinessType) - { + public int updateWmsBusinessType(WmsBusinessType wmsBusinessType) { return wmsBusinessTypeMapper.updateWmsBusinessType(wmsBusinessType); } /** * 批量删除出入库类型 - * + * * @param typeIds 需要删除的出入库类型主键 * @return 结果 */ @Override - public int deleteWmsBusinessTypeByTypeIds(String[] typeIds) - { + public int deleteWmsBusinessTypeByTypeIds(String[] typeIds) { return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeIds(typeIds); } /** * 删除出入库类型信息 - * + * * @param typeId 出入库类型主键 * @return 结果 */ @Override - public int deleteWmsBusinessTypeByTypeId(String typeId) - { + public int deleteWmsBusinessTypeByTypeId(String typeId) { return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeId(typeId); } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java index 81ce599..3717c45 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java @@ -331,7 +331,7 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { // 构建出库计划 WmsOutPlan wmsOutPlan = new WmsOutPlan(); wmsOutPlan.setPlanCode(Long.toString(System.currentTimeMillis(), 32).toUpperCase(Locale.ROOT)); - wmsOutPlan.setWmsBusinessTypeId(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId() != null ? Long.parseLong(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId()) : 11L); + wmsOutPlan.setWmsBusinessTypeId(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId() != null ? this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId() : 11L); wmsOutPlan.setPlanState("1"); wmsOutPlan.setPlanType("XTTB"); wmsOutPlan.setRemark("同步小型刀具库数据"); @@ -447,7 +447,7 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { // 构建出库计划 WmsOutPlan wmsOutPlan = new WmsOutPlan(); wmsOutPlan.setPlanCode(Long.toString(System.currentTimeMillis(), 32).toUpperCase(Locale.ROOT)); - wmsOutPlan.setWmsBusinessTypeId(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId() != null ? Long.parseLong(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId()) : 11L); + wmsOutPlan.setWmsBusinessTypeId(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId() != null ? this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("DPCK").getTypeId() : 11L); wmsOutPlan.setPlanState("1"); wmsOutPlan.setPlanType("XTTB"); wmsOutPlan.setRemark("同步小型刀具库数据"); @@ -586,7 +586,7 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { // 构建出库计划 WmsOutPlan wmsOutPlan = new WmsOutPlan(); wmsOutPlan.setPlanCode(Long.toString(System.currentTimeMillis(), 32).toUpperCase(Locale.ROOT)); - wmsOutPlan.setWmsBusinessTypeId(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("CK04").getTypeId() != null ? Long.parseLong(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("CK04").getTypeId()) : 14L); + wmsOutPlan.setWmsBusinessTypeId(this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("CK04").getTypeId() != null ? this.wmsBusinessTypeMapper.selectWmsBusinessTypeByCode("CK04").getTypeId() : 14L); wmsOutPlan.setPlanState("1"); wmsOutPlan.setPlanType("SCZB"); wmsOutPlan.setRemark("一键清退无寿命物品");