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;
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)

View File

@ -1,6 +1,7 @@
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;
@ -11,8 +12,8 @@ import java.util.List;
* @author yinjinlu
* @date 2024-10-31
*/
public interface WmsBusinessTypeMapper
{
@Mapper
public interface WmsBusinessTypeMapper {
/**
* 查询出入库类型
*

View File

@ -19,6 +19,14 @@ public interface IWmsBusinessTypeService
*/
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;
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;
@ -15,10 +17,9 @@ import com.ktg.mes.md.service.IWmsBusinessTypeService;
* @date 2024-10-31
*/
@Service
public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService
{
@Autowired
private WmsBusinessTypeMapper wmsBusinessTypeMapper;
@RequiredArgsConstructor
public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService {
private final WmsBusinessTypeMapper wmsBusinessTypeMapper;
/**
* 查询出入库类型
@ -27,11 +28,21 @@ public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService
* @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);
}
/**
* 查询出入库类型列表
*
@ -39,8 +50,7 @@ public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService
* @return 出入库类型
*/
@Override
public List<WmsBusinessType> selectWmsBusinessTypeList(WmsBusinessType wmsBusinessType)
{
public List<WmsBusinessType> selectWmsBusinessTypeList(WmsBusinessType wmsBusinessType) {
return wmsBusinessTypeMapper.selectWmsBusinessTypeList(wmsBusinessType);
}
@ -51,8 +61,7 @@ public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService
* @return 结果
*/
@Override
public int insertWmsBusinessType(WmsBusinessType wmsBusinessType)
{
public int insertWmsBusinessType(WmsBusinessType wmsBusinessType) {
wmsBusinessType.setCreateTime(DateUtils.getNowDate());
return wmsBusinessTypeMapper.insertWmsBusinessType(wmsBusinessType);
}
@ -64,8 +73,7 @@ public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService
* @return 结果
*/
@Override
public int updateWmsBusinessType(WmsBusinessType wmsBusinessType)
{
public int updateWmsBusinessType(WmsBusinessType wmsBusinessType) {
return wmsBusinessTypeMapper.updateWmsBusinessType(wmsBusinessType);
}
@ -76,8 +84,7 @@ public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService
* @return 结果
*/
@Override
public int deleteWmsBusinessTypeByTypeIds(String[] typeIds)
{
public int deleteWmsBusinessTypeByTypeIds(String[] typeIds) {
return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeIds(typeIds);
}
@ -88,8 +95,7 @@ public class WmsBusinessTypeServiceImpl implements IWmsBusinessTypeService
* @return 结果
*/
@Override
public int deleteWmsBusinessTypeByTypeId(String typeId)
{
public int deleteWmsBusinessTypeByTypeId(String typeId) {
return wmsBusinessTypeMapper.deleteWmsBusinessTypeByTypeId(typeId);
}
}

View File

@ -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("一键清退无寿命物品");