|
@@ -485,18 +485,20 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
throw new BusinessRuntimeException("您有未支付订单.");
|
|
throw new BusinessRuntimeException("您有未支付订单.");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
- //claude code限购
|
|
|
|
|
- if (goodsId == Constant.CLAUDE_CODE_GOODS_ID) {
|
|
|
|
|
- //是否拥有这张车票
|
|
|
|
|
- Integer selectCount = groupsRelationMapper.selectCountByGoodsId(userIdList, Constant.CLAUDE_CODE_GOODS_ID, DateTime.now());
|
|
|
|
|
- if (selectCount > 0) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("claude code车票限购一次");
|
|
|
|
|
- }
|
|
|
|
|
- //购买cc体验卡 仅可体检一次
|
|
|
|
|
- if (sku != null && ObjectUtil.equal(sku.getId(), Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID)) {
|
|
|
|
|
- checkCCTrialCardNum(userIdList);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ List<Long> userIdList = null;
|
|
|
|
|
+ if (goodsId == Constant.CLAUDE_CODE_GOODS_ID || goodsId == Constant.CODEX_GOODS_ID) {
|
|
|
|
|
+ userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
+ //claude code限购
|
|
|
|
|
+ if (goodsId == Constant.CLAUDE_CODE_GOODS_ID) {
|
|
|
|
|
+ //是否拥有这张车票
|
|
|
|
|
+ Integer selectCount = groupsRelationMapper.selectCountByGoodsId(userIdList, Constant.CLAUDE_CODE_GOODS_ID, DateTime.now());
|
|
|
|
|
+ if (selectCount > 0) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("claude code车票限购一次");
|
|
|
|
|
+ }
|
|
|
|
|
+ //购买cc体验卡 仅可体检一次
|
|
|
|
|
+ if (sku != null && ObjectUtil.equal(sku.getId(), Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID)) {
|
|
|
|
|
+ checkCCTrialCardNum(userIdList);
|
|
|
|
|
+ }
|
|
|
// //是否是赠送codex sku
|
|
// //是否是赠送codex sku
|
|
|
// if (sku.getIsCodex()) {
|
|
// if (sku.getIsCodex()) {
|
|
|
// //是否存在codex
|
|
// //是否存在codex
|
|
@@ -505,17 +507,18 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
// throw BusinessRuntimeException.getInstance("您已购买了codex套餐,如需claude可用codex抵扣升级,不可重复购买");
|
|
// throw BusinessRuntimeException.getInstance("您已购买了codex套餐,如需claude可用codex抵扣升级,不可重复购买");
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
- }
|
|
|
|
|
- //codex 限购
|
|
|
|
|
- if (goodsId == Constant.CODEX_GOODS_ID) {
|
|
|
|
|
- Integer selectCount = groupsRelationMapper.selectCountByGoodsId(userIdList, Constant.CODEX_GOODS_ID, DateTime.now());
|
|
|
|
|
- if (selectCount > 0) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("codex车票限购一次");
|
|
|
|
|
}
|
|
}
|
|
|
- //是否拥有cc赠送codex
|
|
|
|
|
- CodexUser codexUser = codexUserMapper.selectOne(Wrappers.lambdaQuery(CodexUser.class).in(CodexUser::getUserId, userIdList).last("limit 1"));
|
|
|
|
|
- if (codexUser != null) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("codex车票限购一次");
|
|
|
|
|
|
|
+ //codex 限购
|
|
|
|
|
+ if (goodsId == Constant.CODEX_GOODS_ID) {
|
|
|
|
|
+ Integer selectCount = groupsRelationMapper.selectCountByGoodsId(userIdList, Constant.CODEX_GOODS_ID, DateTime.now());
|
|
|
|
|
+ if (selectCount > 0) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("codex车票限购一次");
|
|
|
|
|
+ }
|
|
|
|
|
+ //是否拥有cc赠送codex
|
|
|
|
|
+ CodexUser codexUser = codexUserMapper.selectOne(Wrappers.lambdaQuery(CodexUser.class).in(CodexUser::getUserId, userIdList).last("limit 1"));
|
|
|
|
|
+ if (codexUser != null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("codex车票限购一次");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -617,6 +620,9 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
|
|
//租赁商品
|
|
//租赁商品
|
|
|
if (goodsDon.getType() == 4) {
|
|
if (goodsDon.getType() == 4) {
|
|
|
|
|
+ if (userIdList == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getGatewayApiCode(GatewayApiCode.CMS_TOKEN_VALID);
|
|
|
|
|
+ }
|
|
|
//是否已实名认证过
|
|
//是否已实名认证过
|
|
|
Integer count = userCertRecordMapper.selectCount(Wrappers.lambdaQuery(UserCertRecord.class).in(UserCertRecord::getUserId, userIdList));
|
|
Integer count = userCertRecordMapper.selectCount(Wrappers.lambdaQuery(UserCertRecord.class).in(UserCertRecord::getUserId, userIdList));
|
|
|
if (count == 0) throw BusinessRuntimeException.getInstance("请您先完成实名认证..");
|
|
if (count == 0) throw BusinessRuntimeException.getInstance("请您先完成实名认证..");
|