liusheng
8 天以前 c111e3eff1191b29d2d2baf2f485a4bf3a2edc00
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);
    }
    /**
     * 查询当前登陆人自己(病区、部门)的患者住院记录列表
@@ -92,6 +93,8 @@
    @PostMapping("/selectPatMedInhospListCount")
    @ApiOperation("查询出、入院看病人次和人数")
    public AjaxResult selectPatMedInhospListCount(PatMedReq patMedReq) {
        SysUser user = getLoginUser().getUser();
        patMedReq.setOrgid(user.getOrgid());
        return success(patMedInhospService.selectPatMedInhospListCount(patMedReq));
    }
@@ -174,4 +177,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()));
    }
}