Browse Source

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing 2 years ago
parent
commit
1223844818

+ 51 - 4
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -1038,8 +1038,8 @@ public class DailyReportUploadService {
        result.put("benrenVerified",benrenVerified);//本人上级未核实
        result.put("benrenNotVerified",benrenNotVerified);//本人上级已核实
        result.put("notVerifiedTotal",selectListInfoByTotal2(doctorId,dept,"0",null,null,null,null,null).size());//未核实数量(本人+管辖部门)
        result.put("doubtTotal",selectListInfoByTotal2(doctorId,dept,null,null,null,null,1,null).size());//效能异常(本人+管辖部门)
        result.put("notVerifiedTotal",selectListInfoByTotal2(doctorId,dept,"0",null,null,null,null,null,null).size());//未核实数量(本人+管辖部门)
        result.put("doubtTotal",selectListInfoByTotal2(doctorId,dept,null,null,null,null,1,null,null).size());//效能异常(本人+管辖部门)
        result.put("urgingTotal",getUrgingList(doctorId,dept,null,null,null,null,null,null).size());//催促数量(本人+管辖部门)
        result.put("reportUploadDO",reportUploadDO);
        return result;
@ -1478,7 +1478,7 @@ public class DailyReportUploadService {
     * @param doubtState 存疑0无存疑1存疑
     * @return
     */
    public List<Map<String,Object>> selectListInfoByTotal2(String user,String dept,String state,String startDate,String endDate,String name,Integer doubtState,Integer readState) {
    public List<Map<String,Object>> selectListInfoByTotal2(String user,String dept,String state,String startDate,String endDate,String name,Integer doubtState,Integer readState,String filterOthers) {
        String sqlCondition = " ";
        String boosID = "";
@ -1519,13 +1519,21 @@ public class DailyReportUploadService {
            for (BaseDoctorRoleDO roleDO:baseDoctorRoleDOS){
                if (roleDO.getRoleCode().equalsIgnoreCase("admin")||roleDO.getRoleCode().equalsIgnoreCase("deptAdmin")){
                    flag = false;
                    if (StringUtils.isNotBlank(filterOthers)){//只返回自己应核实的数据
                        if("1".equals(filterOthers)){
                            List<String> myDoctors = getDoctorByRole(user);
                            String doctorsIn = myDoctors.stream().map(String::valueOf).collect(Collectors.joining("','"));
                            condition += " and doc.id in ('"+doctorsIn+"') ";
                        }
                    }
                    break;
                }
            }
            if (flag){
                condition = " and doc.id='"+user+"' ";
                condition += " and doc.id='"+user+"' ";
            }
        }
        sql = " select doc.name,dh.dept_code,dh.dept_name,d1.id,doc.job_title_name as jobTitleName,doc.photo,report_date reportDate,d1.state,total_hour," +
                "\tdoubt_type AS doubtType,\n" +
                "\tdoubt_state AS doubtState,\n" +
@ -4496,6 +4504,45 @@ public class DailyReportUploadService {
        return result;
    }
    /**
     * 获取管理员直系下属,
     * @param user
     * @return
     */
    public List<String> getDoctorByRole(String user){
        List<String> doctors = new ArrayList<>();
        String sql = " select dict_value from wlyy_hospital_sys_dict where dict_name='BOOS_ADMIN_SENDER'  ";
        List<String> boosSenderIds = jdbcTemplate.queryForList(sql, String.class);
        String boosID = " ";
        if (boosSenderIds.size() > 0) {
            boosID = boosSenderIds.get(0);
        }
        sql = " select * from base_doctor_role where doctor_code='"+user+"' ";
        List<Map<String,Object>> userRoles = jdbcTemplate.queryForList(sql);
        if (userRoles.size()==0){
        }else {
            String role_code = userRoles.get(0).get("role_code").toString();
            if ("admin".equals(role_code)){
                sql =  " select DISTINCT doctor_code from base_doctor_role where doctor_code<>'"+boosID+"'" +
                        " UNION " +
                        "SELECT DISTINCT doc.id from base_doctor doc INNER JOIN base_doctor_hospital dh  " +
                        "on doc.id = dh.doctor_code and doc.del=1 and dh.del=1 and doc.identity=0  " +
                        "LEFT JOIN (select role.doctor_code,dh.dept_code from base_doctor_role role INNER JOIN base_doctor doc on role.doctor_code = doc.id and doc.del=1 " +
                        " INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1  )RU on dh.dept_code = RU.dept_code " +
                        " where RU.dept_code is null  ";
                doctors = jdbcTemplate.queryForList(sql,String.class);
            } else if ("deptAdmin".equals(role_code)) {//查询出管理员所在部门
                sql =" select distinct dh2.doctor_code from base_doctor_hospital dh " +
                        "INNER JOIN base_doctor_hospital dh2 on dh.dept_code = dh2.dept_code " +
                        "INNER JOIN base_doctor doc on dh2.doctor_code = doc.id   " +
                        "where dh.doctor_code='"+user+"' and dh.del=1 and doc.identity=0 and dh2.del=1 and doc.del=1  ";
                doctors = jdbcTemplate.queryForList(sql,String.class);
            }
        }
        return doctors;
    }
    /**
     * 初始化项目成员

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dailyReport/DailyReportUploadPoint.java

@ -454,9 +454,11 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
                                             @ApiParam(name = "endDate", value = "结束时间")
                                             @RequestParam(value = "endDate", required = false) String endDate,
                                             @ApiParam(name = "name", value = "具体医生姓名")
                                             @RequestParam(value = "name", required = false) String name) {
                                             @RequestParam(value = "name", required = false) String name,
                                             @ApiParam(name = "filterOthers", value = "过滤不属于自己核实的数据1过滤 0不过滤")
                                             @RequestParam(value = "filterOthers", required = false) String filterOthers) {
        try {
            return ListEnvelop.getSuccess("success",dailyReportUploadService.selectListInfoByTotal2(user,dept,state,startDate,endDate,name,doubtState,readState));
            return ListEnvelop.getSuccess("success",dailyReportUploadService.selectListInfoByTotal2(user,dept,state,startDate,endDate,name,doubtState,readState,filterOthers));
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }