zjh
5 天以前 f8150f79c0914080c42af9737d36c676f0c1a9f8
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java
@@ -8,6 +8,7 @@
import cn.hutool.extra.pinyin.PinyinUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ltkj.common.annotation.RepeatSubmit;
import com.ltkj.common.core.domain.entity.DictUserInfo;
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.hosp.domain.DictHosp;
@@ -20,6 +21,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.StringUtil;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -221,6 +223,7 @@
    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
    @PutMapping
    @ApiOperation(value = "修改用户")
    @RepeatSubmit
    public AjaxResult edit(@Validated @RequestBody SysUser user) {
        userService.checkUserAllowed(user);
        userService.checkUserDataScope(user.getUserId());
@@ -324,6 +327,16 @@
        return ajax;
    }
    @GetMapping("/userListByDeptId")
    public AjaxResult userListByDeptId(@RequestParam(required = false) String deptId){
        LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
        if(StringUtil.isNotBlank(deptId)){
            List<Long> deptIds = deptService.getDeptTreeById(deptId);
            wrapper.in(SysUser::getDeptId,deptIds);
        }
        return AjaxResult.success(userService.list(wrapper));
    }
    /**
     * 用户授权角色
     */