限制人员添加用户

This commit is contained in:
2025-01-08 10:12:43 +08:00
parent f6b489d950
commit 66158e94dd

View File

@@ -502,7 +502,7 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
account.setCreateDate(new Date()); account.setCreateDate(new Date());
account.setIsBeginner(1); account.setIsBeginner(1);
log.info("添加用户:{}", accountAddDTO.getUserEmail()); log.info("管理员:{}添加用户账号{}", UserContext.getUserHolder().getUsername(), accountAddDTO.getUserEmail());
return accountService.save(account); return accountService.save(account);
} }
@@ -515,13 +515,16 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
throw new BusinessException("you have to choose a user"); throw new BusinessException("you have to choose a user");
} }
String username = UserContext.getUserHolder().getUsername();
Account account = new Account(); Account account = new Account();
// 修改用户有效期截止日期、用户类型、积分 // 修改用户有效期截止日期、用户类型、积分
if (!Objects.isNull(validEndTime)) { if (!Objects.isNull(validEndTime)) {
account.setValidEndTime(validEndTime); account.setValidEndTime(validEndTime);
log.info("管理员:{},修改用户 {} 信息,将账号到期时间置为:{}", username, accountId, validEndTime);
} }
if (!Objects.isNull(systemUser)) { if (!Objects.isNull(systemUser)) {
account.setSystemUser(systemUser); account.setSystemUser(systemUser);
log.info("管理员:{},修改用户 {} 信息,将账号身份置为:{}", username, accountId, systemUser);
} }
/*if (!StringUtils.isNullOrEmpty(systemUser)) { /*if (!StringUtils.isNullOrEmpty(systemUser)) {
int systemUser = 0; int systemUser = 0;
@@ -543,10 +546,10 @@ public class ConvenientInquiryServiceImpl extends ServiceImpl<QuestionnaireMappe
}*/ }*/
if (!Objects.isNull(credits)) { if (!Objects.isNull(credits)) {
account.setCredits(new BigDecimal(credits)); account.setCredits(new BigDecimal(credits));
log.info("管理员:{},修改用户 {} 信息,将账号积分置为:{}", username, accountId, credits);
} }
account.setId(accountId); account.setId(accountId);
account.setUpdateDate(new Date()); account.setUpdateDate(new Date());
log.info("修改用户信息:{}", accountId);
return accountMapper.updateById(account) == 1; return accountMapper.updateById(account) == 1;
// accountService.update(account,null); // accountService.update(account,null);
} }