|
@ -85,7 +85,7 @@ public class KGHJRKTask extends AbstractTask { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
// 设置终点并修改创建成功状态
|
|
|
// 设置终点并修改创建成功状态
|
|
|
if("HCQ7".equals(point.getRegion_code())) { |
|
|
if ("HCQ7".equals(point.getRegion_code())) { |
|
|
task.setTask_type("11"); |
|
|
task.setTask_type("11"); |
|
|
} else { |
|
|
} else { |
|
|
task.setTask_type("12"); |
|
|
task.setTask_type("12"); |
|
@ -130,41 +130,61 @@ public class KGHJRKTask extends AbstractTask { |
|
|
//从前往后判断,直到发现点位有货,取前一个
|
|
|
//从前往后判断,直到发现点位有货,取前一个
|
|
|
SchBasePoint schBasePoint = null; |
|
|
SchBasePoint schBasePoint = null; |
|
|
if (!"ZJBKGHJDJW".equals(regionCode)) { |
|
|
if (!"ZJBKGHJDJW".equals(regionCode)) { |
|
|
|
|
|
boolean flag = false; |
|
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) { |
|
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) { |
|
|
SchBasePoint temp = schBasePointList.get(i); |
|
|
SchBasePoint temp = schBasePointList.get(i); |
|
|
if (temp.getVehicle_qty() >= 1 && |
|
|
//三拖一起放,如果不是01结尾直接跳过
|
|
|
temp.getPoint_code().endsWith("01") |
|
|
if (!temp.getPoint_code().endsWith("01")) { |
|
|
&& ObjectUtil.isEmpty(temp.getIng_task_code())) { |
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
//如果当列已放满,跳过到下一列最后一个点位0501开始判断
|
|
|
|
|
|
if (flag && !temp.getPoint_code().endsWith("0501")) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} else if(flag && temp.getPoint_code().endsWith("0501")) { |
|
|
|
|
|
flag = false; |
|
|
|
|
|
} |
|
|
|
|
|
if (temp.getVehicle_qty() == 1 || |
|
|
|
|
|
ObjectUtil.isNotEmpty(temp.getIng_task_code())) { |
|
|
if (schBasePoint != null) { |
|
|
if (schBasePoint != null) { |
|
|
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code()); |
|
|
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code()); |
|
|
|
|
|
return schBasePoint; |
|
|
} else { |
|
|
} else { |
|
|
log.info("当前区域:" + regionCode + "所有点位均已放满,暂时跳过"); |
|
|
log.info("当前区域:" + regionCode2 + "初始点位" + temp.getPoint_code() + "有货,暂时跳过本列"); |
|
|
|
|
|
flag = true; |
|
|
} |
|
|
} |
|
|
break; |
|
|
//放货三拖一起放,只能到01位置
|
|
|
} |
|
|
} else if (temp.getPoint_code().endsWith("01")) { |
|
|
//放货三拖一起放,只能到01位置
|
|
|
|
|
|
if(temp.getPoint_code().endsWith("01")) { |
|
|
|
|
|
schBasePoint = temp; |
|
|
schBasePoint = temp; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
schBasePointList = pointMapper.findPointByRegion(regionCode2, "1"); |
|
|
schBasePointList = pointMapper.findPointByRegion(regionCode2, "1"); |
|
|
|
|
|
flag = false; |
|
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) { |
|
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) { |
|
|
SchBasePoint temp = schBasePointList.get(i); |
|
|
SchBasePoint temp = schBasePointList.get(i); |
|
|
//三拖一起放,如果不是01结尾直接跳过
|
|
|
//三拖一起放,如果不是01结尾直接跳过
|
|
|
if (!temp.getPoint_code().endsWith("01")) { |
|
|
if (!temp.getPoint_code().endsWith("01")) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
if (temp.getVehicle_qty() == 1 && |
|
|
//如果当列已放满,跳过到下一列最后一个点位1001开始判断
|
|
|
ObjectUtil.isEmpty(temp.getIng_task_code())) { |
|
|
if (flag && !temp.getPoint_code().endsWith("1001")) { |
|
|
|
|
|
continue; |
|
|
|
|
|
}else if(flag && temp.getPoint_code().endsWith("1001")) { |
|
|
|
|
|
flag = false; |
|
|
|
|
|
} |
|
|
|
|
|
if (temp.getVehicle_qty() == 1 || |
|
|
|
|
|
ObjectUtil.isNotEmpty(temp.getIng_task_code())) { |
|
|
if (schBasePoint != null) { |
|
|
if (schBasePoint != null) { |
|
|
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code()); |
|
|
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code()); |
|
|
|
|
|
return schBasePoint; |
|
|
} else { |
|
|
} else { |
|
|
log.info("当前区域:" + regionCode2 + "所有点位均已放满,暂时跳过"); |
|
|
log.info("当前区域:" + regionCode2 + "初始点位" + temp.getPoint_code() + "有货,暂时跳过本列"); |
|
|
|
|
|
flag = true; |
|
|
} |
|
|
} |
|
|
break; |
|
|
//放货三拖一起放,只能到01位置
|
|
|
|
|
|
} else if (temp.getPoint_code().endsWith("01")) { |
|
|
|
|
|
schBasePoint = temp; |
|
|
} |
|
|
} |
|
|
schBasePoint = temp; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -251,9 +271,13 @@ public class KGHJRKTask extends AbstractTask { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) { |
|
|
protected synchronized void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) { |
|
|
//重新计算固化室放货点位
|
|
|
//重新计算固化室放货点位
|
|
|
JSONObject extGroupData = JSONObject.parseObject(schBaseTask.getExt_group_data()); |
|
|
JSONObject extGroupData = JSONObject.parseObject(schBaseTask.getExt_group_data()); |
|
|
|
|
|
if (!schBaseTask.getPoint_code2().endsWith("DDD")) { |
|
|
|
|
|
log.info("当前任务" + schBaseTask.getTask_code() + "二次已分配点位" + schBaseTask.getPoint_code2() + ",无需重算"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); |
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code1())); |
|
|
SchBasePoint point = findNextPoint(startPoint, schBaseTask.getVehicle_type()); |
|
|
SchBasePoint point = findNextPoint(startPoint, schBaseTask.getVehicle_type()); |
|
@ -263,7 +287,7 @@ public class KGHJRKTask extends AbstractTask { |
|
|
//空架缓存区不需要该逻辑,左右都是同一套点位体系
|
|
|
//空架缓存区不需要该逻辑,左右都是同一套点位体系
|
|
|
if (!"HCQ7".equals(point.getRegion_code())) { |
|
|
if (!"HCQ7".equals(point.getRegion_code())) { |
|
|
schBaseTask.setPoint_code2(point.getPoint_code().replace("HCQ", "QHQ")); |
|
|
schBaseTask.setPoint_code2(point.getPoint_code().replace("HCQ", "QHQ")); |
|
|
}else{ |
|
|
} else { |
|
|
schBaseTask.setPoint_code2(point.getPoint_code()); |
|
|
schBaseTask.setPoint_code2(point.getPoint_code()); |
|
|
} |
|
|
} |
|
|
if (ObjectUtil.isNotEmpty(point.getIng_task_code()) && !schBaseTask.getTask_code().equals(point.getIng_task_code())) { |
|
|
if (ObjectUtil.isNotEmpty(point.getIng_task_code()) && !schBaseTask.getTask_code().equals(point.getIng_task_code())) { |
|
|