rev: 修改任务状态的获取
This commit is contained in:
@@ -4,11 +4,14 @@ package org.nl.wms.sch.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.wms.sch.manage.FinishTypeEnum;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.TaskService;
|
||||
@@ -34,6 +37,7 @@ import java.util.Map;
|
||||
public class TaskController {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final ISysDictService dictService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询任务")
|
||||
@@ -74,20 +78,8 @@ public class TaskController {
|
||||
@Log("获取任务状态列表")
|
||||
@ApiOperation("获取任务状态列表")
|
||||
public ResponseEntity<Object> getTaskStatus() {
|
||||
TaskStatusEnum[] values = TaskStatusEnum.values();
|
||||
JSONArray arr = new JSONArray();
|
||||
for (TaskStatusEnum value : values) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("code", value.getCode());
|
||||
json.put("name", value.getName());
|
||||
arr.add(json);
|
||||
}
|
||||
//增加未完成状态
|
||||
JSONObject unFinish = new JSONObject();
|
||||
unFinish.put("code", "-1");
|
||||
unFinish.put("name", "未完成");
|
||||
arr.add(unFinish);
|
||||
return new ResponseEntity<>(arr, HttpStatus.OK);
|
||||
return new ResponseEntity<>(dictService.list(new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, "task_status")), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/taskType")
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
SELECT
|
||||
task.*,
|
||||
md.class_name task_type_name,
|
||||
dict.label task_status_name,
|
||||
DICT.label task_status_name,
|
||||
reg1.region_name as point1_region_name,
|
||||
reg2.region_name as point2_region_name,
|
||||
reg3.region_name as point3_region_name,
|
||||
|
||||
Reference in New Issue
Block a user