Commit 40cc98bf by 周晓航

修复 枚举判断问题

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 72cae5aa
...@@ -14,6 +14,10 @@ package com.freemud.sdk.api.assortment.order.enums; ...@@ -14,6 +14,10 @@ package com.freemud.sdk.api.assortment.order.enums;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
/**
* com.freemud.application.sdk.api.ordercenter.enums.OrderClientType
* 两个枚举类 需要同步加, 不然在订单业务代码中 会报错
*/
public enum OrderSourceType { public enum OrderSourceType {
WE_CHAT("we_chat", "自营微信小程序", 1), WE_CHAT("we_chat", "自营微信小程序", 1),
SAAS("saas", "saas 点餐", 2), SAAS("saas", "saas 点餐", 2),
...@@ -46,6 +50,7 @@ public enum OrderSourceType { ...@@ -46,6 +50,7 @@ public enum OrderSourceType {
ASSISTANT("assistant","非码小助手", 29), ASSISTANT("assistant","非码小助手", 29),
SHERPAS("sherpas","食派士", 30), SHERPAS("sherpas","食派士", 30),
CASHIER("cashier", "收银单", 36), CASHIER("cashier", "收银单", 36),
WE_CHAT_LIVE_SELL("we_chat_live_sell", "微信视频卖券", 37),
parkingmanual("parkingmanual", "农工商停车手工录单", 98), parkingmanual("parkingmanual", "农工商停车手工录单", 98),
PARKING("parking", "农工商停车", 99), PARKING("parking", "农工商停车", 99),
SDG("sdg", "闪电购", 1000); SDG("sdg", "闪电购", 1000);
...@@ -64,7 +69,8 @@ public enum OrderSourceType { ...@@ -64,7 +69,8 @@ public enum OrderSourceType {
if (e.getCode().equals(code)) if (e.getCode().equals(code))
return e; return e;
} }
return null; // 没查询到 默认设置 saas
return OrderSourceType.SAAS;
} }
/** /**
......
...@@ -11,6 +11,10 @@ package com.freemud.application.sdk.api.ordercenter.enums; ...@@ -11,6 +11,10 @@ package com.freemud.application.sdk.api.ordercenter.enums;
* @date: 2019/4/2 13:44 * @date: 2019/4/2 13:44
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved. * @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目 * 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
* <p>
* <p>
* * com.freemud.application.sdk.api.ordercenter.enums.OrderClientType
* * 两个枚举类 需要同步加, 不然在订单业务代码中 会报错
*/ */
public enum OrderClientType { public enum OrderClientType {
...@@ -18,7 +22,7 @@ public enum OrderClientType { ...@@ -18,7 +22,7 @@ public enum OrderClientType {
SAAS(2, "i点餐"), SAAS(2, "i点餐"),
ALIPAY(3, "自营支付宝小程序"), ALIPAY(3, "自营支付宝小程序"),
HTML5(4, "自营H5"), HTML5(4, "自营H5"),
ANDROID( 5, "自营安卓APP"), ANDROID(5, "自营安卓APP"),
IOS(6, "自营苹果APP"), IOS(6, "自营苹果APP"),
PC_WEB(7, "自营PC-WEB"), PC_WEB(7, "自营PC-WEB"),
ELEME(8, "饿了么"), ELEME(8, "饿了么"),
...@@ -27,9 +31,9 @@ public enum OrderClientType { ...@@ -27,9 +31,9 @@ public enum OrderClientType {
MEITUAN(11, "美团外卖"), MEITUAN(11, "美团外卖"),
APP(12, "自营APP"), APP(12, "自营APP"),
I_MEMBER(13, "i应用会员"), I_MEMBER(13, "i应用会员"),
I_CARGO(14 , "i应用订货"), I_CARGO(14, "i应用订货"),
POS(15 , "POS"), POS(15, "POS"),
WAI_MEAL(19,"i围餐"), WAI_MEAL(19, "i围餐"),
JUBAOPEN(20, "美团服务商"), JUBAOPEN(20, "美团服务商"),
DIANPING(21, "美团点评"), DIANPING(21, "美团点评"),
KOUBEI(22, "口碑"), KOUBEI(22, "口碑"),
...@@ -39,8 +43,8 @@ public enum OrderClientType { ...@@ -39,8 +43,8 @@ public enum OrderClientType {
TIKTOKPAY(27, "抖音小程序"), TIKTOKPAY(27, "抖音小程序"),
BEAUTIFUL(28, "美业"), BEAUTIFUL(28, "美业"),
ASSISTANT(29, "非码小助手"), ASSISTANT(29, "非码小助手"),
SHERPAS(30,"食派士"), SHERPAS(30, "食派士"),
PARKING(99 , "农工商停车"), PARKING(99, "农工商停车"),
CASHIER(36, "收银买单"), CASHIER(36, "收银买单"),
WE_CHAT_LIVE_SELL(37, "微信视频卖券"), WE_CHAT_LIVE_SELL(37, "微信视频卖券"),
; ;
...@@ -70,9 +74,9 @@ public enum OrderClientType { ...@@ -70,9 +74,9 @@ public enum OrderClientType {
this.name = name; this.name = name;
} }
public static OrderClientType getOrderClientType(Integer index){ public static OrderClientType getOrderClientType(Integer index) {
for (OrderClientType orderType : values()){ for (OrderClientType orderType : values()) {
if (index.equals(orderType.getIndex())){ if (index.equals(orderType.getIndex())) {
return orderType; return orderType;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment