fengjin
2022-11-23 5fe1243b526deffe146761a19dece3ede4fa603d
flower_city/src/main/java/com/dg/core/controller/UserController.java
@@ -113,6 +113,7 @@
            map.put("userType", user.getUserType());
            map.put("departmentId", user.getDepartmentId());
            map.put("departmentName", user.getDepartmentName());
            map.put("moreDepartmentIds", user.getMoreDepartmentIds());
            return ResultData.success(map);
        }
@@ -148,6 +149,7 @@
            map.put("userType", user.getUserType());
            map.put("departmentId", user.getDepartmentId());
            map.put("departmentName", user.getDepartmentName());
            map.put("moreDepartmentIds", user.getMoreDepartmentIds());
            return ResultData.success(map);
        }
@@ -195,9 +197,9 @@
        Assert.notNull(pageNum, "pageNum can not be empty");
        Assert.notNull(pageSize, "pageSize can not be empty");
        Page<SysUser> pageParam = new Page<>(pageNum,pageSize);
        List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"3",keyword,null);
        List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,null,keyword,null,"1");
        int num=IUserService.selectNum("3",keyword,null);
        int num=IUserService.selectNum(null,keyword,null,"1");
        return getDataTable(list,num);
    }
@@ -246,7 +248,7 @@
                config.setUserId(user.getUserId());
                config.setCreateBy(user.getUserId()+"");
                config.setUserType("3");
                config.setIsDivisionHead("1");
                config.setUpdateTime(LocalDateTime.now());
                return toAjax(IUserService.updateConfig(config));
            }
@@ -264,7 +266,7 @@
                config.setUserId(user2.getUserId());
                config.setCreateBy(user2.getUserId()+"");
                config.setUserType("3");
                config.setIsDivisionHead("1");
                config.setUpdateTime(LocalDateTime.now());
                return toAjax(IUserService.updateConfig(config));
            }
@@ -278,6 +280,7 @@
        config.setCreateBy(sysUser.getUserId()+"");
        config.setUserId(Snowflake.getId()+"");
        config.setUserType("3");
        config.setIsDivisionHead("1");
        config.setCreateTime(LocalDateTime.now());
        config.setUpdateTime(LocalDateTime.now());
@@ -390,6 +393,30 @@
    }
    /**
     * 获取登录人员信息
     *
     * @return 结果
     */
    @ApiOperation(value = "获取登录人员信息,userType=1 为超级管理员  isDivisionHead=1 为部门领导",response = SysUser.class)
    @PostMapping("/getLoginInformation")
    @Authorization
    public ResultData getLoginInformation(@CurrentUser SysUser sysUse)
    {
      return  ResultData.success(sysUse);
    }
    @ApiOperation("切换部门接口")
    @GetMapping(value = "/switch/department")
    public ResultData switchDepartment(@RequestParam(value = "departmentId",required = false) String departmentId,
                                       @CurrentUser SysUser sysUse)
    {
        sysUse.setDepartmentId(departmentId);
        return toAjax(IUserService.updateConfig(sysUse));
    }