ren 更新枚举类
This commit is contained in:
@@ -78,6 +78,7 @@ import org.nl.system.service.param.ISysParamService;
|
|||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
import org.openscada.opc.lib.da.Server;
|
import org.openscada.opc.lib.da.Server;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -95,9 +96,9 @@ import java.io.InputStream;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jiaolm
|
* @author jiaolm
|
||||||
* @date 2023-05-09
|
* @date 2023-05-09
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -108,7 +109,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
|||||||
// private final RedisUtils redisUtils;
|
// private final RedisUtils redisUtils;
|
||||||
private final DeviceMapper deviceMapper;
|
private final DeviceMapper deviceMapper;
|
||||||
private final RouteLineMapper routeLineMapper;
|
private final RouteLineMapper routeLineMapper;
|
||||||
// private final StageActorMapper stageActorMapper;
|
// private final StageActorMapper stageActorMapper;
|
||||||
private final StorageCellMapper storageCellMapper;
|
private final StorageCellMapper storageCellMapper;
|
||||||
private final DeviceExtraMapper deviceExtraMapper;
|
private final DeviceExtraMapper deviceExtraMapper;
|
||||||
private final DeviceRunpointMapper deviceRunpointMapper;
|
private final DeviceRunpointMapper deviceRunpointMapper;
|
||||||
@@ -1066,11 +1067,14 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceAppService.removeDevice(device_code);
|
updateDevice(device_code);
|
||||||
|
|
||||||
deviceAppService.addDevice(device_code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void updateDevice(String device_code){
|
||||||
|
deviceAppService.removeDevice(device_code);
|
||||||
|
deviceAppService.addDevice(device_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package org.nl.acs.task.enums;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum AgvSystemTypeEnum {
|
||||||
|
NDC_System_Type("1", "NDC_System_Type", "NDC系统"),
|
||||||
|
XG_System_Type("2", "XG_System_Type", "仙工系统");
|
||||||
|
|
||||||
|
//索引
|
||||||
|
private String index;
|
||||||
|
//编码
|
||||||
|
private String code;
|
||||||
|
//名字
|
||||||
|
private String name;
|
||||||
|
//描述
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
// 构造方法
|
||||||
|
AgvSystemTypeEnum(String index, String code, String name) {
|
||||||
|
this.index = index;
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray getList() {
|
||||||
|
JSONArray arr = new JSONArray();
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
for (AgvSystemTypeEnum em : AgvSystemTypeEnum.values()) {
|
||||||
|
json.put("code", em.getCode());
|
||||||
|
json.put("name", em.getName());
|
||||||
|
arr.add(json);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String code) {
|
||||||
|
for (AgvSystemTypeEnum c : AgvSystemTypeEnum.values()) {
|
||||||
|
if (c.code == code) {
|
||||||
|
return c.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package org.nl.acs.task.enums;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 立库任务类型
|
||||||
|
*/
|
||||||
|
public enum StorageTaskTypeEnum {
|
||||||
|
IN("1", "Conveyor_Task", "任务"),
|
||||||
|
OUT("2", "Stacker_Task", "堆垛机任务"),
|
||||||
|
MOVE("3", "Truss_Task", "行架任务"),
|
||||||
|
AGV_Task("4", "AGV_Task", "AGV任务");
|
||||||
|
|
||||||
|
//索引
|
||||||
|
private String index;
|
||||||
|
//编码
|
||||||
|
private String code;
|
||||||
|
//名字
|
||||||
|
private String name;
|
||||||
|
//描述
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
// 构造方法
|
||||||
|
StorageTaskTypeEnum(String index, String code, String name) {
|
||||||
|
this.index = index;
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray getList() {
|
||||||
|
JSONArray arr = new JSONArray();
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
for (StorageTaskTypeEnum em : StorageTaskTypeEnum.values()) {
|
||||||
|
json.put("code", em.getCode());
|
||||||
|
json.put("name", em.getName());
|
||||||
|
arr.add(json);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String code) {
|
||||||
|
for (StorageTaskTypeEnum c : StorageTaskTypeEnum.values()) {
|
||||||
|
if (c.code == code) {
|
||||||
|
return c.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,10 +12,8 @@ public enum TaskStatusEnum {
|
|||||||
READY("0", "READY", "就绪"),
|
READY("0", "READY", "就绪"),
|
||||||
BUSY("1", "BUSY", "执行中"),
|
BUSY("1", "BUSY", "执行中"),
|
||||||
FINISHED("2", "FINISHED", "完成"),
|
FINISHED("2", "FINISHED", "完成"),
|
||||||
|
|
||||||
CANCEL("3", "CANCEL", "取消"),
|
CANCEL("3", "CANCEL", "取消"),
|
||||||
|
ERROR("99", "ERROR", "异常");
|
||||||
ERROR("99", "CANCEL", "异常");
|
|
||||||
|
|
||||||
//索引
|
//索引
|
||||||
private String index;
|
private String index;
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package org.nl.acs.task.enums;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum TaskTypeEnum {
|
||||||
|
Conveyor_Task("1", "Conveyor_Task", "输送线任务"),
|
||||||
|
Stacker_Task("2", "Stacker_Task", "堆垛机任务"),
|
||||||
|
Truss_Task("3", "Truss_Task", "行架任务"),
|
||||||
|
AGV_Task("4", "AGV_Task", "AGV任务");
|
||||||
|
|
||||||
|
//索引
|
||||||
|
private String index;
|
||||||
|
//编码
|
||||||
|
private String code;
|
||||||
|
//名字
|
||||||
|
private String name;
|
||||||
|
//描述
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
// 构造方法
|
||||||
|
TaskTypeEnum(String index, String code, String name) {
|
||||||
|
this.index = index;
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray getList() {
|
||||||
|
JSONArray arr = new JSONArray();
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
for (TaskTypeEnum em : TaskTypeEnum.values()) {
|
||||||
|
json.put("code", em.getCode());
|
||||||
|
json.put("name", em.getName());
|
||||||
|
arr.add(json);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String code) {
|
||||||
|
for (TaskTypeEnum c : TaskTypeEnum.values()) {
|
||||||
|
if (c.code == code) {
|
||||||
|
return c.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user