fix: task
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.nl.acs.task;
|
||||
|
||||
/**
|
||||
* @author 20220102CG\noblelift
|
||||
*/
|
||||
public class TaskInstructionLock {
|
||||
public TaskInstructionLock() {
|
||||
}
|
||||
|
||||
@@ -4,24 +4,48 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 20220102CG\noblelift
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AgvSystemTypeEnum {
|
||||
/**
|
||||
* 一期1楼叉车NDC系统
|
||||
*/
|
||||
One_NDC_System_Type("1", "1", "一期1楼叉车NDC系统"),
|
||||
/**
|
||||
* 一期2楼NDC系统
|
||||
*/
|
||||
Two_NDC_System_Type("2", "2", "一期2楼NDC系统"),
|
||||
/**
|
||||
* 仙工AGV系统
|
||||
*/
|
||||
XG_System_Type("3", "3", "仙工AGV系统");
|
||||
|
||||
//索引
|
||||
/**
|
||||
* 索引
|
||||
*/
|
||||
private String index;
|
||||
//编码
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
//名字
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private String name;
|
||||
//描述
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
// 构造方法
|
||||
/**
|
||||
* 构造方法
|
||||
* @param index
|
||||
* @param code
|
||||
* @param name
|
||||
*/
|
||||
AgvSystemTypeEnum(String index, String code, String name) {
|
||||
this.index = index;
|
||||
this.code = code;
|
||||
|
||||
@@ -5,29 +5,49 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 立库任务类型
|
||||
* @author 20220102CG\noblelift
|
||||
*/
|
||||
public enum StorageTaskTypeEnum {
|
||||
// 入库任务
|
||||
IN("1", "1", "入库任务"),
|
||||
// 空盘入库任务
|
||||
EMPTY_IN("2", "2", "空盘入库任务"),
|
||||
// 出库任务
|
||||
OUT("3", "3", "出库任务"),
|
||||
// 空盘出库任务
|
||||
EMPTY_OUT("4", "4", "空盘出空任务"),
|
||||
// 转库任务
|
||||
MOVE("5", "5", "转库任务");
|
||||
|
||||
|
||||
//索引
|
||||
/**
|
||||
* 索引
|
||||
*/
|
||||
private String index;
|
||||
//编码
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
//名字
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private String name;
|
||||
//描述
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
// 构造方法
|
||||
/**
|
||||
* 构造方法
|
||||
* @param index
|
||||
* @param code
|
||||
* @param name
|
||||
*/
|
||||
StorageTaskTypeEnum(String index, String code, String name) {
|
||||
this.index = index;
|
||||
this.code = code;
|
||||
|
||||
@@ -5,26 +5,44 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 20220102CG\noblelift
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum TaskStatusEnum {
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
READY("0", "READY", "就绪"),
|
||||
BUSY("1", "BUSY", "执行中"),
|
||||
FINISHED("2", "FINISHED", "完成"),
|
||||
CANCEL("3", "CANCEL", "取消"),
|
||||
ERROR("99", "ERROR", "异常");
|
||||
|
||||
//索引
|
||||
/**
|
||||
* 索引
|
||||
*/
|
||||
private String index;
|
||||
//编码
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
//名字
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private String name;
|
||||
//描述
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
// 构造方法
|
||||
/**
|
||||
* 构造方法
|
||||
* @param index
|
||||
* @param code
|
||||
* @param name
|
||||
*/
|
||||
TaskStatusEnum(String index, String code, String name) {
|
||||
this.index = index;
|
||||
this.code = code;
|
||||
|
||||
@@ -4,10 +4,15 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 20220102CG\noblelift
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum TaskTypeEnum {
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
Raw_Foil_AGV_Task("1", "1", "生箔AGV任务"),
|
||||
Cutting_AGV_Task("2", "2", "分切AGV任务"),
|
||||
Standard_AGV_Task("3", "3", "普通AGV任务"),
|
||||
@@ -22,16 +27,29 @@ public enum TaskTypeEnum {
|
||||
|
||||
Stacker_Task("11", "11", "堆垛机任务");
|
||||
|
||||
//索引
|
||||
/**
|
||||
* 索引
|
||||
*/
|
||||
private String index;
|
||||
//编码
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
//名字
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private String name;
|
||||
//描述
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
// 构造方法
|
||||
/**
|
||||
* 构造方法
|
||||
* @param index
|
||||
* @param code
|
||||
* @param name
|
||||
*/
|
||||
TaskTypeEnum(String index, String code, String name) {
|
||||
this.index = index;
|
||||
this.code = code;
|
||||
|
||||
@@ -38,19 +38,48 @@ public interface TaskFeedbackService extends CommonService<TaskFeedback> {
|
||||
*/
|
||||
List<TaskFeedbackDto> queryAll(TaskFeedbackQueryParam query);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return TaskFeedback
|
||||
*/
|
||||
TaskFeedback getById(String id);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return TaskFeedbackDto
|
||||
*/
|
||||
TaskFeedbackDto findById(String id);
|
||||
|
||||
/**
|
||||
* 插入一条新数据。
|
||||
* 新增
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
int insert(TaskFeedbackDto resources);
|
||||
|
||||
/**
|
||||
* 根据id修改
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
int updateById(TaskFeedbackDto resources);
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int removeById(String id);
|
||||
|
||||
/**
|
||||
* id批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int removeByIds(Set<String> ids);
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,19 +40,48 @@ public interface TaskService extends CommonService<Task> {
|
||||
*/
|
||||
List<TaskDto> queryAll(TaskQueryParam query);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param id /
|
||||
* @return TaskDto
|
||||
*/
|
||||
Task getById(String id);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param id /
|
||||
* @return TaskDto
|
||||
*/
|
||||
TaskDto findById(String id);
|
||||
|
||||
/**
|
||||
* 插入一条新数据。
|
||||
* 新增数据
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
int insert(TaskDto resources);
|
||||
|
||||
/**
|
||||
* 根据id修改数据
|
||||
* @param resources
|
||||
* @return
|
||||
*/
|
||||
int updateById(TaskDto resources);
|
||||
|
||||
/**
|
||||
* 根据id删除数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int removeById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除数据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int removeByIds(Set<String> ids);
|
||||
|
||||
/**
|
||||
@@ -103,7 +132,12 @@ public interface TaskService extends CommonService<Task> {
|
||||
*/
|
||||
List<TaskDto> queryAll(String whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 根据状态查询
|
||||
*
|
||||
* @param task_status task_status
|
||||
* @return AcsTask
|
||||
*/
|
||||
List<TaskDto> queryAllByStatus(String task_status);
|
||||
|
||||
|
||||
@@ -149,21 +183,30 @@ public interface TaskService extends CommonService<Task> {
|
||||
|
||||
/**
|
||||
* 根据设备号查询未执行的任务
|
||||
* @param device_code
|
||||
* @return
|
||||
*/
|
||||
List<TaskDto> queryTaskByDeviceCode(String device_code);
|
||||
|
||||
/**
|
||||
* 根据设备号查询未执行的任务
|
||||
* @param start_device_code
|
||||
* @return List<TaskDto>
|
||||
*/
|
||||
List<TaskDto> queryTaskByStartDeviceCode(String start_device_code);
|
||||
|
||||
/**
|
||||
* 根据设备号查询未执行的任务
|
||||
* @param back_start_device_code
|
||||
* @return List<TaskDto></TaskDto>
|
||||
*/
|
||||
List<TaskDto> queryTaskByBackDeviceCode(String back_start_device_code);
|
||||
|
||||
/**
|
||||
* 根据设备号和任务状态查询
|
||||
*
|
||||
* @param device_code
|
||||
* @return
|
||||
* @return List<TaskDto></TaskDto>
|
||||
*/
|
||||
List<TaskDto> queryTaskByDeviceCodeAndStatus(String device_code);
|
||||
|
||||
@@ -171,7 +214,7 @@ public interface TaskService extends CommonService<Task> {
|
||||
* 根据前工位取货点查找执行中的任务
|
||||
*
|
||||
* @param head_start_device_code
|
||||
* @return
|
||||
* @return List<TaskDto></TaskDto>
|
||||
*/
|
||||
List<TaskDto> queryTaskByStartAndIntStatus(String head_start_device_code);
|
||||
|
||||
@@ -179,34 +222,36 @@ public interface TaskService extends CommonService<Task> {
|
||||
* 根据后工位取货点查找执行中的任务
|
||||
*
|
||||
* @param head_next_device_code
|
||||
* @return
|
||||
* @return List<TaskDto></TaskDto>
|
||||
*/
|
||||
List<TaskDto> queryTaskByNextAndIntStatus(String head_next_device_code);
|
||||
|
||||
|
||||
/**
|
||||
* 根据关联编号查询非立刻下发的关联任务
|
||||
* @param link_num
|
||||
* @return TaskDto
|
||||
*/
|
||||
TaskDto queryTaskByLinkNum(String link_num);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
* @param dto
|
||||
* @throws Exception
|
||||
*/
|
||||
void create(TaskDto dto) throws Exception;
|
||||
|
||||
/**
|
||||
* 常规任务保存
|
||||
*
|
||||
* @param /
|
||||
* @param json
|
||||
* @throws Exception
|
||||
*/
|
||||
void ordinaryTaskCreate(JSONObject json) throws Exception;
|
||||
|
||||
/**
|
||||
* 特殊任务保存
|
||||
*
|
||||
* @param /
|
||||
* @param json
|
||||
* @throws Exception
|
||||
*/
|
||||
void specialTaskCreate(JSONObject json) throws Exception;
|
||||
|
||||
@@ -219,8 +264,8 @@ public interface TaskService extends CommonService<Task> {
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
* @param ids
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ids) throws Exception;
|
||||
|
||||
@@ -233,29 +278,41 @@ public interface TaskService extends CommonService<Task> {
|
||||
|
||||
/**
|
||||
* 取消任务
|
||||
*
|
||||
* @param ids
|
||||
* @throws Exception
|
||||
*/
|
||||
void cancel(String ids) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 取消任务
|
||||
*
|
||||
* @param ids
|
||||
* @throws Exception
|
||||
*/
|
||||
void cancelNoSendWms(String ids) throws Exception;
|
||||
|
||||
/**
|
||||
* 手动创建指令
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Instruction createInst(String ids) throws Exception;
|
||||
|
||||
/**
|
||||
* 手动创建指令
|
||||
* @param inst
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Instruction createInst(Instruction inst) throws Exception;
|
||||
|
||||
|
||||
/**'
|
||||
* 创建指令
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Instruction createTemporaryInst(TaskDto dto);
|
||||
|
||||
/**
|
||||
@@ -276,12 +333,32 @@ public interface TaskService extends CommonService<Task> {
|
||||
void createTaskByClick(JSONObject json);
|
||||
|
||||
|
||||
/**
|
||||
* 检查是否允许创建任务
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
int checkAllowCreate(String code);
|
||||
|
||||
/**
|
||||
* 从缓存中删除任务
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
boolean removeByCodeFromCache(String code);
|
||||
|
||||
/**
|
||||
* 根据容器编号查询任务
|
||||
* @param container_code
|
||||
* @return
|
||||
*/
|
||||
TaskDto findByContainer(String container_code);
|
||||
|
||||
/**
|
||||
* 根据任务编号查询任务
|
||||
* @param task_code
|
||||
* @return
|
||||
*/
|
||||
TaskDto findByCodeFromCache(String task_code);
|
||||
|
||||
|
||||
@@ -293,8 +370,20 @@ public interface TaskService extends CommonService<Task> {
|
||||
*/
|
||||
TaskDto findByNextCode(String device_code);
|
||||
|
||||
/**
|
||||
* 根据目的地设备编号查询当前是否有设备
|
||||
*
|
||||
* @param device_code
|
||||
* @return
|
||||
*/
|
||||
List<TaskDto> findAllByNextCode(String device_code);
|
||||
|
||||
/**
|
||||
* 根据设备编号查询当前是否有设备
|
||||
*
|
||||
* @param device_code
|
||||
* @return
|
||||
*/
|
||||
Integer queryAllTaskMaterialQty(String device_code);
|
||||
|
||||
/**
|
||||
@@ -322,6 +411,12 @@ public interface TaskService extends CommonService<Task> {
|
||||
*/
|
||||
List<TaskDto> findAllTaskFromCache();
|
||||
|
||||
/**
|
||||
* 格式化任务
|
||||
*
|
||||
* @param task
|
||||
* @return
|
||||
*/
|
||||
TaskDto foramte(TaskDto task);
|
||||
|
||||
/**
|
||||
@@ -367,9 +462,10 @@ public interface TaskService extends CommonService<Task> {
|
||||
|
||||
/**
|
||||
* 查询相同起终任务的数量
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @param start_device
|
||||
* @param next_device
|
||||
* @param status
|
||||
* @return Integer
|
||||
*/
|
||||
Integer querySameDeviceReadyTask(String start_device, String next_device, String status);
|
||||
|
||||
@@ -384,7 +480,9 @@ public interface TaskService extends CommonService<Task> {
|
||||
|
||||
/**
|
||||
* 导出任务树形记录
|
||||
* @param list
|
||||
* @param response
|
||||
* @throws IOException
|
||||
*/
|
||||
void downloadTaskTreeLogging(List<JSONObject> list, HttpServletResponse response) throws IOException;
|
||||
|
||||
@@ -392,6 +490,7 @@ public interface TaskService extends CommonService<Task> {
|
||||
* 导出任务记录
|
||||
* @param all
|
||||
* @param response
|
||||
* @throws IOException
|
||||
*/
|
||||
void downloadTaskLogging(List<JSONObject> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ import java.util.*;
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class TaskFeedbackServiceImpl extends CommonServiceImpl<TaskFeedbackMapper, TaskFeedback> implements TaskFeedbackService {
|
||||
|
||||
// private final RedisUtils redisUtils;
|
||||
@Autowired
|
||||
TaskFeedbackMapper taskFeedbackMapper;
|
||||
@Autowired
|
||||
@@ -174,18 +173,9 @@ public class TaskFeedbackServiceImpl extends CommonServiceImpl<TaskFeedbackMappe
|
||||
return ConvertUtil.convertList(insList, TaskFeedbackDto.class);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public TaskFeedbackDto findById(String taskback_id) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task_feedback");
|
||||
// JSONObject json = wo.query("taskback_id ='" + taskback_id + "'").uniqueResult(0);
|
||||
// final TaskFeedbackDto obj = json.toJavaObject(TaskFeedbackDto.class);
|
||||
// return obj;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TaskFeedbackDto findByCode(String code) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task_feedback");
|
||||
// JSONObject json = wo.query("task_code ='" + code + "' and is_finished='0' ").uniqueResult(0);
|
||||
TaskFeedback taskFeedback = new LambdaQueryChainWrapper<>(taskFeedbackMapper)
|
||||
.eq(TaskFeedback::getTask_code, code)
|
||||
.eq(TaskFeedback::getIs_finished, "0")
|
||||
@@ -209,10 +199,6 @@ public class TaskFeedbackServiceImpl extends CommonServiceImpl<TaskFeedbackMappe
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task_feedback");
|
||||
// JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
//
|
||||
// wo.insert(json);
|
||||
|
||||
TaskFeedback entity = ConvertUtil.convert(dto, TaskFeedback.class);
|
||||
taskFeedbackMapper.insert(entity);
|
||||
@@ -238,9 +224,7 @@ public class TaskFeedbackServiceImpl extends CommonServiceImpl<TaskFeedbackMappe
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task_feedback");
|
||||
for (String taskback_id : ids) {
|
||||
// wo.delete("taskback_id = '" + taskback_id + "'");
|
||||
taskFeedbackMapper.deleteById(taskback_id);
|
||||
}
|
||||
}
|
||||
@@ -300,7 +284,7 @@ public class TaskFeedbackServiceImpl extends CommonServiceImpl<TaskFeedbackMappe
|
||||
int status = body.getStatus();
|
||||
|
||||
dto.setTask_status(entity.getTask_status());
|
||||
if (status == 200) {
|
||||
if (status == CommonFinalParam.STATUS_OPEN) {
|
||||
dto.setIs_finished(CommonFinalParam.ONE);
|
||||
dto.setError_code("200");
|
||||
dto.setRemark("");
|
||||
|
||||
@@ -88,7 +88,6 @@ import java.util.stream.Collectors;
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
// private final RedisUtils redisUtils;
|
||||
@Autowired
|
||||
TaskMapper taskMapper;
|
||||
@Autowired
|
||||
@@ -366,10 +365,11 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
if (!ObjectUtil.isEmpty(material_type) && !task.getMaterial().equals(material_type)) {
|
||||
continue;
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(point_code)
|
||||
&& !(task.getStart_point_code().contains(point_code)
|
||||
|| task.getNext_point_code().contains(point_code))) {
|
||||
continue;
|
||||
if (!ObjectUtil.isEmpty(point_code)) {
|
||||
if(!(task.getStart_point_code().contains(point_code)
|
||||
|| task.getNext_point_code().contains(point_code))){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(task_type) && !task.getTask_type().equals(task_type)) {
|
||||
continue;
|
||||
@@ -415,7 +415,6 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
|
||||
IPage<Task> queryPage = PageUtil.toMybatisPage(page);
|
||||
LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.eq(InstructionMybatis::getIs_delete,"0");
|
||||
if (!StrUtil.isEmpty(task_code)) {
|
||||
wrapper.eq(Task::getTask_code, task_code);
|
||||
}
|
||||
@@ -458,20 +457,9 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
return ConvertUtil.convertList(taskList, TaskDto.class);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public TaskDto findById(String task_id) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||
// JSONObject json = wo.query("task_id ='" + task_id + "'").uniqueResult(0);
|
||||
// final TaskDto obj = json.toJavaObject(TaskDto.class);
|
||||
// return obj;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryAllUnfinished(Map whereJson) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||
// JSONArray arr = wo.query("task_status < 2 ").getResultJSONArray(0);
|
||||
// List<TaskDto> list = arr.toJavaList(TaskDto.class);
|
||||
// return list;
|
||||
List<Task> taskList = new LambdaQueryChainWrapper<>(taskMapper)
|
||||
.lt(Task::getTask_status, TaskStatusEnum.FINISHED.getIndex())
|
||||
.list();
|
||||
@@ -480,10 +468,6 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
|
||||
@Override
|
||||
public TaskDto findByCode(String code) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||
// JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0);
|
||||
// final TaskDto obj = json.toJavaObject(TaskDto.class);
|
||||
// return obj;
|
||||
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
||||
.eq(Task::getTask_code, code)
|
||||
.one();
|
||||
@@ -513,10 +497,11 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
if (!StrUtil.equals(task.getTask_type(), "6")) {
|
||||
continue;
|
||||
}
|
||||
if ((task.getStart_device_code().equals(start_device_code)
|
||||
|| task.getStart_device_code2().equals(start_device_code))
|
||||
&& StrUtil.equals(task.getTask_status(), TaskStatusEnum.READY.getIndex())) {
|
||||
list.add(task);
|
||||
if (StrUtil.equals(task.getTask_status(), TaskStatusEnum.READY.getIndex())) {
|
||||
if((task.getStart_device_code().equals(start_device_code)
|
||||
|| task.getStart_device_code2().equals(start_device_code))){
|
||||
list.add(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
@@ -556,6 +541,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryTaskByStartAndIntStatus(String head_start_device_code) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
@@ -564,18 +550,20 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
if (!StrUtil.equals(task.getTask_type(), "6")) {
|
||||
continue;
|
||||
}
|
||||
if ((task.getStart_device_code().equals(head_start_device_code)
|
||||
|| task.getStart_device_code2().equals(head_start_device_code))
|
||||
&& StrUtil.equals(task.getTask_status(), TaskStatusEnum.BUSY.getIndex())) {
|
||||
Instruction instruction = instructionService.findByTaskcodeAndStatus(task.getTask_code());
|
||||
if (ObjectUtil.isNotEmpty(instruction)) {
|
||||
list.add(task);
|
||||
if (StrUtil.equals(task.getTask_status(), TaskStatusEnum.BUSY.getIndex())) {
|
||||
if((task.getStart_device_code().equals(head_start_device_code)
|
||||
|| task.getStart_device_code2().equals(head_start_device_code))){
|
||||
Instruction instruction = instructionService.findByTaskcodeAndStatus(task.getTask_code());
|
||||
if (ObjectUtil.isNotEmpty(instruction)) {
|
||||
list.add(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryTaskByNextAndIntStatus(String back_start_device_code) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
@@ -602,10 +590,6 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryByStauts(String status) {
|
||||
// WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||
// JSONArray arr = wo.query("task_status = '" + status + "'").getResultJSONArray(0);
|
||||
// List<TaskDto> list = arr.toJavaList(TaskDto.class);
|
||||
// return list;
|
||||
List<Task> taskList = new LambdaQueryChainWrapper<>(taskMapper)
|
||||
.eq(Task::getTask_status, status)
|
||||
.list();
|
||||
@@ -764,7 +748,6 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
TaskDto dto = new TaskDto();
|
||||
Map whereJson = (Map) array.get(i);
|
||||
|
||||
// String device_code = (String) whereJson.get("device_code");
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
dto.setRoute_plan_code("one");
|
||||
String next_device_code = "";
|
||||
@@ -1400,6 +1383,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
return tasks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDto findByContainer(String container_code) {
|
||||
Iterator var3 = tasks.iterator();
|
||||
|
||||
@@ -1413,6 +1397,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDto findByCodeFromCache(String task_code) {
|
||||
Iterator var3 = tasks.iterator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user