|
|
@@ -11,8 +11,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
|
+import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
|
+import com.cyksj.model.dto.GptCardTokenDto;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.request.GptIndependentExportRechargeReq;
|
|
|
import com.cyksj.model.request.GroupsRelationRechargeReq;
|
|
|
@@ -158,7 +160,15 @@ public class GptRechargeServiceImpl implements GptRechargeService {
|
|
|
if (orderDon == null) {
|
|
|
throw BusinessRuntimeException.getInstance("代充订单不存在或已退款");
|
|
|
}
|
|
|
- String accessToken = req.getAccessToken();
|
|
|
+ //入库token json
|
|
|
+ String saveTokenJson = req.getAccessToken();
|
|
|
+ String accessToken;
|
|
|
+ try {
|
|
|
+ GptCardTokenDto gptCardTokenDto = Jsons.parseObject(saveTokenJson, GptCardTokenDto.class);
|
|
|
+ accessToken = gptCardTokenDto.getAccessToken();
|
|
|
+ } catch (Exception e) {
|
|
|
+ accessToken = saveTokenJson;
|
|
|
+ }
|
|
|
//验证用户token是否正确
|
|
|
TokenParseResult tokenParseResult = parseToken(accessToken);
|
|
|
if (!tokenParseResult.getSuccess()) {
|
|
|
@@ -166,7 +176,7 @@ public class GptRechargeServiceImpl implements GptRechargeService {
|
|
|
}
|
|
|
String rechargeAccount = tokenParseResult.getMessage();
|
|
|
//记录代充账号 token
|
|
|
- relation.setGptToken(accessToken);
|
|
|
+ relation.setGptToken(saveTokenJson);
|
|
|
relation.setAccount(rechargeAccount);
|
|
|
//获取GPT代充key
|
|
|
//代充卡密类型
|
|
|
@@ -221,7 +231,7 @@ public class GptRechargeServiceImpl implements GptRechargeService {
|
|
|
.set(StrUtil.isNotBlank(password), GroupsRelation::getPassword, password)
|
|
|
.set(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.recharging)
|
|
|
.set(GroupsRelation::getCardKey, gptCardKey)
|
|
|
- .set(GroupsRelation::getGptToken, accessToken)
|
|
|
+ .set(GroupsRelation::getGptToken, saveTokenJson)
|
|
|
.set(GroupsRelation::getGptTaskId, taskId)
|
|
|
.eq(GroupsRelation::getId, relationId));
|
|
|
return taskId;
|