|
@@ -466,8 +466,32 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
relation.setNewRelationId(newRelation.getId());
|
|
relation.setNewRelationId(newRelation.getId());
|
|
|
relationClearService.clearTicket(relation, source);
|
|
relationClearService.clearTicket(relation, source);
|
|
|
|
|
|
|
|
|
|
+ if (plusPurchaseSkuRelation != null && plus_relationList != null) {
|
|
|
|
|
+ plus_relationList.remove(relationId);
|
|
|
|
|
+ plus_relationList.add(newRelation.getId());
|
|
|
|
|
+ plusPurchaseSkuRelation.setRelationIds(plus_relationList.toString());
|
|
|
|
|
+ orderDiscountPlusPurchaseSkuRelationMapper.updateById(plusPurchaseSkuRelation);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (source != null && source == UserTicketClearedRecord.Source.abnormal) {
|
|
|
|
|
+ //将用户异常订单关闭
|
|
|
|
|
+ workOrderMapper.update(null, Wrappers.lambdaUpdate(WorkOrder.class)
|
|
|
|
|
+ .set(WorkOrder::getStatus, WorkOrder.Status.close)
|
|
|
|
|
+ .eq(WorkOrder::getStatus, WorkOrder.Status.waiting)
|
|
|
|
|
+ .eq(WorkOrder::getUserId, userId)
|
|
|
|
|
+ .eq(WorkOrder::getRelationId, relationId));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if ((newRelation.getStartTime() == null || newRelation.getExpiryTime() == null)) {
|
|
if ((newRelation.getStartTime() == null || newRelation.getExpiryTime() == null)) {
|
|
|
List<OrderDon> orderDonList = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getUserId, userId).eq(OrderDon::getRelationId, relationId).eq(OrderDon::getStatus, OrderDon.Status.hasPayment));
|
|
List<OrderDon> orderDonList = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getUserId, userId).eq(OrderDon::getRelationId, relationId).eq(OrderDon::getStatus, OrderDon.Status.hasPayment));
|
|
|
|
|
+ if (orderDonList.isEmpty()) {
|
|
|
|
|
+ orderDonList = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
|
|
+ .eq(OrderDon::getUserId, userId)
|
|
|
|
|
+ .eq(OrderDon::getRelationId, relationId)
|
|
|
|
|
+ .eq(OrderDon::getStatus, OrderDon.Status.complete)
|
|
|
|
|
+ .orderByDesc(OrderDon::getId)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ }
|
|
|
if (groups.getStatus() == GroupsTrips.Status.waiting) {
|
|
if (groups.getStatus() == GroupsTrips.Status.waiting) {
|
|
|
orderDonList.forEach(hasPaymentOrder -> {
|
|
orderDonList.forEach(hasPaymentOrder -> {
|
|
|
hasPaymentOrder.setRelationId(newRelation.getId());
|
|
hasPaymentOrder.setRelationId(newRelation.getId());
|
|
@@ -496,12 +520,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (plusPurchaseSkuRelation != null && plus_relationList != null) {
|
|
|
|
|
- plus_relationList.remove(relationId);
|
|
|
|
|
- plus_relationList.add(newRelation.getId());
|
|
|
|
|
- plusPurchaseSkuRelation.setRelationIds(plus_relationList.toString());
|
|
|
|
|
- orderDiscountPlusPurchaseSkuRelationMapper.updateById(plusPurchaseSkuRelation);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
List<OrderDon> orderDonList = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getUserId, userId).eq(OrderDon::getRelationId, relationId).eq(OrderDon::getStatus, OrderDon.Status.complete));
|
|
List<OrderDon> orderDonList = orderDonMapper.selectList(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getUserId, userId).eq(OrderDon::getRelationId, relationId).eq(OrderDon::getStatus, OrderDon.Status.complete));
|
|
|
orderDonList.forEach(completeOrder->{
|
|
orderDonList.forEach(completeOrder->{
|
|
|
completeOrder.setRelationId(newRelation.getId());
|
|
completeOrder.setRelationId(newRelation.getId());
|
|
@@ -509,15 +528,6 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
});
|
|
});
|
|
|
redisService.del(RedisKey.GROUPS_RELATION_NUM_KEY + newRelation.getId());
|
|
redisService.del(RedisKey.GROUPS_RELATION_NUM_KEY + newRelation.getId());
|
|
|
relationMapper.updateById(newRelation);
|
|
relationMapper.updateById(newRelation);
|
|
|
-
|
|
|
|
|
- if (source != null && source == UserTicketClearedRecord.Source.abnormal) {
|
|
|
|
|
- //将用户异常订单关闭
|
|
|
|
|
- workOrderMapper.update(null, Wrappers.lambdaUpdate(WorkOrder.class)
|
|
|
|
|
- .set(WorkOrder::getStatus, WorkOrder.Status.close)
|
|
|
|
|
- .eq(WorkOrder::getStatus, WorkOrder.Status.waiting)
|
|
|
|
|
- .eq(WorkOrder::getUserId, userId)
|
|
|
|
|
- .eq(WorkOrder::getRelationId, relationId));
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public String zfbRefund(OrderRefundReq refundReq, OrderDon orderDon) throws Exception {
|
|
public String zfbRefund(OrderRefundReq refundReq, OrderDon orderDon) throws Exception {
|