Commit 8f08bc4c by 林冲

车辆取消,需同步取消交付单

1 parent b4d0bcf5
package com.gsc4cloud.gsc.vpc.api.enums;
/**
* Delivery order status enum to replace magic numbers in code.
* Codes definition:
* -1: 已取消
* 0: 待交付
* 1: 准备交付/交付中/过户中(进行中)
* 2: 交付完成
*/
public enum DeliveryOrderStatusEnum implements BaseEnum<Integer, String> {
CANCELLED(-1, "已取消"),
PENDING(0, "待交付"),
IN_PROGRESS(1, "进行中"),
COMPLETED(2, "交付完成");
private final Integer code;
private final String desc;
DeliveryOrderStatusEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
@Override
public Integer getCode() {
return code;
}
@Override
public String getDesc() {
return desc;
}
/**
* Map external text to enum
*/
public static DeliveryOrderStatusEnum fromText(String status) {
if (status == null) {
return PENDING;
}
switch (status) {
case "已完成":
return COMPLETED;
case "准备交付":
case "交付中":
case "过户中":
return IN_PROGRESS;
case "已取消":
return CANCELLED;
default:
return PENDING;
}
}
/**
* Get enum by numeric code
*/
public static DeliveryOrderStatusEnum ofCode(Integer code) {
return BaseEnum.getEnumByCode(code, DeliveryOrderStatusEnum.class);
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!