Showing
5 changed files
with
168 additions
and
58 deletions
@@ -12,7 +12,8 @@ public enum ButtonShow { | @@ -12,7 +12,8 @@ public enum ButtonShow { | ||
12 | /*卖家相关*/ | 12 | /*卖家相关*/ |
13 | PAY_EARNESTMONEY("pay_earnestMoney","支付保证金"), | 13 | PAY_EARNESTMONEY("pay_earnestMoney","支付保证金"), |
14 | NOT_SOLD("not_sold","不卖了"), | 14 | NOT_SOLD("not_sold","不卖了"), |
15 | - DELIVER_GOODS("deliver_goods","我要发货") | 15 | + DELIVER_GOODS("deliver_goods","我要发货"), |
16 | + SOLD_AGAIN("sold_again","再次出售") | ||
16 | ; | 17 | ; |
17 | 18 | ||
18 | String code; | 19 | String code; |
1 | package com.yohoufo.order.common; | 1 | package com.yohoufo.order.common; |
2 | 2 | ||
3 | -import java.util.Arrays; | ||
4 | -import java.util.Collections; | ||
5 | -import java.util.List; | 3 | +import java.util.*; |
6 | 4 | ||
7 | /** | 5 | /** |
8 | * Created by chenchao on 2018/9/18. | 6 | * Created by chenchao on 2018/9/18. |
9 | */ | 7 | */ |
10 | public enum SellerOrderListType { | 8 | public enum SellerOrderListType { |
11 | 9 | ||
12 | - in_sale(1, "出售中", | ||
13 | - Arrays.asList(OrderStatus.WAITING_PAY.getCode()), | ||
14 | - Collections.<Integer>emptyList()), | ||
15 | - | ||
16 | - WAITING_PAY(2, "待付款", | ||
17 | - Collections.<Integer>emptyList(),Collections.<Integer>emptyList()), | ||
18 | - | ||
19 | - WAITING_SEND(3, "待发货", | ||
20 | - Arrays.asList(OrderStatus.SELLER_SEND_OUT.getCode(), | ||
21 | - OrderStatus.HAS_PAYED.getCode(), | ||
22 | - OrderStatus.PLATFORM_CHECKING.getCode()), | ||
23 | - Collections.<Integer>emptyList()), | ||
24 | - | ||
25 | - WAITING_DELIVERY(4, "待收货", | ||
26 | - Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode()), | ||
27 | - Collections.<Integer>emptyList()), | ||
28 | - | ||
29 | - ORDER_SUCCESS(5, "交易成功", | ||
30 | - Arrays.asList(OrderStatus.DONE.getCode()), | ||
31 | - Collections.<Integer>emptyList()), | ||
32 | - | ||
33 | - ORDER_FAILED(6, "交易失败", Arrays.asList( | ||
34 | - OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(), | 10 | + IN_SALE(1, "出售中", |
11 | + Arrays.asList( | ||
12 | + SkupStatus.CAN_NOT_SELL.getCode(), | ||
13 | + SkupStatus.CAN_SELL.getCode(), | ||
14 | + SkupStatus.YOHO_CANCEL_SELL.getCode(), | ||
15 | + SkupStatus.SELF_CANCEL_PAY.getCode(), | ||
16 | + SkupStatus.TIMEOUT_CANCEL.getCode(), | ||
17 | + SkupStatus.SELLER_CANCEL_SELL.getCode() | ||
18 | + ) | ||
19 | + ), | ||
20 | + | ||
21 | + WAITING_PAY(2, "待发货", | ||
22 | + Arrays.asList( | ||
23 | + OrderStatus.WAITING_PAY.getCode(), | ||
24 | + OrderStatus.HAS_PAYED.getCode() | ||
25 | + ) | ||
26 | + ), | ||
27 | + | ||
28 | + WAITING_SEND(3, "已发货", | ||
29 | + Arrays.asList( | ||
30 | + OrderStatus.SELLER_SEND_OUT.getCode(), | ||
31 | + OrderStatus.PLATFORM_CHECKING.getCode() | ||
32 | + ) | ||
33 | + ), | ||
34 | + | ||
35 | + ORDER_SUCCESS(5, "交易完成", | ||
36 | + Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode()) | ||
37 | + ), | ||
38 | + | ||
39 | + ORDER_FAILED(6, "交易失败", | ||
40 | + Arrays.asList( | ||
41 | + OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(), | ||
35 | OrderStatus.SEND_OUT_TIMEOUT.getCode(), | 42 | OrderStatus.SEND_OUT_TIMEOUT.getCode(), |
36 | OrderStatus.CHECKING_FAKE.getCode(), | 43 | OrderStatus.CHECKING_FAKE.getCode(), |
37 | OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(), | 44 | OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(), |
38 | - OrderStatus.BUYER_CANCEL_TIMEOUT.getCode()), | ||
39 | - Collections.<Integer>emptyList()); | 45 | + OrderStatus.BUYER_CANCEL_TIMEOUT.getCode() |
46 | + ) | ||
47 | + ); | ||
40 | 48 | ||
41 | int type; | 49 | int type; |
42 | 50 | ||
43 | String desc; | 51 | String desc; |
44 | 52 | ||
45 | - List<Integer> sellerStatus; | ||
46 | - | ||
47 | - List<Integer> buyerStatus; | 53 | + List<Integer> status; |
48 | 54 | ||
49 | - SellerOrderListType(int type, String desc, List<Integer> buyerStatus, List<Integer> sellerStatus) { | 55 | + SellerOrderListType(int type, String desc, List<Integer> status) { |
50 | this.type = type; | 56 | this.type = type; |
51 | this.desc = desc; | 57 | this.desc = desc; |
52 | - this.buyerStatus = buyerStatus; | ||
53 | - this.sellerStatus = sellerStatus; | 58 | + this.status = status; |
54 | } | 59 | } |
55 | 60 | ||
61 | + static Map<Integer, SellerOrderListType> localCache = new HashMap<>(8); | ||
62 | + | ||
63 | + static { | ||
64 | + for(SellerOrderListType v : values()){ | ||
65 | + localCache.put(v.type, v); | ||
66 | + } | ||
67 | + } | ||
56 | /** | 68 | /** |
57 | * 检查是否存在该中查询类型 | 69 | * 检查是否存在该中查询类型 |
58 | * @param code | 70 | * @param code |
59 | * @return | 71 | * @return |
60 | */ | 72 | */ |
61 | public static SellerOrderListType getOrderListType(int code){ | 73 | public static SellerOrderListType getOrderListType(int code){ |
62 | - for(SellerOrderListType v : values()){ | ||
63 | - if(v.type == code){ | ||
64 | - return v; | ||
65 | - } | ||
66 | - } | ||
67 | - return null; | 74 | + return localCache.get(code); |
68 | } | 75 | } |
69 | 76 | ||
70 | public int getType() { | 77 | public int getType() { |
71 | return type; | 78 | return type; |
72 | } | 79 | } |
73 | 80 | ||
74 | - public List<Integer> getBuyerStatus() { | ||
75 | - return buyerStatus; | 81 | + public List<Integer> getStatus() { |
82 | + return status; | ||
76 | } | 83 | } |
77 | } | 84 | } |
@@ -4,26 +4,22 @@ package com.yohoufo.order.common; | @@ -4,26 +4,22 @@ package com.yohoufo.order.common; | ||
4 | 4 | ||
5 | public enum SellerOrderStatus { | 5 | public enum SellerOrderStatus { |
6 | 6 | ||
7 | - WAITING_PAY(0, "待付保证金", new ButtonShow[]{ButtonShow.PAY_EARNESTMONEY,ButtonShow.NOT_SOLD}), | ||
8 | - SELLER_CANCEL_PAY(1, "上架关闭(卖家取消支付)", new ButtonShow[]{ButtonShow.SHOW_DETAIL}), | ||
9 | - SELLER_CANCEL_TIMEOUT(2, "上架关闭(卖家支付超时)", new ButtonShow[]{ButtonShow.SHOW_DETAIL}), | ||
10 | - HAS_PAYED(3, "已支付", new ButtonShow[]{ButtonShow.SHOW_DETAIL, ButtonShow.DELIVER_GOODS, ButtonShow.NOT_SOLD}), | ||
11 | - SELLER_CANCEL_SELL(4, "上架关闭(卖家取消出售)", new ButtonShow[]{ButtonShow.SHOW_DETAIL}), | ||
12 | - BACKGROUNP_CANCEL_SELL(5, "上架关闭(平台取消出售)", new ButtonShow[]{ButtonShow.SHOW_DETAIL}), | ||
13 | - HAS_SELLED(6, "已售出", new ButtonShow[]{ButtonShow.SHOW_DETAIL}); | 7 | + WAITING_PAY(0, "待付保证金"), |
8 | + SELf_CANCEL_PAY(1, "上架关闭(卖家取消支付)"), | ||
9 | + TIMEOUT_CANCEL_(2, "上架关闭(卖家支付超时)"), | ||
10 | + HAS_PAYED(3, "已支付") | ||
11 | + ; | ||
14 | 12 | ||
15 | 13 | ||
16 | - SellerOrderStatus(int code, String desc, ButtonShow[] buttonShows) { | 14 | + SellerOrderStatus(int code, String desc) { |
17 | this.code = code; | 15 | this.code = code; |
18 | this.desc = desc; | 16 | this.desc = desc; |
19 | - this.buttonShows = buttonShows; | ||
20 | } | 17 | } |
21 | 18 | ||
22 | int code; | 19 | int code; |
23 | 20 | ||
24 | String desc; | 21 | String desc; |
25 | 22 | ||
26 | - ButtonShow[] buttonShows; | ||
27 | 23 | ||
28 | public String getDesc() { | 24 | public String getDesc() { |
29 | return desc; | 25 | return desc; |
1 | package com.yohoufo.order.common; | 1 | package com.yohoufo.order.common; |
2 | 2 | ||
3 | +import com.yohoufo.order.constants.OrderDetailDesc; | ||
4 | + | ||
5 | +import java.util.Arrays; | ||
6 | +import java.util.List; | ||
7 | + | ||
3 | public enum SkupStatus { | 8 | public enum SkupStatus { |
9 | + /** | ||
10 | + * 售出 | ||
11 | + */ | ||
12 | + SELL_OUT(2, "售出", new Node(null, null, null)), | ||
13 | + /** | ||
14 | + * 可售(已支付) | ||
15 | + */ | ||
16 | + CAN_SELL(1, "可售", | ||
17 | + new Node( | ||
18 | + Arrays.asList(ButtonShow.NOT_SOLD, ButtonShow.SHOW_DETAIL), | ||
19 | + Arrays.asList(ButtonShow.NOT_SOLD), | ||
20 | + OrderDetailDesc.Seller.PAY_FINISH | ||
21 | + ) | ||
22 | + ), | ||
23 | + /** | ||
24 | + * 不可售(未支付) | ||
25 | + */ | ||
26 | + CAN_NOT_SELL(0,"待付保证金", | ||
27 | + new Node( | ||
28 | + Arrays.asList(ButtonShow.NOT_SOLD, ButtonShow.PAY_EARNESTMONEY), | ||
29 | + Arrays.asList(ButtonShow.NOT_SOLD, ButtonShow.PAY_EARNESTMONEY), | ||
30 | + OrderDetailDesc.Seller.WAIT_PAY | ||
31 | + ) | ||
32 | + ), | ||
4 | 33 | ||
5 | - CAN_SELL(1), | ||
6 | - CAN_NOT_SELL(0); | 34 | + SELF_CANCEL_PAY(20, "上架关闭(卖家取消支付)", |
35 | + new Node( | ||
36 | + Arrays.asList(ButtonShow.SOLD_AGAIN, ButtonShow.DEL_ORDER, ButtonShow.SHOW_DETAIL), | ||
37 | + Arrays.asList(ButtonShow.DEL_ORDER, ButtonShow.SOLD_AGAIN), | ||
38 | + OrderDetailDesc.Seller.SELF_CANCEL_BEFORE_PAY | ||
39 | + ) | ||
40 | + ), | ||
41 | + TIMEOUT_CANCEL(21, "上架关闭(卖家支付超时)", | ||
42 | + new Node( | ||
43 | + Arrays.asList(ButtonShow.SOLD_AGAIN, ButtonShow.DEL_ORDER, ButtonShow.SHOW_DETAIL), | ||
44 | + Arrays.asList(ButtonShow.DEL_ORDER, ButtonShow.SOLD_AGAIN), | ||
45 | + OrderDetailDesc.Seller.TIME_OUT_CANCEL | ||
46 | + ) | ||
47 | + ), | ||
48 | + SELLER_CANCEL_SELL(22, "上架关闭(卖家取消出售)", | ||
49 | + new Node( | ||
50 | + Arrays.asList(ButtonShow.SOLD_AGAIN, ButtonShow.DEL_ORDER, ButtonShow.SHOW_DETAIL), | ||
51 | + Arrays.asList(ButtonShow.DEL_ORDER, ButtonShow.SOLD_AGAIN), | ||
52 | + OrderDetailDesc.Seller.SELF_CANCEL_BEFORE_EXIST_BUY | ||
53 | + ) | ||
54 | + ), | ||
55 | + YOHO_CANCEL_SELL(23, "上架关闭(平台取消出售)", | ||
56 | + new Node( | ||
57 | + Arrays.asList(ButtonShow.SOLD_AGAIN, ButtonShow.DEL_ORDER, ButtonShow.SHOW_DETAIL), | ||
58 | + Arrays.asList(ButtonShow.DEL_ORDER, ButtonShow.SOLD_AGAIN), | ||
59 | + OrderDetailDesc.Seller.YOHO_CANCEL_BEFORE_EXIST_BUY | ||
60 | + ) | ||
61 | + ) | ||
62 | + ; | ||
7 | 63 | ||
8 | - SkupStatus(int code) { | 64 | + SkupStatus(int code,String desc, Node node) { |
9 | this.code = code; | 65 | this.code = code; |
66 | + this.desc = desc; | ||
67 | + this.node = node; | ||
10 | } | 68 | } |
11 | 69 | ||
12 | int code; | 70 | int code; |
13 | 71 | ||
72 | + String desc; | ||
73 | + | ||
74 | + Node node; | ||
75 | + | ||
76 | + static class Node{ | ||
77 | + | ||
78 | + List<ButtonShow> listButtons; | ||
79 | + | ||
80 | + List<ButtonShow> detailButtons; | ||
81 | + | ||
82 | + String detailShowDesc; | ||
83 | + | ||
84 | + public Node(List<ButtonShow> listButtons, List<ButtonShow> detailButtons, String desc) { | ||
85 | + this.listButtons = listButtons; | ||
86 | + this.detailButtons = detailButtons; | ||
87 | + this.detailShowDesc = desc; | ||
88 | + } | ||
89 | + } | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | ||
94 | + | ||
14 | public int getCode() { | 95 | public int getCode() { |
15 | return code; | 96 | return code; |
16 | } | 97 | } |
17 | 98 | ||
18 | - public void setCode(int code) { | ||
19 | - this.code = code; | 99 | + |
100 | + public List<ButtonShow> getListButtons() { | ||
101 | + return node.listButtons; | ||
102 | + } | ||
103 | + | ||
104 | + public List<ButtonShow> getDetailButtons() { | ||
105 | + return node.detailButtons; | ||
106 | + } | ||
107 | + | ||
108 | + public String getDetailShowDesc() { | ||
109 | + return node.detailShowDesc; | ||
20 | } | 110 | } |
21 | } | 111 | } |
@@ -77,5 +77,21 @@ public interface OrderDetailDesc { | @@ -77,5 +77,21 @@ public interface OrderDetailDesc { | ||
77 | String BUYER_HAS_PAID = "买家已付款,请于48小时内发货,超时发货系统自动取消订单并下架商品,您支付的保证金将作为补偿赔付给买家"; | 77 | String BUYER_HAS_PAID = "买家已付款,请于48小时内发货,超时发货系统自动取消订单并下架商品,您支付的保证金将作为补偿赔付给买家"; |
78 | 78 | ||
79 | String BUYER_NO_PAY = "等待买家付款,15分钟未付款将自动取消订单并重新上架商品"; | 79 | String BUYER_NO_PAY = "等待买家付款,15分钟未付款将自动取消订单并重新上架商品"; |
80 | + | ||
81 | + // | ||
82 | + String WAIT_PAY = "请在15分钟内支付保证金,超时将自动取消出售申请", | ||
83 | + | ||
84 | + SELF_CANCEL_BEFORE_PAY = "您已取消商品出售", | ||
85 | + | ||
86 | + TIME_OUT_CANCEL = "支付保证金超时自动取消", | ||
87 | + | ||
88 | + PAY_FINISH = "商品已上架,等待买家购买", | ||
89 | + | ||
90 | + SELF_CANCEL_BEFORE_EXIST_BUY = "您已取消商品售卖,保证金已退还至您的支付账户,请注意查收", | ||
91 | + | ||
92 | + YOHO_CANCEL_BEFORE_EXIST_BUY = "系统下架,保证金已退还至您的支付账户,请注意查收,如有疑问请联系客服"; | ||
93 | + | ||
94 | + | ||
95 | + | ||
80 | } | 96 | } |
81 | } | 97 | } |
-
Please register or login to post a comment