Parcourir la source

时效性报表表头及备注修改

SGTY il y a 8 mois
Parent
commit
3331222289

+ 32 - 37
src/main/java/com/diagbot/dto/ExportReportDetailaDTO.java

@@ -8,41 +8,36 @@ import java.util.Date;
 
 @Data
 public class ExportReportDetailaDTO {
-    /**
-     * 医院id
-     */
-    private String hospitalId;
-    @Excel(name = "病人住院序号", width = 20, orderNum = "1")
-    private String behospitalCode;
-    @Excel(name = "病人姓名", orderNum = "2")
-    private String name;
-    @Excel(name = "性别", orderNum = "3")
-    private String sex;
-    @Excel(name = "病案号", orderNum = "4")
-    private String fileCode;
-    @Excel(name = "主管医生", width = 20, orderNum = "5")
-    private String doctorName;
-    private String directorDoctorId;
-    /**
-     * 科室名称
-     */
-    @Excel(name = "住院科室", orderNum = "6")
-    private String behDeptName;
-    //病区code
-    private String ward_code;
-    private String wardName;
-    /**
-     * 科室编码
-     */
-    private String behDeptId;
-    @Excel(name = "规则名称", width = 40, orderNum = "7")
-    private String ruleName;
-    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "8")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date behospitalDate;
-    @Excel(name = "入院记录创建时间", format = "yyyy-MM-dd", width = 30, orderNum = "9")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date behospitalGmtCreate;
-    @Excel(name = "是否归档", orderNum = "10")
-    private String isPlacefile;
+//    @Excel(name = "病人住院序号", width = 20, orderNum = "1")
+//    private String behospitalCode;
+//
+//    @Excel(name = "病人姓名", orderNum = "2")
+//    private String name;
+//
+//    @Excel(name = "性别", orderNum = "3")
+//    private String sex;
+//
+//    @Excel(name = "病案号", orderNum = "4")
+//    private String fileCode;
+//
+//    @Excel(name = "主管医生", width = 20, orderNum = "5")
+//    private String doctorName;
+//
+//    @Excel(name = "住院科室", orderNum = "6")
+//    private String behDeptName;
+//
+//    @Excel(name = "规则名称", width = 40, orderNum = "7")
+//    private String ruleName;
+//
+//    @Excel(name = "入院日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "8")
+//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+//    private Date behospitalDate;
+//
+//    @Excel(name = "入院记录创建时间", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "9")
+//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+//    private Date behospitalGmtCreate;
+//
+//    @Excel(name = "是否归档", orderNum = "10")
+//    private String isPlacefile;
+
 }

