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

Commit b67cc9cf authored by 胡佳晨's avatar 胡佳晨

下单回滚 限购

parent b645ded0
...@@ -110,6 +110,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -110,6 +110,7 @@ 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;
List<AdamEntersVo> entersVoList = new ArrayList<>();
Long startTime = System.currentTimeMillis(); Long startTime = System.currentTimeMillis();
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
String lock = "userId:" + uid; String lock = "userId:" + uid;
...@@ -260,7 +261,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -260,7 +261,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
isDownGeneral = true; isDownGeneral = true;
//学生票 判断 //学生票 判断
List<AdamEntersVo> entersVoList = new ArrayList<>(); entersVoList = new ArrayList<>();
if (isTrueName == 1) { if (isTrueName == 1) {
currentTime = System.currentTimeMillis(); currentTime = System.currentTimeMillis();
for (String enterId : payOrderParam.getEnterIdList()) { for (String enterId : payOrderParam.getEnterIdList()) {
...@@ -318,6 +319,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -318,6 +319,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber()); dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
log.debug("redis 修改库存 异常 -> time:" + (currentTime) + "毫秒"); log.debug("redis 修改库存 异常 -> time:" + (currentTime) + "毫秒");
for (AdamEntersVo enters : entersVoList) {
dataUtils.changeBuyInfo(uid, enters.getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), -1);
}
if (entersVoList.size() == 0) {
for (int i = 0; i < payOrderParam.getNumber(); i++) {
dataUtils.changeBuyInfo(uid, "", payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), -1);
}
}
} }
e.printStackTrace(); e.printStackTrace();
log.error("Kylin Order Pay Error = " + e.getMessage()); log.error("Kylin Order Pay Error = " + e.getMessage());
...@@ -1153,12 +1162,12 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService { ...@@ -1153,12 +1162,12 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsService {
} }
Map token = CurrentUtil.getTokenClaims(); Map token = CurrentUtil.getTokenClaims();
String username = StringUtils.defaultString(((String) token.get("nickname")), ""); String username = StringUtils.defaultString(((String) token.get("nickname")), "");
// String result = refundsStatusService.userOrderTicketRefunding(orderTicketVo, refundSinglePrice.doubleValue(), orderTicketEntitiesId, reason, picList, uid, username, kylinOrderRefundsVoBaseList.size()); String result = refundsStatusService.userOrderTicketRefunding(orderTicketVo, refundSinglePrice.doubleValue(), orderTicketEntitiesId, reason, picList, uid, username, kylinOrderRefundsVoBaseList.size());
// if (result != "") { if (result != "") {
// return ResponseDto.success(result); return ResponseDto.success(result);
// } else { } else {
return ResponseDto.failure(ErrorMapping.get("20019")); return ResponseDto.failure(ErrorMapping.get("20019"));
// } }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return ResponseDto.failure(ErrorMapping.get("20019")); return ResponseDto.failure(ErrorMapping.get("20019"));
......
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