|
@@ -33,6 +33,7 @@ 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.redis.RedisService;
|
|
|
|
|
+import com.cyksj.service.mange.AccountCommonService;
|
|
|
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;
|
|
@@ -98,6 +99,8 @@ public class CmsAccountController {
|
|
|
|
|
|
|
|
private final AccountUpdatePasswordRecordMapper accountUpdatePasswordRecordMapper;
|
|
private final AccountUpdatePasswordRecordMapper accountUpdatePasswordRecordMapper;
|
|
|
|
|
|
|
|
|
|
+ private final AccountCommonService accountCommonService;
|
|
|
|
|
+
|
|
|
private final RedisService redisService;
|
|
private final RedisService redisService;
|
|
|
|
|
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
@@ -347,10 +350,7 @@ public class CmsAccountController {
|
|
|
account.setPassword(account.getPassword().trim());
|
|
account.setPassword(account.getPassword().trim());
|
|
|
//账号是否已经添加过
|
|
//账号是否已经添加过
|
|
|
if (!account.getAccount().contains("客服")) {
|
|
if (!account.getAccount().contains("客服")) {
|
|
|
- int count = accountService.count(Wrappers.lambdaQuery(Account.class)
|
|
|
|
|
- .eq(Account::getAccount, account.getAccount())
|
|
|
|
|
- .eq(Account::getGoodsId, account.getGoodsId()));
|
|
|
|
|
- if (count > 0) {
|
|
|
|
|
|
|
+ if (accountCommonService.checkIsDupAccount(account.getGoodsId(), account.getAccount())) {
|
|
|
throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
|
|
throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -388,10 +388,7 @@ public class CmsAccountController {
|
|
|
if (StrUtil.isNotBlank(data.getAccount())) {
|
|
if (StrUtil.isNotBlank(data.getAccount())) {
|
|
|
//账号是否已经添加过
|
|
//账号是否已经添加过
|
|
|
if (!account.contains("客服")) {
|
|
if (!account.contains("客服")) {
|
|
|
- int count = accountService.count(Wrappers.lambdaQuery(Account.class)
|
|
|
|
|
- .eq(Account::getAccount, account)
|
|
|
|
|
- .eq(Account::getGoodsId, goodsId));
|
|
|
|
|
- if (count > 0) {
|
|
|
|
|
|
|
+ if (accountCommonService.checkIsDupAccount(goodsId, account)) {
|
|
|
log.info("该平台下:{}已生成该账号:{}", goodsId, account);
|
|
log.info("该平台下:{}已生成该账号:{}", goodsId, account);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -446,15 +443,11 @@ public class CmsAccountController {
|
|
|
.eq(UserTicketClearedRecord::getAccountId, account.getId()));
|
|
.eq(UserTicketClearedRecord::getAccountId, account.getId()));
|
|
|
isClear = true;
|
|
isClear = true;
|
|
|
}
|
|
}
|
|
|
- if (StrUtil.isNotBlank(account.getAccount())){
|
|
|
|
|
|
|
+ if (!db.getAccount().equals(account.getAccount())){
|
|
|
account.setAccount(account.getAccount().trim());
|
|
account.setAccount(account.getAccount().trim());
|
|
|
//账号是否已经添加过
|
|
//账号是否已经添加过
|
|
|
if (!account.getAccount().contains("客服")) {
|
|
if (!account.getAccount().contains("客服")) {
|
|
|
- int count = accountService.count(Wrappers.lambdaQuery(Account.class)
|
|
|
|
|
- .ne(Account::getId, account.getId())
|
|
|
|
|
- .eq(Account::getAccount, account.getAccount())
|
|
|
|
|
- .eq(Account::getGoodsId, account.getGoodsId()));
|
|
|
|
|
- if (count > 0) {
|
|
|
|
|
|
|
+ if (accountCommonService.checkIsDupAccount(account.getGoodsId(), account.getAccount())) {
|
|
|
throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
|
|
throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -680,15 +673,6 @@ public class CmsAccountController {
|
|
|
if (account.getGoodsId() != 1l) {
|
|
if (account.getGoodsId() != 1l) {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
- //账号是否已经添加过
|
|
|
|
|
- if (!account.getAccount().contains("客服")) {
|
|
|
|
|
- int count = accountService.count(Wrappers.lambdaQuery(Account.class)
|
|
|
|
|
- .eq(Account::getAccount, account.getAccount())
|
|
|
|
|
- .eq(Account::getGoodsId, account.getGoodsId()));
|
|
|
|
|
- if (count > 0) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("该平台下已生成该账号");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
Boolean flag = false;
|
|
Boolean flag = false;
|
|
|
String oldPwd = account.getPassword();
|
|
String oldPwd = account.getPassword();
|
|
|
if (account != null) {
|
|
if (account != null) {
|