|
|
@@ -14,6 +14,8 @@ import com.cyksj.model.dto.VipDeductDto;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
import com.cyksj.model.response.VipUserPageResp;
|
|
|
+import com.cyksj.service.chatgpt.ChatGptAccountService;
|
|
|
+import com.cyksj.service.claude.ClaudeService;
|
|
|
import com.cyksj.service.user.UserBindRelationService;
|
|
|
import com.cyksj.service.vip.VipFrontService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -58,6 +60,10 @@ public class VipFrontServiceImpl implements VipFrontService {
|
|
|
|
|
|
private final GoodsDonSkuMapper goodsDonSkuMapper;
|
|
|
|
|
|
+ private final ChatGptAccountService chatGptAccountService;
|
|
|
+
|
|
|
+ private final ClaudeService claudeService;
|
|
|
+
|
|
|
@Override
|
|
|
public void fillVipInfo(Long userId, VipUserPageResp vipUserPageResp) {
|
|
|
SysConfig sysConfig = sysConfigMapper.selectOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.VIP_FEE_KEY).last("limit 1"));
|
|
|
@@ -164,19 +170,23 @@ public class VipFrontServiceImpl implements VipFrontService {
|
|
|
//GPT
|
|
|
if (goodsId == Constant.GPT_PLUS_GID) {
|
|
|
ChatgptUser chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class).eq(ChatgptUser::getRelationId, relationId).last("limit 1"));
|
|
|
+ if (chatgptUser == null) {
|
|
|
+ chatGptAccountService.getUserInfo(relation.getUserId(), relation.getId());
|
|
|
+ chatgptUser = chatgptUserMapper.selectOne(Wrappers.lambdaQuery(ChatgptUser.class).eq(ChatgptUser::getRelationId, relationId).last("limit 1"));
|
|
|
+ }
|
|
|
if (chatgptUser != null) {
|
|
|
//获取抵扣金额
|
|
|
deductMoney = deductMoney.add(getFinalDeductMoney(relationId, relation.getSkuId(), chatgptUser.getRenewSkuId(), chatgptUser.getRenewOrderId(), chatgptUser.getRenewExpiryTime(), relation.getStartTime(), relationExpiryTime, now, userIdList));
|
|
|
- } else {
|
|
|
- throw BusinessRuntimeException.getInstance("请先前往AI镜像专区使用");
|
|
|
}
|
|
|
} else if (goodsId == Constant.CLAUDE_PRO_GID) {
|
|
|
ClaudeUser claudeUser = claudeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeUser.class).eq(ClaudeUser::getRelationId, relationId).last("limit 1"));
|
|
|
+ if (claudeUser == null) {
|
|
|
+ claudeService.getUserInfo(relation.getUserId(), relation.getId());
|
|
|
+ claudeUser = claudeUserMapper.selectOne(Wrappers.lambdaQuery(ClaudeUser.class).eq(ClaudeUser::getRelationId, relationId).last("limit 1"));
|
|
|
+ }
|
|
|
if (claudeUser != null) {
|
|
|
//获取抵扣金额
|
|
|
deductMoney = deductMoney.add(getFinalDeductMoney(relationId, relation.getSkuId(), claudeUser.getRenewSkuId(), claudeUser.getRenewOrderId(), claudeUser.getRenewExpiryTime(), relation.getStartTime(), relationExpiryTime, now, userIdList));
|
|
|
- } else {
|
|
|
- throw BusinessRuntimeException.getInstance("请先前往AI镜像专区使用");
|
|
|
}
|
|
|
} else {
|
|
|
//该车票抵扣金额
|