"拉卡拉进件支付代码"
This commit is contained in:
@@ -611,12 +611,23 @@ public class DateUtils {
|
||||
return Math.abs(hours);
|
||||
}
|
||||
private final static SimpleDateFormat sdfTimes = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
|
||||
public static String getSdfTimes() {
|
||||
return sdfTimes.format(new Date());
|
||||
}
|
||||
|
||||
public static Date convertDate(String date) {
|
||||
try {
|
||||
return sdf.parse(date);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws ParseException {
|
||||
|
||||
System.out.println(convertDate("20230603163342"));
|
||||
//List<String> last6Months = getLast6Months();
|
||||
// List<String> last6Months = new ArrayList<>();
|
||||
// last6Months.add("2019-11");
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.pluss.platform.util;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author Exrickx
|
||||
*/
|
||||
@Slf4j
|
||||
public class SnowFlakeUtil {
|
||||
|
||||
/**
|
||||
* 派号器workid:0~31
|
||||
* 机房datacenterid:0~31
|
||||
*/
|
||||
private static Snowflake snowflake = IdUtil.createSnowflake(1, 1);
|
||||
|
||||
public static Long nextId() {
|
||||
return snowflake.nextId();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user