fix:增加桁架任务及二次分配任务完成情况校验
This commit is contained in:
@@ -196,8 +196,8 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
log.info("一楼装箱区二次分配任务编号为:" + taskCode + ",接口返回最新点位:---------------------------------------------" + newPoint.getPoint_code());
|
||||
return newPoint.getPoint_code();
|
||||
} else {
|
||||
log.info("一楼装箱区二次分配任务编号为:" + taskCode + ",分配失败,存在未完成的取放货任务或点位外层有载具阻挡!");
|
||||
throw new BadRequestException("存在未完成的取放货任务或点位外层有载具阻挡!");
|
||||
log.info("一楼装箱区二次分配任务编号为:" + taskCode + ",分配失败,暂无点位资源或点位外层有载具阻挡!");
|
||||
throw new BadRequestException("一楼装箱区二次分配任务编号为:" + taskCode + ",分配失败,暂无点位资源或点位外层有载具阻挡!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,14 +239,25 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(null, pointIds, null, pointIds);
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("空载具放货分配"))) {
|
||||
List<BstIvtPackageinfoivt> ivtList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空"))).sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq).reversed()).collect(Collectors.toList());
|
||||
List<BstIvtPackageinfoivt> pointList = new ArrayList<>();
|
||||
List<BstIvtPackageinfoivt> ivtList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具"))).sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq)).collect(Collectors.toList());
|
||||
//有空载具
|
||||
if (CollectionUtils.isNotEmpty(ivtList)) {
|
||||
// BstIvtPackageinfoivt bstIvtPackageinfoivt = new BstIvtPackageinfoivt();
|
||||
// bstIvtPackageinfoivt.setPoint_code(ivtList.get(0).getPoint_code());
|
||||
// returList.add(bstIvtPackageinfoivt);
|
||||
// return returList;
|
||||
BstIvtPackageinfoivt bstIvtPackageinfoivt = new BstIvtPackageinfoivt();
|
||||
bstIvtPackageinfoivt.setPoint_code(ivtList.get(0).getPoint_code());
|
||||
bstIvtPackageinfoivt.setSort_seq(ivtList.get(0).getSort_seq());
|
||||
returList.add(bstIvtPackageinfoivt);
|
||||
return returList;
|
||||
//判断是否有空载具阻挡
|
||||
pointList.add(getBstIvtPackageinfoivt(returList, packageinfoivtList));
|
||||
return pointList;
|
||||
} else {
|
||||
return returList;
|
||||
BstIvtPackageinfoivt bstIvtPackageinfoivt = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空"))).sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq).reversed()).collect(Collectors.toList()).get(0);
|
||||
pointList.add(bstIvtPackageinfoivt);
|
||||
return pointList;
|
||||
}
|
||||
} else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务取货分配"))) {
|
||||
taskList = bstIvtPackageinfoivtMapper.getTaskList(pointIds, pointIds, pointIds, pointIds);
|
||||
@@ -310,16 +321,16 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
.collect(Collectors.toList());
|
||||
//送空载具到空载具缓存位任务,需要判断是否存在已分配的且未完成的送空载具任务,如果存在,判断存在是否阻挡
|
||||
if (taskType.equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)")) || taskType.equals(PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)"))) {
|
||||
return getBstIvtPackageinfoivts(pointCode, taskList, ivtList);
|
||||
return getNoBlockIvt(pointCode, taskList, ivtList);
|
||||
} else {
|
||||
return ivtList;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断阻挡
|
||||
* 获取没有阻挡的点位
|
||||
*/
|
||||
private List<BstIvtPackageinfoivt> getBstIvtPackageinfoivts(String pointCode, List<SchBaseTask> taskList, List<BstIvtPackageinfoivt> ivtList) {
|
||||
private List<BstIvtPackageinfoivt> getNoBlockIvt(String pointCode, List<SchBaseTask> taskList, List<BstIvtPackageinfoivt> ivtList) {
|
||||
Set<String> taskPointSet = taskList.stream().map(SchBaseTask::getPoint_code2).filter(pointCode2 -> !pointCode2.equals("ZXQ_01_1")).collect(Collectors.toSet());
|
||||
List<BstIvtPackageinfoivt> pointList = new ArrayList<>();
|
||||
//存在补空载具任务已分配却未完成的任务
|
||||
@@ -570,7 +581,8 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
BstIvtPackageinfoivt ivtInfo = getIvtInfoFromRegion(baseTask.getTask_type(), actionType);
|
||||
List<BstIvtPackageinfoivt> newPointList = packageinfoivtService.checkEndPointTask(bstIvtPackageinfoivt.getPoint_status(), ivtInfo.getIvt_status(), targetPoint, ivtInfo.getSort_seq().toString(), "");
|
||||
if (CollectionUtils.isEmpty(newPointList)) {
|
||||
throw new BadRequestException("暂无点位资源!");
|
||||
log.info("一楼装箱区二次分配任务编号为:" + baseTask.getTask_code() + ",分配失败,暂无点位资源或点位外层有载具阻挡!");
|
||||
throw new BadRequestException("一楼装箱区二次分配任务编号为:" + baseTask.getTask_code() + ",分配失败,暂无点位资源或点位外层有载具阻挡!");
|
||||
}
|
||||
newPoint = newPointList.get(0);
|
||||
return newPoint;
|
||||
|
||||
Reference in New Issue
Block a user