|
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -228,22 +229,44 @@ public class ConsoleExportFacade {
|
|
|
}
|
|
|
Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
- //时间间隔90天
|
|
|
- long interval = 90l * 24l * 60l * 60l * 1000l;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ //时间间隔7天
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
qcResultShortPageVO.setCurrent(1L);
|
|
|
qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
- List<ExportExcelDTO> record = behospitalInfoFacade.qcResultShortPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportExcelDTO> records = behospitalInfoFacade.qcResultShortPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
String fileName = "缺陷详情质控评分页.xls";
|
|
|
- ExcelUtils.exportExcelUser(record, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
- }
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 出院人数统计导出
|
|
@@ -261,20 +284,68 @@ public class ConsoleExportFacade {
|
|
|
Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
//时间间隔7天
|
|
|
- long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
qcResultShortPageVO.setCurrent(1L);
|
|
|
qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.leaveHosMRPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
String fileName = "出院人数统计.xls";
|
|
|
- ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<ExportWideExcelDTO> transList(List<ExportExcelDTO>res, List<ExportWideExcelDTO>resWide){
|
|
|
+ if(ListUtil.isNotEmpty(res)){
|
|
|
+ res.forEach(exportExcelDTO->{
|
|
|
+ ExportWideExcelDTO exportWideExcelDTO = new ExportWideExcelDTO();
|
|
|
+ exportWideExcelDTO.setAvgScore(exportExcelDTO.getAvgScore());
|
|
|
+ exportWideExcelDTO.setBehDeptName(exportExcelDTO.getBehDeptName());
|
|
|
+ List<ExportExcelBehospitalDTO> excelBehospitalDTOS = exportExcelDTO.getExcelBehospitalDTOS();
|
|
|
+ List<ExportExcelWideBehospitalDTO> exportExcelWideBehospitalDTOs = new ArrayList<>();
|
|
|
+ excelBehospitalDTOS.forEach(exportExcelBehospitalDTO->{
|
|
|
+ ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
|
|
|
+ exportExcelWideBehospitalDTO.setBehDoctorName(exportExcelBehospitalDTO.getBehDoctorName());
|
|
|
+ exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
|
|
|
+ exportExcelWideBehospitalDTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
|
|
|
+ exportExcelWideBehospitalDTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
|
|
|
+ exportExcelWideBehospitalDTO.setPatName(exportExcelBehospitalDTO.getPatName());
|
|
|
+ exportExcelWideBehospitalDTO.setScore(exportExcelBehospitalDTO.getScore());
|
|
|
+ exportExcelWideBehospitalDTO.setScoreBn(exportExcelBehospitalDTO.getScoreBn());
|
|
|
+ exportExcelWideBehospitalDTOs.add(exportExcelWideBehospitalDTO);
|
|
|
+ });
|
|
|
+ exportWideExcelDTO.setExcelBehospitalDTOS(exportExcelWideBehospitalDTOs);
|
|
|
+ resWide.add(exportWideExcelDTO);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return resWide;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -337,27 +408,48 @@ public class ConsoleExportFacade {
|
|
|
Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
//时间间隔7天
|
|
|
- long interval = 90l * 24l * 60l * 60l * 1000l;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
qcResultShortPageVO.setCurrent(1L);
|
|
|
qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.badLevelPagePageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
String fileName = null;
|
|
|
if("不合格数".equals(qcResultShortPageVO.getTitleName())){
|
|
|
- fileName = "病案首页不合格数病历详情页.xls";
|
|
|
+ fileName = "病案首页不合格数病历详情页.xls";
|
|
|
}else{
|
|
|
- fileName = "病案首页合格数病历详情页.xls";
|
|
|
+ fileName = "病案首页合格数病历详情页.xls";
|
|
|
}
|
|
|
-
|
|
|
- ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
- }
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 未整改病历统计导出
|
|
@@ -435,20 +527,42 @@ public class ConsoleExportFacade {
|
|
|
Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
//时间间隔7天
|
|
|
- long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
qcResultShortPageVO.setCurrent(1L);
|
|
|
qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.hmImproveMRPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
String fileName = "病案首页改善率评分病历导出.xls";
|
|
|
- ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -466,20 +580,43 @@ public class ConsoleExportFacade {
|
|
|
}
|
|
|
Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
+
|
|
|
//时间间隔7天
|
|
|
- long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
- if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
- if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
qcResultShortPageVO.setCurrent(1L);
|
|
|
qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.qcCheckMRPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
String fileName = "质控核查病历导出.xls";
|
|
|
- ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
}
|
|
|
}
|