"拉卡拉进件支付代码"

This commit is contained in:
hankaikai
2023-06-05 14:27:09 +08:00
parent 20961894dc
commit ecbdd3f0b1
23 changed files with 632 additions and 221 deletions

View File

@@ -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");

View File

@@ -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 {
/**
* 派号器workid0~31
* 机房datacenterid0~31
*/
private static Snowflake snowflake = IdUtil.createSnowflake(1, 1);
public static Long nextId() {
return snowflake.nextId();
}
}