|
@@ -19,8 +19,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
- * @Description: 报表导出装饰层
|
|
|
- * @author: gaodm
|
|
|
+ * @Description: 控制台(医生)统计相关API
|
|
|
+ * @author: zhanghang
|
|
|
* @time: 2020/6/18 10:41
|
|
|
*/
|
|
|
@Component
|
|
@@ -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,205 @@ 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.查询
|
|
|
+ doctorAverageStatisticsVO.setSize(9999999);
|
|
|
+ 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", ExportDoctorAverageStatisticsDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医生质控平均分-患者列表(等级)-导出
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param exportDoctorAverageLevelVO
|
|
|
+ * @Return void
|
|
|
+ */
|
|
|
+ public void doctorAverageLevelExport(HttpServletResponse response, ExportDoctorAverageLevelVO exportDoctorAverageLevelVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ exportDoctorAverageLevelVO.setHospitalId(Long.parseLong(hospitalId));
|
|
|
+ //时间设置
|
|
|
+ exportQcresultVOSet(exportDoctorAverageLevelVO);
|
|
|
+ List<ExportDoctorAverageLevel_7DTO> res = behospitalInfoFacade.getBaseMapper().doctorAverageLevelExport(exportDoctorAverageLevelVO);
|
|
|
+ List<ExportDoctorAverageLevel_90DTO> resWide = new ArrayList<>();
|
|
|
+ if ("2".equals(exportDoctorAverageLevelVO.getRadioCheck())) {
|
|
|
+ resWide = doctorAveragetransList(res, resWide);
|
|
|
+ }
|
|
|
+ String fileName = "抽查住院病历质量情况.xls";
|
|
|
+ response.setContentType("text/html;charset=UTF-8");
|
|
|
+ if ("1".equals(exportDoctorAverageLevelVO.getRadioCheck())) {
|
|
|
+ ExcelUtils.exportExcelUser(res, null, "sheet1", ExportDoctorAverageLevel_7DTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if ("2".equals(exportDoctorAverageLevelVO.getRadioCheck())) {
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportDoctorAverageLevel_90DTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<ExportDoctorAverageLevel_90DTO> doctorAveragetransList(List<ExportDoctorAverageLevel_7DTO> res, List<ExportDoctorAverageLevel_90DTO> resWide) {
|
|
|
+ if (ListUtil.isNotEmpty(res)) {
|
|
|
+ res.forEach(exportExcelDTO -> {
|
|
|
+ ExportDoctorAverageLevel_90DTO exportWideExcelDTO = new ExportDoctorAverageLevel_90DTO();
|
|
|
+ exportWideExcelDTO.setAvgScore(exportExcelDTO.getAvgScore());
|
|
|
+ exportWideExcelDTO.setBehDeptName(exportExcelDTO.getBehDeptName());
|
|
|
+ List<ExportBehospital_7DTO> excelBehospitalDTOS = exportExcelDTO.getExcelBehospitalDTOS();
|
|
|
+ List<ExportBehospital_90DTO> exportExcelWideBehospitalDTOs = new ArrayList<>();
|
|
|
+ excelBehospitalDTOS.forEach(exportExcelBehospitalDTO -> {
|
|
|
+ ExportBehospital_90DTO exportBehospital_90DTO = new ExportBehospital_90DTO();
|
|
|
+ exportBehospital_90DTO.setDoctorName(exportExcelBehospitalDTO.getDoctorName());
|
|
|
+ exportBehospital_90DTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
|
|
|
+ exportBehospital_90DTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
|
|
|
+ exportBehospital_90DTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
|
|
|
+ exportBehospital_90DTO.setPatName(exportExcelBehospitalDTO.getPatName());
|
|
|
+ exportBehospital_90DTO.setScore(exportExcelBehospitalDTO.getScore());
|
|
|
+ exportBehospital_90DTO.setScoreBn(exportExcelBehospitalDTO.getScoreBn());
|
|
|
+ exportExcelWideBehospitalDTOs.add(exportBehospital_90DTO);
|
|
|
+ });
|
|
|
+ exportWideExcelDTO.setExcelBehospitalDTOS(exportExcelWideBehospitalDTOs);
|
|
|
+ resWide.add(exportWideExcelDTO);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return resWide;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void exportQcresultVOSet(ExportDoctorAverageLevelVO doctorAverageLevelVO) {
|
|
|
+ //入参验证
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90 * 24 * 60 * 60 * 1000l;
|
|
|
+ //入院时间
|
|
|
+ if (null != doctorAverageLevelVO && null != doctorAverageLevelVO.getBehosDateStart() && null != doctorAverageLevelVO.getBehosDateEnd()) {
|
|
|
+ Date startDate = doctorAverageLevelVO.getBehosDateStart();
|
|
|
+ Date endDate = doctorAverageLevelVO.getBehosDateEnd();
|
|
|
+ if ("1".equals(doctorAverageLevelVO.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天");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ doctorAverageLevelVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(doctorAverageLevelVO.getBehosDateStart()));
|
|
|
+ doctorAverageLevelVO.setBehosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(doctorAverageLevelVO.getBehosDateEnd(), 1)));
|
|
|
+ }
|
|
|
+ //出院时间
|
|
|
+ if (null != doctorAverageLevelVO && null != doctorAverageLevelVO.getLeaveHosDateStart() && null != doctorAverageLevelVO.getLeaveHosDateEnd()) {
|
|
|
+ Date startDate = doctorAverageLevelVO.getLeaveHosDateStart();
|
|
|
+ Date endDate = doctorAverageLevelVO.getLeaveHosDateEnd();
|
|
|
+ if ("1".equals(doctorAverageLevelVO.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天");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ doctorAverageLevelVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(doctorAverageLevelVO.getLeaveHosDateStart()));
|
|
|
+ doctorAverageLevelVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(doctorAverageLevelVO.getLeaveHosDateEnd(), 1)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医生质控缺陷列表-导出
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param getDetailListPageVO
|
|
|
+ * @Return void
|
|
|
+ */
|
|
|
+ public void getDoctorDetailPageExport(HttpServletResponse response, GetDoctorDetailPageVO getDetailListPageVO) {
|
|
|
+ //1.查询
|
|
|
+ getDetailListPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ IPage<GetDoctorDetailPageDTO> doctorDetailPage = consoleByDoctorFacade.getDoctorDetailPage(getDetailListPageVO);
|
|
|
+ //2.列表拷贝
|
|
|
+ List<ExportGetDoctorDetailPageDTO> records = BeanUtil.listCopyTo(doctorDetailPage.getRecords(), ExportGetDoctorDetailPageDTO.class);
|
|
|
+ //3.导出
|
|
|
+ String fileName = "医生缺陷列表.xls";
|
|
|
+ response.setContentType("text/html;charset=UTF-8");
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportGetDoctorDetailPageDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 缺陷数量对应的病历-导出
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param getDetailRecordListPageVO
|
|
|
+ * @Return void
|
|
|
+ */
|
|
|
+ public void getDetailRecordListPageExport(HttpServletResponse response, GetDetailRecordListPageVO getDetailRecordListPageVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ getDetailRecordListPageVO.setHospitalId(hospitalId);
|
|
|
+ if (StringUtil.isNotBlank(getDetailRecordListPageVO.getDeptName())
|
|
|
+ && getDetailRecordListPageVO.getDeptName().equals("全部")) {
|
|
|
+ getDetailRecordListPageVO.setDeptName("");
|
|
|
+ }
|
|
|
+ Date startDate = getDetailRecordListPageVO.getStartDate();
|
|
|
+ Date endDate = getDetailRecordListPageVO.getEndDate();
|
|
|
+ //时间间隔90天
|
|
|
+ long interval = 90 * 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天");
|
|
|
+ }
|
|
|
+ getDetailRecordListPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ //1.查询
|
|
|
+ List<ExportExcelDTO> detailRecordListExport = consoleByDoctorFacade.getDetailRecordListExport(getDetailRecordListPageVO);
|
|
|
+ String fileName = "缺陷病历信息.xls";
|
|
|
+ response.setContentType("text/html;charset=UTF-8");
|
|
|
+ ExcelUtils.exportExcelUser(detailRecordListExport, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
}
|