xuhy
3 天以前 508f3e225df87e0da974424981e7782fc5ce875c
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -295,7 +295,7 @@
    {
        Long userId = user.getUserId();
        // 删除用户与角色关联
//        userRoleMapper.deleteUserRoleByUserId(userId);
        userRoleMapper.deleteUserRoleByUserId(userId);
        // 新增用户与角色管理
        insertUserRoleId(user);
        // 删除用户与岗位关联
@@ -614,11 +614,6 @@
    }
    @Override
    public int updateUserIfBlack(List<Long> ids) {
        return userMapper.updateUserIfBlack(ids);
    }
    @Override
    public List<SysUser> selectAllList() {
        return userMapper.selectAllList();
    }
@@ -642,19 +637,23 @@
    }
    @Override
    public void addAccount(TShopDTO dto) {
    public Long addAccount(TShopDTO dto) {
        SysUser sysUser = new SysUser();
        sysUser.setUserName(dto.getAccount());
        sysUser.setPhonenumber(dto.getAccount());
        sysUser.setNickName(dto.getShopHead());
        if(dto.getShopType() ==1){
        sysUser.setObjectId(dto.getId());
        if(dto.getShopType().equals(1)){
            sysUser.setRoleType(2);
            sysUser.setRoleId(9L);
        }else {
            sysUser.setRoleType(3);
            sysUser.setRoleId(2L);
        }
        sysUser.setPassword(SecurityUtils.encryptPassword(dto.getPassword()));
        sysUser.setRePassword(SecurityUtils.encryptPassword("123456"));
        this.insertUser(sysUser);
        // TODO 自动绑定角色
        return sysUser.getUserId();
    }
    @Override