|
|
@@ -3804,11 +3804,16 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
returnGalaxyCoin(orderDon);
|
|
|
}
|
|
|
|
|
|
- //GPT独立会员续费,名称包含pro的规格不进入代充
|
|
|
- if (orderDon.getGoodsId() == Constant.GPT_PLUS_GID && sku.getNum() == 1
|
|
|
- && !StrUtil.containsIgnoreCase(sku.getSpecVal(), "pro")) {
|
|
|
- incrGroupsRelationRechargeRemainIfRecharge(orderDon.getRelationId(), sku.getMonths(), orderDon.getOrderType());
|
|
|
-
|
|
|
+ //GPT独立会员续费,名称包含pro的规格不进入代充
|
|
|
+ boolean isGptIndividualMember = orderDon.getGoodsId() == Constant.GPT_PLUS_GID && sku.getNum() == 1
|
|
|
+ && !StrUtil.containsIgnoreCase(sku.getSpecVal(), "pro");
|
|
|
+ //YouTube个人会员与GPT Plus独立会员使用相同的代充次数,家庭组不增加
|
|
|
+ boolean isYoutubeIndividualMember = orderDon.getGoodsId() == Constant.YOUTUBE_PREMIUM_GOODS_ID && sku.getNum() == 1;
|
|
|
+ if (isGptIndividualMember || isYoutubeIndividualMember) {
|
|
|
+ incrGroupsRelationRechargeRemainIfRecharge(orderDon.getRelationId(), sku.getMonths(), orderDon.getOrderType(), isGptIndividualMember);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isGptIndividualMember) {
|
|
|
// GPT独立会员购买,赠送sora邀请码
|
|
|
try {
|
|
|
soraCodeFrontService.grantSoraCodeForGptMember(orderDon.getUserId(), orderDon.getId());
|
|
|
@@ -6226,9 +6231,22 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void incrGroupsRelationRechargeRemainIfRecharge(Long relationId, Integer addNum, Integer orderType) {
|
|
|
+ private void incrGroupsRelationRechargeRemainIfRecharge(Long relationId, Integer addNum, Integer orderType, boolean deductFirstRecharge) {
|
|
|
GroupsRelation relation = groupsRelationMapper.selectById(relationId);
|
|
|
if (orderType == 1) {
|
|
|
+ //YouTube个人会员下单时只初始化次数,客服在代充列表点击发货后才扣除一次
|
|
|
+ if (!deductFirstRecharge) {
|
|
|
+ if (relation.getRechargeNum() == null) {
|
|
|
+ relation.setRechargeNum(addNum);
|
|
|
+ relation.setRechargeRemainNum(addNum);
|
|
|
+ if (relation.getRechargeStatus() == null) {
|
|
|
+ relation.setRechargeStatus(GroupsRelation.RechargeStatus.waiting);
|
|
|
+ }
|
|
|
+ groupsRelationMapper.updateById(relation);
|
|
|
+ gptUserRechargeRecordService.recordGptUserRechargeNum(null, relation.getUserId(), relation.getId(), relation.getAccount(), addNum, null, "下单");
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
//已发车
|
|
|
GroupsTrips groupsTrips = groupsMapper.selectById(relation.getGroupsId());
|
|
|
if (groupsTrips.getAccountId() != null) {
|