生成订单报错

This commit is contained in:
谭凯凯 2025-01-06 15:22:53 +08:00 committed by Tankaikai
parent bff6bbb8f3
commit 42cd464a33
2 changed files with 6 additions and 10 deletions

View File

@ -327,7 +327,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
}
} catch (Exception e) {
log.error("生成商品订单错误!!!" + e.getMessage());
log.error("生成商品订单错误!!!", e);
}
// finally {
// reentrantReadWriteLock.writeLock().unlock();

View File

@ -1,8 +1,5 @@
package com.sqx.modules.utils;
import cn.hutool.core.lang.Singleton;
import cn.hutool.core.lang.Snowflake;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
@ -71,12 +68,11 @@ public class AliPayOrderUtil {
// d 代表参数为正数型
return machineId+String.format("%015d", hashCodeV);*/
// return IdUtil.getSnowflake(1, 1).nextIdStr();
// 经测试高并发下单机生成ID的速度能达到每秒10万以上无ID重复的风险
return Singleton.get(Snowflake.class).nextIdStr();
UUID uuid = UUID.randomUUID();
return uuid.toString().replace("-", "");
}
/**
* 获取当前日期是星期几<br>
*