package com.ks.app.utils.vip;
|
|
import com.ks.app.entity.SystemEnum;
|
import com.ks.app.entity.vip.OrderType;
|
|
/**
|
* @author hxh
|
* @title: VIPOrderUtil
|
* @description: TODO
|
* @date 2021/11/17 14:59
|
*/
|
public class VIPOrderUtil {
|
|
/**
|
* 获取第三方订单号
|
*
|
* @param orderType
|
* @param id
|
* @return
|
*/
|
public static String getOutOrderNo(SystemEnum system, OrderType orderType, Long id) {
|
if (orderType == OrderType.vip) {
|
return system.name() + "_vip_" + id;
|
}
|
|
return null;
|
}
|
|
|
public static Long getIdFromOutOrderNo(String orderNo) {
|
String system = orderNo.split("_")[0];
|
return Long.parseLong(orderNo.replace(system + "_vip_", ""));
|
}
|
|
|
}
|