|
@@ -34,6 +34,8 @@ public class ConsoleExportFacade {
|
|
|
private SysHospitalSetFacade sysHospitalSetFacade;
|
|
|
@Autowired
|
|
|
private FilterFacade filterFacade;
|
|
|
+ @Autowired
|
|
|
+ private ConsoleByDoctorFacade consoleByDoctorFacade;
|
|
|
|
|
|
/**
|
|
|
* 病案首页合格率占比
|
|
@@ -88,7 +90,7 @@ public class ConsoleExportFacade {
|
|
|
filterVO.setSize(Long.MAX_VALUE);
|
|
|
filterVO.setSearchCount(false);
|
|
|
String fileName = null;
|
|
|
- if ( "1".equals(filterVO.getIsPlacefile())) {
|
|
|
+ if ("1".equals(filterVO.getIsPlacefile())) {
|
|
|
fileName = "终末病历稽查表.xls";
|
|
|
} else {
|
|
|
fileName = "运行病历稽查表.xls";
|
|
@@ -212,7 +214,6 @@ public class ConsoleExportFacade {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 各模块缺陷占比导出
|
|
|
*
|
|
@@ -323,7 +324,7 @@ public class ConsoleExportFacade {
|
|
|
long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
long interval_90 = 90 * 24 * 60 * 60 * 1000l;
|
|
|
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
//时间间隔7天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -331,7 +332,7 @@ public class ConsoleExportFacade {
|
|
|
if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//时间间隔90天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -346,27 +347,27 @@ public class ConsoleExportFacade {
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.leaveHosMRPageExport(qcResultShortPageVO);
|
|
|
List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
resWide = transList(records, resWide);
|
|
|
}
|
|
|
String fileName = "出院人数统计.xls";
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ 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->{
|
|
|
+ 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->{
|
|
|
+ excelBehospitalDTOS.forEach(exportExcelBehospitalDTO -> {
|
|
|
ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
|
|
|
exportExcelWideBehospitalDTO.setDoctorName(exportExcelBehospitalDTO.getDoctorName());
|
|
|
exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
|
|
@@ -447,7 +448,7 @@ public class ConsoleExportFacade {
|
|
|
long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
long interval_90 = 90 * 24 * 60 * 60 * 1000l;
|
|
|
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
//时间间隔7天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -455,7 +456,7 @@ public class ConsoleExportFacade {
|
|
|
if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//时间间隔90天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -470,22 +471,22 @@ public class ConsoleExportFacade {
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.badLevelPagePageExport(qcResultShortPageVO);
|
|
|
List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
resWide = transList(records, resWide);
|
|
|
}
|
|
|
String fileName = null;
|
|
|
- if("不合格数".equals(qcResultShortPageVO.getTitleName())){
|
|
|
+ if ("不合格数".equals(qcResultShortPageVO.getTitleName())) {
|
|
|
fileName = "病案首页不合格数病历详情页.xls";
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
fileName = "病案首页合格数病历详情页.xls";
|
|
|
}
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 病案首页不合格/合格数-XY
|
|
@@ -506,7 +507,7 @@ public class ConsoleExportFacade {
|
|
|
long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
long interval_90 = 90 * 24 * 60 * 60 * 1000l;
|
|
|
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
//时间间隔7天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -514,7 +515,7 @@ public class ConsoleExportFacade {
|
|
|
if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//时间间隔90天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -529,19 +530,19 @@ public class ConsoleExportFacade {
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.getBaseMapper().badLevelPageXYExport(qcResultShortPageVO);
|
|
|
List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
resWide = transList(records, resWide);
|
|
|
}
|
|
|
String fileName = null;
|
|
|
- if("不合格数".equals(qcResultShortPageVO.getTitleName())){
|
|
|
+ if ("不合格数".equals(qcResultShortPageVO.getTitleName())) {
|
|
|
fileName = "病案首页不合格数病历详情页.xls";
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
fileName = "病案首页合格数病历详情页.xls";
|
|
|
}
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
}
|
|
@@ -614,7 +615,7 @@ public class ConsoleExportFacade {
|
|
|
public void hmImproveMRPageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
|
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
qcResultShortPageVO.setHospitalId(hospitalId);
|
|
|
- if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
+ if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
&& qcResultShortPageVO.getDeptName().equals("全部")) {
|
|
|
qcResultShortPageVO.setDeptName("");
|
|
|
}
|
|
@@ -624,7 +625,7 @@ public class ConsoleExportFacade {
|
|
|
long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
long interval_90 = 90 * 24 * 60 * 60 * 1000l;
|
|
|
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
//时间间隔7天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -632,7 +633,7 @@ public class ConsoleExportFacade {
|
|
|
if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//时间间隔90天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -647,14 +648,14 @@ public class ConsoleExportFacade {
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.hmImproveMRPageExport(qcResultShortPageVO);
|
|
|
List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
resWide = transList(records, resWide);
|
|
|
}
|
|
|
String fileName = "病案首页改善率评分病历导出.xls";
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
}
|
|
@@ -679,7 +680,7 @@ public class ConsoleExportFacade {
|
|
|
long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
long interval_90 = 90 * 24 * 60 * 60 * 1000l;
|
|
|
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
//时间间隔7天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -687,7 +688,7 @@ public class ConsoleExportFacade {
|
|
|
if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//时间间隔90天
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
@@ -702,14 +703,14 @@ public class ConsoleExportFacade {
|
|
|
qcResultShortPageVO.setSearchCount(false);
|
|
|
List<ExportExcelDTO> records = behospitalInfoFacade.qcCheckMRPageExport(qcResultShortPageVO);
|
|
|
List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
resWide = transList(records, resWide);
|
|
|
}
|
|
|
String fileName = "质控核查病历导出.xls";
|
|
|
- if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
- if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
|
|
|
ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
}
|
|
@@ -725,21 +726,21 @@ public class ConsoleExportFacade {
|
|
|
String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
behospitalPageVO.setHospitalId(Long.valueOf(hospitalId));
|
|
|
|
|
|
- Date startDate = behospitalPageVO.getLeaveHosDateStart();
|
|
|
- Date endDate = behospitalPageVO.getLeaveHosDateEnd();
|
|
|
- //时间间隔30天
|
|
|
- long interval = 30 * 24l * 60l * 60l * 1000l;
|
|
|
+ Date startDate = behospitalPageVO.getLeaveHosDateStart();
|
|
|
+ Date endDate = behospitalPageVO.getLeaveHosDateEnd();
|
|
|
+ //时间间隔30天
|
|
|
+ long interval = 30 * 24l * 60l * 60l * 1000l;
|
|
|
if (endDate.getTime() < startDate.getTime()) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
- }
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于30天");
|
|
|
- }
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于30天");
|
|
|
+ }
|
|
|
|
|
|
behospitalPageVO.setCurrent(1L);
|
|
|
behospitalPageVO.setSize(Long.MAX_VALUE);
|
|
|
behospitalPageVO.setSearchCount(false);
|
|
|
- // orderMethod(behospitalPageVO);
|
|
|
+ // orderMethod(behospitalPageVO);
|
|
|
|
|
|
IPage<QualityControlDTO> page = consoleFacade.getQualityControlExport(behospitalPageVO);
|
|
|
List<QualityControlDTO> records = page.getRecords();
|
|
@@ -748,27 +749,46 @@ public class ConsoleExportFacade {
|
|
|
ExcelUtils.exportExcel(records, "病历质控报表", "sheet1", QualityControlDTO.class, fileName, response, 26.8f);
|
|
|
}
|
|
|
|
|
|
- static void orderMethod(BehospitalPageVO behospitalPageVO){
|
|
|
- List orders = behospitalPageVO.getOrders();
|
|
|
- Boolean flag= false;
|
|
|
- List<OrderItem> itemList = new ArrayList<>();
|
|
|
- for (Object order : orders) {
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- OrderItem orderName = objectMapper.convertValue(order, OrderItem.class);
|
|
|
- itemList.add(orderName);
|
|
|
- if(!orderName.getColumn().equals("deptName")){
|
|
|
- flag = true;
|
|
|
- }
|
|
|
- }
|
|
|
- //科室作为第一升序排列,传入排序随后 配合excel注解属性mergeVertical处理科室合并
|
|
|
- if(flag){
|
|
|
- OrderItem orderItem = new OrderItem();
|
|
|
- orderItem.setAsc(true);
|
|
|
- orderItem.setColumn("deptName");
|
|
|
- itemList.add(orderItem);
|
|
|
- Collections.reverse(itemList);
|
|
|
- behospitalPageVO.setOrders(itemList);
|
|
|
- }
|
|
|
-
|
|
|
- };
|
|
|
+ static void orderMethod(BehospitalPageVO behospitalPageVO) {
|
|
|
+ List orders = behospitalPageVO.getOrders();
|
|
|
+ Boolean flag = false;
|
|
|
+ List<OrderItem> itemList = new ArrayList<>();
|
|
|
+ for (Object order : orders) {
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ OrderItem orderName = objectMapper.convertValue(order, OrderItem.class);
|
|
|
+ itemList.add(orderName);
|
|
|
+ if (!orderName.getColumn().equals("deptName")) {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //科室作为第一升序排列,传入排序随后 配合excel注解属性mergeVertical处理科室合并
|
|
|
+ if (flag) {
|
|
|
+ OrderItem orderItem = new OrderItem();
|
|
|
+ orderItem.setAsc(true);
|
|
|
+ orderItem.setColumn("deptName");
|
|
|
+ itemList.add(orderItem);
|
|
|
+ Collections.reverse(itemList);
|
|
|
+ behospitalPageVO.setOrders(itemList);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ ;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医生质控平均分页面统计-导出
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param doctorAverageStatisticsVO
|
|
|
+ * @Return void
|
|
|
+ */
|
|
|
+ public void doctorAverageStatisticsExport(HttpServletResponse response, DoctorAverageStatisticsVO doctorAverageStatisticsVO) {
|
|
|
+ //1.查询
|
|
|
+ IPage<DoctorAverageStatisticsDTO> page = consoleByDoctorFacade.doctorAverageStatistics(doctorAverageStatisticsVO);
|
|
|
+ //2.列表拷贝
|
|
|
+ List<ExportDoctorAverageStatisticsDTO> records = BeanUtil.listCopyTo(page.getRecords(), ExportDoctorAverageStatisticsDTO.class);
|
|
|
+ //3.导出
|
|
|
+ String fileName = "医生质控平均分.xls";
|
|
|
+ ExcelUtils.exportExcel(records, null, "sheet1", ReBeHosDTO.class, fileName, response);
|
|
|
+ }
|
|
|
}
|