+ 43 - 0
src/main/java/com/diagbot/dto/ExportReportDetailaaDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ExportReportDetailaaDTO {
+    @Excel(name = "病人住院序号", width = 20, orderNum = "1")
+    private String behospitalCode;
+
+    @Excel(name = "病人姓名", orderNum = "2")
+    private String name;
+
+    @Excel(name = "性别", orderNum = "3")
+    private String sex;
+
+    @Excel(name = "病案号", orderNum = "4")
+    private String fileCode;
+
+    @Excel(name = "主管医生", width = 20, orderNum = "5")
+    private String doctorName;
+
+    @Excel(name = "住院科室", orderNum = "6")
+    private String behDeptName;
+
+    @Excel(name = "规则名称", width = 40, orderNum = "7")
+    private String ruleName;
+
+    @Excel(name = "入院日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date behospitalDate;
+
+    @Excel(name = "首次病程记录创建时间", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "9")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date behospitalGmtCreate;
+
+    @Excel(name = "是否归档", orderNum = "10")
+    private String isPlacefile;
+
+}

+ 43 - 0
src/main/java/com/diagbot/dto/ExportReportDetailabDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ExportReportDetailabDTO {
+    @Excel(name = "病人住院序号", width = 20, orderNum = "1")
+    private String behospitalCode;
+
+    @Excel(name = "病人姓名", orderNum = "2")
+    private String name;
+
+    @Excel(name = "性别", orderNum = "3")
+    private String sex;
+
+    @Excel(name = "病案号", orderNum = "4")
+    private String fileCode;
+
+    @Excel(name = "主管医生", width = 20, orderNum = "5")
+    private String doctorName;
+
+    @Excel(name = "住院科室", orderNum = "6")
+    private String behDeptName;
+
+    @Excel(name = "规则名称", width = 40, orderNum = "7")
+    private String ruleName;
+
+    @Excel(name = "入院日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date behospitalDate;
+
+    @Excel(name = "入院记录创建时间", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "9")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date behospitalGmtCreate;
+
+    @Excel(name = "是否归档", orderNum = "10")
+    private String isPlacefile;
+
+}

+ 43 - 0
src/main/java/com/diagbot/dto/ExportReportDetailacDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ExportReportDetailacDTO {
+    @Excel(name = "病人住院序号", width = 20, orderNum = "1")
+    private String behospitalCode;
+
+    @Excel(name = "病人姓名", orderNum = "2")
+    private String name;
+
+    @Excel(name = "性别", orderNum = "3")
+    private String sex;
+
+    @Excel(name = "病案号", orderNum = "4")
+    private String fileCode;
+
+    @Excel(name = "主管医生", width = 20, orderNum = "5")
+    private String doctorName;
+
+    @Excel(name = "住院科室", orderNum = "6")
+    private String behDeptName;
+
+    @Excel(name = "规则名称", width = 40, orderNum = "7")
+    private String ruleName;
+
+    @Excel(name = "入院日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date behospitalDate;
+
+    @Excel(name = "自杀、冲动、猝死记录创建时间", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "9")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date behospitalGmtCreate;
+
+    @Excel(name = "是否归档", orderNum = "10")
+    private String isPlacefile;
+
+}

+ 2 - 17
src/main/java/com/diagbot/dto/ExportReportDetailbDTO.java

@@ -8,10 +8,6 @@ import java.util.Date;
 
 @Data
 public class ExportReportDetailbDTO {
-    /**
-     * 医院id
-     */
-    private String hospitalId;
     @Excel(name = "病人住院序号", width = 20, orderNum = "1")
     private String behospitalCode;
     @Excel(name = "病人姓名", orderNum = "2")
@@ -22,25 +18,14 @@ public class ExportReportDetailbDTO {
     private String fileCode;
     @Excel(name = "主管医生", width = 20, orderNum = "5")
     private String doctorName;
-    private String directorDoctorId;
-    /**
-     * 科室名称
-     */
     @Excel(name = "住院科室", orderNum = "6")
     private String behDeptName;
-    //病区code
-    private String ward_code;
-    private String wardName;
-    /**
-     * 科室编码
-     */
-    private String behDeptId;
     @Excel(name = "规则名称", width = 40, orderNum = "7")
     private String ruleName;
     @Excel(name = "备注", width = 40, orderNum = "8")
     private String remark;
-    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "9")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "入院日期", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "9")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date behospitalDate;
     @Excel(name = "是否归档", orderNum = "10")
     private String isPlacefile;

+ 0 - 10
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -154,16 +154,6 @@ public class ConsoleExportFacade {
                 && qcResultShortPageVO.getDeptName().equals("全部")) {
             qcResultShortPageVO.setDeptName("");
         }
-        Date startDate = qcResultShortPageVO.getStartDate();
-        Date endDate = qcResultShortPageVO.getEndDate();
-        //时间间隔7天
-        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天");
-        }
 
         qcResultShortPageVO.setCurrent(1L);
         qcResultShortPageVO.setSize(Long.MAX_VALUE);

+ 33 - 26
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -24,6 +24,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
 import com.diagbot.vo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
+import org.json.simple.JSONObject;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -2857,9 +2858,9 @@ public class ConsoleFacade {
      */
     public List<Map<String, Object>> TimelinessReportExport(QcResultShortPageVO qcResultShortPageVO) {
         List<Map<String, Object>> records = new LinkedList<>();
-        List<ExportReportDetailaDTO> unfinishedFirst = behospitalInfoFacade.getUnfinishedFirst_HZQY(qcResultShortPageVO);
-        List<ExportReportDetailaDTO> unfinishedIn = behospitalInfoFacade.getUnfinishedIn_HZQY(qcResultShortPageVO);
-        List<ExportReportDetailaDTO> unfinishedSuicide = behospitalInfoFacade.getUnfinishedSuicide_HZQY(qcResultShortPageVO);
+        List<ExportReportDetailaaDTO> unfinishedFirst = behospitalInfoFacade.getUnfinishedFirst_HZQY(qcResultShortPageVO);
+        List<ExportReportDetailabDTO> unfinishedIn = behospitalInfoFacade.getUnfinishedIn_HZQY(qcResultShortPageVO);
+        List<ExportReportDetailacDTO> unfinishedSuicide = behospitalInfoFacade.getUnfinishedSuicide_HZQY(qcResultShortPageVO);
         List<ExportReportDetailbDTO> unfinishedThree = behospitalInfoFacade.getUnfinishedThree_HZQY(qcResultShortPageVO);
         List<ExportReportDetailbDTO> unfinishedSix = behospitalInfoFacade.getUnfinishedSix_HZQY(qcResultShortPageVO);
 
@@ -2867,7 +2868,7 @@ public class ConsoleFacade {
         ExportParams empExportParams1 = new ExportParams();
         empExportParams1.setSheetName("首次病程未在患者入院8小时内完成");
         map1.put("title", empExportParams1);
-        map1.put("entity", ExportReportDetailaDTO.class);
+        map1.put("entity", ExportReportDetailaaDTO.class);
         map1.put("data", unfinishedFirst);
 
         Map<String, Object> map2 = new HashMap<>();
@@ -3146,7 +3147,7 @@ public class ConsoleFacade {
      */
     public UnModifyMRDTO TimelinessReportA(FilterTimelinessVO filterTimelinessVO) {
         UnModifyMRDTO unModifyMRDTO = new UnModifyMRDTO();
-            List<Object> retList = Lists.newLinkedList();
+        List<Object> retList = Lists.newLinkedList();
         List<ColumnDTO> columns = Lists.newLinkedList();
 
         Integer orderNo = 1;
@@ -3217,7 +3218,17 @@ public class ConsoleFacade {
         ColumnDTO columnBehospitalGmtCreate = new ColumnDTO();
         columnBehospitalGmtCreate.setOrderNo(orderNo);
         columnBehospitalGmtCreate.setFieldName("behospitalGmtCreate");
-        columnBehospitalGmtCreate.setColumnName("入院记录创建时间");
+        if (filterTimelinessVO.getCasesEntryId().equals("3241")) {
+            // 首次病程未在患者入院8小时内完成
+            columnBehospitalGmtCreate.setColumnName("首次病程创建时间");
+        } else if (filterTimelinessVO.getCasesEntryId().equals("3242")) {
+            // 入院记录未在患者入院24小时内完成
+            columnBehospitalGmtCreate.setColumnName("入院记录创建时间");
+        } else if (filterTimelinessVO.getCasesEntryId().equals("3243")) {
+            // 自杀、冲动、猝死病历入院记录未在患者入院24小时内完成
+            columnBehospitalGmtCreate.setColumnName("自杀等记录创建时间");
+        }
+//        columnBehospitalGmtCreate.setColumnName("入院记录创建时间");
         columnBehospitalGmtCreate.setIsShow(1);
         columns.add(columnBehospitalGmtCreate);
         orderNo++;
@@ -3241,17 +3252,15 @@ public class ConsoleFacade {
         qcResultShortPageVO.setStartDate(startDate);
         qcResultShortPageVO.setEndDate(endDate);
 
-        for (String casesEntryId : filterTimelinessVO.getCasesEntryIds()) {
-            if (casesEntryId.equals("3241")) {
-                List<ExportReportDetailaDTO> unfinishedFirst = behospitalInfoFacade.getUnfinishedFirst_HZQY(qcResultShortPageVO);
-                retList.addAll(unfinishedFirst);
-            } else if (casesEntryId.equals("3242")) {
-                List<ExportReportDetailaDTO> unfinishedIn = behospitalInfoFacade.getUnfinishedIn_HZQY(qcResultShortPageVO);
-                retList.addAll(unfinishedIn);
-            } else if (casesEntryId.equals("3243")) {
-                List<ExportReportDetailaDTO> unfinishedSuicide = behospitalInfoFacade.getUnfinishedSuicide_HZQY(qcResultShortPageVO);
-                retList.addAll(unfinishedSuicide);
-            }
+        if (filterTimelinessVO.getCasesEntryId().equals("3241")) {
+            List<ExportReportDetailaaDTO> unfinishedFirst = behospitalInfoFacade.getUnfinishedFirst_HZQY(qcResultShortPageVO);
+            retList.addAll(unfinishedFirst);
+        } else if (filterTimelinessVO.getCasesEntryId().equals("3242")) {
+            List<ExportReportDetailabDTO> unfinishedIn = behospitalInfoFacade.getUnfinishedIn_HZQY(qcResultShortPageVO);
+            retList.addAll(unfinishedIn);
+        } else if (filterTimelinessVO.getCasesEntryId().equals("3243")) {
+            List<ExportReportDetailacDTO> unfinishedSuicide = behospitalInfoFacade.getUnfinishedSuicide_HZQY(qcResultShortPageVO);
+            retList.addAll(unfinishedSuicide);
         }
 
         unModifyMRDTO.setColumns(columns);
@@ -3362,15 +3371,13 @@ public class ConsoleFacade {
         QcResultShortPageVO qcResultShortPageVO = new QcResultShortPageVO();
         qcResultShortPageVO.setStartDate(startDate);
         qcResultShortPageVO.setEndDate(endDate);
-        List<String> casesEntryIds = filterTimelinessVO.getCasesEntryIds();
-        for (String casesEntryId : casesEntryIds) {
-            if (casesEntryId.equals("3240")) {
-                List<ExportReportDetailbDTO> unfinishedThree = behospitalInfoFacade.getUnfinishedThree_HZQY(qcResultShortPageVO);
-                retList.addAll(unfinishedThree);
-            } else if (casesEntryId.equals("3244")) {
-                List<ExportReportDetailbDTO> unfinishedSix = behospitalInfoFacade.getUnfinishedSix_HZQY(qcResultShortPageVO);
-                retList.addAll(unfinishedSix);
-            }
+
+        if (filterTimelinessVO.getCasesEntryId().equals("3240")) {
+            List<ExportReportDetailbDTO> unfinishedThree = behospitalInfoFacade.getUnfinishedThree_HZQY(qcResultShortPageVO);
+            retList.addAll(unfinishedThree);
+        } else if (filterTimelinessVO.getCasesEntryId().equals("3244")) {
+            List<ExportReportDetailbDTO> unfinishedSix = behospitalInfoFacade.getUnfinishedSix_HZQY(qcResultShortPageVO);
+            retList.addAll(unfinishedSix);
         }
 
         unModifyMRDTO.setColumns(columns);

+ 3 - 3
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -290,7 +290,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param qcResultShortPageVO
      * @return
      */
-    public List<ExportReportDetailaDTO> getUnfinishedFirst_HZQY(QcResultShortPageVO qcResultShortPageVO);
+    public List<ExportReportDetailaaDTO> getUnfinishedFirst_HZQY(QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 时效性报表-入院记录未在患者入院24小时内完成(杭州七院)
@@ -298,7 +298,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param qcResultShortPageVO
      * @return
      */
-    public List<ExportReportDetailaDTO> getUnfinishedIn_HZQY(QcResultShortPageVO qcResultShortPageVO);
+    public List<ExportReportDetailabDTO> getUnfinishedIn_HZQY(QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 时效性报表-自杀、冲动、猝死病历入院记录未在患者入院24小时内完成(杭州七院)
@@ -306,7 +306,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param qcResultShortPageVO
      * @return
      */
-    public List<ExportReportDetailaDTO> getUnfinishedSuicide_HZQY(QcResultShortPageVO qcResultShortPageVO);
+    public List<ExportReportDetailacDTO> getUnfinishedSuicide_HZQY(QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 时效性报表-超过三天未书写病历(杭州七院)

+ 3 - 3
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -293,7 +293,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param qcResultShortPageVO
      * @return
      */
-    public List<ExportReportDetailaDTO> getUnfinishedFirst_HZQY(QcResultShortPageVO qcResultShortPageVO);
+    public List<ExportReportDetailaaDTO> getUnfinishedFirst_HZQY(QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 时效性报表-入院记录未在患者入院24小时内完成(杭州七院)
@@ -301,7 +301,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param qcResultShortPageVO
      * @return
      */
-    public List<ExportReportDetailaDTO> getUnfinishedIn_HZQY(QcResultShortPageVO qcResultShortPageVO);
+    public List<ExportReportDetailabDTO> getUnfinishedIn_HZQY(QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 时效性报表-自杀、冲动、猝死病历入院记录未在患者入院24小时内完成(杭州七院)
@@ -309,7 +309,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @param qcResultShortPageVO
      * @return
      */
-    public List<ExportReportDetailaDTO> getUnfinishedSuicide_HZQY(QcResultShortPageVO qcResultShortPageVO);
+    public List<ExportReportDetailacDTO> getUnfinishedSuicide_HZQY(QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 时效性报表-超过三天未书写病历(杭州七院)

+ 3 - 3
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -357,7 +357,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public List<ExportReportDetailaDTO> getUnfinishedFirst_HZQY(QcResultShortPageVO qcResultShortPageVO) {
+    public List<ExportReportDetailaaDTO> getUnfinishedFirst_HZQY(QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.getUnfinishedFirst_HZQY(qcResultShortPageVO);
     }
 
@@ -368,7 +368,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public List<ExportReportDetailaDTO> getUnfinishedIn_HZQY(QcResultShortPageVO qcResultShortPageVO) {
+    public List<ExportReportDetailabDTO> getUnfinishedIn_HZQY(QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.getUnfinishedIn_HZQY(qcResultShortPageVO);
     }
 
@@ -379,7 +379,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
      * @return
      */
     @Override
-    public List<ExportReportDetailaDTO> getUnfinishedSuicide_HZQY(QcResultShortPageVO qcResultShortPageVO) {
+    public List<ExportReportDetailacDTO> getUnfinishedSuicide_HZQY(QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.getUnfinishedSuicide_HZQY(qcResultShortPageVO);
     }
 

+ 50 - 0
src/main/java/com/diagbot/util/ExcelUtils.java

@@ -3,11 +3,13 @@ package com.diagbot.util;
 
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
 import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.ImportParams;
 import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
 import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
 import cn.afterturn.easypoi.excel.export.styler.ExcelExportStylerDefaultImpl;
+import com.alibaba.fastjson.JSONObject;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ExcelExportStylerUserImpl;
@@ -25,6 +27,8 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.*;
+import java.lang.reflect.Field;
 
 /**
  * @Description: excel 导入导出工具类
@@ -194,4 +198,50 @@ public class ExcelUtils {
         return list;
     }
 
+    /**
+     * 设置注解参数
+     * @param annotation  注解
+     * @param entity
+     */
+    private static void annotationParams(Excel annotation,ExcelExportEntity entity){
+        if (annotation.addressList()){
+            entity.setAddressList(annotation.addressList());
+            entity.setReplace(annotation.replace());
+        }
+        entity.setReplace(annotation.replace());
+        entity.setOrderNum(Integer.parseInt(annotation.orderNum()));
+        entity.setGroupName(annotation.groupName());
+        entity.setNeedMerge(annotation.needMerge());
+        entity.setMergeVertical(annotation.mergeVertical());
+    }
+
+    /**
+     * 动态导出列,根据Excel注解获取列的字段注释(表头名)、宽度
+     * @param clazz
+     * @param fields 选择要导出的列
+     * @param changeHead 要更改表头的列,格式是{"字段1":"更改的表头1","字段2":"更改的表头2"}
+     */
+    public static List<ExcelExportEntity> dynamicExport(Class<?> clazz,String fields, JSONObject changeHead) {
+        List<ExcelExportEntity> beanList = new ArrayList<>();
+        String[] split = fields.split(",");
+        int length = split.length;
+        try {
+            for (int i = 0; i < length; i++) {
+                Field f = clazz.getDeclaredField(split[i]);
+                Excel annotation = f.getAnnotation((Excel.class));
+                String comment = annotation.name();
+                if (changeHead != null && Objects.nonNull(changeHead.get(f.getName()))){
+                    comment = changeHead.get(f.getName()).toString();
+                }
+                Double width = annotation.width();
+                ExcelExportEntity entity = new ExcelExportEntity(comment, f.getName(), width.intValue());
+                annotationParams(annotation,entity);
+                beanList.add(entity);
+            }
+        }catch (NoSuchFieldException e){
+            e.printStackTrace();
+        }
+        return beanList;
+    }
+
 }

+ 3 - 2
src/main/java/com/diagbot/vo/FilterTimelinessVO.java

@@ -25,12 +25,13 @@ public class FilterTimelinessVO {
     /**
      * 关键条目id
      */
-    private List<String> casesEntryIds;
-//    private Long casesEntryId;
+//    private List<String> casesEntryIds;
+    private String casesEntryId;
 
     /**
      * 科室名称
      */
+    @ApiModelProperty(hidden = true)
     private String deptName;
 
     @NotNull(message = "请输入起始时间")

+ 2 - 17
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -133,23 +133,8 @@ public class ConsoleExportController {
      * @return
      */
     @ApiOperation(value = "时效性报表导出-杭州七院",
-            notes = "behospitalCode: 病历号<br>" +
-                    "patName: 病人姓名 <br>" +
-                    "behDeptName:科室名称 <br>" +
-                    "doctorId:医生工号 <br>" +
-                    "doctorName:医生姓名 <br>" +
-                    "level: 病历等级 <br>" +
-                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
-                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
-                    "chName: 病历核查人员 <br>" +
-                    "mrName: 首页核查人员 <br>" +
-                    "chTimeStart: 病历核查起始时间 <br>" +
-                    "chTimeEnd: 病历核查截止时间 <br>" +
-                    "mrTimeStart: 首页核查起始时间 <br>" +
-                    "mrTimeEnd: 首页核查截止时间 <br>" +
-                    "startDate: 起始时间 <br>" +
-                    "endDate: 截止时间 <br>" +
-                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+            notes = "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>")
     @PostMapping("/TimelinessReportExport")
     @SysLogger("TimelinessReportExport")
     public void TimelinessReportExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {

+ 25 - 80
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -3265,10 +3265,9 @@
     </select>
 
     <!-- 时效性报表-首次病程未在患者入院8小时内完成(杭州七院标准版) -->
-    <select id="getUnfinishedFirst_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailaDTO">
+    <select id="getUnfinishedFirst_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailaaDTO">
         SELECT DISTINCT
         a.behospital_code AS behospitalCode,
-        a.hospital_id AS hospitalId,
             a.`name` AS name,
             a.sex AS sex,
             a.file_code AS fileCode,
@@ -3298,29 +3297,18 @@
           AND b.is_deleted = 'N'
           AND b.cases_entry_id = '3241'
         AND a.hospital_id = '14'
-        <if test="isPlacefile != null and isPlacefile == 0">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-            </if>
+        <if test="startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-            </if>
+        <if test="endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
     <!-- 时效性报表-入院记录未在患者入院24小时内完成(杭州七院) -->
-    <select id="getUnfinishedIn_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailaDTO">
+    <select id="getUnfinishedIn_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailabDTO">
         SELECT DISTINCT
         a.behospital_code AS behospitalCode,
-        a.hospital_id AS hospitalId,
         a.`name` AS name,
         a.sex AS sex,
         a.file_code AS fileCode,
@@ -3350,29 +3338,18 @@
         AND b.is_deleted = 'N'
         AND b.cases_entry_id = '3242'
         AND a.hospital_id = '14'
-        <if test="isPlacefile != null and isPlacefile == 0">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-            </if>
+        <if test="startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-            </if>
+        <if test="endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
     <!-- 时效性报表-自杀、冲动、猝死病历入院记录未在患者入院24小时内完成(杭州七院) -->
-    <select id="getUnfinishedSuicide_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailaDTO">
+    <select id="getUnfinishedSuicide_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailacDTO">
         SELECT DISTINCT
         a.behospital_code AS behospitalCode,
-        a.hospital_id AS hospitalId,
         a.`name` AS name,
         a.sex AS sex,
         a.file_code AS fileCode,
@@ -3402,21 +3379,11 @@
         AND b.is_deleted = 'N'
         AND b.cases_entry_id = '3243'
         AND a.hospital_id = '14'
-        <if test="isPlacefile != null and isPlacefile == 0">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-            </if>
+        <if test="startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-            </if>
+        <if test="endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -3424,14 +3391,13 @@
     <select id="getUnfinishedThree_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailbDTO">
         SELECT DISTINCT
         a.behospital_code AS behospitalCode,
-        a.hospital_id AS hospitalId,
         a.`name` AS name,
         a.sex AS sex,
         a.file_code AS fileCode,
         a.doctor_name AS doctorName,
         a.beh_dept_name AS behDeptName,
         b.msg AS ruleName,
-        b.remark AS remark,
+        b.info AS remark,
         a.behospital_date AS behospitalDate,
         a.is_placefile AS isPlacefile
         FROM
@@ -3442,21 +3408,11 @@
         AND b.is_deleted = 'N'
         AND b.cases_entry_id = '3240'
         AND a.hospital_id = '14'
-        <if test="isPlacefile != null and isPlacefile == 0">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-            </if>
+        <if test="startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-            </if>
+        <if test="endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>
 
@@ -3464,14 +3420,13 @@
     <select id="getUnfinishedSix_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailbDTO">
         SELECT DISTINCT
         a.behospital_code AS behospitalCode,
-        a.hospital_id AS hospitalId,
         a.`name` AS name,
         a.sex AS sex,
         a.file_code AS fileCode,
         a.doctor_name AS doctorName,
         a.beh_dept_name AS behDeptName,
         b.msg AS ruleName,
-        b.remark AS remark,
+        b.info AS remark,
         a.behospital_date AS behospitalDate,
         a.is_placefile AS isPlacefile
         FROM
@@ -3482,21 +3437,11 @@
         AND b.is_deleted = 'N'
         AND b.cases_entry_id = '3244'
         AND a.hospital_id = '14'
-        <if test="isPlacefile != null and isPlacefile == 0">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
-            </if>
+        <if test="startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
         </if>
-        <if test="isPlacefile != null and isPlacefile == 1">
-            <if test="startDate != null ">
-                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
-            </if>
-            <if test="endDate != null ">
-                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
-            </if>
+        <if test="endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
         </if>
     </select>