refactor(入库任务): 增加库位信息

This commit is contained in:
Kelvin 2024-11-25 09:39:16 +08:00
parent 575e5d1b61
commit a012aa0743
3 changed files with 44 additions and 5 deletions

View File

@ -124,11 +124,10 @@ public class WmsInTaskController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('wm:wmsInTask:issueBatch')")
// @Log(title = "入库任务", businessType = BusinessType.UPDATE)
@PostMapping("/open/issueBatch")
@PostMapping("/open/issueBatch/{ids}")
@ResponseBody
public AjaxResult issueBatch(@RequestBody List<String> wmsInTaskIdList) {
wmsInTaskIdList.forEach(taskId -> {
public AjaxResult issueBatch(@PathVariable String[] ids) {
for (String taskId : ids) {
// 获取任务信息
WmsInTask wmsInTask = wmsInTaskService.selectWmsInTaskById(taskId);
// 更新任务状态
@ -230,7 +229,7 @@ public class WmsInTaskController extends BaseController {
}
mdItemService.updateMdItem(mbbBdMrlMitm);
}
});
}
return toAjax(1);
}
}

View File

@ -60,6 +60,9 @@ public class WmsInTask extends BaseEntity {
* 库位编码
*/
private String cellCode;
private String cellX;
private String cellY;
private String cellZ;
/**
* 起始库位
@ -205,6 +208,30 @@ public class WmsInTask extends BaseEntity {
this.cellCode = cellCode;
}
public String getCellX() {
return cellX;
}
public void setCellX(String cellX) {
this.cellX = cellX;
}
public String getCellY() {
return cellY;
}
public void setCellY(String cellY) {
this.cellY = cellY;
}
public String getCellZ() {
return cellZ;
}
public void setCellZ(String cellZ) {
this.cellZ = cellZ;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
@ -313,6 +340,9 @@ public class WmsInTask extends BaseEntity {
.append("cellName", getCellName())
.append("cellCode", getCellCode())
.append("cellOrig", getCellOrig())
.append("cellX", getCellX())
.append("cellY", getCellY())
.append("cellZ", getCellZ())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())

View File

@ -9,7 +9,9 @@ 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.WmStorageArea;
import com.ktg.mes.wm.domain.WmsInPlanDetailEntity;
import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -31,6 +33,8 @@ public class WmsInTaskServiceImpl implements IWmsInTaskService {
private MdItemMapper mdItemMapper;
@Autowired
private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService;
@Autowired
private WmStorageAreaMapper wmStorageAreaMapper;
/**
* 查询入库任务
@ -58,6 +62,12 @@ public class WmsInTaskServiceImpl implements IWmsInTaskService {
WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity();
wmsInPlanDetailEntityQuery.setPlanDetailsId(task.getDetailInId());
// 库位信息
WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaCode(task.getCellCode());
task.setCellX(wmStorageArea.getPositionX().toString());
task.setCellY(wmStorageArea.getPositionY().toString());
task.setCellZ(wmStorageArea.getPositionZ().toString());
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery);
task.setWmsInPlanDetailEntityList(wmsInPlanDetailEntityList);
wmsInTaskList.add(task);