liusheng
2025-07-08 c410c133f21297fc2bf6fc32335652eb07eb6d52
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
@@ -46,9 +46,9 @@
        //获取当前登陆人
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        if (!"admin".equals(user.getUserName()) && CollectionUtils.isEmpty(patMedInhosp.getDeptcodes()) && CollectionUtils.isEmpty(patMedInhosp.getHospitaldistrictcodes()))
            //如果在院病区科室同时间为空,返回空
        if (!"admin".equals(user.getUserName()) && shouldReturnEmpty(patMedInhosp)) {
            return getDataTable2(0, null);
        }
        PageUtils.startPageByPost(patMedInhosp.getPageNum(), patMedInhosp.getPageSize());
        List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp);
@@ -60,6 +60,7 @@
        });
        return getDataTable2(count, list);
    }
    /**
     * 查询当前登陆人自己(病区、部门)的患者住院记录列表
@@ -174,4 +175,14 @@
        return getDataTable(patMedInhospService.getDocAndPat(patMedInhosp));
    }
    private boolean shouldReturnEmpty(PatMedInhosp patMedInhosp) {
        return (patMedInhosp.getCry() == 1
                && CollectionUtils.isEmpty(patMedInhosp.getLeaveldeptcodes())
                && CollectionUtils.isEmpty(patMedInhosp.getLeavehospitaldistrictcodes()))
                || (patMedInhosp.getCry() == 0
                && CollectionUtils.isEmpty(patMedInhosp.getDeptcodes())
                && CollectionUtils.isEmpty(patMedInhosp.getHospitaldistrictcodes()));
    }
}