|
|
@ -108,27 +108,31 @@ public class KGHJRKTask extends AbstractTask { |
|
|
|
* 判断目标点位 |
|
|
|
* 1.A区的去A区缓存点,B区的去B区 |
|
|
|
* 2.倒叙查找,找到满足当前位置数量不足3的即可 |
|
|
|
* 3.负极板优先放到HCQ7,放满了再放到HCQ1 |
|
|
|
*/ |
|
|
|
private SchBasePoint findNextPoint(SchBasePoint startPoint, String vehicleType) { |
|
|
|
String regionCode = null; |
|
|
|
String regionCode2 = null; |
|
|
|
if ("A1".equals(startPoint.getWorkshop_code())) { |
|
|
|
//A1空架到HCQ1
|
|
|
|
regionCode = "HCQ1"; |
|
|
|
regionCode = "HCQ7"; |
|
|
|
regionCode2 ="HCQ1"; |
|
|
|
if ("1".equals(vehicleType)) { |
|
|
|
regionCode = "ZJBKGHJDJW"; |
|
|
|
} |
|
|
|
|
|
|
|
} else if ("A2".equals(startPoint.getWorkshop_code())) { |
|
|
|
//A1空架到KGHJ2
|
|
|
|
regionCode = "KGHJ2"; |
|
|
|
//A1空架到HCQ5
|
|
|
|
regionCode = "HCQ5"; |
|
|
|
} |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1"); |
|
|
|
//负极板优先放到HCQ7,放满了再放到HCQ1
|
|
|
|
//从前往后判断,直到发现点位有货,取前一个
|
|
|
|
SchBasePoint schBasePoint = null; |
|
|
|
if (!"ZJBKGHJDJW".equals(regionCode)) { |
|
|
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) { |
|
|
|
SchBasePoint temp = schBasePointList.get(i); |
|
|
|
if (temp.getVehicle_qty() == 1 && |
|
|
|
if (temp.getVehicle_qty() > 1 && |
|
|
|
ObjectUtil.isEmpty(temp.getIng_task_code())) { |
|
|
|
if (schBasePoint != null) { |
|
|
|
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code()); |
|
|
@ -139,6 +143,26 @@ public class KGHJRKTask extends AbstractTask { |
|
|
|
} |
|
|
|
schBasePoint = temp; |
|
|
|
} |
|
|
|
if(ObjectUtil.isEmpty(schBasePoint)){ |
|
|
|
schBasePointList = pointMapper.findPointByRegion(regionCode2, "1"); |
|
|
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) { |
|
|
|
SchBasePoint temp = schBasePointList.get(i); |
|
|
|
//三拖一起放,如果不是01结尾直接跳过
|
|
|
|
if(!temp.getPoint_code().endsWith("01")){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
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 + "所有点位均已放满,暂时跳过"); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
schBasePoint = temp; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) { |
|
|
|
SchBasePoint temp = schBasePointList.get(i); |
|
|
@ -181,11 +205,18 @@ public class KGHJRKTask extends AbstractTask { |
|
|
|
if (status.equals(TaskStatus.FINISHED)) { // 完成
|
|
|
|
// 终点解锁,库存增加
|
|
|
|
endPointObj.setIng_task_code(""); |
|
|
|
//正极板对接位通过plc信号同步,任务完成不增加
|
|
|
|
// if(!"ZJBKGHJDJW".equals(startPointObj.getRegion_code())) {
|
|
|
|
endPointObj.setVehicle_qty(startPointObj.getVehicle_qty() + 1); |
|
|
|
// }
|
|
|
|
endPointObj.setVehicle_qty(1); |
|
|
|
pointService.update(endPointObj); |
|
|
|
if("HCQ7".equals(endPointObj.getRegion_code())){ |
|
|
|
endPointObj = pointService.getById(endPoint.substring(0,endPoint.length()-1)+"2"); |
|
|
|
endPointObj.setIng_task_code(""); |
|
|
|
endPointObj.setVehicle_qty(1); |
|
|
|
pointService.update(endPointObj); |
|
|
|
endPointObj = pointService.getById(endPoint.substring(0,endPoint.length()-1)+"3"); |
|
|
|
endPointObj.setIng_task_code(""); |
|
|
|
endPointObj.setVehicle_qty(1); |
|
|
|
pointService.update(endPointObj); |
|
|
|
} |
|
|
|
|
|
|
|
// 任务完成
|
|
|
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); |
|
|
|