SequenceUtil.java
568 Bytes
package com.rnt.utils;
import com.jfinal.kit.PropKit;
public class SequenceUtil {
/**
*
* @param prx 订单类型
*/
public static String getNextOrderId(String orderType) {
PropKit.use("a_little_config.txt");
SnowflakeIdWorker idWorker = new SnowflakeIdWorker(Long.parseLong(PropKit.get("workerId")),Long.parseLong(PropKit.get("datacenterId")));
long id = idWorker.nextId();
if(orderType != null && orderType !=""){
return orderType+id;
}else{
return id+"";
}
}
}