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

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

提交 同步 大麦

parent 3ebfd60d
...@@ -107,13 +107,13 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -107,13 +107,13 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
KylinPerformanceVo performanceData = dataUtils.getPerformanceVo(payOrderParam.getPerformanceId()); KylinPerformanceVo performanceData = dataUtils.getPerformanceVo(payOrderParam.getPerformanceId());
KylinTicketTimesVo ticketTimesData = null; KylinTicketTimesVo ticketTimesData = null;
KylinTicketVo ticketData = null; KylinTicketVo ticketData = null;
for (int x = 0 ; x<performanceData.getTicketTimeList().size();x++){ for (int x = 0; x < performanceData.getTicketTimeList().size(); x++) {
KylinTicketTimesVo timeItem = performanceData.getTicketTimeList().get(x); KylinTicketTimesVo timeItem = performanceData.getTicketTimeList().get(x);
if(timeItem.getTimeId().equals(payOrderParam.getTimeId())){ if (timeItem.getTimeId().equals(payOrderParam.getTimeId())) {
ticketTimesData = timeItem; ticketTimesData = timeItem;
for (int y = 0 ; y < ticketTimesData.getTicketList().size();y++){ for (int y = 0; y < ticketTimesData.getTicketList().size(); y++) {
KylinTicketVo ticketItem = ticketTimesData.getTicketList().get(y); KylinTicketVo ticketItem = ticketTimesData.getTicketList().get(y);
if(ticketItem.getTimeId().equals(payOrderParam.getTicketId())){ if (ticketItem.getTimeId().equals(payOrderParam.getTicketId())) {
ticketData = ticketItem; ticketData = ticketItem;
break; break;
} }
...@@ -310,7 +310,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -310,7 +310,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
} }
} }
lock.unlock(); lock.unlock();
return order(payOrderParam, uid, isMember, isTrueName, performanceData, ticketData, entersVoList, isStudent); return order(payOrderParam, uid, isMember, isTrueName, performanceData, ticketData, entersVoList, isStudent, ticketTimesData);
} }
} catch (Exception e) { } catch (Exception e) {
if (isDownGeneral) { if (isDownGeneral) {
...@@ -323,7 +323,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -323,7 +323,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
} }
} }
private ResponseDto<PayResultVo> order(PayOrderParam payOrderParam, String uid, boolean isMember, int isTrueName, KylinPerformanceVo performanceData, KylinTicketVo ticketData, List<AdamEntersVo> entersVoList, Integer isStudent) { private ResponseDto<PayResultVo> order(PayOrderParam payOrderParam, String uid, boolean isMember, int isTrueName, KylinPerformanceVo performanceData, KylinTicketVo ticketData, List<AdamEntersVo> entersVoList, Integer isStudent, KylinTicketTimesVo ticketTimesData) {
LinkedList<String> sqls = new LinkedList<>(); LinkedList<String> sqls = new LinkedList<>();
String source = CurrentUtil.getCliSource() == null ? "" : CurrentUtil.getCliSource(); String source = CurrentUtil.getCliSource() == null ? "" : CurrentUtil.getCliSource();
String version = CurrentUtil.getCliVersion() == null ? "" : CurrentUtil.getCliVersion(); String version = CurrentUtil.getCliVersion() == null ? "" : CurrentUtil.getCliVersion();
...@@ -448,6 +448,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -448,6 +448,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTicketEntitiesVo.setTicketTitle(ticketData.getTitle()); orderTicketEntitiesVo.setTicketTitle(ticketData.getTitle());
orderTicketEntitiesVo.setUseStart(ticketData.getUseStart()); orderTicketEntitiesVo.setUseStart(ticketData.getUseStart());
orderTicketEntitiesVo.setUseEnd(ticketData.getUseEnd()); orderTicketEntitiesVo.setUseEnd(ticketData.getUseEnd());
orderTicketEntitiesVo.setTicketsmId(ticketData.getMid());
orderTicketEntitiesVo.setTimemId(ticketTimesData.getMid());
orderTicketEntitiesVo.setCreatedAt(orderTicketEntities.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); orderTicketEntitiesVo.setCreatedAt(orderTicketEntities.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
orderTicketEntitiesVo.setUpdatedAt(null); orderTicketEntitiesVo.setUpdatedAt(null);
mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName()); mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName());
...@@ -481,6 +483,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -481,6 +483,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTicketEntitiesVo.setTicketTitle(ticketData.getTitle()); orderTicketEntitiesVo.setTicketTitle(ticketData.getTitle());
orderTicketEntitiesVo.setUseStart(ticketData.getUseStart()); orderTicketEntitiesVo.setUseStart(ticketData.getUseStart());
orderTicketEntitiesVo.setUseEnd(ticketData.getUseEnd()); orderTicketEntitiesVo.setUseEnd(ticketData.getUseEnd());
orderTicketEntitiesVo.setTicketsmId(ticketData.getMid());
orderTicketEntitiesVo.setTimemId(ticketTimesData.getMid());
orderTicketEntitiesVo.setCreatedAt(orderTicketEntities.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); orderTicketEntitiesVo.setCreatedAt(orderTicketEntities.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
orderTicketEntitiesVo.setUpdatedAt(null); orderTicketEntitiesVo.setUpdatedAt(null);
mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName()); mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName());
...@@ -730,7 +734,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -730,7 +734,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
// 发短信 // 发短信
// 大麦回调 // 大麦回调
// sycOrder(orderTickets.getOrderTicketsId()); sycDamaiOrder(orderTickets.getOrderTicketsId());
return "success"; return "success";
} }
...@@ -837,66 +841,61 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -837,66 +841,61 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
@Override @Override
public boolean checkOrderTime(String userId) { public boolean checkOrderTime(String userId) {
try { Query query = new Query();
Query query = new Query(); query.addCriteria(Criteria.where("status").is(KylinTableStatusConst.ORDER_STATUS0).and("overdueAt").lte(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))));
query.addCriteria(Criteria.where("status").is(KylinTableStatusConst.ORDER_STATUS0).and("overdueAt").lte(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); if (null != userId) {
if (null != userId) { query.addCriteria(Criteria.where("userId").is(userId));
query.addCriteria(Criteria.where("userId").is(userId)); }
} List<KylinOrderTicketVo> orderTicketVo = mongoTemplate.find(query,
List<KylinOrderTicketVo> orderTicketVo = mongoTemplate.find(query, KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName());
KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName());
for (KylinOrderTicketVo item : orderTicketVo) { for (KylinOrderTicketVo item : orderTicketVo) {
if (!RedisLockUtil.tryLock("order_lock:" + item.getOrderCode(), 240, 240)) { if (!RedisLockUtil.tryLock("order_lock:" + item.getOrderCode(), 240, 240)) {
continue; continue;
} }
RLock lock = redisLockUtil.lock("order_lock:" + item.getOrderCode(), 240); RLock lock = redisLockUtil.lock("order_lock:" + item.getOrderCode(), 240);
KylinOrderTicketVo itemData = dataUtils.getOrderTicketVo(item.getOrderTicketsId()); KylinOrderTicketVo itemData = dataUtils.getOrderTicketVo(item.getOrderTicketsId());
if (itemData.getStatus() == KylinTableStatusConst.ORDER_STATUS0) { if (itemData.getStatus() == KylinTableStatusConst.ORDER_STATUS0) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
try { try {
//mysql //mysql
KylinOrderTickets orderTickets = new KylinOrderTickets(); KylinOrderTickets orderTickets = new KylinOrderTickets();
orderTickets.setOrderTicketsId(item.getOrderTicketsId()); orderTickets.setOrderTicketsId(item.getOrderTicketsId());
orderTickets.setUpdatedAt(now); orderTickets.setUpdatedAt(now);
KylinOrderTicketStatus orderTicketStatus = new KylinOrderTicketStatus(); KylinOrderTicketStatus orderTicketStatus = new KylinOrderTicketStatus();
orderTicketStatus.setOrderId(item.getOrderTicketsId()); orderTicketStatus.setOrderId(item.getOrderTicketsId());
orderTicketStatus.setStatus(KylinTableStatusConst.ORDER_STATUS2); orderTicketStatus.setStatus(KylinTableStatusConst.ORDER_STATUS2);
orderTicketStatus.setUpdatedAt(now); orderTicketStatus.setUpdatedAt(now);
//vo //vo
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("status", KylinTableStatusConst.ORDER_STATUS2); map.put("status", KylinTableStatusConst.ORDER_STATUS2);
map.put("updatedAt", now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); map.put("updatedAt", now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
mongoTemplate.getCollection(KylinOrderTicketVo.class.getSimpleName()).updateOne( mongoTemplate.getCollection(KylinOrderTicketVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderTicketsId").is(orderTickets.getOrderTicketsId())).getQueryObject(), Query.query(Criteria.where("orderTicketsId").is(orderTickets.getOrderTicketsId())).getQueryObject(),
new BasicDBObject("$set", mongoConverter.convertToMongoType(map)) new BasicDBObject("$set", mongoConverter.convertToMongoType(map))
); );
dataUtils.delOrderTicketRedis(orderTickets.getOrderTicketsId()); dataUtils.delOrderTicketRedis(orderTickets.getOrderTicketsId());
dataUtils.changeSurplusGeneral(itemData.getTicketId(), itemData.getNumber()); dataUtils.changeSurplusGeneral(itemData.getTicketId(), itemData.getNumber());
rabbitTemplate.convertAndSend(MQConst.EXCHANGES_LIQUIDNET_SQL, MQConst.ROUTING_KEY_SQL, rabbitTemplate.convertAndSend(MQConst.EXCHANGES_LIQUIDNET_SQL, MQConst.ROUTING_KEY_SQL,
SqlMapping.get("kylin_order_ticket.close", orderTickets.getCloseOrderObject())); SqlMapping.get("kylin_order_ticket.close", orderTickets.getCloseOrderObject()));
rabbitTemplate.convertAndSend(MQConst.EXCHANGES_LIQUIDNET_SQL, MQConst.ROUTING_KEY_SQL, rabbitTemplate.convertAndSend(MQConst.EXCHANGES_LIQUIDNET_SQL, MQConst.ROUTING_KEY_SQL,
SqlMapping.get("kylin_order_ticket_status.close", orderTicketStatus.getCloseOrderObject())); SqlMapping.get("kylin_order_ticket_status.close", orderTicketStatus.getCloseOrderObject()));
} catch (Exception e) { } catch (Exception e) {
lock.unlock();
e.printStackTrace();
return false;
}
} else {
lock.unlock(); lock.unlock();
e.printStackTrace();
return false;
} }
} else {
lock.unlock();
} }
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
} }
return true;
} }
@Override @Override
...@@ -924,34 +923,46 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -924,34 +923,46 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
} }
} }
private boolean sycOrder(String orderId) { private boolean sycDamaiOrder(String orderId) {
try { try {
KylinOrderTicketVo orderData = mongoTemplate.findOne( KylinOrderTicketVo orderData = dataUtils.getOrderTicketVo(orderId);
Query.query(Criteria.where("orderTicketsId").is(orderId)), KylinPerformanceVo vo = dataUtils.getPerformanceVo(orderData.getPerformanceId());
KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName()); int isSysDamai = 0;
List<KylinOrderTicketEntitiesVo> listData = mongoTemplate.find(Query.query(Criteria.where("orderId").is(orderId)), KylinOrderTicketEntitiesVo.class, KylinOrderTicketEntitiesVo.class.getSimpleName()); for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
AlibabaDamaiMevOpenBatchpushticketRequest req = new AlibabaDamaiMevOpenBatchpushticketRequest(); KylinTicketTimesVo timeItem = vo.getTicketTimeList().get(x);
List<AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam> list2 = new ArrayList<AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam>(); for (int y = 0; y < timeItem.getTicketList().size(); y++) {
for (int i = 0; i < listData.size(); i++) { KylinTicketVo ticketItem = timeItem.getTicketList().get(y);
KylinOrderTicketEntitiesVo item = listData.get(i); if (ticketItem.getTimeId().equals(orderData.getTicketId())) {
AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam obj3 = new AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam(); isSysDamai = ticketItem.getSysDamai();
list2.add(obj3); break;
obj3.setUserName(item.getEnterName());//用户名 入场人姓名 }
obj3.setCertificateNo(item.getEnterIdCode());//证件号 入场人身份证 }
obj3.setOrderUserMobile(item.getEnterMobile());//用户手机号 入场人手机号 }
obj3.setCertificateType(item.getEnterType().longValue());//证件内容 入场人证件type if (isSysDamai == 1) {
obj3.setPayTime(DateUtils.parseDate(orderData.getTimePay(),new String[]{"yyyy-MM-dd HH:mm:ss"}));//支付时间 List<KylinOrderTicketEntitiesVo> listData = mongoTemplate.find(Query.query(Criteria.where("orderId").is(orderId)), KylinOrderTicketEntitiesVo.class, KylinOrderTicketEntitiesVo.class.getSimpleName());
// obj3.setPerformId(timemId);//场次id AlibabaDamaiMevOpenBatchpushticketRequest req = new AlibabaDamaiMevOpenBatchpushticketRequest();
// obj3.setTicketItemId(ticketsmId); List<AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam> list2 = new ArrayList<AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam>();
obj3.setVoucherId(item.getMid().longValue());//票单号 入场人id for (int i = 0; i < listData.size(); i++) {
KylinOrderTicketEntitiesVo item = listData.get(i);
obj3.setOrderId(Long.parseLong(orderData.getOrderTicketsId()));//订单id orderId AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam obj3 = new AlibabaDamaiMevOpenBatchpushticketRequest.ThirdTicketPushOpenParam();
obj3.setMediumType(orderData.getGetTicketType().equals("express") ? 1L : 2L);//票类型 快递 电子 list2.add(obj3);
obj3.setSupplierSecret(taobaoTicketUtils.getSupplierSecret()); obj3.setUserName(item.getEnterName());//用户名 入场人姓名
obj3.setSystemId(taobaoTicketUtils.getSystemId()); obj3.setCertificateNo(item.getEnterIdCode());//证件号 入场人身份证
obj3.setSeatType(1L); obj3.setOrderUserMobile(item.getEnterMobile());//用户手机号 入场人手机号
obj3.setTicketType(1L);//票类型 obj3.setCertificateType(item.getEnterType().longValue());//证件内容 入场人证件type
obj3.setPayTime(DateUtils.parseDate(orderData.getTimePay(), new String[]{"yyyy-MM-dd HH:mm:ss"}));//支付时间
obj3.setPerformId(item.getTimemId().longValue());//场次id
obj3.setTicketItemId(item.getTicketsmId().longValue());
obj3.setVoucherId(item.getMid().longValue());//票单号 入场人id
obj3.setOrderId(Long.parseLong(orderData.getOrderTicketsId()));//订单id orderId
obj3.setMediumType(orderData.getGetTicketType().equals("express") ? 1L : 2L);//票类型 快递 电子
obj3.setSupplierSecret(taobaoTicketUtils.getSupplierSecret());
obj3.setSystemId(taobaoTicketUtils.getSystemId());
obj3.setSeatType(1L);
obj3.setTicketType(1L);//票类型
}
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
......
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