fengjin
2022-11-23 5fe1243b526deffe146761a19dece3ede4fa603d
flower_city/src/main/java/com/dg/core/controller/GuideDoController.java
@@ -50,15 +50,23 @@
    public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum,
                                          @RequestParam(value = "pageSize",required = false) Integer pageSize,
                                          @RequestParam(value = "keyword",required = false) String keyword,
                                          @RequestParam(value = "isDivisionHead",required = false) String isDivisionHead,
                                          @CurrentUser SysUser sysUser)
    {
        Assert.notNull(pageNum, "pageNum can not be empty");
        Assert.notNull(pageSize, "pageSize can not be empty");
        Page<SysUser> pageParam = new Page<>(pageNum,pageSize);
        List<String> ids= PermissionUtil.getPermission(sysUser,iOrganizationChartService);
        List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"2",keyword,ids,null);
        int num=IUserService.selectNum("2",keyword,ids);
        List<SysUser> list ;
        int num;
        if (isDivisionHead!=null&&!isDivisionHead.equals("")){
            list = IUserService.selectConfigList(pageParam,pageSize,"2",keyword,ids,isDivisionHead);
            num=IUserService.selectNum("2",keyword,ids,isDivisionHead);
        }
        else{
            list = IUserService.selectConfigList(pageParam,pageSize,"2",keyword,ids,null);
            num=IUserService.selectNum("2",keyword,ids,null);
        }
        return getDataTable(list,num);
    }
@@ -72,7 +80,7 @@
    @ApiOperation("新增导办用户接口")
    @PostMapping("/add")
    @Authorization
    public ResultData insertConfig(@RequestBody SysUser config)
    public ResultData insertConfig(@RequestBody SysUser config,@CurrentUser SysUser sysUser)
    {
        Assert.notNull(config, "parameter can not be empty");
@@ -125,6 +133,13 @@
            user.setIsDivisionHead(config.getIsDivisionHead());
            user.setStatus(config.getStatus());
            user.setUpdateTime(LocalDateTime.now());
            user.setDepartmentIds(config.getDepartmentIds());
            user.setDepartmentIdStr(config.getDepartmentIdStr());
            user.setMoreDepartmentIds(config.getMoreDepartmentIds());
            user.setDataPermission(config.getMoreDepartmentIds().substring(config.getMoreDepartmentIds().indexOf(",")+1));
            user.setMattersIds(config.getMattersIds());
            user.setMasterNames(config.getMasterNames());
            user.setMattersNames(config.getMattersNames());
            //提示用户名或密码错误
            return toAjax(IUserService.updateConfig(user));
        }
@@ -137,6 +152,7 @@
        {
            config.setRoleIds("2");
        }
        config.setCreateBy(sysUser.getUserId());
        config.setCreateTime(LocalDateTime.now());
        config.setUpdateTime(LocalDateTime.now());
        config.setUserId(Snowflake.getId()+"");
@@ -176,6 +192,7 @@
        //是否是部门领导(1是  2不是)
        if(StringUtils.equals("1",config.getIsDivisionHead()))
        {
            config.setDataPermission(config.getMoreDepartmentIds().substring(config.getMoreDepartmentIds().indexOf(",")+1));
            config.setRoleIds("13");
        }
        else