陈昶聿
17 小时以前 0d10bc99eec75672b049339399e4f762fbd9746e
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -4,6 +4,7 @@
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.*;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
@@ -133,6 +134,7 @@
        SysUserDept sysUserDept = new SysUserDept();
        sysUserDept.setUserId(sysUser.getUserId());
        sysUserDept.setDeptType(sysUser.getSearchscope());
        sysUserDept.setOrgid(sysUser.getOrgid());
        List<SysUserDept> sysUserDeptKSs = null;
        List<SysUserDept> sysUserDeptBQs = null;
        if (StringUtils.isNotEmpty(sysUser.getSearchscope()) && sysUser.getSearchscope().equals("0")) {
@@ -181,14 +183,16 @@
        String[] split = userName.split("&");
        SysUser sysUser = userMapper.selectUserByUserNameByCondition(split[0], split[1], null);
        if (Objects.isNull(sysUser)) return sysUser;
        //这里只卡用户类型为“患者”的
        if (sysUser.getUserType().equals("患者") && StringUtils.isNotEmpty(split[3]) && !split[3].equals("null") && !sysUser.getUserType().equals(split[3].trim()))
            throw new BaseException("当前用户类型与登录用户类型不一致");
        boolean isAdmin = StringUtils.isNotEmpty(split[0]) && "admin".equals(split[0]);
        IUserExtInfoService userExtInfoService = SpringUtils.getBean(IUserExtInfoService.class);
        Executor executor = SpringUtils.getBean("threadPoolTaskExecutor");
        // === 并行查询: 用户机构信息 + 部门列表 ===
        CompletableFuture<Map<String, String>> orgInfoFuture = CompletableFuture.supplyAsync(() ->
                userExtInfoService.getUserOrgInfo(sysUser.getUserId().toString(), split[1], split[2]), executor);
        CompletableFuture<Map<String, String>> orgInfoFuture = CompletableFuture.supplyAsync(() -> userExtInfoService.getUserOrgInfo(sysUser.getUserId().toString(), split[1], split[2]), executor);
        CompletableFuture<List<SysDept>> deptsFuture;
        if (isAdmin) {
@@ -340,10 +344,7 @@
        //获取当前登陆人的机构和院�?
        IUserExtInfoService userExtInfoService2 = SpringUtils.getBean(IUserExtInfoService.class);
        Map<String, String> userOrgInfo2 = userExtInfoService2.getUserOrgInfo(
                sysUser.getUserId().toString(),
                split[1],
                split[3]);
        Map<String, String> userOrgInfo2 = userExtInfoService2.getUserOrgInfo(sysUser.getUserId().toString(), split[1], split[3]);
        if (!userOrgInfo2.isEmpty()) {
            sysUser.setOrgid(userOrgInfo2.get("orgid"));
            sysUser.setCampusid(userOrgInfo2.get("campusid"));