zoujiajian 1 年間 前
コミット
9426f7ba2a

+ 7 - 8
netflix-service/src/main/java/com/cyksj/server/recharge/impl/GptProxyRechargeServiceImpl.java

@@ -219,8 +219,6 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
 			if (updateRemainNum == 0) {
 				throw BusinessRuntimeException.getInstance("代充异常,请重试");
 			}
-			//重新获取车票
-			relation = relationMapper.selectById(relationId);
 			OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
 					.in(OrderDon::getUserId, userIdList)
 					.eq(OrderDon::getRelationId, relationId)
@@ -237,8 +235,6 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
 				throw BusinessRuntimeException.getInstance("您输入的凭证有误,请重新输入");
 			}
 			String rechargeAccount = tokenParseResult.getMessage();
-			//记录代充账号 token
-			relation.setAccount(rechargeAccount);
 			//获取GPT代充key
 			GptRechargeCardKey gptRechargeCardKey = gptRechargeCardKeyMapper.selectOne(Wrappers.lambdaQuery(GptRechargeCardKey.class)
 					.eq(GptRechargeCardKey::getStatus, Boolean.FALSE)
@@ -266,11 +262,14 @@ public class GptProxyRechargeServiceImpl implements GptProxyRechargeService {
 				setRechargeRelationStatusAutoError(relation);
 				throw BusinessRuntimeException.getInstance("充值失败,请联系客服开通");
 			}
-			relation.setRechargeStatus(GroupsRelation.RechargeStatus.recharging);
-			relation.setCardKey(gptCardKey);
 			String taskId = result.getTaskId();
-			relation.setGptTaskId(taskId);
-			relationMapper.updateById(relation);
+			relationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
+					//记录代充账号
+					.set(GroupsRelation::getAccount, rechargeAccount)
+					.set(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.recharging)
+					.set(GroupsRelation::getCardKey, gptCardKey)
+					.set(GroupsRelation::getGptTaskId, taskId)
+					.eq(GroupsRelation::getId, relationId));
 			return taskId;
 		} finally {
 			if (redisService.hasKey(key)) {