|
@ -83,7 +83,7 @@ public class TBXBKJTask extends AbstractTask { |
|
|
// 找起点
|
|
|
// 找起点
|
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
.eq(SchBasePoint::getPoint_code, task.getPoint_code2())); |
|
|
.eq(SchBasePoint::getPoint_code, task.getPoint_code2())); |
|
|
SchBasePoint point = findNextPoint(startPoint); |
|
|
SchBasePoint point = findNextPoint(startPoint,task); |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
task.setRemark("未找到所需点位!"); |
|
|
task.setRemark("未找到所需点位!"); |
|
|
taskService.update(task); |
|
|
taskService.update(task); |
|
@ -106,7 +106,7 @@ public class TBXBKJTask extends AbstractTask { |
|
|
/** |
|
|
/** |
|
|
* 从01到10顺序判断最先有货的工位 |
|
|
* 从01到10顺序判断最先有货的工位 |
|
|
*/ |
|
|
*/ |
|
|
private SchBasePoint findNextPoint(SchBasePoint startPoint) { |
|
|
private SchBasePoint findNextPoint(SchBasePoint startPoint,SchBaseTask task) { |
|
|
String regionCode = null; |
|
|
String regionCode = null; |
|
|
if ("TBX1".equals(startPoint.getRegion_code())) { |
|
|
if ("TBX1".equals(startPoint.getRegion_code())) { |
|
|
//TBX1找A区
|
|
|
//TBX1找A区
|
|
@ -119,7 +119,12 @@ public class TBXBKJTask extends AbstractTask { |
|
|
SchBasePoint temp = null; |
|
|
SchBasePoint temp = null; |
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1"); |
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1"); |
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
if (schBasePoint.getVehicle_qty() > 0 && ObjectUtil.isEmpty(schBasePoint.getIng_task_code())) { |
|
|
//如果当前任务已锁定则直接返回
|
|
|
|
|
|
if(task.getTask_code().equals(schBasePoint.getIng_task_code())){ |
|
|
|
|
|
return schBasePoint; |
|
|
|
|
|
} |
|
|
|
|
|
if (schBasePoint.getVehicle_qty() > 0 && |
|
|
|
|
|
(ObjectUtil.isEmpty(schBasePoint.getIng_task_code()))) { |
|
|
if (temp == null || |
|
|
if (temp == null || |
|
|
schBasePoint.getPoint_code().startsWith(temp.getPoint_code().substring(0, temp.getPoint_code().length() - 2)) |
|
|
schBasePoint.getPoint_code().startsWith(temp.getPoint_code().substring(0, temp.getPoint_code().length() - 2)) |
|
|
&&schBasePoint.getPoint_code().compareTo(temp.getPoint_code())>0){ |
|
|
&&schBasePoint.getPoint_code().compareTo(temp.getPoint_code())>0){ |
|
@ -194,12 +199,12 @@ public class TBXBKJTask extends AbstractTask { |
|
|
//todo 重算最优点
|
|
|
//todo 重算最优点
|
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
SchBasePoint startPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code2())); |
|
|
.eq(SchBasePoint::getPoint_code, schBaseTask.getPoint_code2())); |
|
|
SchBasePoint point = this.findNextPoint(startPoint); |
|
|
SchBasePoint point = this.findNextPoint(startPoint,schBaseTask); |
|
|
schBaseTask.setPoint_code1(point.getPoint_code()); |
|
|
schBaseTask.setPoint_code1(point.getPoint_code()); |
|
|
// //重算点位时把点位占用,防止发起重复任务
|
|
|
//重算点位时把点位占用,防止发起重复任务
|
|
|
// point.setIng_task_code(schBaseTask.getTask_code());
|
|
|
point.setIng_task_code(schBaseTask.getTask_code()); |
|
|
// //空固化架区别于组盘,任务完成后再扣除库存
|
|
|
// //空固化架区别于组盘,任务完成后再扣除库存
|
|
|
//// point.setVehicle_qty(point.getVehicle_qty() - 1);
|
|
|
//// point.setVehicle_qty(point.getVehicle_qty() - 1);
|
|
|
// pointService.update(point);
|
|
|
pointService.update(point); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |