李永德
1 year ago
20 changed files with 491 additions and 442 deletions
@ -1,166 +1,166 @@ |
|||||
//package org.nl.wms.sch.task_manage.task.tasks.hn;
|
package org.nl.wms.sch.task_manage.task.tasks.hn; |
||||
//
|
|
||||
//import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil; |
||||
//import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil; |
||||
//import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject; |
||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
//import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException; |
||||
//import org.nl.wms.pdm.service.IPdmBdWorkorderService;
|
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; |
||||
//import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
||||
//import org.nl.wms.sch.point.service.ISchBasePointService;
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
||||
//import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
||||
//import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; |
||||
//import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
import org.nl.wms.sch.task.service.dao.SchBaseTask; |
||||
//import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; |
||||
//import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
import org.nl.wms.sch.task_manage.AbstractTask; |
||||
//import org.nl.wms.sch.task_manage.AbstractTask;
|
import org.nl.wms.sch.task_manage.GeneralDefinition; |
||||
//import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
|
import org.nl.wms.sch.task_manage.enums.PointStatusEnum; |
||||
//import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
|
import org.nl.wms.sch.task_manage.task.TaskType; |
||||
//import org.nl.wms.sch.task_manage.task.TaskType;
|
import org.nl.wms.sch.task_manage.task.core.TaskStatus; |
||||
//import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
import org.nl.wms.util.PointUtils; |
||||
//import org.nl.wms.util.PointUtils;
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component; |
||||
//import org.springframework.stereotype.Component;
|
import org.springframework.transaction.annotation.Transactional; |
||||
//import org.springframework.transaction.annotation.Transactional;
|
|
||||
//
|
import java.util.Arrays; |
||||
//import java.util.Arrays;
|
import java.util.List; |
||||
//import java.util.List;
|
import java.util.stream.Collectors; |
||||
//import java.util.stream.Collectors;
|
|
||||
//
|
/** |
||||
///**
|
* @Author: lyd |
||||
// * @Author: lyd
|
* @Description: 混料缺空:呼叫空载具 |
||||
// * @Description: 混料缺空:呼叫空载具
|
* @Date: 2023/5/19 |
||||
// * @Date: 2023/5/19
|
*/ |
||||
// */
|
@Deprecated |
||||
//@Component
|
@Component |
||||
//@TaskType("HLQKTask")
|
@TaskType("--") |
||||
//public class HNQKTask extends AbstractTask {
|
public class HNQKTask extends AbstractTask { |
||||
// private static String TASK_CONFIG_CODE = "HLQKTask";
|
private static String TASK_CONFIG_CODE = "--"; |
||||
// private static String EMPTY_ZHONG = "1";
|
private static String EMPTY_ZHONG = "1"; |
||||
//
|
|
||||
// @Autowired
|
@Autowired |
||||
// private ISchBasePointService pointService;
|
private ISchBasePointService pointService; |
||||
// @Autowired
|
@Autowired |
||||
// private ISchBaseTaskService taskService;
|
private ISchBaseTaskService taskService; |
||||
// @Autowired
|
@Autowired |
||||
// private ISchBaseTaskconfigService taskConfigService;
|
private ISchBaseTaskconfigService taskConfigService; |
||||
// @Autowired
|
@Autowired |
||||
// private IPdmBdWorkorderService workorderService;
|
private IPdmBdWorkorderService workorderService; |
||||
//
|
|
||||
// /**
|
/** |
||||
// * 具体业务
|
* 具体业务 |
||||
// */
|
*/ |
||||
// @Override
|
@Override |
||||
// @Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class) |
||||
// protected void create() {
|
protected void create() { |
||||
// // 获取任务
|
// 获取任务
|
||||
// List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
|
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); |
||||
// // 配置信息
|
// 配置信息
|
||||
// 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)); |
||||
// for (SchBaseTask task : tasks) {
|
for (SchBaseTask task : tasks) { |
||||
// 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()); |
||||
// // 找起点
|
// 找起点
|
||||
// String extGroupData = task.getExt_group_data();
|
String extGroupData = task.getExt_group_data(); |
||||
// JSONObject jsonObject = JSONObject.parseObject(extGroupData);
|
JSONObject jsonObject = JSONObject.parseObject(extGroupData); |
||||
// SchBasePoint point = findStartPoint(startRegionStr, jsonObject);
|
SchBasePoint point = findStartPoint(startRegionStr, jsonObject); |
||||
// if (ObjectUtil.isEmpty(point)) {
|
if (ObjectUtil.isEmpty(point)) { |
||||
// task.setRemark("未找到所需点位!");
|
task.setRemark("未找到所需点位!"); |
||||
// taskService.update(task);
|
taskService.update(task); |
||||
// // 消息通知
|
// 消息通知
|
||||
// continue;
|
continue; |
||||
// }
|
} |
||||
// // 设置终点并修改创建成功状态
|
// 设置终点并修改创建成功状态
|
||||
// task.setPoint_code1(point.getPoint_code());
|
task.setPoint_code1(point.getPoint_code()); |
||||
// task.setRemark("");
|
task.setRemark(""); |
||||
// task.setTask_status(TaskStatus.CREATED.getCode());
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
||||
// taskService.update(task);
|
taskService.update(task); |
||||
//
|
|
||||
// point.setIng_task_code(task.getTask_code());
|
point.setIng_task_code(task.getTask_code()); |
||||
// pointService.update(point);
|
pointService.update(point); |
||||
//
|
|
||||
// //下发
|
//下发
|
||||
//// this.renotifyAcs(task);
|
// this.renotifyAcs(task);
|
||||
// }
|
} |
||||
// }
|
} |
||||
//
|
|
||||
// /**
|
/** |
||||
// * 找起点, 通过料盅睏料线区域的空盅位置找到空盅
|
* 找起点, 通过料盅睏料线区域的空盅位置找到空盅 |
||||
// *
|
* |
||||
// * @param startRegionStr
|
* @param startRegionStr |
||||
// * @param extGroupData
|
* @param extGroupData |
||||
// * @return
|
* @return |
||||
// */
|
*/ |
||||
// private SchBasePoint findStartPoint(List<String> startRegionStr, JSONObject extGroupData) {
|
private SchBasePoint findStartPoint(List<String> startRegionStr, JSONObject extGroupData) { |
||||
// LambdaQueryWrapper<SchBasePoint> lam = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SchBasePoint> lam = new LambdaQueryWrapper<>(); |
||||
// lam.in(SchBasePoint::getRegion_code, startRegionStr)
|
lam.in(SchBasePoint::getRegion_code, startRegionStr) |
||||
// .eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_VEHICLE.getCode())
|
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_VEHICLE.getCode()) |
||||
// .eq(SchBasePoint::getPoint_type, EMPTY_ZHONG)
|
.eq(SchBasePoint::getPoint_type, EMPTY_ZHONG) |
||||
// .and(la -> la.isNull(SchBasePoint::getIng_task_code) // 当前执行的任务为空或者NULL,有数据表示锁住
|
.and(la -> la.isNull(SchBasePoint::getIng_task_code) // 当前执行的任务为空或者NULL,有数据表示锁住
|
||||
// .or()
|
.or() |
||||
// .eq(SchBasePoint::getIng_task_code, ""))
|
.eq(SchBasePoint::getIng_task_code, "")) |
||||
// .orderByAsc(SchBasePoint::getIn_order_seq)
|
.orderByAsc(SchBasePoint::getIn_order_seq) |
||||
// .orderByAsc(SchBasePoint::getPoint_code);
|
.orderByAsc(SchBasePoint::getPoint_code); |
||||
// List<SchBasePoint> schBasePoints = pointService.list(lam);
|
List<SchBasePoint> schBasePoints = pointService.list(lam); |
||||
// return ObjectUtil.isNotEmpty(schBasePoints) ? schBasePoints.get(0) : null;
|
return ObjectUtil.isNotEmpty(schBasePoints) ? schBasePoints.get(0) : null; |
||||
// }
|
} |
||||
//
|
|
||||
// @Override
|
@Override |
||||
// @Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class) |
||||
// protected void updateStatus(String task_code, TaskStatus status) {
|
protected void updateStatus(String task_code, TaskStatus status) { |
||||
// // 校验任务
|
// 校验任务
|
||||
// SchBaseTask taskObj = taskService.getByCode(task_code);
|
SchBaseTask taskObj = taskService.getByCode(task_code); |
||||
// if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) { |
||||
// throw new BadRequestException("该任务已完成!");
|
throw new BadRequestException("该任务已完成!"); |
||||
// }
|
} |
||||
// if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) { |
||||
// throw new BadRequestException("该任务已取消!");
|
throw new BadRequestException("该任务已取消!"); |
||||
// }
|
} |
||||
// // 获取参数
|
// 获取参数
|
||||
// String startPoint = taskObj.getPoint_code1(); // 获取起点
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
||||
// String endPoint = taskObj.getPoint_code2(); // 获取起点
|
String endPoint = taskObj.getPoint_code2(); // 获取起点
|
||||
// SchBasePoint startPointObj = pointService.getById(startPoint);
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
||||
// SchBasePoint endPointObj = pointService.getById(endPoint);
|
SchBasePoint endPointObj = pointService.getById(endPoint); |
||||
// // 根据传来的类型去对任务进行操作
|
// 根据传来的类型去对任务进行操作
|
||||
// if (status.equals(TaskStatus.EXECUTING)) { // 执行中
|
if (status.equals(TaskStatus.EXECUTING)) { // 执行中
|
||||
// taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
taskObj.setTask_status(TaskStatus.EXECUTING.getCode()); |
||||
// taskObj.setRemark("执行中");
|
taskObj.setRemark("执行中"); |
||||
// }
|
} |
||||
// if (status.equals(TaskStatus.FINISHED)) { // 完成
|
if (status.equals(TaskStatus.FINISHED)) { // 完成
|
||||
// // 起点清空
|
// 起点清空
|
||||
// if (ObjectUtil.isNotEmpty(startPointObj)) {
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
||||
// PointUtils.clearPoint(startPointObj);
|
PointUtils.clearPoint(startPointObj); |
||||
// taskObj.setVehicle_code(startPointObj.getVehicle_code());
|
taskObj.setVehicle_code(startPointObj.getVehicle_code()); |
||||
// endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode());
|
endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode()); |
||||
// endPointObj.setVehicle_type("1");
|
endPointObj.setVehicle_type("1"); |
||||
// endPointObj.setVehicle_code(startPointObj.getVehicle_code());
|
endPointObj.setVehicle_code(startPointObj.getVehicle_code()); |
||||
// endPointObj.setVehicle_qty(1);
|
endPointObj.setVehicle_qty(1); |
||||
// endPointObj.setUpdate_time(DateUtil.now());
|
endPointObj.setUpdate_time(DateUtil.now()); |
||||
// pointService.updateById(endPointObj);
|
pointService.updateById(endPointObj); |
||||
// }
|
} |
||||
// // 任务完成
|
// 任务完成
|
||||
// taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); |
||||
// taskObj.setRemark(GeneralDefinition.TASK_FINISH);
|
taskObj.setRemark(GeneralDefinition.TASK_FINISH); |
||||
// }
|
} |
||||
// if (status.equals(TaskStatus.CANCELED)) { // 取消
|
if (status.equals(TaskStatus.CANCELED)) { // 取消
|
||||
// // 起点解锁
|
// 起点解锁
|
||||
// if (ObjectUtil.isNotEmpty(startPointObj)) {
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
||||
// startPointObj.setIng_task_code("");
|
startPointObj.setIng_task_code(""); |
||||
// pointService.update(startPointObj);
|
pointService.update(startPointObj); |
||||
// }
|
} |
||||
// taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
taskObj.setTask_status(TaskStatus.CANCELED.getCode()); |
||||
// }
|
} |
||||
// taskService.update(taskObj);
|
taskService.update(taskObj); |
||||
// }
|
} |
||||
//
|
|
||||
// @Override
|
@Override |
||||
// public void forceFinish(String task_code) {
|
public void forceFinish(String task_code) { |
||||
// this.updateStatus(task_code, TaskStatus.FINISHED);
|
this.updateStatus(task_code, TaskStatus.FINISHED); |
||||
// }
|
} |
||||
//
|
|
||||
// @Override
|
@Override |
||||
// public void cancel(String task_code) {
|
public void cancel(String task_code) { |
||||
// this.updateStatus(task_code, TaskStatus.CANCELED);
|
this.updateStatus(task_code, TaskStatus.CANCELED); |
||||
// }
|
} |
||||
//}
|
} |
||||
//
|
|
||||
|
@ -1,171 +1,171 @@ |
|||||
//package org.nl.wms.sch.task_manage.task.tasks.yz;
|
package org.nl.wms.sch.task_manage.task.tasks.yz; |
||||
//
|
|
||||
//import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert; |
||||
//import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil; |
||||
//import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject; |
||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
//import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j; |
||||
//import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException; |
||||
//import org.nl.wms.pdm.service.IPdmBdWorkorderService;
|
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; |
||||
//import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
|
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; |
||||
//import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; |
||||
//import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
|
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; |
||||
//import org.nl.wms.sch.point.service.ISchBasePointService;
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
||||
//import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
||||
//import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
||||
//import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; |
||||
//import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
import org.nl.wms.sch.task.service.dao.SchBaseTask; |
||||
//import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; |
||||
//import org.nl.wms.sch.task_manage.AbstractTask;
|
import org.nl.wms.sch.task_manage.AbstractTask; |
||||
//import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum;
|
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
||||
//import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
|
import org.nl.wms.sch.task_manage.task.TaskType; |
||||
//import org.nl.wms.sch.task_manage.task.TaskType;
|
import org.nl.wms.sch.task_manage.task.core.TaskStatus; |
||||
//import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
import org.nl.wms.sch.task_manage.task.tasks.yz.mapper.YZMapper; |
||||
//import org.nl.wms.sch.task_manage.task.tasks.yz.mapper.YZMapper;
|
import org.nl.wms.util.PointUtils; |
||||
//import org.nl.wms.util.PointUtils;
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component; |
||||
//import org.springframework.stereotype.Component;
|
|
||||
//
|
import java.util.Arrays; |
||||
//import java.util.Arrays;
|
import java.util.List; |
||||
//import java.util.List;
|
import java.util.stream.Collectors; |
||||
//import java.util.stream.Collectors;
|
|
||||
//
|
/** |
||||
///**
|
* @Author: lyd |
||||
// * @Author: lyd
|
* @Description: 压制缺料任务 |
||||
// * @Description: 压制缺料任务
|
* @Date: 2023/5/25 |
||||
// * @Date: 2023/5/25
|
*/ |
||||
// */
|
@Slf4j |
||||
//@Slf4j
|
@Deprecated |
||||
//@Component
|
@Component |
||||
//@TaskType("YZQLTask")
|
@TaskType("-") |
||||
//public class YZQLTask extends AbstractTask {
|
public class YZQLTask extends AbstractTask { |
||||
// private static String TASK_CONFIG_CODE = "YZQLTask";
|
private static String TASK_CONFIG_CODE = "-"; |
||||
//
|
|
||||
// @Autowired
|
@Autowired |
||||
// private ISchBasePointService pointService;
|
private ISchBasePointService pointService; |
||||
// @Autowired
|
@Autowired |
||||
// private ISchBaseTaskService taskService;
|
private ISchBaseTaskService taskService; |
||||
// @Autowired
|
@Autowired |
||||
// private ISchBaseTaskconfigService taskConfigService;
|
private ISchBaseTaskconfigService taskConfigService; |
||||
// @Autowired
|
@Autowired |
||||
// private ISchBaseVehiclematerialgroupService vehiclematerialgroupService;
|
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; |
||||
// @Autowired
|
@Autowired |
||||
// private IPdmBdWorkorderService workorderService;
|
private IPdmBdWorkorderService workorderService; |
||||
// @Autowired
|
@Autowired |
||||
// private YZMapper yzMapper;
|
private YZMapper yzMapper; |
||||
//
|
|
||||
// @Override
|
@Override |
||||
// protected void create() throws BadRequestException {
|
protected void create() throws BadRequestException { |
||||
// // 获取任务
|
// 获取任务
|
||||
// List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
|
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY); |
||||
// // 配置信息
|
// 配置信息
|
||||
// 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)); |
||||
// for (SchBaseTask task : tasks) {
|
for (SchBaseTask task : tasks) { |
||||
// 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()); |
||||
// // 找起点
|
// 找起点
|
||||
// String extGroupData = task.getExt_group_data();
|
String extGroupData = task.getExt_group_data(); |
||||
// JSONObject jsonObject = JSONObject.parseObject(extGroupData);
|
JSONObject jsonObject = JSONObject.parseObject(extGroupData); |
||||
// jsonObject.put("vehicle_type", task.getVehicle_type());
|
jsonObject.put("vehicle_type", task.getVehicle_type()); |
||||
// SchBasePoint point = findStartPoint(startRegionStr, jsonObject);
|
SchBasePoint point = findStartPoint(startRegionStr, jsonObject); |
||||
// if (ObjectUtil.isEmpty(point)) {
|
if (ObjectUtil.isEmpty(point)) { |
||||
// task.setRemark("未找到所需点位!");
|
task.setRemark("未找到所需点位!"); |
||||
// taskService.update(task);
|
taskService.update(task); |
||||
// // 消息通知
|
// 消息通知
|
||||
// continue;
|
continue; |
||||
// }
|
} |
||||
// // 设置起点并修改创建成功状态
|
// 设置起点并修改创建成功状态
|
||||
// task.setPoint_code1(point.getPoint_code());
|
task.setPoint_code1(point.getPoint_code()); |
||||
// task.setTask_status(TaskStatus.CREATED.getCode());
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
||||
// task.setVehicle_code(point.getVehicle_code());
|
task.setVehicle_code(point.getVehicle_code()); |
||||
// taskService.update(task);
|
taskService.update(task); |
||||
//
|
|
||||
// point.setIng_task_code(task.getTask_code());
|
point.setIng_task_code(task.getTask_code()); |
||||
// pointService.update(point);
|
pointService.update(point); |
||||
//
|
|
||||
// //下发
|
//下发
|
||||
//// this.renotifyAcs(task);
|
// this.renotifyAcs(task);
|
||||
// }
|
} |
||||
// }
|
} |
||||
//
|
|
||||
// /**
|
/** |
||||
// * 找起点业务:混碾机工单的物料标识相同的位置
|
* 找起点业务:混碾机工单的物料标识相同的位置 |
||||
// *
|
* |
||||
// * @param startRegionStr : 区域列表
|
* @param startRegionStr : 区域列表 |
||||
// * @param extGroupData : 外部参数,包含条件所需的信息
|
* @param extGroupData : 外部参数,包含条件所需的信息 |
||||
// * @return
|
* @return |
||||
// * @description : JSONObject获取不到就是null
|
* @description : JSONObject获取不到就是null |
||||
// */
|
*/ |
||||
// private SchBasePoint findStartPoint(List<String> startRegionStr, JSONObject extGroupData) {
|
private SchBasePoint findStartPoint(List<String> startRegionStr, JSONObject extGroupData) { |
||||
// // 获取当前工单
|
// 获取当前工单
|
||||
// String workorderCode = extGroupData.getString("workorder_code");
|
String workorderCode = extGroupData.getString("workorder_code"); |
||||
// PdmBdWorkorder workOrder = ObjectUtil.isNotEmpty(workorderCode)
|
PdmBdWorkorder workOrder = ObjectUtil.isNotEmpty(workorderCode) |
||||
// ? workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>()
|
? workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>() |
||||
// .eq(PdmBdWorkorder::getWorkorder_code, workorderCode))
|
.eq(PdmBdWorkorder::getWorkorder_code, workorderCode)) |
||||
// : null;
|
: null; |
||||
// Assert.notNull(workOrder, "工单不能为空!");
|
Assert.notNull(workOrder, "工单不能为空!"); |
||||
// // 查找混碾机工单的物料相同的位置
|
// 查找混碾机工单的物料相同的位置
|
||||
// List<SchBasePoint> points = yzMapper.findPointForYZQL(startRegionStr, workOrder.getMaterial_id());
|
List<SchBasePoint> points = yzMapper.findPointForYZQL(startRegionStr, workOrder.getMaterial_id()); |
||||
// return ObjectUtil.isNotEmpty(points) ? points.get(0) : null;
|
return ObjectUtil.isNotEmpty(points) ? points.get(0) : null; |
||||
// }
|
} |
||||
//
|
|
||||
//
|
|
||||
// @Override
|
@Override |
||||
// protected void updateStatus(String task_code, TaskStatus status) {
|
protected void updateStatus(String task_code, TaskStatus status) { |
||||
// // 校验任务
|
// 校验任务
|
||||
// SchBaseTask taskObj = taskService.getByCode(task_code);
|
SchBaseTask taskObj = taskService.getByCode(task_code); |
||||
// if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) { |
||||
// throw new BadRequestException("该任务已完成!");
|
throw new BadRequestException("该任务已完成!"); |
||||
// }
|
} |
||||
// if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) { |
||||
// throw new BadRequestException("该任务已取消!");
|
throw new BadRequestException("该任务已取消!"); |
||||
// }
|
} |
||||
// // 获取参数
|
// 获取参数
|
||||
// String startPoint = taskObj.getPoint_code1(); // 起点
|
String startPoint = taskObj.getPoint_code1(); // 起点
|
||||
// JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data())
|
JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data()) |
||||
// ? JSONObject.parseObject(taskObj.getExt_group_data())
|
? JSONObject.parseObject(taskObj.getExt_group_data()) |
||||
// : null;
|
: null; |
||||
// SchBasePoint startPointObj = pointService.getById(startPoint);
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
||||
// // 根据传来的类型去对任务进行操作
|
// 根据传来的类型去对任务进行操作
|
||||
// if (status.equals(TaskStatus.EXECUTING)) { // 执行中
|
if (status.equals(TaskStatus.EXECUTING)) { // 执行中
|
||||
// taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
taskObj.setTask_status(TaskStatus.EXECUTING.getCode()); |
||||
// taskObj.setRemark("执行中");
|
taskObj.setRemark("执行中"); |
||||
// }
|
} |
||||
// if (status.equals(TaskStatus.FINISHED)) { // 完成
|
if (status.equals(TaskStatus.FINISHED)) { // 完成
|
||||
// // 任务上有载具编码 -> 获取当前载具编码的组盘信息
|
// 任务上有载具编码 -> 获取当前载具编码的组盘信息
|
||||
// SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper<SchBaseVehiclematerialgroup>()
|
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper<SchBaseVehiclematerialgroup>() |
||||
// .eq(SchBaseVehiclematerialgroup::getVehicle_code, taskObj.getVehicle_code())
|
.eq(SchBaseVehiclematerialgroup::getVehicle_code, taskObj.getVehicle_code()) |
||||
// .eq(SchBaseVehiclematerialgroup::getVehicle_type, taskObj.getVehicle_type())
|
.eq(SchBaseVehiclematerialgroup::getVehicle_type, taskObj.getVehicle_type()) |
||||
// .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue()));
|
.eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue())); |
||||
// // 将载具设置为已解绑
|
// 将载具设置为已解绑
|
||||
// one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
|
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); |
||||
// vehiclematerialgroupService.update(one);
|
vehiclematerialgroupService.update(one); |
||||
// // 释放点位,将点位设置为空位,清空数据
|
// 释放点位,将点位设置为空位,清空数据
|
||||
// if (ObjectUtil.isNotEmpty(startPointObj)) {
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
||||
// PointUtils.clearPoint(startPointObj);
|
PointUtils.clearPoint(startPointObj); |
||||
// // todo: 终点暂时无设置
|
// todo: 终点暂时无设置
|
||||
// }
|
} |
||||
// // 任务修改成完成
|
// 任务修改成完成
|
||||
// taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode()); |
||||
// }
|
} |
||||
// if (status.equals(TaskStatus.CANCELED)) { // 取消
|
if (status.equals(TaskStatus.CANCELED)) { // 取消
|
||||
// taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
taskObj.setTask_status(TaskStatus.CANCELED.getCode()); |
||||
// // 释放点位,起点正在执行的任务清空
|
// 释放点位,起点正在执行的任务清空
|
||||
// if (ObjectUtil.isNotEmpty(startPointObj)) {
|
if (ObjectUtil.isNotEmpty(startPointObj)) { |
||||
// startPointObj.setIng_task_code("");
|
startPointObj.setIng_task_code(""); |
||||
// pointService.update(startPointObj);
|
pointService.update(startPointObj); |
||||
// }
|
} |
||||
// }
|
} |
||||
// taskService.update(taskObj);
|
taskService.update(taskObj); |
||||
// }
|
} |
||||
//
|
|
||||
// @Override
|
@Override |
||||
// public void forceFinish(String task_code) {
|
public void forceFinish(String task_code) { |
||||
// this.updateStatus(task_code, TaskStatus.FINISHED);
|
this.updateStatus(task_code, TaskStatus.FINISHED); |
||||
// }
|
} |
||||
//
|
|
||||
// @Override
|
@Override |
||||
// public void cancel(String task_code) {
|
public void cancel(String task_code) { |
||||
// this.updateStatus(task_code, TaskStatus.CANCELED);
|
this.updateStatus(task_code, TaskStatus.CANCELED); |
||||
// }
|
} |
||||
//}
|
} |
||||
|
Loading…
Reference in new issue