rev: 修改任务状态的获取

This commit is contained in:
2023-04-03 19:47:50 +08:00
parent 5b92d9b664
commit b6626bdbbb
3 changed files with 13 additions and 20 deletions

View File

@@ -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")

View File

@@ -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,