init
This commit is contained in:
@@ -8,10 +8,20 @@ public class OrderNoUtil {
|
||||
|
||||
public static final Snowflake snowflake = IdUtil.getSnowflake(1, 1);
|
||||
|
||||
public static final String VIP_ORDER_SUB = "V";
|
||||
public static final String RECHARGE_ORDER_SUB = "R";
|
||||
public static String createOrderNo(OrderTypeEnum sub){
|
||||
return sub.getType() + snowflake.nextIdStr();
|
||||
}
|
||||
|
||||
public static String createOrderNo(String sub){
|
||||
return sub + snowflake.nextIdStr();
|
||||
public static OrderTypeEnum getType(String orderNo){
|
||||
if(orderNo == null){
|
||||
return null;
|
||||
}
|
||||
OrderTypeEnum[] values = OrderTypeEnum.values();
|
||||
for (OrderTypeEnum value : values) {
|
||||
if(orderNo.startsWith(value.getType())){
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user