Explorar el Código

fix ChatGPT账号车队

zoujiajian hace 3 años
padre
commit
f4fa7a69e0

+ 4 - 0
netflix-dao/src/main/java/com/cyksj/mapper/GroupsRelationMapper.java

@@ -36,4 +36,8 @@ public interface GroupsRelationMapper extends BaseMapper<GroupsRelation> {
 	Integer selectViewPwdCount(Long groupsId);
 	Integer selectViewPwdCount(Long groupsId);
 
 
 	GroupsRelation selectRandomOneRelationByGroupsId(Long groupsId);
 	GroupsRelation selectRandomOneRelationByGroupsId(Long groupsId);
+
+	List<GroupsRelation> selectExpiredRelationByCondition(@Param("now") DateTime now, @Param("list") List<Long> filterSkuIds);
+
+	GroupsRelation selectOutsideRelationByGroupsId(Long groupsId);
 }
 }

+ 3 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/GroupsRelation.java

@@ -79,7 +79,9 @@ public class GroupsRelation extends BaseEntity {
         locking("锁定中"),
         locking("锁定中"),
         overdue("过期"),
         overdue("过期"),
         validity("有效"),
         validity("有效"),
-        none("无人");
+        none("无人"),
+        outside("额外")
+        ;
 
 
         private String desc;
         private String desc;
 
 

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/views/EmptyGroupsRelationView.java

@@ -6,6 +6,8 @@ import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
+import java.util.Date;
+
 /*
 /*
  *项目名: netflix
  *项目名: netflix
  *文件名: EmptyGroupsRelationView
  *文件名: EmptyGroupsRelationView
@@ -31,6 +33,9 @@ public class EmptyGroupsRelationView {
 	@DbField("gt.available_num")
 	@DbField("gt.available_num")
 	private Integer availableNum;
 	private Integer availableNum;
 
 
+	@DbField("a.expiry_time")
+	private Date expiryTime;
+
 	@DbField("gt.status")
 	@DbField("gt.status")
 	private GroupsTrips.Status status;
 	private GroupsTrips.Status status;
 }
 }

+ 21 - 0
netflix-dao/src/main/resources/mapper/GroupRelationMapper.xml

@@ -100,4 +100,25 @@
           and status = 'none'
           and status = 'none'
         order by rand() limit 1
         order by rand() limit 1
     </select>
     </select>
+
+    <select id="selectExpiredRelationByCondition" resultType="com.cyksj.model.entity.GroupsRelation">
+        select gr.*
+        from groups_relation gr
+        inner join groups_trips gt on gt.id = gr.groups_id
+        where gt.sku_id not in
+        <foreach collection="list" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        and gr.expiry_time &lt;= #{now}
+    </select>
+
+    <select id="selectOutsideRelationByGroupsId" resultType="com.cyksj.model.entity.GroupsRelation">
+        select *
+        from groups_relation
+        where groups_id = #{groupsId}
+          and user_id = 0
+          and num > 20
+          and status = 'outside'
+        order by rand() limit 1
+    </select>
 </mapper>
 </mapper>

+ 10 - 0
netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java

@@ -10,6 +10,7 @@ import com.cyksj.common.EnvCommonService;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
+import com.cyksj.dto.RedisKey;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.manage.DelGroupsTripsRecordMapper;
 import com.cyksj.mapper.manage.DelGroupsTripsRecordMapper;
 import com.cyksj.mapper.manage.GroupsTripsAccountReplaceRecordMapper;
 import com.cyksj.mapper.manage.GroupsTripsAccountReplaceRecordMapper;
@@ -240,6 +241,12 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
                 throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
                 throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
             }
             }
         }
         }
+        if (afterStartTime == null) {
+            afterStartTime = groupsAccountView.getStartTime();
+        }
+        if (afterExpiryTime == null) {
+            afterExpiryTime = groupsAccountView.getExpiryTime();
+        }
 
 
         //替换账号
         //替换账号
         accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
         accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
@@ -248,7 +255,10 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
                 .set(Account::getRemark, remark)
                 .set(Account::getRemark, remark)
                 .set(Account::getStartTime, afterStartTime)
                 .set(Account::getStartTime, afterStartTime)
                 .set(Account::getExpiryTime, afterExpiryTime)
                 .set(Account::getExpiryTime, afterExpiryTime)
+                .set(Account::getGptRefreshToken, StrUtil.EMPTY)
                 .eq(Account::getId, accountId));
                 .eq(Account::getId, accountId));
+        //清除gpt token
+        redisService.del(RedisKey.CHATGPT_ACCESS_TOKEN + groupsAccountView.getAccount());
 
 
         //保存替换记录
         //保存替换记录
         GroupsTripsAccountReplaceRecord replaceRecord = new GroupsTripsAccountReplaceRecord();
         GroupsTripsAccountReplaceRecord replaceRecord = new GroupsTripsAccountReplaceRecord();

+ 38 - 6
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -318,20 +318,30 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
         LambdaQueryWrapper<GroupsTrips> queryWrapper = Wrappers.lambdaQuery(GroupsTrips.class)
         LambdaQueryWrapper<GroupsTrips> queryWrapper = Wrappers.lambdaQuery(GroupsTrips.class)
                 .eq(GroupsTrips::getSkuId, orderDon.getSkuId())
                 .eq(GroupsTrips::getSkuId, orderDon.getSkuId())
                 .eq(GroupsTrips::getId, groupId)
                 .eq(GroupsTrips::getId, groupId)
-                .gt(GroupsTrips::getAvailableNum, 0).last("limit 1")
                 .ne(GroupsTrips::getId, relation.getGroupsId())
                 .ne(GroupsTrips::getId, relation.getGroupsId())
-                .ne(GroupsTrips::getStatus, GroupsTrips.Status.down);
+                .ne(GroupsTrips::getStatus, GroupsTrips.Status.down)
+                .last("limit 1");
         GroupsTrips groups = groupsMapper.selectOne(queryWrapper);
         GroupsTrips groups = groupsMapper.selectOne(queryWrapper);
-        if (groups == null) throw BusinessRuntimeException.getInstance("该新车位人员已满");
-
+        if (groups == null) throw BusinessRuntimeException.getInstance("车队不存在或已下架");
+        if (orderDon.getGoodsId() != 18 && groups.getAvailableNum() <= 0) {
+            throw BusinessRuntimeException.getInstance("该新车位人员已满");
+        }
         //获取新车队车位
         //获取新车队车位
-        GroupsRelation newRelation = getRelationThisTrips(orderDon.getUserId(), groupId, 1);
+        GroupsRelation newRelation;
+        if (orderDon.getGoodsId() == 18 && groups.getAvailableNum() == 0) {
+            //GPT车队 额外增加车位 并不让上车
+            newRelation = getChatGPTOutsideRelation(orderDon.getUserId(), groupId, 1);
+        } else {
+            newRelation = getRelationThisTrips(orderDon.getUserId(), groupId, 1);
+        }
 
 
         newRelation.setUserId(relation.getUserId());
         newRelation.setUserId(relation.getUserId());
         newRelation.setStartTime(relation.getStartTime());
         newRelation.setStartTime(relation.getStartTime());
         newRelation.setExpiryTime(relation.getExpiryTime());
         newRelation.setExpiryTime(relation.getExpiryTime());
         newRelation.setCustomerService(relation.getCustomerService());
         newRelation.setCustomerService(relation.getCustomerService());
-        newRelation.setStatus(GroupsRelation.Status.validity);
+        if (newRelation.getStatus() != GroupsRelation.Status.outside) {
+            newRelation.setStatus(GroupsRelation.Status.validity);
+        }
 
 
         //清除原先车票
         //清除原先车票
         relation.setNewRelationId(newRelation.getId());
         relation.setNewRelationId(newRelation.getId());
@@ -627,4 +637,26 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
         }
         }
         return relation;
         return relation;
     }
     }
+
+    private GroupsRelation getChatGPTOutsideRelation(Long userId, Long groupsId, Integer retryNum) {
+        //寻找快满编车队额外座位
+        GroupsRelation relation = relationMapper.selectOutsideRelationByGroupsId(groupsId);
+        if (relation == null) {
+            relation = new GroupsRelation();
+            relation.setStatus(GroupsRelation.Status.outside);
+            relation.setUserId(userId);
+            relation.setGroupsId(groupsId);
+            GroupsRelation maxNumRelation = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class).eq(GroupsRelation::getGroupsId, groupsId).orderByDesc(GroupsRelation::getNum).last("limit 1"));
+            relation.setNum(maxNumRelation.getNum() + 1);
+            relationMapper.insert(relation);
+            return relation;
+        }
+        Long relationId = relation.getId();
+        if (!redisService.setNx(RedisKey.GROUPS_RELATION_NUM_KEY + relationId, userId, 60 * 5L)) {
+            if (retryNum == 7) throw BusinessRuntimeException.getInstance("该车队人员已满,请选择另一车队");
+            retryNum++;
+            getChatGPTOutsideRelation(userId, groupsId, retryNum);
+        }
+        return relation;
+    }
 }
 }

+ 12 - 6
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationClearServiceImpl.java

@@ -49,6 +49,7 @@ public class GroupRelationClearServiceImpl implements GroupRelationClearService
 	public void clearTicket(GroupsRelation relation, UserTicketClearedRecord.Source source) {
 	public void clearTicket(GroupsRelation relation, UserTicketClearedRecord.Source source) {
 		Long relationId = relation.getId();
 		Long relationId = relation.getId();
 		Long newRelationId = relation.getNewRelationId();
 		Long newRelationId = relation.getNewRelationId();
+		final GroupsRelation.Status relationStatus = relation.getStatus();
 		//记录用户被清除车票历史记录
 		//记录用户被清除车票历史记录
 		GroupsRelationView groupsRelation = beanSearcher.searchFirst(GroupsRelationView.class,
 		GroupsRelationView groupsRelation = beanSearcher.searchFirst(GroupsRelationView.class,
 				MapUtils.builder().field(GroupsRelationView::getId, relationId).build());
 				MapUtils.builder().field(GroupsRelationView::getId, relationId).build());
@@ -70,17 +71,22 @@ public class GroupRelationClearServiceImpl implements GroupRelationClearService
 //				relation.setUserId(0l);
 //				relation.setUserId(0l);
 //				isFlag = true;
 //				isFlag = true;
 //			}
 //			}
-			relation.setStatus(GroupsRelation.Status.none);
+			if (relationStatus != GroupsRelation.Status.outside) {
+				relation.setStatus(GroupsRelation.Status.none);
+			}
 			relation.setIsHandle(false);
 			relation.setIsHandle(false);
 			relation.setRenewStatus(false);
 			relation.setRenewStatus(false);
 			relation.setAccount(null);
 			relation.setAccount(null);
 			Integer success = groupsRelationMapper.updateExpiryTime(relation, expireTime);
 			Integer success = groupsRelationMapper.updateExpiryTime(relation, expireTime);
 			if (success == 1) {
 			if (success == 1) {
-				log.info("开始清除过期子账号,座位号:{}", relation.getId());
-				int count = groupsMapper.incrAvailableNum(relation.getGroupsId());
-				if (count == 0) {
-					log.error("车位异常 groupId:{}", relation.getGroupsId());
-					groupsMapper.updateAvailableNum(relation.getGroupsId());
+				//2023-06-07 GPT账号座位大于20
+				if (relationStatus != GroupsRelation.Status.outside) {
+					log.info("开始清除过期子账号,座位号:{}", relation.getId());
+					int count = groupsMapper.incrAvailableNum(relation.getGroupsId());
+					if (count == 0) {
+						log.error("车位异常 groupId:{}", relation.getGroupsId());
+						groupsMapper.updateAvailableNum(relation.getGroupsId());
+					}
 				}
 				}
 				UserTicketClearedRecord userTicketClearedRecord = new UserTicketClearedRecord();
 				UserTicketClearedRecord userTicketClearedRecord = new UserTicketClearedRecord();
 				userTicketClearedRecord.setAccountId(groupsRelation.getAccountId());
 				userTicketClearedRecord.setAccountId(groupsRelation.getAccountId());

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -60,7 +60,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, MapUtils.builder()
 		List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, MapUtils.builder()
 				.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
 				.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
 				.field(RenewalView::getUserId, userIds).op(Operator.InList)
 				.field(RenewalView::getUserId, userIds).op(Operator.InList)
-				.field(RenewalView::getStatus, List.of("validity", "overdue")).op(Operator.InList)
+				.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
 				.orderBy(RenewalView::getExpiryTime).asc()
 				.orderBy(RenewalView::getExpiryTime).asc()
 				.build());
 				.build());
 		//过滤邀请制、已失效的车位
 		//过滤邀请制、已失效的车位

+ 4 - 1
netflix-service/src/main/java/com/cyksj/task/Scheduler.java

@@ -96,6 +96,8 @@ public class Scheduler {
 
 
 	    private final UserBenefitsService userBenefitsService;
 	    private final UserBenefitsService userBenefitsService;
 
 
+	    private final static List<Long> filter_skuIds = List.of(177l);
+
 
 
     /**
     /**
      * 每5分钟清理过期账号
      * 每5分钟清理过期账号
@@ -104,7 +106,8 @@ public class Scheduler {
     @Transactional(rollbackFor = Throwable.class)
     @Transactional(rollbackFor = Throwable.class)
     public void clearExpiry() {
     public void clearExpiry() {
         DateTime now = new DateTime();
         DateTime now = new DateTime();
-        List<GroupsRelation> expiryList = groupsRelationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class).le(GroupsRelation::getExpiryTime, now));
+        //List<GroupsRelation> expiryList = groupsRelationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class).le(GroupsRelation::getExpiryTime, now));
+	    List<GroupsRelation> expiryList = groupsRelationMapper.selectExpiredRelationByCondition(now, filter_skuIds);
         log.info("定时清理过期账号start ===> 数量:{}", expiryList.size());
         log.info("定时清理过期账号start ===> 数量:{}", expiryList.size());
         //过期账号清楚有效期
         //过期账号清楚有效期
         expiryList.forEach(relation -> groupRelationClearService.clearTicket(relation, UserTicketClearedRecord.Source.self));
         expiryList.forEach(relation -> groupRelationClearService.clearTicket(relation, UserTicketClearedRecord.Source.self));

+ 11 - 6
netflix-web/src/main/java/com/cyksj/web/controller/manage/CmsOrderController.java

@@ -15,7 +15,7 @@ import com.cyksj.common.util.Xmls;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
-import com.cyksj.mapper.GroupsRelationMapper;
+import com.cyksj.mapper.GoodsDonSkuMapper;
 import com.cyksj.mapper.OrderCommentMapper;
 import com.cyksj.mapper.OrderCommentMapper;
 import com.cyksj.mapper.RealGoodsInterestUserMapper;
 import com.cyksj.mapper.RealGoodsInterestUserMapper;
 import com.cyksj.mapper.channel.ChannelPopularizeMapper;
 import com.cyksj.mapper.channel.ChannelPopularizeMapper;
@@ -79,7 +79,7 @@ public class CmsOrderController {
 
 
 	private final OrderCommentMapper orderCommentMapper;
 	private final OrderCommentMapper orderCommentMapper;
 
 
-	private final GroupsRelationMapper relationMapper;
+	private final GoodsDonSkuMapper skuMapper;
 
 
 	private final ChannelPopularizeMapper channelPopularizeMapper;
 	private final ChannelPopularizeMapper channelPopularizeMapper;
 
 
@@ -504,12 +504,17 @@ public class CmsOrderController {
 	 */
 	 */
 	@GetMapping("/get/sameSpec/empty/relation")
 	@GetMapping("/get/sameSpec/empty/relation")
 	public Result<SearchResult<EmptyGroupsRelationView>> getSameSpecEmptyRelation(Long skuId, Long groupsId) {
 	public Result<SearchResult<EmptyGroupsRelationView>> getSameSpecEmptyRelation(Long skuId, Long groupsId) {
-		SearchResult<EmptyGroupsRelationView> search = beanSearcher.search(EmptyGroupsRelationView.class, MapUtils.flatBuilder(request.getParameterMap())
+		MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap())
 				.field(EmptyGroupsRelationView::getGroupsId, groupsId).op(Operator.NotEqual)
 				.field(EmptyGroupsRelationView::getGroupsId, groupsId).op(Operator.NotEqual)
-				.field(EmptyGroupsRelationView::getAvailableNum, 0).op(Operator.GreaterThan)
 				.field(EmptyGroupsRelationView::getStatus, GroupsTrips.Status.down.name()).op(Operator.NotEqual)
 				.field(EmptyGroupsRelationView::getStatus, GroupsTrips.Status.down.name()).op(Operator.NotEqual)
-				.field(EmptyGroupsRelationView::getSkuId, skuId).orderBy(EmptyGroupsRelationView::getAvailableNum).desc()
-				.build());
+				.field(EmptyGroupsRelationView::getSkuId, skuId).orderBy(EmptyGroupsRelationView::getAvailableNum)
+				.desc();
+		GoodsDonSku sku = skuMapper.selectById(skuId);
+		if (sku.getGoodsId() != 18) {
+			builder.field(EmptyGroupsRelationView::getAvailableNum, 0).op(Operator.GreaterThan);
+		}
+		SearchResult<EmptyGroupsRelationView> search = beanSearcher.search(EmptyGroupsRelationView.class,
+				builder.build());
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 	}
 }
 }

