|
|
package com.yohoufo.order.common;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by chenchao on 2018/9/18.
|
|
|
*/
|
|
|
public enum SellerOrderListType {
|
|
|
|
|
|
in_sale(1, "出售中",
|
|
|
Arrays.asList(OrderStatus.WAITING_PAY.getCode()),
|
|
|
Collections.<Integer>emptyList()),
|
|
|
|
|
|
WAITING_PAY(2, "待付款",
|
|
|
Collections.<Integer>emptyList(),Collections.<Integer>emptyList()),
|
|
|
|
|
|
WAITING_SEND(3, "待发货",
|
|
|
Arrays.asList(OrderStatus.SELLER_SEND_OUT.getCode(),
|
|
|
OrderStatus.HAS_PAYED.getCode(),
|
|
|
OrderStatus.PLATFORM_CHECKING.getCode()),
|
|
|
Collections.<Integer>emptyList()),
|
|
|
|
|
|
WAITING_DELIVERY(4, "待收货",
|
|
|
Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode()),
|
|
|
Collections.<Integer>emptyList()),
|
|
|
|
|
|
ORDER_SUCCESS(5, "交易成功",
|
|
|
Arrays.asList(OrderStatus.DONE.getCode()),
|
|
|
Collections.<Integer>emptyList()),
|
|
|
|
|
|
ORDER_FAILED(6, "交易失败", Arrays.asList(
|
|
|
IN_SALE(1, "出售中",
|
|
|
Arrays.asList(
|
|
|
SkupStatus.CAN_NOT_SELL.getCode(),
|
|
|
SkupStatus.CAN_SELL.getCode(),
|
|
|
SkupStatus.YOHO_CANCEL_SELL.getCode(),
|
|
|
SkupStatus.SELF_CANCEL_PAY.getCode(),
|
|
|
SkupStatus.TIMEOUT_CANCEL.getCode(),
|
|
|
SkupStatus.SELLER_CANCEL_SELL.getCode()
|
|
|
)
|
|
|
),
|
|
|
|
|
|
WAITING_PAY(2, "待发货",
|
|
|
Arrays.asList(
|
|
|
OrderStatus.WAITING_PAY.getCode(),
|
|
|
OrderStatus.HAS_PAYED.getCode()
|
|
|
)
|
|
|
),
|
|
|
|
|
|
WAITING_SEND(3, "已发货",
|
|
|
Arrays.asList(
|
|
|
OrderStatus.SELLER_SEND_OUT.getCode(),
|
|
|
OrderStatus.PLATFORM_CHECKING.getCode()
|
|
|
)
|
|
|
),
|
|
|
|
|
|
ORDER_SUCCESS(5, "交易完成",
|
|
|
Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode())
|
|
|
),
|
|
|
|
|
|
ORDER_FAILED(6, "交易失败",
|
|
|
Arrays.asList(
|
|
|
OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(),
|
|
|
OrderStatus.SEND_OUT_TIMEOUT.getCode(),
|
|
|
OrderStatus.CHECKING_FAKE.getCode(),
|
|
|
OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(),
|
|
|
OrderStatus.BUYER_CANCEL_TIMEOUT.getCode()),
|
|
|
Collections.<Integer>emptyList());
|
|
|
OrderStatus.BUYER_CANCEL_TIMEOUT.getCode()
|
|
|
)
|
|
|
);
|
|
|
|
|
|
int type;
|
|
|
|
|
|
String desc;
|
|
|
|
|
|
List<Integer> sellerStatus;
|
|
|
|
|
|
List<Integer> buyerStatus;
|
|
|
List<Integer> status;
|
|
|
|
|
|
SellerOrderListType(int type, String desc, List<Integer> buyerStatus, List<Integer> sellerStatus) {
|
|
|
SellerOrderListType(int type, String desc, List<Integer> status) {
|
|
|
this.type = type;
|
|
|
this.desc = desc;
|
|
|
this.buyerStatus = buyerStatus;
|
|
|
this.sellerStatus = sellerStatus;
|
|
|
this.status = status;
|
|
|
}
|
|
|
|
|
|
static Map<Integer, SellerOrderListType> localCache = new HashMap<>(8);
|
|
|
|
|
|
static {
|
|
|
for(SellerOrderListType v : values()){
|
|
|
localCache.put(v.type, v);
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
* 检查是否存在该中查询类型
|
|
|
* @param code
|
|
|
* @return
|
|
|
*/
|
|
|
public static SellerOrderListType getOrderListType(int code){
|
|
|
for(SellerOrderListType v : values()){
|
|
|
if(v.type == code){
|
|
|
return v;
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
return localCache.get(code);
|
|
|
}
|
|
|
|
|
|
public int getType() {
|
|
|
return type;
|
|
|
}
|
|
|
|
|
|
public List<Integer> getBuyerStatus() {
|
|
|
return buyerStatus;
|
|
|
public List<Integer> getStatus() {
|
|
|
return status;
|
|
|
}
|
|
|
} |
...
|
...
|
|