This commit is contained in:
psh
2024-01-04 14:14:36 +08:00
parent dfb31d0307
commit 89652ee42d
3 changed files with 41 additions and 15 deletions

View File

@@ -236,11 +236,12 @@ public class BPSLTask extends AbstractTask {
//todo 重算最优点
JSONObject jsonObject = JSONObject.parseObject(schBaseTask.getExt_group_data());
SchBasePoint point = this.findNextPoint(jsonObject,schBaseTask);
if( "1".equals(jsonObject.getString("material_type"))) {
schBaseTask.setPoint_code1(point.getPoint_code()+"0"+point.getVehicle_qty());
}else{
//正极板现在不堆叠
// if( "1".equals(jsonObject.getString("material_type"))) {
// schBaseTask.setPoint_code1(point.getPoint_code()+"0"+point.getVehicle_qty());
// }else{
schBaseTask.setPoint_code1(point.getPoint_code());
}
// }
//重算点位时把点位占用
point.setIng_task_code(schBaseTask.getTask_code());
// point.setVehicle_qty(point.getVehicle_qty() - 1);

View File

@@ -85,7 +85,7 @@ public class KGHJRKTask extends AbstractTask {
continue;
}
// 设置终点并修改创建成功状态
task.setPoint_code2(point.getPoint_code());
task.setPoint_code2(point.getNext_wait_point());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");
taskService.update(task);
@@ -120,18 +120,31 @@ public class KGHJRKTask extends AbstractTask {
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"1");
//从前往后判断,直到发现点位有货,取前一个
SchBasePoint schBasePoint=null;
for(int i=schBasePointList.size()-1;i>=0;i--) {
SchBasePoint temp = schBasePointList.get(i);
if(temp.getVehicle_qty()==1&&
ObjectUtil.isEmpty(temp.getIng_task_code())){
if(schBasePoint!=null) {
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code());
}else{
log.info("当前区域:{}所有点位均已放满,暂时跳过",regionCode);
if(!"ZJBKGHJDJW".equals(regionCode)) {
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
SchBasePoint temp = schBasePointList.get(i);
if (temp.getVehicle_qty() == 1 &&
ObjectUtil.isEmpty(temp.getIng_task_code())) {
if (schBasePoint != null) {
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code());
} else {
throw new BadRequestException("当前区域:"+regionCode+"所有点位均已放满,暂时跳过");
}
break;
}
break;
schBasePoint = temp;
}
}else{
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
SchBasePoint temp = schBasePointList.get(i);
if (temp.getVehicle_qty() <3 &&
ObjectUtil.isEmpty(temp.getIng_task_code())) {
schBasePoint = temp;
}
}
if (schBasePoint==null){
throw new BadRequestException("当前区域:"+regionCode+"所有点位均已放满,暂时跳过");
}
schBasePoint=temp;
}
return schBasePoint;
}