|
@@ -311,6 +311,17 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
|
|
@Override
|
|
|
public Boolean editUser(UserEditInfoRequest request) {
|
|
|
User user = getInfo();
|
|
|
+ //修改昵称后 修改企业账户信息
|
|
|
+ LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId,user.getId());
|
|
|
+ List<UserEnterprise> list = userEnterpriseService.list(enterpriseLambdaQueryWrapper);
|
|
|
+ if (null!=list&&list.size()>0){
|
|
|
+ for (UserEnterprise userEnterprise : list) {
|
|
|
+ userEnterprise.setNickname(request.getNickname());
|
|
|
+ userEnterpriseService.updateById(userEnterprise);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
LambdaUpdateWrapper<User> wrapper = Wrappers.lambdaUpdate();
|
|
|
wrapper.set(User::getNickname, request.getNickname());
|
|
|
wrapper.set(User::getAvatar, systemAttachmentService.clearPrefix(request.getAvatar()));
|
|
@@ -1161,11 +1172,14 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
|
|
LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
|
|
|
UserEnterprise one = userEnterpriseService.getOne(enterpriseLambdaQueryWrapper);
|
|
|
- BigDecimal usedLineOfCredit = one.getUsedLineOfCredit();
|
|
|
- int i = usedLineOfCredit.compareTo(BigDecimal.valueOf(0));
|
|
|
- if (i > 0) {
|
|
|
- return false;
|
|
|
+ if (null!=one){
|
|
|
+ BigDecimal usedLineOfCredit = one.getUsedLineOfCredit();
|
|
|
+ int i = usedLineOfCredit.compareTo(BigDecimal.valueOf(0));
|
|
|
+ if (i > 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
userEnterpriseService.remove(enterpriseLambdaQueryWrapper);
|
|
|
if (null != one) {
|
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -1175,7 +1189,6 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
|
|
//注销企业子用户
|
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(UserBypassAccount::getUserId, user.getId());
|
|
|
- queryWrapper.eq(UserBypassAccount::getIsDelete, 1);
|
|
|
userBypassAccountService.remove(queryWrapper);
|
|
|
|
|
|
|