订单管理相关
This commit is contained in:
@@ -12,6 +12,6 @@ import com.zt.plat.framework.common.exception.ErrorCode;
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
ErrorCode PURCHASE_ORDER_NOT_EXISTS = new ErrorCode(1_008_000_001, "采购订单不存在");
|
||||
|
||||
ErrorCode ORDER_ID_NOT_EXISTS = new ErrorCode(1_008_000_010, "订单id不能为空");
|
||||
ErrorCode PRCH_ORD_DTL_NOT_EXISTS = new ErrorCode(1_008_001_001, "采购订单明细不存在");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.contractorder.enums.purchaseorder;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum PurchaseOrderStatusEnum {
|
||||
// 草稿状态
|
||||
DRAFT("DRAFT", "草稿"),
|
||||
// 审批中状态
|
||||
APPROVING("APPR", "审批中"),
|
||||
// 待提交ERP状态
|
||||
TO_SUBMIT_ERP("SUB", "待提交ERP"),
|
||||
// 执行中状态
|
||||
IN_PROGRESS("IN_PROGRESS", "执行中"),
|
||||
// 关闭状态
|
||||
CLOSED("CLOSE", "关闭");
|
||||
|
||||
/** 状态编码 */
|
||||
private final String code;
|
||||
/** 状态描述 */
|
||||
private final String description;
|
||||
|
||||
PurchaseOrderStatusEnum(String code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编码获取枚举实例
|
||||
* @param code 状态编码
|
||||
* @return 匹配的枚举,无匹配时返回 null
|
||||
*/
|
||||
public static PurchaseOrderStatusEnum getByCode(String code) {
|
||||
for (PurchaseOrderStatusEnum status : PurchaseOrderStatusEnum.values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user