陈昶聿
3 天以前 1e5d108d1f1991b2ddda91a19de5716bee0f306d
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -573,15 +573,29 @@
                if (statisticaltype == 1) {
                    if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())) {
                        //全部病区
                        String deptInfo = user.getDeptInfo();
                        List<String> leavehospitaldistrictcodes = JSON.parseArray(deptInfo).stream().map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList());
                        List<String> leavehospitaldistrictcodes = null;
                        SysUserDept sysUserWard = new SysUserDept();
                        sysUserWard.setUserId(user.getUserId());
                        sysUserWard.setOrgid(user.getOrgid());
                        sysUserWard.setDeptType("2");
                        List<SysUserDept> wardList = sysUserDeptService.selectSysUserDeptList(sysUserWard);
                        if(CollectionUtils.isNotEmpty(wardList)) {
                            leavehospitaldistrictcodes = wardList.stream().map(SysUserDept::getDeptCode).collect(Collectors.toList());
                        }
                        serviceSubtaskCountReq.setLeavehospitaldistrictcodes(leavehospitaldistrictcodes);
                    }
                } else if (statisticaltype == 2) {
                    if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())) {
                        //全部科室
                        String hospInfo = user.getHospInfo();
                        List<String> deptCodes = JSON.parseArray(hospInfo).stream().map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList());
                        List<String> deptCodes = null;
                        SysUserDept sysUserDept = new SysUserDept();
                        sysUserDept.setUserId(user.getUserId());
                        sysUserDept.setOrgid(user.getOrgid());
                        sysUserDept.setDeptType("1");
                        List<SysUserDept> deptList = sysUserDeptService.selectSysUserDeptList(sysUserDept);
                        if(CollectionUtils.isNotEmpty(deptList)){
                            deptCodes = deptList.stream().map(SysUserDept::getDeptCode).collect(Collectors.toList());
                        }
                        serviceSubtaskCountReq.setDeptcodes(deptCodes);
                    }
                }