|
|
@@ -389,6 +389,23 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
upgradeOrderDonMapper.updateById(orderDon);
|
|
|
return;
|
|
|
}
|
|
|
+ Long userId = orderDon.getUserId();
|
|
|
+ List<Long> userIdList = null;
|
|
|
+ //检验gpt套餐
|
|
|
+ if (upgradePackage.getGoodsId() == 18) {
|
|
|
+ userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ //是否有更高级的套餐
|
|
|
+ UpgradeOrderDon more = upgradeOrderDonMapper.selectOne(Wrappers.lambdaQuery(UpgradeOrderDon.class)
|
|
|
+ .in(UpgradeOrderDon::getUserId, userIdList)
|
|
|
+ .eq(UpgradeOrderDon::getRelationId, orderDon.getRelationId())
|
|
|
+ .gt(UpgradeOrderDon::getNum, orderDon.getNum())
|
|
|
+ .eq(UpgradeOrderDon::getStatus, UpgradeOrderDon.Status.complete)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (more != null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请先退掉其更高级套餐");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//调用第三方接口退款
|
|
|
String outNo = orderRefundService.centerUpgradeRefund(refundReq, orderDon);
|
|
|
orderDon.setRefundDesc(refundReq.getRefundDesc());
|
|
|
@@ -421,19 +438,6 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
|
|
|
GroupsRelation relation = groupsRelationMapper.selectById(chatgptUser.getRelationId());
|
|
|
GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
|
|
|
GoodsDonSku sku = skuMapper.selectById(groupsTrips.getSkuId());
|
|
|
- Long userId = orderDon.getUserId();
|
|
|
- List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
-
|
|
|
- //是否有更高级的套餐
|
|
|
- UpgradeOrderDon more = upgradeOrderDonMapper.selectOne(Wrappers.lambdaQuery(UpgradeOrderDon.class)
|
|
|
- .in(UpgradeOrderDon::getUserId, userIdList)
|
|
|
- .eq(UpgradeOrderDon::getRelationId, orderDon.getRelationId())
|
|
|
- .gt(UpgradeOrderDon::getNum, orderDon.getNum())
|
|
|
- .eq(UpgradeOrderDon::getStatus, UpgradeOrderDon.Status.complete)
|
|
|
- .last("limit 1"));
|
|
|
- if (more != null) {
|
|
|
- throw BusinessRuntimeException.getInstance("请先退掉其更高级套餐");
|
|
|
- }
|
|
|
|
|
|
//原先sku的套餐
|
|
|
Long gptLimitTime = sku.getGptLimitTime();
|