|
|
@@ -11,6 +11,7 @@ import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.order.OrderCommonService;
|
|
|
import com.cyksj.service.relation.GroupRelationClearService;
|
|
|
+import com.cyksj.service.user.UserBindRelationService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -44,6 +45,8 @@ public class OrderCommonServiceImpl implements OrderCommonService {
|
|
|
private final RedisService redisService;
|
|
|
|
|
|
private final GroupRelationClearService clearService;
|
|
|
+
|
|
|
+ private final UserBindRelationService userBindRelationService;
|
|
|
@Override
|
|
|
public void clearUnrealGoodsDetail(OrderDon orderDon, Integer goodsType, GoodsDonSku sku) {
|
|
|
if (goodsType == 1 && sku != null) {
|
|
|
@@ -54,14 +57,15 @@ public class OrderCommonServiceImpl implements OrderCommonService {
|
|
|
relationIds.add(relationId);
|
|
|
Integer num = orderDon.getNum();
|
|
|
DateTime now = DateTime.now();
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(orderDon.getUserId(), null);
|
|
|
GroupsRelation relation = groupsRelationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
- .eq(GroupsRelation::getUserId, orderDon.getUserId())
|
|
|
+ .in(GroupsRelation::getUserId, userIdList)
|
|
|
.eq(GroupsRelation::getId, relationId)
|
|
|
.in(GroupsRelation::getStatus, List.of(GroupsRelation.Status.validity, GroupsRelation.Status.outside)));
|
|
|
//车票变更之后
|
|
|
if (relation == null || orderDon.getIsChangeTicket()) {
|
|
|
UserRenewChangeTicketRecord record = userRenewChangeTicketRecordMapper.selectOne(Wrappers.lambdaQuery(UserRenewChangeTicketRecord.class)
|
|
|
- .eq(UserRenewChangeTicketRecord::getUserId, orderDon.getUserId())
|
|
|
+ .in(UserRenewChangeTicketRecord::getUserId, userIdList)
|
|
|
.eq(UserRenewChangeTicketRecord::getPreRelationId, relationId)
|
|
|
.orderByDesc(UserRenewChangeTicketRecord::getId).last("limit 1"));
|
|
|
if (record != null && relationId.equals(record.getPreRelationId())) {
|
|
|
@@ -77,7 +81,7 @@ public class OrderCommonServiceImpl implements OrderCommonService {
|
|
|
//是否有其他付款订单是否过期
|
|
|
otherOrder = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.in(OrderDon::getRelationId, relationIds)
|
|
|
- .eq(OrderDon::getUserId, orderDon.getUserId())
|
|
|
+ .in(OrderDon::getUserId, userIdList)
|
|
|
.ne(OrderDon::getId, orderDon.getId())
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderAllStatus)
|
|
|
.orderByDesc(OrderDon::getId)
|