jiangping
2024-05-07 541c8aa8d08e4bb758adad33167d1e84943cbfec
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -194,6 +194,12 @@
                .eq(SystemUser::getUsername,company.getUsername()))>0){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该登录账号已存在,请更新重试~");
        }
        if(systemUserMapper.selectCount(new QueryWrapper<SystemUser>().lambda()
                .eq(SystemUser::getDeleted,Boolean.TRUE)
                .eq(SystemUser::getMobile,company.getPhone()))>0){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该手机号已存在,请更换重试~");
        }
        SystemUser user = new SystemUser();
        user.setUsername(company.getUsername());
        // 生成密码盐
@@ -218,6 +224,12 @@
                .eq(SystemUser::getUsername,company.getUsername()))>0){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该登录账号已存在,请更新重试~");
        }
        if(systemUserMapper.selectCount(new QueryWrapper<SystemUser>().lambda()
                .eq(SystemUser::getDeleted,Boolean.TRUE)
                .ne(SystemUser::getUsername,company.getUsername())
                .eq(SystemUser::getMobile,company.getPhone()))>0){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该手机号已存在,请更新重试~");
        }
        SystemUser model = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda()
                .eq(SystemUser::getDeleted,Boolean.TRUE)
                .eq(SystemUser::getUsername,oldUserName).last("limit 1"));
@@ -240,6 +252,7 @@
            user.setStatus(Constants.ZERO);
            systemUserMapper.insert(user);//插入新的管理员账号
        }else{
            model.setMobile(company.getPhone());
            model.setUsername(company.getUsername());
            model.setCreateUser(company.getCreator());
            model.setCreateTime(company.getCreateDate());