Browse Source

代码修改

liubing 2 years ago
parent
commit
8359bc37ce

+ 77 - 7
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -3423,7 +3423,7 @@ public class DailyReportUploadService {
                startDateTmp = DateUtil.strToDate(startResult.get(0));
            }
        }else {
            sql = " select min(begin_time) from base_daily_report_item where begin_time is not null  ";
            sql = " select min(begin_time) from base_daily_report_item where  begin_time is not null and del=1  ";
            if (StringUtils.isNotBlank(projectCode)){
                sql += "  and project_code='"+projectCode+"' ";
            }
@ -3483,7 +3483,7 @@ public class DailyReportUploadService {
                " INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1 " +
                "Inner JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 " +
                "LEFT JOIN base_daily_report_detail rd on up.id = rd.report_id " +
                "inner join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 where 1=1 " +
                "LEFT join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 where 1=1 " +
                "and DATE_FORMAT(up.report_date,'%w') BETWEEN 1 and 5  "+sqlWhere;
        //只计算出周一到周五上传的数量去求未上传
@ -3514,7 +3514,7 @@ public class DailyReportUploadService {
                "INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1 " +
                "Inner JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 " +
                "LEFT JOIN base_daily_report_detail rd on up.id = rd.report_id " +
                " inner join base_daily_report_item i on i.id = rd.report_item_id and i.del=1  where 1=1 " +
                " LEFT join base_daily_report_item i on i.id = rd.report_item_id and i.del=1  where 1=1 " +
                " "+sqlWhere;
        acWorkHours = jdbcTemplate.queryForObject(acWorkHoursSql,Double.class);
@ -3523,7 +3523,7 @@ public class DailyReportUploadService {
                "INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1 " +
                "Inner JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 " +
                "LEFT JOIN base_daily_report_detail rd on up.id = rd.report_id " +
                "inner join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 where 1=1 " +
                "LEFT join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 where 1=1 " +
                " "+sqlWhere+" and rd.doubt_type is not null group by rd.doubt_type";
        List<Map<String,Object>> doubtTypeList = jdbcTemplate.queryForList(doubtTypeSql);
        for (Map<String,Object>tmp:doubtTypeList){
@ -3558,7 +3558,7 @@ public class DailyReportUploadService {
                "INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1 " +
                "Inner JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 " +
                "LEFT JOIN base_daily_report_detail rd on up.id = rd.report_id " +
                "inner join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 where 1=1 " +
                "LEFT join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 where 1=1 " +
                " "+sqlWhere+" group by doctor_duty_code ";
        List<Map<String,Object>> doctorTypeHourList = jdbcTemplate.queryForList(doctorTypeSql);
@ -3794,7 +3794,7 @@ public class DailyReportUploadService {
                "DATE_FORMAT(rd.create_time,'%Y-%m-%d %H:%i:%S') create_time,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time," +
                " CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt', " +
                " rd.doubt_type doubtType, rd.remark " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1  " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id " +
                "INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 LEFT JOIN  " +
                "base_daily_report_detail rd on up.id = rd.report_id " +
                "LEFT JOIN base_daily_report_item it on rd.report_item_id = it.id " +
@ -3853,7 +3853,7 @@ public class DailyReportUploadService {
                "DATE_FORMAT(rd.create_time,'%Y-%m-%d %H:%i:%S') create_time,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time," +
                " CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt'," +
                " rd.doubt_type doubtType, rd.remark " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1  " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id " +
                "INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 LEFT JOIN  " +
                "base_daily_report_detail rd on up.id = rd.report_id " +
                "LEFT JOIN base_daily_report_item it on rd.report_item_id = it.id " +
@ -4023,7 +4023,77 @@ public class DailyReportUploadService {
            JSONObject tmp = JSONObject.parseObject(dictValues.get(0));
            doubtTypeObj = tmp.getJSONObject("dailyReportDoubtTypeName");
        }
        Set<String> resultTimeList = new HashSet<>();
        Date startDateTmp = DateUtil.strToDate(startDate);
        Date endDateTmp = DateUtil.strToDate(endDate);
        for (;!startDateTmp.after(endDateTmp);){
            resultTimeList.add(DateUtil.dateToStr(startDateTmp,DateUtil.YYYY_MM_DD));
            startDateTmp = DateUtil.getNextDay1(startDateTmp,1);
        }
        if(userCompleteList.size()>0){
            String doctorTmp = null;
            String doctorNameTmp = null;
            String deptNameTmp = null;
            String jobTitleNameTmp = null;
            Set searchTimeList = new HashSet();
            List<Map<String,Object>> notReportList = new ArrayList<>();
            for(Map<String,Object>tmp:userCompleteList){
                String doctorId = null==tmp.get("doctor_id")?"":tmp.get("doctor_id").toString();
                String reportDate = null==tmp.get("report_date")?"":tmp.get("report_date").toString();
                String doctorName = null==tmp.get("doctor_name")?"":tmp.get("doctor_name").toString();
                String deptName = null==tmp.get("dept_name")?"":tmp.get("dept_name").toString();
                String jobTitleName = null==tmp.get("job_title_name")?"":tmp.get("job_title_name").toString();
                if(StringUtils.isBlank(doctorTmp)){
                    doctorTmp = doctorId;
                    doctorNameTmp = doctorName;
                    deptNameTmp = deptName;
                    jobTitleNameTmp = jobTitleName;
                }
                if (!doctorTmp.equals(doctorId)){
                    for (String tmpTime:resultTimeList){
                        if (!searchTimeList.contains(tmpTime)){
                            Map<String,Object> notReportObj = new HashMap<>();
                            notReportObj.put("doctor_id",doctorTmp);
                            notReportObj.put("report_date",tmpTime);
                            notReportObj.put("doctor_name",doctorNameTmp);
                            notReportObj.put("dept_name",deptNameTmp);
                            notReportObj.put("job_title_name",jobTitleNameTmp);
                            notReportObj.put("week_name",DateUtil.getWeekStr(tmpTime));
                            System.out.println(tmpTime+":"+DateUtil.getWeekStr(tmpTime));
                            notReportList.add(notReportObj);
                        }
                    }
                    searchTimeList = new HashSet();
                    searchTimeList.add(reportDate);
                    doctorTmp = doctorId;
                    doctorNameTmp = doctorName;
                    deptNameTmp = deptName;
                    jobTitleNameTmp = jobTitleName;
                }else {
                    searchTimeList.add(reportDate);
                }
            }
            for (String tmpTime:resultTimeList){
                if (!searchTimeList.contains(tmpTime)){
                    Map<String,Object> notReportObj = new HashMap<>();
                    notReportObj.put("doctor_id",doctorTmp);
                    notReportObj.put("report_date",tmpTime);
                    notReportObj.put("doctor_name",doctorNameTmp);
                    notReportObj.put("dept_name",deptNameTmp);
                    notReportObj.put("job_title_name",jobTitleNameTmp);
                    notReportObj.put("week_name",DateUtil.getWeekStr(tmpTime));
                    System.out.println(DateUtil.getWeekStr(tmpTime));
                    notReportList.add(notReportObj);
                }
            }
            userCompleteList.addAll(notReportList);
        }
        userCompleteList.sort(Comparator.comparing(e->((Map<String,Object>)e).get("dept_name").toString()).reversed().thenComparing(e->((Map<String,Object>)e).get("doctor_id").toString()).thenComparing(e->((Map<String,Object>)e).get("report_date").toString()));
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        WritableSheet sheet = wwb.createSheet("sheet", 1);
        String[] header = {"员工完成情况("+startDate+"至"+endDate+")","","","","","","","","","","","","","","","","","",""};//

+ 7 - 7
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -800,19 +800,19 @@ public class DateUtil {
    public static String getWeekStr(String sdate) {
        String str = "";
        str = DateUtil.getWeek(sdate);
        if ("1".equals(str)) {
        if ("1".equals(str)||"Monday".equals(str)) {
            str = "星期日";
        } else if ("2".equals(str)) {
        } else if ("2".equals(str)||"Tuesday".equals(str)) {
            str = "星期一";
        } else if ("3".equals(str)) {
        } else if ("3".equals(str)||"Wednesday".equals(str)) {
            str = "星期二";
        } else if ("4".equals(str)) {
        } else if ("4".equals(str)||"Thursday".equals(str)) {
            str = "星期三";
        } else if ("5".equals(str)) {
        } else if ("5".equals(str)||"Friday".equals(str)) {
            str = "星期四";
        } else if ("6".equals(str)) {
        } else if ("6".equals(str)||"Saturday".equals(str)) {
            str = "星期五";
        } else if ("7".equals(str)) {
        } else if ("7".equals(str)||"Sunday".equals(str)) {
            str = "星期六";
        }
        return str;