refactor(入库任务): 将库位信息填充至料箱,代码块优化

This commit is contained in:
Kelvin 2025-01-05 16:27:24 +08:00
parent cf738261c4
commit ea7d61a6f4

View File

@ -135,6 +135,11 @@ public class WmsInTaskController extends BaseController {
// 将料箱rfid绑定至任务 // 将料箱rfid绑定至任务
wmsInTask.setBoxRfid(rfid); wmsInTask.setBoxRfid(rfid);
// 将库位信息填充至料箱
UcmCtBase ucmCtBase = ucmCtBaseService.selectUcmCtBaseByCode(wmsInTask.getBoxRfid());
ucmCtBase.setAttr1(wmsInTask.getCellTgt().toString());
ucmCtBaseService.updateUcmCtBase(ucmCtBase);
wmsInTaskService.updateWmsInTask(wmsInTask); wmsInTaskService.updateWmsInTask(wmsInTask);
return AjaxResult.success(wmsInTask); return AjaxResult.success(wmsInTask);
} }
@ -194,10 +199,6 @@ public class WmsInTaskController extends BaseController {
// 入库类型为整刀回库 // 入库类型为整刀回库
if (Objects.equals(wmsInTask.getPlanTypeId(), "9")) { if (Objects.equals(wmsInTask.getPlanTypeId(), "9")) {
// 将库位信息填充至料箱
UcmCtBase ucmCtBase = ucmCtBaseService.selectUcmCtBaseByCode(wmsInTask.getBoxRfid());
ucmCtBase.setAttr1(wmsInTask.getCellTgt().toString());
ucmCtBaseService.updateUcmCtBase(ucmCtBase);
// 插入台账数据 // 插入台账数据
wmsInPlanDetailEntityList.forEach(planDetailEntity -> { wmsInPlanDetailEntityList.forEach(planDetailEntity -> {
BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId()); BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId());
@ -301,10 +302,6 @@ public class WmsInTaskController extends BaseController {
}); });
mdItemService.updateMdItem(mbbBdMrlMitm); mdItemService.updateMdItem(mbbBdMrlMitm);
} else if (Objects.equals(wmsInTask.getPlanTypeCode(), "CGRK")) { } else if (Objects.equals(wmsInTask.getPlanTypeCode(), "CGRK")) {
// 将库位信息填充至料箱
UcmCtBase ucmCtBase = ucmCtBaseService.selectUcmCtBaseByCode(wmsInTask.getBoxRfid());
ucmCtBase.setAttr1(wmsInTask.getCellTgt().toString());
ucmCtBaseService.updateUcmCtBase(ucmCtBase);
// 插入台账数据 // 插入台账数据
wmsInPlanDetailEntityList.forEach(planDetailEntity -> { wmsInPlanDetailEntityList.forEach(planDetailEntity -> {
BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId()); BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId());
@ -321,10 +318,6 @@ public class WmsInTaskController extends BaseController {
baseKnifeService.updateBaseKnife(baseKnife); baseKnifeService.updateBaseKnife(baseKnife);
}); });
} else if (Objects.equals(wmsInTask.getPlanTypeCode(), "GJHK")) { } else if (Objects.equals(wmsInTask.getPlanTypeCode(), "GJHK")) {
// 将库位信息填充至料箱
UcmCtBase ucmCtBase = ucmCtBaseService.selectUcmCtBaseByCode(wmsInTask.getBoxRfid());
ucmCtBase.setAttr1(wmsInTask.getCellTgt().toString());
ucmCtBaseService.updateUcmCtBase(ucmCtBase);
// 插入台账数据 // 插入台账数据
wmsInPlanDetailEntityList.forEach(planDetailEntity -> { wmsInPlanDetailEntityList.forEach(planDetailEntity -> {
BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId()); BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId());