admin
2021-11-19 4daec329f36cc9d86911c08b8ec8e00270792189
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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_", ""));
    }
 
 
}