|
|
@@ -393,6 +393,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
private final NanoUserQuotaMapper nanoUserQuotaMapper;
|
|
|
|
|
|
+ private final UserTicketClearedRecordMapper userTicketClearedRecordMapper;
|
|
|
+
|
|
|
private final List<String> noChekGoodsTemp = List.of("Apple One", "Youtube", "Spotify");
|
|
|
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
@@ -474,6 +476,10 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
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);
|
|
|
+ }
|
|
|
}
|
|
|
//校验奈飞限购信息
|
|
|
checkNfPayLimit(goodsId, userId);
|
|
|
@@ -5373,4 +5379,23 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
userBalanceSourceRecordMapper.deleteById(userBalanceSourceRecord.getId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void checkCCTrialCardNum(List<Long> userIdList) {
|
|
|
+ Integer payCcTy = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class).eq(OrderDon::getSkuId, Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID).in(OrderDon::getUserId, userIdList).notIn(OrderDon::getStatus, Constant.noOrderAllStatus));
|
|
|
+ if (payCcTy > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("claude code体验天卡车票仅可体验一次");
|
|
|
+ }
|
|
|
+ if (payCcTy == 0) {
|
|
|
+ Number number = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getUserId, userIdList).op(Operator.InList).field(GroupsRelationView::getSkuId, Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID).build());
|
|
|
+ if (number.intValue() > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("claude code体验天卡车票仅可体验一次");
|
|
|
+ }
|
|
|
+ if (number.intValue() == 0) {
|
|
|
+ Integer ccCount = userTicketClearedRecordMapper.selectCount(Wrappers.lambdaQuery(UserTicketClearedRecord.class).in(UserTicketClearedRecord::getUserId, userIdList).eq(UserTicketClearedRecord::getSkuId, Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID));
|
|
|
+ if (ccCount > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("claude code体验天卡车票仅可体验一次");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|