refactor: 自动分配优化

This commit is contained in:
Kelvin 2024-12-19 09:14:18 +08:00
parent 4711eac382
commit 18a0416a28
3 changed files with 4 additions and 2 deletions

View File

@ -102,7 +102,7 @@ public class WmsInTaskController extends BaseController {
} }
// 自动分配非临时库位 // 自动分配非临时库位
WmStorageArea wmStorageArea = this.wmStorageLocationService.queryOneAreaByLocationCode("DDJ01", ucmCtBaseByCode.getAttr3() == 1); WmStorageArea wmStorageArea = this.wmStorageLocationService.queryOneAreaByLocationCode("DDJ01", ucmCtBaseByCode.getAttr3() != null && ucmCtBaseByCode.getAttr3() == 1);
wmsInTask.setCellTgt(wmStorageArea.getAreaId()); wmsInTask.setCellTgt(wmStorageArea.getAreaId());
wmsInTask.setCellName(wmStorageArea.getAreaName()); wmsInTask.setCellName(wmStorageArea.getAreaName());
wmsInTask.setCellCode(wmStorageArea.getAreaCode()); wmsInTask.setCellCode(wmStorageArea.getAreaCode());

View File

@ -172,7 +172,8 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService {
// 过滤掉临时库位 // 过滤掉临时库位
.filter(it -> !it.getAreaCode().equals("TEMP")) .filter(it -> !it.getAreaCode().equals("TEMP"))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (wmStorageAreaList.isEmpty()) throw new RuntimeException("自动获取库位失败,无可用库位"); if (wmStorageAreaList == null || wmStorageAreaList.isEmpty())
throw new RuntimeException("自动获取库位失败,无可用库位");
// 返回第一个可用的库位 // 返回第一个可用的库位
return wmStorageAreaList.get(0); return wmStorageAreaList.get(0);

View File

@ -62,6 +62,7 @@ public class WmsInTaskServiceImpl implements IWmsInTaskService {
return null; return null;
} }
for (BaseKnife baseKnife : ucmCtBase.getBaseKnifeList()) { for (BaseKnife baseKnife : ucmCtBase.getBaseKnifeList()) {
wmsInTaskList.clear();
WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity(); WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity();
wmsInPlanDetailEntityQuery.setRfid(baseKnife.getRfid()); wmsInPlanDetailEntityQuery.setRfid(baseKnife.getRfid());