|
|
@ -110,20 +110,25 @@ public class TBXBKJTask extends AbstractTask { |
|
|
|
String regionCode = null; |
|
|
|
if ("TBX1".equals(startPoint.getRegion_code())) { |
|
|
|
//TBX1找A区
|
|
|
|
regionCode = "HCQ3"; |
|
|
|
regionCode = "HCQ1"; |
|
|
|
|
|
|
|
} else if ("TBX2".equals(startPoint.getRegion_code())) { |
|
|
|
//TBX2找B区
|
|
|
|
regionCode = "HCQ5"; |
|
|
|
} |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode,"1"); |
|
|
|
SchBasePoint temp = null; |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1"); |
|
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
|
if (schBasePoint.getVehicle_qty() > 0&&ObjectUtil.isEmpty(schBasePoint.getIng_task_code())) { |
|
|
|
log.info("涂板线补空架找到当前符合条件的点位{}",schBasePoint.getPoint_code()); |
|
|
|
return schBasePoint; |
|
|
|
if (schBasePoint.getVehicle_qty() > 0 && ObjectUtil.isEmpty(schBasePoint.getIng_task_code())) { |
|
|
|
if (temp == null || |
|
|
|
schBasePoint.getPoint_code().startsWith(temp.getPoint_code().substring(0, temp.getPoint_code().length() - 2)) |
|
|
|
&&schBasePoint.getPoint_code().compareTo(temp.getPoint_code())>0){ |
|
|
|
temp=schBasePoint; |
|
|
|
log.info("涂板线补空架找到当前符合条件的点位{}", schBasePoint.getPoint_code()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return temp; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -150,8 +155,8 @@ public class TBXBKJTask extends AbstractTask { |
|
|
|
if (status.equals(TaskStatus.FINISHED)) { // 完成
|
|
|
|
// 起点解锁,库存减少
|
|
|
|
startPointObj.setIng_task_code(""); |
|
|
|
startPointObj.setVehicle_qty(startPointObj.getVehicle_qty()-1); |
|
|
|
pointService.update(endPointObj); |
|
|
|
startPointObj.setVehicle_qty(startPointObj.getVehicle_qty() - 1); |
|
|
|
pointService.update(startPointObj); |
|
|
|
|
|
|
|
// 任务完成
|
|
|
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); |
|
|
@ -185,7 +190,7 @@ public class TBXBKJTask extends AbstractTask { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { |
|
|
|
protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) { |
|
|
|
//todo 重算最优点
|
|
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code2())); |
|
|
|