|
@@ -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();
|
|
|
}
|
|
}
|