|
@ -58,14 +58,16 @@ public class CTQKTask extends AbstractTask { |
|
|
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); |
|
|
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); |
|
|
for (SchBaseTask task : tasks) { |
|
|
for (SchBaseTask task : tasks) { |
|
|
TaskUtils.setUpdateByAcs(task); // 修改修改者
|
|
|
TaskUtils.setUpdateByAcs(task); // 修改修改者
|
|
|
List<String> startRegionStr = Arrays.stream(taskConfig.getStart_region_str().split(",")).collect(Collectors.toList()); |
|
|
List<String> startRegionStr = Arrays.stream(taskConfig.getStart_region_str().split(",")) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
// 找起点
|
|
|
// 找起点
|
|
|
SchBasePoint point = findStartPoint(startRegionStr); |
|
|
SchBasePoint point = findStartPoint(startRegionStr); |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
task.setRemark("暂无托盘!"); |
|
|
task.setRemark("暂无托盘!"); |
|
|
taskService.updateById(task); |
|
|
taskService.updateById(task); |
|
|
// 消息通知
|
|
|
// 消息通知
|
|
|
noticeService.createNotice(task.getRemark(), TASK_CONFIG_CODE + task.getTask_code(), NoticeTypeEnum.WARN.getCode()); |
|
|
noticeService.createNotice(task.getRemark(), TASK_CONFIG_CODE + task.getPoint_code2(), |
|
|
|
|
|
NoticeTypeEnum.WARN.getCode()); |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
// 设置终点并修改创建成功状态
|
|
|
// 设置终点并修改创建成功状态
|
|
@ -74,14 +76,11 @@ public class CTQKTask extends AbstractTask { |
|
|
task.setVehicle_qty(point.getVehicle_qty()); |
|
|
task.setVehicle_qty(point.getVehicle_qty()); |
|
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
|
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
|
|
taskService.updateById(task); |
|
|
taskService.updateById(task); |
|
|
|
|
|
// 点位信息更新
|
|
|
point.setIng_task_code(task.getTask_code()); |
|
|
point.setIng_task_code(task.getTask_code()); |
|
|
pointService.update(point); |
|
|
pointService.update(point); |
|
|
PointUtils.setUpdateByAcs(point); |
|
|
PointUtils.setUpdateByAcs(point); |
|
|
pointService.updateById(point); |
|
|
pointService.updateById(point); |
|
|
|
|
|
|
|
|
//下发
|
|
|
|
|
|
//this.renotifyAcs(task);
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -91,8 +90,9 @@ public class CTQKTask extends AbstractTask { |
|
|
// 配置信息
|
|
|
// 配置信息
|
|
|
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>() |
|
|
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>() |
|
|
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); |
|
|
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); |
|
|
TaskUtils.setUpdateByAcs(task); // 修改修改者
|
|
|
TaskUtils.setUpdateByAcs(task); |
|
|
List<String> startRegionStr = Arrays.stream(taskConfig.getStart_region_str().split(",")).collect(Collectors.toList()); |
|
|
List<String> startRegionStr = Arrays.stream(taskConfig.getStart_region_str().split(",")) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
// 找起点
|
|
|
// 找起点
|
|
|
SchBasePoint point = findStartPoint(startRegionStr); |
|
|
SchBasePoint point = findStartPoint(startRegionStr); |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
if (ObjectUtil.isEmpty(point)) { |
|
@ -107,7 +107,7 @@ public class CTQKTask extends AbstractTask { |
|
|
task.setVehicle_qty(point.getVehicle_qty()); |
|
|
task.setVehicle_qty(point.getVehicle_qty()); |
|
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
|
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
|
|
taskService.save(task); |
|
|
taskService.save(task); |
|
|
|
|
|
// 点位更新
|
|
|
point.setIng_task_code(task.getTask_code()); |
|
|
point.setIng_task_code(task.getTask_code()); |
|
|
pointService.update(point); |
|
|
pointService.update(point); |
|
|
PointUtils.setUpdateByAcs(point); |
|
|
PointUtils.setUpdateByAcs(point); |
|
@ -135,7 +135,6 @@ public class CTQKTask extends AbstractTask { |
|
|
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) { |
|
|
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) { |
|
|
throw new BadRequestException("该任务已取消!"); |
|
|
throw new BadRequestException("该任务已取消!"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 根据传来的类型去对任务进行操作
|
|
|
// 根据传来的类型去对任务进行操作
|
|
|
if (status.equals(TaskStatus.EXECUTING)) { // 执行中
|
|
|
if (status.equals(TaskStatus.EXECUTING)) { // 执行中
|
|
|
taskObj.setTask_status(TaskStatus.EXECUTING.getCode()); |
|
|
taskObj.setTask_status(TaskStatus.EXECUTING.getCode()); |
|
@ -168,12 +167,11 @@ public class CTQKTask extends AbstractTask { |
|
|
} |
|
|
} |
|
|
this.cancelTask(taskObj, TaskFinishedTypeEnum.MANUAL_PC); |
|
|
this.cancelTask(taskObj, TaskFinishedTypeEnum.MANUAL_PC); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { |
|
|
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { |
|
|
// 获取参数
|
|
|
// 获取参数
|
|
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
|
|
SchBasePoint startPointObj = pointService.getById(taskObj.getPoint_code1()); |
|
|
String endPoint = taskObj.getPoint_code2(); // 获取起点
|
|
|
SchBasePoint endPointObj = pointService.getById(taskObj.getPoint_code2()); |
|
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
|
|
|
|
|
SchBasePoint endPointObj = pointService.getById(endPoint); |
|
|
|
|
|
// 起点清空
|
|
|
// 起点清空
|
|
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
|
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
|
|
PointUtils.setUpdateByType(startPointObj, taskFinishedType); |
|
|
PointUtils.setUpdateByType(startPointObj, taskFinishedType); |
|
@ -193,10 +191,10 @@ public class CTQKTask extends AbstractTask { |
|
|
TaskUtils.setUpdateByType(taskObj, taskFinishedType); |
|
|
TaskUtils.setUpdateByType(taskObj, taskFinishedType); |
|
|
taskService.updateById(taskObj); |
|
|
taskService.updateById(taskObj); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { |
|
|
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { |
|
|
// 获取参数
|
|
|
// 获取参数
|
|
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
|
|
SchBasePoint startPointObj = pointService.getById(taskObj.getPoint_code1()); |
|
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
|
|
|
|
|
// 起点解锁
|
|
|
// 起点解锁
|
|
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
|
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
|
|
startPointObj.setIng_task_code(""); |
|
|
startPointObj.setIng_task_code(""); |
|
|