|
|
@@ -680,6 +680,10 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
if (relation.getRechargeStatus() != null) {
|
|
|
throw BusinessRuntimeException.getInstance("代充账号车票无法更换车票");
|
|
|
}
|
|
|
+ String key = RedisService.key.NETFLIX_CHANGE_TICKET_KEY.getName() + relationId;
|
|
|
+ if (!redisService.setNx(key, relationId, RedisService.key.NETFLIX_CHANGE_TICKET_KEY.getTimeout())) {
|
|
|
+ throw BusinessRuntimeException.getInstance("正在更换车票中..");
|
|
|
+ }
|
|
|
Long userId = relation.getUserId();
|
|
|
log.info("用户userId:{}更换车票relationId:{}", userId, relationId);
|
|
|
OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
@@ -763,7 +767,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
relationClearService.clearTicket(relation, source);
|
|
|
|
|
|
//兜底处理 多余车票
|
|
|
-// clearOtherChangeTicket(userId, relationId, newRelation);
|
|
|
+ clearOtherChangeTicket(userId, relationId, newRelation);
|
|
|
|
|
|
//奈飞车票
|
|
|
if (orderDon.getGoodsId() == 1) {
|
|
|
@@ -1574,8 +1578,14 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
.eq(OrderDon::getRelationId, rid)
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderAllStatus));
|
|
|
if (selectCount == 0) {
|
|
|
- log.info("清除用户:{}多余车票", userId);
|
|
|
- relationClearService.clearTicket(r, UserTicketClearedRecord.Source.manual);
|
|
|
+ //不是优惠加购
|
|
|
+ Integer count = orderDiscountPlusPurchaseSkuRelationMapper.selectCount(Wrappers.lambdaQuery(OrderDiscountPlusPurchaseSkuRelation.class)
|
|
|
+ .eq(OrderDiscountPlusPurchaseSkuRelation::getUserId, userId)
|
|
|
+ .apply("JSON_CONTAINS(relation_ids,'" + rid + "')"));
|
|
|
+ if (count == 0) {
|
|
|
+ log.info("清除用户:{}多余车票", userId);
|
|
|
+ relationClearService.clearTicket(r, UserTicketClearedRecord.Source.manual);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|