oms发单

This commit is contained in:
赵辉
2026-01-28 13:20:09 +08:00
parent bbbb0b835d
commit e26dc853d5
46 changed files with 5455 additions and 0 deletions
@@ -0,0 +1,38 @@
package com.mhd.oms.enums;
import lombok.Getter;
/**
* 货物类型枚举
* @author System
* @date 2024
*/
@Getter
public enum CargoTypeEnum {
STOCK("STOCK", "库存货物"),
MATERIAL("MATERIAL", "物料货物"),
MANUAL("MANUAL", "手动输入货物");
private final String code;
private final String description;
CargoTypeEnum(String code, String description) {
this.code = code;
this.description = description;
}
/**
* 根据代码获取枚举
* @param code 代码
* @return 货物类型枚举
*/
public static CargoTypeEnum fromCode(String code) {
for (CargoTypeEnum type : values()) {
if (type.getCode().equals(code)) {
return type;
}
}
throw new IllegalArgumentException("无效的货物类型代码: " + code);
}
}
@@ -0,0 +1,21 @@
package com.mhd.oms.enums;
public enum DictTypeEnum {
GOODSUNIT("goods_unit", "货物单位");
private final String typeCode;
private final String typeName;
DictTypeEnum(String typeCode, String typeName) {
this.typeCode = typeCode;
this.typeName = typeName;
}
public String getTypeCode() {
return typeCode;
}
public String getTypeName() {
return typeName;
}
}
@@ -0,0 +1,63 @@
package com.mhd.oms.enums;
/**
* 订单操作枚举
*
* @author
*/
public enum OrderOperateEnum {
/**
* 创建订单
*/
create_order(1, "创建订单"),
/**
* 修改订单
*/
update_order(2, "修改订单"),
/**
* 删除订单
*/
delete_order(3, "删除订单"),
/**
* 审核订单
*/
audit_order(4, "审核订单"),
/**
* 取消订单
*/
cancel_order(5, "取消订单"),
/**
* 完成订单
*/
complete_order(6, "完成订单");
private final Integer key;
private final String value;
OrderOperateEnum(Integer key, String value) {
this.key = key;
this.value = value;
}
public Integer getKey() {
return key;
}
public String getValue() {
return value;
}
public static String findByKey(Integer key) {
for (OrderOperateEnum operate : values()) {
if (operate.key.equals(key)) {
return operate.value;
}
}
return null;
}
}
@@ -0,0 +1,63 @@
package com.mhd.oms.enums;
/**
* 订单状态枚举
*
* @author
*/
public enum OrderStatusEnum {
/**
* 订单未部署
*/
ORDER_NOT_DEPLOY(1, "未调度"),
/**
* 订单未审核
*/
ORDER_NOT_AUDIT(2, "未审核"),
/**
* 订单已审核
*/
ORDER_AUDITED(3, "已审核"),
/**
* 订单进行中
*/
ORDER_IN_PROGRESS(4, "进行中"),
/**
* 订单已完成
*/
ORDER_COMPLETED(5, "已完成"),
/**
* 订单已关闭
*/
ORDER_CLOSED(6, "已关闭");
private final Integer key;
private final String value;
OrderStatusEnum(Integer key, String value) {
this.key = key;
this.value = value;
}
public Integer getKey() {
return key;
}
public String getValue() {
return value;
}
public static String findByKey(Integer key) {
for (OrderStatusEnum status : values()) {
if (status.key.equals(key)) {
return status.value;
}
}
return null;
}
}
@@ -0,0 +1,29 @@
package com.mhd.oms.enums;
import lombok.Getter;
@Getter
public enum OrderType {
MECHANICAL_TRANSPORT(1, "普货运输"),
OVERSIZE_TRANSPORT(2, "危化运输"),
TANK_TRANSPORT(3, "罐车运输"),
JINAN_SPECIAL_LINE(4, "济南专线"),
JIANGXI_SPECIAL_LINE(5, "江西专线");
private final Integer code;
private final String description;
OrderType(Integer code, String description) {
this.code = code;
this.description = description;
}
public static OrderType fromCode(Integer code) {
for (OrderType type : OrderType.values()) {
if (type.getCode().equals(code)) {
return type;
}
}
throw new IllegalArgumentException("无效的订单类型代码: " + code);
}
}