|
|
@@ -10,6 +10,7 @@ import com.cyksj.mapper.*;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.order.OrderCommonService;
|
|
|
+import com.cyksj.service.relation.GroupRelationClearService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -42,6 +43,8 @@ public class OrderCommonServiceImpl implements OrderCommonService {
|
|
|
|
|
|
private final RedisService redisService;
|
|
|
|
|
|
+ private final GroupRelationClearService clearService;
|
|
|
+
|
|
|
@Override
|
|
|
public void clearUnrealGoodsDetail(OrderDon orderDon, Integer goodsType, GoodsDonSku sku) {
|
|
|
if (goodsType == 1 && sku != null) {
|
|
|
@@ -117,19 +120,7 @@ public class OrderCommonServiceImpl implements OrderCommonService {
|
|
|
}
|
|
|
}
|
|
|
if (isFlag) {
|
|
|
- relation.setUserId(0l);
|
|
|
- if (relation.getStatus() != GroupsRelation.Status.outside) {
|
|
|
- relation.setStatus(GroupsRelation.Status.none);
|
|
|
- }
|
|
|
- relation.setStartTime(null);
|
|
|
- relation.setExpiryTime(null);
|
|
|
- relation.setIsHandle(false);
|
|
|
- relation.setRenewStatus(false);
|
|
|
- relation.setAccount(null);
|
|
|
- groupsRelationMapper.updateExpiryTime(relation, expiryTime);
|
|
|
- if (relation.getStatus() != GroupsRelation.Status.outside) {
|
|
|
- delRelation(relation);
|
|
|
- }
|
|
|
+ clearService.clearTicket(relation, UserTicketClearedRecord.Source.refund);
|
|
|
} else {
|
|
|
if (expiryTime != null) {
|
|
|
if (sku.getDays() != null && sku.getDays() > 0) {
|
|
|
@@ -142,7 +133,11 @@ public class OrderCommonServiceImpl implements OrderCommonService {
|
|
|
}
|
|
|
}
|
|
|
relation.setExpiryTime(expiryTime);
|
|
|
- groupsRelationMapper.updateById(relation);
|
|
|
+ if (expiryTime.compareTo(now) <= 0) {
|
|
|
+ clearService.clearTicket(relation, UserTicketClearedRecord.Source.refund);
|
|
|
+ } else {
|
|
|
+ groupsRelationMapper.updateById(relation);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
orderDon.setIsKickOut(true);
|