|
|
@@ -3,7 +3,11 @@ package com.zhongzheng.common.utils;
|
|
|
import java.lang.management.ManagementFactory;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Date;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.RandomStringUtils;
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
|
|
/**
|
|
|
@@ -157,4 +161,19 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|
|
{
|
|
|
return System.currentTimeMillis()/1000;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取日期格式订单号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String getDateOrderSn()
|
|
|
+ {
|
|
|
+ DateTimeFormatter ofPattern = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
|
|
|
+ String localDate = LocalDateTime.now().format(ofPattern);
|
|
|
+ //随机数
|
|
|
+ String randomNumeric = RandomStringUtils.randomNumeric(8);
|
|
|
+ return randomNumeric;
|
|
|
+ }
|
|
|
+
|
|
|
}
|