记得上下班打卡 | git大法好,push需谨慎

Commit 0cabb623 authored by 胡佳晨's avatar 胡佳晨

增加下单接口总耗时

parent 4dfeb069
......@@ -113,11 +113,12 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
public ResponseDto<PayResultVo> checkCanOrder(PayOrderParam payOrderParam) {
Long currentTime;
boolean isDownGeneral = false;
Long startTime = System.currentTimeMillis();
String uid = CurrentUtil.getCurrentUid();
String lock = "userId:" + uid;
if (!redisLockUtil.tryLock(lock, 1, 5)) {
return ResponseDto.failure(ErrorMapping.get("20023"));//参数错误
}
// if (!redisLockUtil.tryLock(lock, 1, 5)) {
// return ResponseDto.failure(ErrorMapping.get("20023"));//参数错误
// }
try {
currentTime = System.currentTimeMillis();
KylinPerformanceVo performanceData = dataUtils.getPerformanceVo(payOrderParam.getPerformanceId());
......@@ -308,7 +309,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
}
ResponseDto<PayResultVo> resultData = order(payOrderParam, uid, isMember, isTrueName, performanceData, ticketData, entersVoList, isStudent, ticketTimesData, currentTime);
redisLockUtil.unlock(lock);
// redisLockUtil.unlock(lock);
log.debug("总耗时 ->"+(System.currentTimeMillis()-startTime)+"毫秒");
return resultData;
}
} catch (Exception e) {
......@@ -333,7 +335,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
//生成订单 order_ticket
KylinOrderTickets orderTickets = new KylinOrderTickets();
String orderTicketId = IDGenerator.nextSnowId().toString();
log.debug("\n ORDER_TICKET_ID = " + orderTicketId + " \n TIME = " + System.currentTimeMillis());
orderTickets.setOrderTicketsId(orderTicketId);
orderTickets.setUserId(uid);
Map token = CurrentUtil.getTokenClaims();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment