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

Commit 9572d519 authored by 胡佳晨's avatar 胡佳晨

修改 data

parent 99a90bbb
......@@ -119,7 +119,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
// }
try {
KylinPerformanceVo performanceData = dataUtils.getPerformanceVo(payOrderParam.getPerformanceId());
log.debug("获取演出详情 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 获取演出详情 -> time:"+currentTime+"毫秒");
KylinTicketTimesVo ticketTimesData = null;
KylinTicketVo ticketData = null;
for (int x = 0; x < performanceData.getTicketTimeList().size(); x++) {
......@@ -158,7 +159,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
String timeEnd = ticketData.getTimeEnd(); // 购票停售时间
String timeExpressEnd = ticketData.getTimeEndExpress(); // 快递停售时间
boolean isMember = feignAdamBaseClient.isMember(uid).getData();//获取是否是会员
log.debug("fegin 会员 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("fegin 会员 -> time:"+(currentTime)+"毫秒");
// boolean isMember = true;
int memberType; //会员状态 不需要判断会员 1判断会员逻辑 2会员专属
if (ticketData.getIsExclusive() == 1) {
......@@ -228,10 +230,12 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
// 判断库存
int surplusGeneral = dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), -payOrderParam.getNumber());
log.debug("获取库存 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 获取库存 -> time:"+(currentTime)+"毫秒");
if (surplusGeneral < 0) {//库存回滚
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
log.debug("修改库存 售罄 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 修改库存 售罄 -> time:"+(currentTime)+"毫秒");
//redisLockUtil.unlock(lock);
return ResponseDto.failure("该票种已售罄");//没抢到
} else {
......@@ -251,7 +255,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
}
}
}
log.debug("获取 feign 入场人 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("获取 feign 入场人 -> time:"+(currentTime)+"毫秒");
}
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
......@@ -264,7 +269,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
if (entersVoList.size() > 0) {
for (int i = 0; i < entersVoList.size(); i++) {
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, entersVoList.get(i).getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, 1, 1, memberType, isTrueName);
log.debug("判断库存 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 判断库存 -> time:"+(currentTime)+"毫秒");
if (!res1.equals("")) {
//redisLockUtil.unlock(lock);
return ResponseDto.failure(res1);//乱七八糟异常
......@@ -272,7 +278,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
}
} else {
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, "", payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, payOrderParam.getNumber(), payOrderParam.getNumber(), memberType, isTrueName);
log.debug("判断库存 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 判断库存 -> time:"+(currentTime)+"毫秒");
if (!res1.equals("")) {
//redisLockUtil.unlock(lock);
return ResponseDto.failure(res1);//乱七八糟异常
......@@ -284,7 +291,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
} catch (Exception e) {
if (isDownGeneral) {
dataUtils.changeSurplusGeneral(payOrderParam.getTicketId(), payOrderParam.getNumber());
log.debug("修改库存 异常 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 修改库存 异常 -> time:"+(currentTime)+"毫秒");
}
e.printStackTrace();
log.error("Kylin Order Pay Error = " + e.getMessage());
......@@ -342,7 +350,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTickets.setExpressAddress(addressesVo.getAddress());
orderTickets.setExpressPhone(addressesVo.getPhone());
orderTickets.setGetTicketType("express");
log.debug("feign 获取入场人 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("feign 获取入场人 -> time:"+(currentTime)+"毫秒");
} else {
orderTickets.setExpressContacts("");
orderTickets.setExpressAddress("");
......@@ -431,9 +440,11 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTicketEntitiesVo.setUpdatedAt(null);
orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt());
mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName());
log.debug("mongo 添加入场人 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("mongo 添加入场人 -> time:"+(currentTime)+"毫秒");
dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1);
log.debug("redis 修改 限购 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 修改 限购 -> time:"+(currentTime)+"毫秒");
}
} else {
for (int i = 0; i < payOrderParam.getNumber(); i++) {
......@@ -469,9 +480,11 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTicketEntitiesVo.setUpdatedAt(null);
orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt());
mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName());
log.debug("mongo 添加入场人 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("mongo 添加入场人 -> time:"+(currentTime)+"毫秒");
dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1);
log.debug("redis 修改限购 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 修改限购 -> time:"+(currentTime)+"毫秒");
}
}
// 调用支付
......@@ -504,7 +517,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
}
String returnData = HttpUtil.post(payUrl + payOrderParam.getDeviceFrom() + "/" + payOrderParam.getPayType(), httpData);
log.debug("调用 PHP 支付 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("调用 PHP 支付 -> time:"+(currentTime)+"毫秒");
PayResultVo payResultVo = JsonUtils.fromJson(returnData, PayResultVo.class);
payResultVo.setOrder_id(orderTicketId);
payResultVo.setPrice(orderTickets.getPriceActual());
......@@ -530,16 +544,19 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTicketVo.setCreatedAt(orderTickets.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
orderTicketVo.setChangeDate(orderTickets.getCreatedAt());
mongoTemplate.insert(orderTicketVo, KylinOrderTicketVo.class.getSimpleName());
log.debug("mongo 添加 订单 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("mongo 添加 订单 -> time:"+(currentTime)+"毫秒");
mongoVoUtils.resetOrderListVo(uid, 1, orderTicketVo.getOrderTicketsId());
log.debug("redis 修改订单列表 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("redis 修改订单列表 -> time:"+(currentTime)+"毫秒");
// 执行sql
String sqlData = SqlMapping.gets(sqls, sqlsDataB, sqlsDataC, sqlsDataD, sqlsDataA);
rabbitTemplate.convertAndSend(MQConst.EXCHANGES_LIQUIDNET_SQL_ORDER_CREADE, MQConst.ROUTING_KEY_SQL_ORDER_CREATE,
sqlData);
log.debug("MQ 发送 -> time:"+(System.currentTimeMillis()-currentTime)+"毫秒");
currentTime=System.currentTimeMillis()-currentTime;
log.debug("MQ 发送 -> time:"+(currentTime)+"毫秒");
return ResponseDto.success(payResultVo);
}
......
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