//package com.emr.controller;
//
//import com.emr.entity.Archive_Master_Vo;
//import com.emr.entity.OffsetLimitPage;
//import com.emr.service.Archive_MasterService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.ArrayList;
//import java.util.List;
//
//
//@Controller
//@RequestMapping("pathological/")
//public class PathologicalReportController {
//    @Autowired
//    private Archive_MasterService archiveMasterService;
//    /**
//     * 病理报表
//     * @return
//     */
//    @RequestMapping("pathologicalReport")
//    public String pathologicalReport(Model model, String startDateTo, String endDateTo){
//        model.addAttribute("startDate",startDateTo);
//        model.addAttribute("endDate",endDateTo);
//        return "pathological/pathologicalReport";
//    }
//
//    /**
//     * 病理报表统计分页查询
//     * @return
//     */
//    @RequestMapping("getPathologicalReportList")
//    @ResponseBody
//    public OffsetLimitPage getPathologicalReportList(Integer offset,
//                                               Integer limit,
//                                               Archive_Master_Vo Archive_Master_Vo,
//                                               HttpServletRequest request){
//        List<Archive_Master_Vo>   ArchiveMasterList =  archiveMasterService.selectArchiveMasterVoAndExt(Archive_Master_Vo);
//        OffsetLimitPage offsetLimitPage = new OffsetLimitPage();
//        offsetLimitPage.setTotal((long) ArchiveMasterList.size());
//        List<Archive_Master_Vo> list = new ArrayList<>();
//        for (int i = 0; i < ArchiveMasterList.size(); i++) {
//            list.add(ArchiveMasterList.get(i));
//            if(list.size() == limit){
//                break;
//            }
//        }
//        offsetLimitPage.setRows(list);
//        //request.getSession().removeAttribute("unSubmitRecords");
//        return offsetLimitPage;
//    }
//
//    /**
//     * 统计总病历数，已提交数，已归档数，已采集完整数
//     */
////    @RequestMapping("selectCount")
////    @ResponseBody
////    public Msg selectCount(RecordSearch recordSearch) throws Exception{
////        SubmitRecordStatistics recordStatistics = recordService.selectCount(recordSearch);
////        return Msg.success().add("record",recordStatistics);
////    }
////
////    /**
////     * 病案提交导出
////     * @param response
////     */
////    @ResponseBody
////    @RequestMapping(value = "/exportExcelSubmit")
////    public void exportExcelSubmit(HttpServletResponse response,
////                                  RecordSearch recordSearch,
////                                  HttpServletRequest request){
////        String tableThNames = "科室名称,出院人数,医生已提交,医生未提交,医生提交率," +
////                                                 "医生质控员已提交,医生质控员未提交,医生质控员提交率," +
////                                                 "科主任已提交,科主任未提交,科主任提交率," +
////                                                 "护士已提交,护士未提交,护士提交率," +
////                                                 "护士质控员已提交,护士质控员未提交,护士质控员提交率," +
////                                                 "护士长已提交,护士长未提交,护士长提交率";
////        String fieldCns = "deptNameCn,count,doctorSubmitCount,unDoctorSubmitCount,doctorSubmitPercent," +
////                                            "doctorCheckCount,unDoctorCheckCount,doctorCheckPercent," +
////                                            "directorCheckCount,unDirectorCheckCount,directorCheckPercent," +
////                                            "nurseSubmitCount,unNurseSubmitCount,nurseSubmitPercent," +
////                                            "nurseCheckCount,unNurseCheckCount,nurseCheckPercent," +
////                                            "headNurseCount,unHeadNurseCount,headNursePercent";
////        //构造excel的数据
////        try {
////            List<SubmitRecord> list = recordService.selectUnCountGroupDept(recordSearch,request);
////            //文件名
////            String fileName = "病案提交统计" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
////            //ExportExcelUtil
////            ExportExcelUtil exportExcelUtil = new ExportExcelUtil();
////            //导出excel的操作
////            exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response);
////        }catch (Exception e){
////            ExceptionPrintUtil.printException(e);
////            e.printStackTrace();
////        }
////    }
////
////    /**
////     * 科室病案超期頁面
////     * @return
////     */
////    @RequestMapping("deptOverTimeInfo")
////    public String deptOverTimeInfo(Model model, String startDateTo, String endDateTo){
////        model.addAttribute("startDate",startDateTo);
////        model.addAttribute("endDate",endDateTo);
////        return "record/deptOverTimeInfo";
////    }
////
////    /**
////     * 科室病案超期頁面中，其中各个角色的提交率
////     */
////    @RequestMapping("selectOvertimeCount")
////    @ResponseBody
////    public Msg selectOvertimeCount(RecordSearch recordSearch, HttpServletRequest request) throws Exception{
////        SubmitRecordStatistics recordStatistics = recordService.selectOvertimeCount(recordSearch,request);
////        return Msg.success().add("record",recordStatistics);
////    }
////
////    /**
////     * 按科室待审核角色病案超时分页查询
////     * @return
////     */
////    @RequestMapping("getRecordGroupDeptAndRole")
////    @ResponseBody
////    public OffsetLimitPage getRecordGroupDeptAndRole(Integer offset,
////                                                     Integer limit,
////                                                     RecordSearch recordSearch){
////        if(offset != null && limit != null) {
////            PageHelper.offsetPage(offset, limit);
////        }
////        List<Archive_Master_Vo> submitRecords = new Page<>();
////        try {
////            submitRecords = recordService.selectRecordGroupDeptAndRole(recordSearch);
////        }catch (Exception e){
////            e.printStackTrace();
////            ExceptionPrintUtil.printException(e);
////        }
////
////        return new OffsetLimitPage((Page) submitRecords);
////    }
////
////    /**
////     * 科室病案超期导出
////     * @param response
////     */
////    @ResponseBody
////    @RequestMapping(value = "/exportExcelDeptOverTime")
////    public void exportExcelDeptOverTime(HttpServletResponse response,
////                                        RecordSearch recordSearch,
////                                        HttpServletRequest request){
////        String tableThNames = "科室名称,超期份數,医生未提交,医生质控员未提交,科主任未提交,护士未提交,"+
////                "护士质控员未提交,护士长未提交,病案室未提交";
////        String fieldCns = "deptNameCn,count,unDoctorSubmitCount,unDoctorCheckCount,unDirectorCheckCount," +
////                "unNurseSubmitCount,unNurseCheckCount,unHeadNurseCount,headNurseCount";
////        //构造excel的数据
////        try {
////            List<SubmitRecord> list = recordService.selectUnCountGroupDept(recordSearch,request);
////            //文件名
////            String fileName = "科室病案超期" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
////            //ExportExcelUtil
////            ExportExcelUtil exportExcelUtil = new ExportExcelUtil();
////            //导出excel的操作
////            exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response);
////        }catch (Exception e){
////            ExceptionPrintUtil.printException(e);
////            e.printStackTrace();
////        }
////    }
////
////    /**
////     * 病案提交明细页面
////     * @return
////     */
////    @RequestMapping("signedRecord")
////    public String signedRecord(){
////        return "record/signedRecord";
////    }
////
////    /**
////     * 病案提交明细分页查询
////     * @return
////     */
////    @RequestMapping("getSignedRecordList")
////    @ResponseBody
////    public OffsetLimitPage getSignedRecordList(Integer offset, Integer limit, RecordSearch recordSearch){
////        if(offset != null && limit != null) {
////            PageHelper.offsetPage(offset, limit);
////        }
////        List<SubmitRecordStatistics> submitRecords = new Page<>();
////        try {
////            submitRecords = recordService.getSignedRecordList(recordSearch);
////        }catch (Exception e){
////            e.printStackTrace();
////            ExceptionPrintUtil.printException(e);
////        }
////        return new OffsetLimitPage((Page)submitRecords);
////    }
////
////    /**
////     * 病案签收导出
////     * @param response
////     */
////    @ResponseBody
////    @RequestMapping(value = "/exportExcelSigned")
////    public void exportExcelSigned(HttpServletResponse response,RecordSearch recordSearch){
////        String tableThNames = "出院日期,出院科室,出院人数,采集完整,已提交,已归档,完整率,提交率,归档率";
////        String fieldCns = "disDate,deptNameCn,allCount,count3,count1,count2,count3Percent,count1Percent,count2Percent";
////        //构造excel的数据
////        try {
////            List<SubmitRecordStatistics> list = recordService.getSignedRecordList(recordSearch);
////            //文件名
////            String fileName = "病案室签收统计" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
////            //ExportExcelUtil
////            ExportExcelUtil exportExcelUtil = new ExportExcelUtil();
////            //导出excel的操作
////            exportExcelUtil.expordExcel(tableThNames,fieldCns,list,fileName,response);
////        }catch (Exception e){
////            ExceptionPrintUtil.printException(e);
////            e.printStackTrace();
////        }
////    }
//}
