refactor(入库任务): 联查 物料名称

This commit is contained in:
LJW 2024-11-15 17:15:48 +08:00
parent c4b20c8af8
commit 21ea93c5d9
2 changed files with 43 additions and 22 deletions

View File

@ -113,6 +113,11 @@ public class WmsInTask extends BaseEntity {
@Excel(name = "物料编码") @Excel(name = "物料编码")
private String materialCode; private String materialCode;
/**
* 物料名称
*/
private String materialName;
/** /**
* 入库明细ID * 入库明细ID
*/ */
@ -263,6 +268,14 @@ public class WmsInTask extends BaseEntity {
this.detailInId = detailInId; this.detailInId = detailInId;
} }
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -288,6 +301,7 @@ public class WmsInTask extends BaseEntity {
.append("planInStatus", getPlanInStatus()) .append("planInStatus", getPlanInStatus())
.append("planInCode", getPlanInCode()) .append("planInCode", getPlanInCode())
.append("materialCode", getMaterialCode()) .append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("detailInId", getDetailInId()) .append("detailInId", getDetailInId())
.toString(); .toString();
} }

View File

@ -1,8 +1,13 @@
package com.ktg.mes.wm.service.impl; package com.ktg.mes.wm.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.ktg.common.utils.DateUtils; import com.ktg.common.utils.DateUtils;
import com.ktg.generator.util.MultiModuleCodeGenerator; import com.ktg.generator.util.MultiModuleCodeGenerator;
import com.ktg.mes.md.domain.MdItem;
import com.ktg.mes.md.mapper.MdItemMapper;
import com.ktg.mes.md.service.IMdItemService;
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.wm.mapper.WmsInTaskMapper; import com.ktg.mes.wm.mapper.WmsInTaskMapper;
@ -11,49 +16,54 @@ import com.ktg.mes.wm.service.IWmsInTaskService;
/** /**
* 入库任务Service业务层处理 * 入库任务Service业务层处理
* *
* @author yinjinlu * @author yinjinlu
* @date 2024-11-01 * @date 2024-11-01
*/ */
@Service @Service
public class WmsInTaskServiceImpl implements IWmsInTaskService public class WmsInTaskServiceImpl implements IWmsInTaskService {
{
@Autowired @Autowired
private WmsInTaskMapper wmsInTaskMapper; private WmsInTaskMapper wmsInTaskMapper;
@Autowired
private MdItemMapper mdItemMapper;
/** /**
* 查询入库任务 * 查询入库任务
* *
* @param id 入库任务主键 * @param id 入库任务主键
* @return 入库任务 * @return 入库任务
*/ */
@Override @Override
public WmsInTask selectWmsInTaskById(String id) public WmsInTask selectWmsInTaskById(String id) {
{
return wmsInTaskMapper.selectWmsInTaskById(id); return wmsInTaskMapper.selectWmsInTaskById(id);
} }
/** /**
* 查询入库任务列表 * 查询入库任务列表
* *
* @param wmsInTask 入库任务 * @param wmsInTask 入库任务
* @return 入库任务 * @return 入库任务
*/ */
@Override @Override
public List<WmsInTask> selectWmsInTaskList(WmsInTask wmsInTask) public List<WmsInTask> selectWmsInTaskList(WmsInTask wmsInTask) {
{ List<WmsInTask> wmsInTaskList = new ArrayList<>();
return wmsInTaskMapper.selectWmsInTaskList(wmsInTask); wmsInTaskMapper.selectWmsInTaskList(wmsInTask).forEach(task -> {
MdItem mdItem = mdItemMapper.selectMdItemByCode(task.getMaterialCode());
task.setMaterialName(mdItem.getItemName());
wmsInTaskList.add(task);
});
return wmsInTaskList;
} }
/** /**
* 新增入库任务 * 新增入库任务
* *
* @param wmsInTask 入库任务 * @param wmsInTask 入库任务
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertWmsInTask(WmsInTask wmsInTask) public int insertWmsInTask(WmsInTask wmsInTask) {
{
wmsInTask.setCreateTime(DateUtils.getNowDate()); wmsInTask.setCreateTime(DateUtils.getNowDate());
// 生成任务号 // 生成任务号
String taskInCode = MultiModuleCodeGenerator.generateTaskCode("RKT"); String taskInCode = MultiModuleCodeGenerator.generateTaskCode("RKT");
@ -63,38 +73,35 @@ public class WmsInTaskServiceImpl implements IWmsInTaskService
/** /**
* 修改入库任务 * 修改入库任务
* *
* @param wmsInTask 入库任务 * @param wmsInTask 入库任务
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateWmsInTask(WmsInTask wmsInTask) public int updateWmsInTask(WmsInTask wmsInTask) {
{
wmsInTask.setUpdateTime(DateUtils.getNowDate()); wmsInTask.setUpdateTime(DateUtils.getNowDate());
return wmsInTaskMapper.updateWmsInTask(wmsInTask); return wmsInTaskMapper.updateWmsInTask(wmsInTask);
} }
/** /**
* 批量删除入库任务 * 批量删除入库任务
* *
* @param ids 需要删除的入库任务主键 * @param ids 需要删除的入库任务主键
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteWmsInTaskByIds(String[] ids) public int deleteWmsInTaskByIds(String[] ids) {
{
return wmsInTaskMapper.deleteWmsInTaskByIds(ids); return wmsInTaskMapper.deleteWmsInTaskByIds(ids);
} }
/** /**
* 删除入库任务信息 * 删除入库任务信息
* *
* @param id 入库任务主键 * @param id 入库任务主键
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteWmsInTaskById(String id) public int deleteWmsInTaskById(String id) {
{
return wmsInTaskMapper.deleteWmsInTaskById(id); return wmsInTaskMapper.deleteWmsInTaskById(id);
} }
} }