refactor(入库任务): 增加查询 入库计划明细实例

This commit is contained in:
LJW 2024-11-22 09:34:19 +08:00
parent 13e6c8e39c
commit 1788735f42
4 changed files with 41 additions and 9 deletions

View File

@ -58,6 +58,16 @@ public class WmsInTaskController extends BaseController {
return getDataTable(list);
}
/**
* 查询入库任务列表
*/
@GetMapping("/open/list")
public TableDataInfo openList(WmsInTask wmsInTask) {
startPage();
List<WmsInTask> list = wmsInTaskService.selectWmsInTaskList(wmsInTask);
return getDataTable(list);
}
/**
* 导出入库任务列表
*/

View File

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import java.util.List;
/**
* 入库任务对象 WMS_IN_TASK
*
@ -129,6 +131,8 @@ public class WmsInTask extends BaseEntity {
@Excel(name = "入库明细ID")
private Long detailInId;
private List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList;
public void setId(Long id) {
this.id = id;
}
@ -289,6 +293,14 @@ public class WmsInTask extends BaseEntity {
this.materialUnit = materialUnit;
}
public List<WmsInPlanDetailEntity> getWmsInPlanDetailEntityList() {
return wmsInPlanDetailEntityList;
}
public void setWmsInPlanDetailEntityList(List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList) {
this.wmsInPlanDetailEntityList = wmsInPlanDetailEntityList;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -316,6 +328,7 @@ public class WmsInTask extends BaseEntity {
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("detailInId", getDetailInId())
.append("wmsInPlanDetailEntityList", getWmsInPlanDetailEntityList())
.toString();
}
}

View File

@ -5,15 +5,15 @@ import com.ktg.mes.wm.domain.WmsInTask;
/**
* 入库任务Service接口
*
*
* @author yinjinlu
* @date 2024-11-01
*/
public interface IWmsInTaskService
public interface IWmsInTaskService
{
/**
* 查询入库任务
*
*
* @param id 入库任务主键
* @return 入库任务
*/
@ -21,7 +21,7 @@ public interface IWmsInTaskService
/**
* 查询入库任务列表
*
*
* @param wmsInTask 入库任务
* @return 入库任务集合
*/
@ -29,7 +29,7 @@ public interface IWmsInTaskService
/**
* 新增入库任务
*
*
* @param wmsInTask 入库任务
* @return 结果
*/
@ -37,7 +37,7 @@ public interface IWmsInTaskService
/**
* 修改入库任务
*
*
* @param wmsInTask 入库任务
* @return 结果
*/
@ -45,7 +45,7 @@ public interface IWmsInTaskService
/**
* 批量删除入库任务
*
*
* @param ids 需要删除的入库任务主键集合
* @return 结果
*/
@ -53,7 +53,7 @@ public interface IWmsInTaskService
/**
* 删除入库任务信息
*
*
* @param id 入库任务主键
* @return 结果
*/

View File

@ -1,6 +1,7 @@
package com.ktg.mes.wm.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.ktg.common.utils.DateUtils;
@ -8,6 +9,8 @@ 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 com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.wm.mapper.WmsInTaskMapper;
@ -24,9 +27,10 @@ import com.ktg.mes.wm.service.IWmsInTaskService;
public class WmsInTaskServiceImpl implements IWmsInTaskService {
@Autowired
private WmsInTaskMapper wmsInTaskMapper;
@Autowired
private MdItemMapper mdItemMapper;
@Autowired
private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService;
/**
* 查询入库任务
@ -51,6 +55,11 @@ public class WmsInTaskServiceImpl implements IWmsInTaskService {
wmsInTaskMapper.selectWmsInTaskList(wmsInTask).forEach(task -> {
MdItem mdItem = mdItemMapper.selectMdItemByCode(task.getMaterialCode());
task.setMaterialName(mdItem.getItemName());
WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity();
wmsInPlanDetailEntityQuery.setPlanDetailsId(task.getDetailInId());
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery);
task.setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList);
wmsInTaskList.add(task);
});
return wmsInTaskList;