|
@@ -80,21 +80,21 @@ public class MirrorUserCleatServiceImpl implements MirrorUserCleatService {
|
|
|
ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class)
|
|
ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class)
|
|
|
.eq(ChatgptUser::getRelationId, orderDon.getRelationId())
|
|
.eq(ChatgptUser::getRelationId, orderDon.getRelationId())
|
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
|
- chatgptUser.setRenewSkuId(null);
|
|
|
|
|
- chatgptUser.setRenewOrderId(null);
|
|
|
|
|
Long presentRenewSkuId = chatgptUser.getRenewSkuId();
|
|
Long presentRenewSkuId = chatgptUser.getRenewSkuId();
|
|
|
//存在不同升级套餐
|
|
//存在不同升级套餐
|
|
|
GoodsDonSku presentRenewSku = skuMapper.selectById(presentRenewSkuId);
|
|
GoodsDonSku presentRenewSku = skuMapper.selectById(presentRenewSkuId);
|
|
|
if (!ObjectUtil.equal(presentRenewSkuId, skuId)) {
|
|
if (!ObjectUtil.equal(presentRenewSkuId, skuId)) {
|
|
|
throw BusinessRuntimeException.getInstance("请先退掉用户目前续费升级的{}规格", presentRenewSku.getSpecVal());
|
|
throw BusinessRuntimeException.getInstance("请先退掉用户目前续费升级的{}规格", presentRenewSku.getSpecVal());
|
|
|
} else {
|
|
} else {
|
|
|
- GroupsRelation relation = groupsRelationMapper.selectById(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
|
|
- .eq(GroupsRelation::getId, orderDon.getRelationId()));
|
|
|
|
|
|
|
+ GroupsRelation relation = groupsRelationMapper.selectById(orderDon.getRelationId());
|
|
|
GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
|
|
GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
|
|
|
GoodsDonSku finalSku = skuMapper.selectById(groupsTrips.getSkuId());
|
|
GoodsDonSku finalSku = skuMapper.selectById(groupsTrips.getSkuId());
|
|
|
//是否存在其他续费升级
|
|
//是否存在其他续费升级
|
|
|
- OrderDon otherRenewOrderDon = orderDonRenewRecordMapper.getOtherRenewSku(orderDon.getId(), presentRenewSku.getMonths(), userIdList);
|
|
|
|
|
- GoodsDonSku otherRenewSku = skuMapper.selectById(otherRenewOrderDon.getSkuId());
|
|
|
|
|
|
|
+ OrderDon otherRenewOrderDon = orderDonRenewRecordMapper.getOtherRenewSku(orderDon.getId(), relation.getId(), userIdList);
|
|
|
|
|
+ GoodsDonSku otherRenewSku = null;
|
|
|
|
|
+ if (otherRenewOrderDon != null) {
|
|
|
|
|
+ otherRenewSku = skuMapper.selectById(otherRenewOrderDon.getSkuId());
|
|
|
|
|
+ }
|
|
|
GoodsDonSku upgradeOrderDonSku = null;
|
|
GoodsDonSku upgradeOrderDonSku = null;
|
|
|
Date renewExpiryTime = null;
|
|
Date renewExpiryTime = null;
|
|
|
//是否存在套餐升级包
|
|
//是否存在套餐升级包
|
|
@@ -114,6 +114,8 @@ public class MirrorUserCleatServiceImpl implements MirrorUserCleatService {
|
|
|
log.info("续费升级订单退款,relation_id:{}存在套餐升级", orderDon.getUserId());
|
|
log.info("续费升级订单退款,relation_id:{}存在套餐升级", orderDon.getUserId());
|
|
|
finalSku = upgradeOrderDonSku;
|
|
finalSku = upgradeOrderDonSku;
|
|
|
}
|
|
}
|
|
|
|
|
+ chatgptUser.setRenewSkuId(null);
|
|
|
|
|
+ chatgptUser.setRenewOrderId(null);
|
|
|
//续费升级
|
|
//续费升级
|
|
|
if (otherRenewSku != null) {
|
|
if (otherRenewSku != null) {
|
|
|
finalSku = otherRenewSku;
|
|
finalSku = otherRenewSku;
|