|
|
@ -51,16 +51,11 @@ public class OrderUtil { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static String generateOrderNo() { |
|
|
|
public static String generateOrderNo() throws Exception { |
|
|
|
try { |
|
|
|
|
|
|
|
// 5位随机数 + 1位线程生成数
|
|
|
|
// 5位随机数 + 1位线程生成数
|
|
|
|
String randomNum = (new Random().nextInt(8999) + 1000) + IDGenerator.nextId(1); |
|
|
|
String randomNum = (new Random().nextInt(8999) + 1000) + IDGenerator.nextId(1); |
|
|
|
// 生成订单号
|
|
|
|
// 生成订单号
|
|
|
|
return DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + randomNum; |
|
|
|
return DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + randomNum; |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|