add:增加一楼任务
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package org.nl.common.enums;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 子卷等级
|
||||
* @author gbx
|
||||
* @since 2023-01-27
|
||||
*/
|
||||
public enum ContainerLevelEnum {
|
||||
//
|
||||
BEST(1, "A+", "1"),
|
||||
WELL(2, "A", "2"),
|
||||
COMMON(3, "A-", "3"),
|
||||
REWORK(4, "返切", "4"),
|
||||
SCRAP(5, "报废", "5"),
|
||||
CONTROL(6, "管制", "6"),
|
||||
OTHER(7, "其他", "7");
|
||||
|
||||
private int index;
|
||||
private String name;
|
||||
private String code;
|
||||
|
||||
public int getIndex() { return index;}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
ContainerLevelEnum(int index, String name, String code) {
|
||||
this.index = index;
|
||||
this.name = name;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public static ContainerLevelEnum getType(String type) {
|
||||
Optional<ContainerLevelEnum> first = Arrays.stream(ContainerLevelEnum.values()).filter(a -> a.getCode().equals(type)).findFirst();
|
||||
return first.orElse(ContainerLevelEnum.OTHER);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.nl.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 装箱区点位库存枚举
|
||||
*
|
||||
* @author gbx
|
||||
* @since 2024-01-31
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PackageInfoIvtEnum {
|
||||
//点位类型
|
||||
POINT_STATUS(MapOf.of("满轴缓存位", "1", "空载具缓存位", "2", "待检区", "3", "管制区", "4", "装箱区", "5", "装箱位", "6")),
|
||||
|
||||
TASK_TYPE(MapOf.of("输送线->满轴缓存位", "010701", "满轴缓存位->待检区", "010702", "满轴缓存位->管制区", "010703", "放空(空载具缓存位->输送线)", "010704", "取空(待检区->空载具缓存位)", "010705", "待检区->管制区", "010706","管制区->待检区", "010707","待检区->装箱区", "010708", "装箱区->装箱对接位", "010709")),
|
||||
//是否
|
||||
IS_USED(MapOf.of("启用", "1", "未启用", "0")),
|
||||
//位置
|
||||
POINT_LOCATION(MapOf.of("上", "0", "下", "1")),
|
||||
//库存状态
|
||||
IVT_STATUS(MapOf.of("空", "0", "1", "空载具", "2", "有子卷"));
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
String code = this.getCode().get(desc);
|
||||
if (StringUtils.isNotEmpty(code)) {
|
||||
return code;
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + desc + "未定义");
|
||||
}
|
||||
|
||||
public String check(String code) {
|
||||
for (Map.Entry<String, String> entry : this.getCode().entrySet()) {
|
||||
if (entry.getValue().equals("code")) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user