|
|
@ -68,9 +68,7 @@ public class CNTTask extends AbstractTask { |
|
|
|
SchBasePoint schBasePoint = null; |
|
|
|
if (TaskType.CARRY_TASK.getValue().equals(task.getTask_type())) { |
|
|
|
schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(), "1"); |
|
|
|
}/* else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) { |
|
|
|
schBasePoint = schBasePointService.selectByReassign(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code()); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
if (ObjectUtil.isEmpty(schBasePoint)) { |
|
|
|
task.setRemark("未找到所需点位!"); |
|
|
|
taskService.updateById(task); |
|
|
@ -89,11 +87,6 @@ public class CNTTask extends AbstractTask { |
|
|
|
task.setAcs_trace_id("4"); |
|
|
|
} |
|
|
|
taskService.updateById(task); |
|
|
|
|
|
|
|
schBasePoint.setIng_task_code(task.getTask_code()); |
|
|
|
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); |
|
|
|
PointUtils.setUpdateByAcs(schBasePoint); |
|
|
|
pointService.updateById(schBasePoint); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -123,6 +116,18 @@ public class CNTTask extends AbstractTask { |
|
|
|
public void cancel(String task_code) { |
|
|
|
//TODO:取消任务的时候将int_task_code的清除
|
|
|
|
SchBaseTask taskObj = taskService.getByCode(task_code); |
|
|
|
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1()); |
|
|
|
if (ObjectUtil.isNotEmpty(schBasePoint)) { |
|
|
|
schBasePoint.setIs_lock(false); |
|
|
|
PointUtils.setUpdateByAcs(schBasePoint); |
|
|
|
schBasePointService.updateById(schBasePoint); |
|
|
|
} |
|
|
|
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2()); |
|
|
|
if (ObjectUtil.isNotEmpty(schBasePoint1)) { |
|
|
|
schBasePoint1.setIs_lock(false); |
|
|
|
PointUtils.setUpdateByAcs(schBasePoint1); |
|
|
|
schBasePointService.updateById(schBasePoint1); |
|
|
|
} |
|
|
|
if (ObjectUtil.isEmpty(taskObj)) { |
|
|
|
throw new BadRequestException("该任务不存在"); |
|
|
|
} |
|
|
@ -140,16 +145,18 @@ public class CNTTask extends AbstractTask { |
|
|
|
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); |
|
|
|
// 起点清空
|
|
|
|
if (ObjectUtil.isNotEmpty(schBasePoint)) { |
|
|
|
PointUtils.updateByIngTaskCode(schBasePoint); |
|
|
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) |
|
|
|
.set(SchBasePoint::getIs_lock, false)); |
|
|
|
schBasePoint.setIs_lock(false); |
|
|
|
PointUtils.setUpdateByAcs(schBasePoint); |
|
|
|
schBasePointService.updateById(schBasePoint); |
|
|
|
} |
|
|
|
String point_code2 = taskObj.getPoint_code2(); |
|
|
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); |
|
|
|
String endPoint = taskObj.getPoint_code2(); |
|
|
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint); |
|
|
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) { |
|
|
|
PointUtils.updateByIngTaskCode(schBasePoint2); |
|
|
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) |
|
|
|
.set(SchBasePoint::getIs_lock, false)); |
|
|
|
schBasePoint2.setIs_lock(false); |
|
|
|
schBasePoint2.setPoint_status(GoodsEnum.IN_STOCK.getValue()); |
|
|
|
schBasePoint2.setVehicle_code(taskObj.getVehicle_code()); |
|
|
|
PointUtils.setUpdateByAcs(schBasePoint2); |
|
|
|
schBasePointService.updateById(schBasePoint2); |
|
|
|
} |
|
|
|
// 任务完成
|
|
|
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); |
|
|
@ -160,22 +167,6 @@ public class CNTTask extends AbstractTask { |
|
|
|
} |
|
|
|
|
|
|
|
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { |
|
|
|
// 获取参数
|
|
|
|
String startPoint = taskObj.getPoint_code1(); |
|
|
|
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint); |
|
|
|
// 起点清空
|
|
|
|
if (ObjectUtil.isNotEmpty(schBasePoint)) { |
|
|
|
PointUtils.updateByIngTaskCode(schBasePoint); |
|
|
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint) |
|
|
|
.set(SchBasePoint::getIs_lock, false)); |
|
|
|
} |
|
|
|
String point_code2 = taskObj.getPoint_code2(); |
|
|
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2); |
|
|
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) { |
|
|
|
PointUtils.updateByIngTaskCode(schBasePoint2); |
|
|
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2) |
|
|
|
.set(SchBasePoint::getIs_lock, false)); |
|
|
|
} |
|
|
|
taskObj.setTask_status(TaskStatus.CANCELED.getCode()); |
|
|
|
taskObj.setRemark(GeneralDefinition.TASK_CANCEL); |
|
|
|
taskObj.setTask_status(TaskStatus.CANCELED.getCode()); |
|
|
|