+ 15 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.annotation.Log;
 import com.cyksj.common.annotation.Log;
 import com.cyksj.common.annotation.NoSubmit;
 import com.cyksj.common.annotation.NoSubmit;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.dto.RedisKey;
 import com.cyksj.dto.Result;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.GatewayResponse;
 import com.cyksj.enums.GatewayResponse;
@@ -31,6 +32,7 @@ import com.cyksj.model.manage.views.GroupsRelationView;
 import com.cyksj.model.response.ExpiredAccountRep;
 import com.cyksj.model.response.ExpiredAccountRep;
 import com.cyksj.model.response.OrderDonAccountRep;
 import com.cyksj.model.response.OrderDonAccountRep;
 import com.cyksj.model.views.*;
 import com.cyksj.model.views.*;
+import com.cyksj.redis.RedisService;
 import com.cyksj.service.mange.CmsAccountService;
 import com.cyksj.service.mange.CmsAccountService;
 import com.cyksj.service.mange.CmsGroupService;
 import com.cyksj.service.mange.CmsGroupService;
 import com.cyksj.service.mange.cms.CmsUserManager;
 import com.cyksj.service.mange.cms.CmsUserManager;
@@ -94,6 +96,8 @@ public class CmsAccountController {
 
 
 	private final AccountDoubleVerifyRecordMapper doubleVerifyRecordMapper;
 	private final AccountDoubleVerifyRecordMapper doubleVerifyRecordMapper;
 
 
+	private final RedisService redisService;
+
 	@GetMapping("/get")
 	@GetMapping("/get")
 	@SaCheckPermission("account:view")
 	@SaCheckPermission("account:view")
 	public Result<SearchResult<AccountView>> get(Long userId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday) {
 	public Result<SearchResult<AccountView>> get(Long userId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday) {
@@ -387,6 +391,8 @@ public class CmsAccountController {
 	    if (db == null) {
 	    if (db == null) {
 		    throw BusinessRuntimeException.getInstance("该账号不存在");
 		    throw BusinessRuntimeException.getInstance("该账号不存在");
 	    }
 	    }
+	    Boolean isClear = false;
+	    String dbAccount = db.getAccount();
 	    long userId = StpUtil.getLoginIdAsLong();
 	    long userId = StpUtil.getLoginIdAsLong();
 	    if (!db.getPassword().equals(account.getPassword())) {
 	    if (!db.getPassword().equals(account.getPassword())) {
 		    account.setCustomerServiceId(0l);
 		    account.setCustomerServiceId(0l);
@@ -396,6 +402,7 @@ public class CmsAccountController {
 		    userTicketClearedRecordMapper.update(null, Wrappers.lambdaUpdate(UserTicketClearedRecord.class)
 		    userTicketClearedRecordMapper.update(null, Wrappers.lambdaUpdate(UserTicketClearedRecord.class)
 				    .set(UserTicketClearedRecord::getDeleted, false)
 				    .set(UserTicketClearedRecord::getDeleted, false)
 				    .eq(UserTicketClearedRecord::getAccountId, account.getId()));
 				    .eq(UserTicketClearedRecord::getAccountId, account.getId()));
+		    isClear = true;
 	    }
 	    }
 	    if (StrUtil.isNotBlank(account.getAccount())){
 	    if (StrUtil.isNotBlank(account.getAccount())){
 			account.setAccount(account.getAccount().trim());
 			account.setAccount(account.getAccount().trim());
@@ -409,6 +416,9 @@ public class CmsAccountController {
 					throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
 					throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
 				}
 				}
 			}
 			}
+		    if (!dbAccount.equals(account.getAccount())) {
+			    isClear = true;
+		    }
 		}
 		}
 	    if (StrUtil.isNotBlank(account.getPassword())){
 	    if (StrUtil.isNotBlank(account.getPassword())){
 		    account.setPassword(account.getPassword().trim());
 		    account.setPassword(account.getPassword().trim());
@@ -441,6 +451,11 @@ public class CmsAccountController {
 				    .eq(AccountDoubleVerifyRecord::getAccountId, account.getId()));
 				    .eq(AccountDoubleVerifyRecord::getAccountId, account.getId()));
 	    }
 	    }
 	    account.setStartTime(null);
 	    account.setStartTime(null);
+	    if (isClear){
+		    account.setGptRefreshToken(StrUtil.EMPTY);
+		    //清除gpt token
+		    redisService.del(RedisKey.CHATGPT_ACCESS_TOKEN + dbAccount);
+	    }
 	    accountService.updateById(account);
 	    accountService.updateById(account);
         return GatewayResponse.SUCCESS.newBuilder().toResult();
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
     }