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

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

增加下单接口总耗时

parent 4dfeb069
...@@ -113,11 +113,12 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -113,11 +113,12 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
public ResponseDto<PayResultVo> checkCanOrder(PayOrderParam payOrderParam) { public ResponseDto<PayResultVo> checkCanOrder(PayOrderParam payOrderParam) {
Long currentTime; Long currentTime;
boolean isDownGeneral = false; boolean isDownGeneral = false;
Long startTime = System.currentTimeMillis();
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
String lock = "userId:" + uid; String lock = "userId:" + uid;
if (!redisLockUtil.tryLock(lock, 1, 5)) { // if (!redisLockUtil.tryLock(lock, 1, 5)) {
return ResponseDto.failure(ErrorMapping.get("20023"));//参数错误 // return ResponseDto.failure(ErrorMapping.get("20023"));//参数错误
} // }
try { try {
currentTime = System.currentTimeMillis(); currentTime = System.currentTimeMillis();
KylinPerformanceVo performanceData = dataUtils.getPerformanceVo(payOrderParam.getPerformanceId()); KylinPerformanceVo performanceData = dataUtils.getPerformanceVo(payOrderParam.getPerformanceId());
...@@ -308,7 +309,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -308,7 +309,8 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
} }
ResponseDto<PayResultVo> resultData = order(payOrderParam, uid, isMember, isTrueName, performanceData, ticketData, entersVoList, isStudent, ticketTimesData, currentTime); 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; return resultData;
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -333,7 +335,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -333,7 +335,6 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
//生成订单 order_ticket //生成订单 order_ticket
KylinOrderTickets orderTickets = new KylinOrderTickets(); KylinOrderTickets orderTickets = new KylinOrderTickets();
String orderTicketId = IDGenerator.nextSnowId().toString(); String orderTicketId = IDGenerator.nextSnowId().toString();
log.debug("\n ORDER_TICKET_ID = " + orderTicketId + " \n TIME = " + System.currentTimeMillis());
orderTickets.setOrderTicketsId(orderTicketId); orderTickets.setOrderTicketsId(orderTicketId);
orderTickets.setUserId(uid); orderTickets.setUserId(uid);
Map token = CurrentUtil.getTokenClaims(); 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