You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.5 KiB
83 lines
2.5 KiB
|
2 weeks ago
|
package common.ecommerce.yqn.enums;
|
||
|
|
|
||
|
|
import common.ecommerce.warehouse.enums.TransferStatus;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 运去哪调拨单状态(API 139 的 {@code transferOutboundPlanStatus})。
|
||
|
|
*
|
||
|
|
* <p>码表来自接口文档,1:1 对应;未知码归 {@link #UNKNOWN},不猜。</p>
|
||
|
|
*/
|
||
|
|
public enum YqnTransferStatus {
|
||
|
|
|
||
|
|
/** 0 草稿。 */
|
||
|
|
DRAFT(0, TransferStatus.DRAFT),
|
||
|
|
/** 3 已驳回。 */
|
||
|
|
REJECTED(3, TransferStatus.REJECTED),
|
||
|
|
/** 5 待审核。 */
|
||
|
|
PENDING_REVIEW(5, TransferStatus.PENDING_REVIEW),
|
||
|
|
/** 6 审核中。 */
|
||
|
|
REVIEWING(6, TransferStatus.REVIEWING),
|
||
|
|
/** 7 审核通过。 */
|
||
|
|
APPROVED(7, TransferStatus.APPROVED),
|
||
|
|
/** 8 待确认。 */
|
||
|
|
PENDING_CONFIRM(8, TransferStatus.PENDING_CONFIRM),
|
||
|
|
/** 9 待备货。 */
|
||
|
|
PENDING_PICKING(9, TransferStatus.PENDING_PICKING),
|
||
|
|
/** 10 待出库。 */
|
||
|
|
PENDING_OUTBOUND(10, TransferStatus.PENDING_OUTBOUND),
|
||
|
|
/** 15 出库中。 */
|
||
|
|
OUTBOUNDING(15, TransferStatus.OUTBOUNDING),
|
||
|
|
/** 20 待入库。 */
|
||
|
|
PENDING_INBOUND(20, TransferStatus.PENDING_INBOUND),
|
||
|
|
/** 25 入库中。 */
|
||
|
|
INBOUNDING(25, TransferStatus.INBOUNDING),
|
||
|
|
/** 70 已完成。 */
|
||
|
|
COMPLETED(70, TransferStatus.COMPLETED),
|
||
|
|
/** 90 已关闭。 */
|
||
|
|
CLOSED(90, TransferStatus.CLOSED),
|
||
|
|
/** 100 取消中。 */
|
||
|
|
CANCELLING(100, TransferStatus.CANCELLING),
|
||
|
|
/** 110 已取消。 */
|
||
|
|
CANCELLED(110, TransferStatus.CANCELLED),
|
||
|
|
/** 120 取消异常。 */
|
||
|
|
CANCEL_EXCEPTION(120, TransferStatus.CANCEL_EXCEPTION),
|
||
|
|
/** 无法识别。 */
|
||
|
|
UNKNOWN(null, TransferStatus.UNKNOWN);
|
||
|
|
|
||
|
|
private final Integer rawCode;
|
||
|
|
private final TransferStatus core;
|
||
|
|
|
||
|
|
YqnTransferStatus(Integer rawCode, TransferStatus core) {
|
||
|
|
this.rawCode = rawCode;
|
||
|
|
this.core = core;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 运去哪的状态码;null 表示无法识别。 */
|
||
|
|
public Integer rawCode() {
|
||
|
|
return rawCode;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 对应的底层状态。 */
|
||
|
|
public TransferStatus toCore() {
|
||
|
|
return core;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 运去哪状态码 → 平台枚举。 */
|
||
|
|
public static YqnTransferStatus of(Integer rawStatus) {
|
||
|
|
if (rawStatus == null) {
|
||
|
|
return UNKNOWN;
|
||
|
|
}
|
||
|
|
for (YqnTransferStatus v : values()) {
|
||
|
|
if (rawStatus.equals(v.rawCode)) {
|
||
|
|
return v;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return UNKNOWN;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 运去哪状态码 → 底层状态。 */
|
||
|
|
public static TransferStatus toCore(Integer rawStatus) {
|
||
|
|
return of(rawStatus).toCore();
|
||
|
|
}
|
||
|
|
}
|