refactor: 出入库类型,设置lombok;增加根据编码查询类型service;typeID类型修改

This commit is contained in:
Kelvin 2025-01-03 16:03:54 +08:00
parent 89eeea78a5
commit fbe60c4e25
5 changed files with 55 additions and 220 deletions

View File

@ -1,5 +1,7 @@
package com.ktg.mes.md.domain; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel; import com.ktg.common.annotation.Excel;
@ -11,13 +13,15 @@ import com.ktg.common.core.domain.BaseEntity;
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
@Getter
@Setter
public class WmsBusinessType extends BaseEntity { public class WmsBusinessType extends BaseEntity {
private static final long serialVersionUID = 1L; 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是") @Excel(name = "是否记录入库时间:0否1是")
private String isRecordInboundTime; 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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -1,21 +1,22 @@
package com.ktg.mes.md.mapper; package com.ktg.mes.md.mapper;
import com.ktg.mes.md.domain.WmsBusinessType; import com.ktg.mes.md.domain.WmsBusinessType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
* 出入库类型Mapper接口 * 出入库类型Mapper接口
* *
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
public interface WmsBusinessTypeMapper @Mapper
{ public interface WmsBusinessTypeMapper {
/** /**
* 查询出入库类型 * 查询出入库类型
* *
* @param typeId 出入库类型主键 * @param typeId 出入库类型主键
* @return 出入库类型 * @return 出入库类型
*/ */
@ -31,7 +32,7 @@ public interface WmsBusinessTypeMapper
/** /**
* 查询出入库类型列表 * 查询出入库类型列表
* *
* @param wmsBusinessType 出入库类型 * @param wmsBusinessType 出入库类型
* @return 出入库类型集合 * @return 出入库类型集合
*/ */
@ -39,7 +40,7 @@ public interface WmsBusinessTypeMapper
/** /**
* 新增出入库类型 * 新增出入库类型
* *
* @param wmsBusinessType 出入库类型 * @param wmsBusinessType 出入库类型
* @return 结果 * @return 结果
*/ */
@ -47,7 +48,7 @@ public interface WmsBusinessTypeMapper
/** /**
* 修改出入库类型 * 修改出入库类型
* *
* @param wmsBusinessType 出入库类型 * @param wmsBusinessType 出入库类型
* @return 结果 * @return 结果
*/ */
@ -55,7 +56,7 @@ public interface WmsBusinessTypeMapper
/** /**
* 删除出入库类型 * 删除出入库类型
* *
* @param typeId 出入库类型主键 * @param typeId 出入库类型主键
* @return 结果 * @return 结果
*/ */
@ -63,7 +64,7 @@ public interface WmsBusinessTypeMapper
/** /**
* 批量删除出入库类型 * 批量删除出入库类型
* *
* @param typeIds 需要删除的数据主键集合 * @param typeIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */

View File

@ -19,6 +19,14 @@ public interface IWmsBusinessTypeService
*/ */
public WmsBusinessType selectWmsBusinessTypeByTypeId(String typeId); public WmsBusinessType selectWmsBusinessTypeByTypeId(String typeId);
/**
* 查询出入库类型
*
* @param code 出入库类型编码
* @return 出入库类型
*/
public WmsBusinessType selectWmsBusinessTypeByCode(String code);
/** /**
* 查询出入库类型列表 * 查询出入库类型列表
* *

View File

@ -1,7 +1,9 @@
package com.ktg.mes.md.service.impl; package com.ktg.mes.md.service.impl;
import java.util.List; import java.util.List;
import com.ktg.common.utils.DateUtils; import com.ktg.common.utils.DateUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ktg.mes.md.mapper.WmsBusinessTypeMapper; import com.ktg.mes.md.mapper.WmsBusinessTypeMapper;
@ -10,86 +12,90 @@ import com.ktg.mes.md.service.IWmsBusinessTypeService;
/** /**
* 出入库类型Service业务层处理 * 出入库类型Service业务层处理
* *
* @author yinjinlu * @author yinjinlu
* @date 2024-10-31 * @date 2024-10-31
*/ */
@Service @Service
public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService @RequiredArgsConstructor
{ public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService {
@Autowired private final WmsBusinessTypeMapper wmsBusinessTypeMapper;
private WmsBusinessTypeMapper wmsBusinessTypeMapper;
/** /**
* 查询出入库类型 * 查询出入库类型
* *
* @param typeId 出入库类型主键 * @param typeId 出入库类型主键
* @return 出入库类型 * @return 出入库类型
*/ */
@Override @Override
public WmsBusinessType selectWmsBusinessTypeByTypeId(String typeId) public WmsBusinessType selectWmsBusinessTypeByTypeId(String typeId) {
{
return wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(typeId); return wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(typeId);
} }
/**
* 查询出入库类型
*
* @param code 出入库类型编码
* @return 出入库类型
*/
@Override
public WmsBusinessType selectWmsBusinessTypeByCode(String code) {
return wmsBusinessTypeMapper.selectWmsBusinessTypeByCode(code);
}
/** /**
* 查询出入库类型列表 * 查询出入库类型列表
* *
* @param wmsBusinessType 出入库类型 * @param wmsBusinessType 出入库类型
* @return 出入库类型 * @return 出入库类型
*/ */
@Override @Override
public List<WmsBusinessType> selectWmsBusinessTypeList(WmsBusinessType wmsBusinessType) public List<WmsBusinessType> selectWmsBusinessTypeList(WmsBusinessType wmsBusinessType) {
{
return wmsBusinessTypeMapper.selectWmsBusinessTypeList(wmsBusinessType); return wmsBusinessTypeMapper.selectWmsBusinessTypeList(wmsBusinessType);
} }
/** /**
* 新增出入库类型 * 新增出入库类型
* *
* @param wmsBusinessType 出入库类型 * @param wmsBusinessType 出入库类型
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertWmsBusinessType(WmsBusinessType wmsBusinessType) public int insertWmsBusinessType(WmsBusinessType wmsBusinessType) {
{
wmsBusinessType.setCreateTime(DateUtils.getNowDate()); wmsBusinessType.setCreateTime(DateUtils.getNowDate());
return wmsBusinessTypeMapper.insertWmsBusinessType(wmsBusinessType); return wmsBusinessTypeMapper.insertWmsBusinessType(wmsBusinessType);
} }
/** /**
* 修改出入库类型 * 修改出入库类型
* *
* @param wmsBusinessType 出入库类型 * @param wmsBusinessType 出入库类型
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateWmsBusinessType(WmsBusinessType wmsBusinessType) public int updateWmsBusinessType(WmsBusinessType wmsBusinessType) {
{
return wmsBusinessTypeMapper.updateWmsBusinessType(wmsBusinessType); return wmsBusinessTypeMapper.updateWmsBusinessType(wmsBusinessType);
} }
/** /**
* 批量删除出入库类型 * 批量删除出入库类型
* *
* @param typeIds 需要删除的出入库类型主键 * @param typeIds 需要删除的出入库类型主键
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteWmsBusinessTypeByTypeIds(String[] typeIds) public int deleteWmsBusinessTypeByTypeIds(String[] typeIds) {
{
return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeIds(typeIds); return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeIds(typeIds);
} }
/** /**
* 删除出入库类型信息 * 删除出入库类型信息
* *
* @param typeId 出入库类型主键 * @param typeId 出入库类型主键
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteWmsBusinessTypeByTypeId(String typeId) public int deleteWmsBusinessTypeByTypeId(String typeId) {
{
return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeId(typeId); return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeId(typeId);
} }
} }

View File

@ -331,7 +331,7 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService {
// 构建出库计划 // 构建出库计划
WmsOutPlan wmsOutPlan = new WmsOutPlan(); WmsOutPlan wmsOutPlan = new WmsOutPlan();
wmsOutPlan.setPlanCode(Long.toString(System.currentTimeMillis(), 32).toUpperCase(Locale.ROOT)); 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.setPlanState("1");
wmsOutPlan.setPlanType("XTTB"); wmsOutPlan.setPlanType("XTTB");
wmsOutPlan.setRemark("同步小型刀具库数据"); wmsOutPlan.setRemark("同步小型刀具库数据");
@ -447,7 +447,7 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService {
// 构建出库计划 // 构建出库计划
WmsOutPlan wmsOutPlan = new WmsOutPlan(); WmsOutPlan wmsOutPlan = new WmsOutPlan();
wmsOutPlan.setPlanCode(Long.toString(System.currentTimeMillis(), 32).toUpperCase(Locale.ROOT)); 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.setPlanState("1");
wmsOutPlan.setPlanType("XTTB"); wmsOutPlan.setPlanType("XTTB");
wmsOutPlan.setRemark("同步小型刀具库数据"); wmsOutPlan.setRemark("同步小型刀具库数据");
@ -586,7 +586,7 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService {
// 构建出库计划 // 构建出库计划
WmsOutPlan wmsOutPlan = new WmsOutPlan(); WmsOutPlan wmsOutPlan = new WmsOutPlan();
wmsOutPlan.setPlanCode(Long.toString(System.currentTimeMillis(), 32).toUpperCase(Locale.ROOT)); 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.setPlanState("1");
wmsOutPlan.setPlanType("SCZB"); wmsOutPlan.setPlanType("SCZB");
wmsOutPlan.setRemark("一键清退无寿命物品"); wmsOutPlan.setRemark("一键清退无寿命物品");