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

This commit is contained in:
LJW 2024-11-22 09:13:01 +08:00
parent 816085fedc
commit f62ad17b71
3 changed files with 33 additions and 1 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

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