Pārlūkot izejas kodu

医生质控平均分列表页、导出功能提交

songxinlu 3 gadi atpakaļ
vecāks
revīzija
0b97de197c

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -292,6 +292,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/appealInfo/getAppealMode").permitAll()
                 .antMatchers("/qc/appealInfo/getUserRole").permitAll()
                 .antMatchers("/qc/mode/getModes").permitAll()
+                .antMatchers("/consoleByDoctor/**").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -369,6 +369,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/appealInfo/getAppealMode", request)
                 || matchers("/qc/appealInfo/getUserRole", request)
                 || matchers("/qc/mode/getModes", request)
+                || matchers("/consoleByDoctor/**", request)
                 || matchers("/", request)) {
             return true;
         }

+ 49 - 0
src/main/java/com/diagbot/dto/DoctorAverageStatisticsDTO.java

@@ -0,0 +1,49 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 医生质控平均分页面统计-接口出参
+ * @Author songxl
+ * @Date 2022/4/8 13:20
+ */
+@ApiModel(value = "医生质控平均分页面统计-接口出参")
+@Getter
+@Setter
+public class DoctorAverageStatisticsDTO implements Serializable {
+    private static final long serialVersionUID = 981655366059103193L;
+
+    @ApiModelProperty(value = "科室名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "科室id")
+    private String deptId;
+
+    @ApiModelProperty(value = "医生名称")
+    private String doctorName;
+
+    @ApiModelProperty(value = "医生工号")
+    private String doctorId;
+
+    @ApiModelProperty(value = "缺陷条目数")
+    private Integer entryNum = 0;
+
+    @ApiModelProperty(value = "质控评分(平均分)")
+    private Double averageValue = 0d;
+
+    @ApiModelProperty(value = "甲级病历数")
+    private String firstLevelStrNum = "0";
+
+    @ApiModelProperty(value = "乙级病历数")
+    private String secondLevelStrNum = "0";
+
+    @ApiModelProperty(value = "丙级病历数")
+    private String thirdLevelStrNum = "0";
+
+
+}

+ 48 - 0
src/main/java/com/diagbot/dto/ExportDoctorAverageStatisticsDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 医生质控平均分页面统计-导出-接口出参
+ * @Author songxl
+ * @Date 2022/4/8 13:20
+ */
+@ApiModel(value = "医生质控平均分页面统计-导出-接口出参")
+@Getter
+@Setter
+public class ExportDoctorAverageStatisticsDTO implements Serializable {
+    private static final long serialVersionUID = 981655366059103193L;
+
+    @Excel(name = "科室")
+    private String deptName;
+
+
+    @Excel(name = "医生姓名")
+    private String doctorName;
+
+    @Excel(name = "医生工号")
+    private String doctorId;
+
+    @Excel(name = "缺陷总数")
+    private Integer entryNum = 0;
+
+    @Excel(name = "质控平均分")
+    private Double averageValue = 0d;
+
+    @Excel(name = "甲级病历数")
+    private String firstLevelStrNum = "0";
+
+    @Excel(name = "乙级病历数")
+    private String secondLevelStrNum = "0";
+
+    @Excel(name = "丙级病历数")
+    private String thirdLevelStrNum = "0";
+
+
+}

+ 30 - 0
src/main/java/com/diagbot/facade/ConsoleByDoctorFacade.java

@@ -0,0 +1,30 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.DoctorAverageStatisticsDTO;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.DoctorAverageStatisticsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:控制台(医生)统计相关处理
+ * @Author:songxl
+ * @date 2022/4/8 13:20
+ */
+@Component
+public class ConsoleByDoctorFacade {
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    /**
+     * 医生质控平均分页面统计
+     *
+     * @param doctorAverageStatisticsVO
+     * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.DoctorAverageStatisticsDTO>
+     */
+    public IPage<DoctorAverageStatisticsDTO> doctorAverageStatistics(DoctorAverageStatisticsVO doctorAverageStatisticsVO) {
+        doctorAverageStatisticsVO.setHospitalId(SysUserUtils.getCurrentHospitalID());
+        return behospitalInfoFacade.getBaseMapper().doctorAverageStatistics(doctorAverageStatisticsVO);
+    }
+}

+ 89 - 69
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -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);
+    }
 }

+ 34 - 20
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -24,6 +24,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public IPage<BehospitalInfoDTO> getPage(BehospitalPageVO behospitalPageVO);
 
     public List<MsgDTO> getMsg(AnalyzeVO analyzeVO);
+
     public List<MsgDTO> getForeignMsg(AnalyzeVO analyzeVO);
 
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
@@ -396,12 +397,13 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
 
     /**
- * 离院病人质控评分年龄单独查询详情页
- *
- * @param
- * @return
- */
-    List<Map<String,Object>>getAge(@Param("hospitalId")String hospitalId, @Param("behospitalCodes")Set<String> behospitalCodes);
+     * 离院病人质控评分年龄单独查询详情页
+     *
+     * @param
+     * @return
+     */
+    List<Map<String, Object>> getAge(@Param("hospitalId") String hospitalId, @Param("behospitalCodes") Set<String> behospitalCodes);
+
     /**
      * 改善率统计-全院(首页)
      *
@@ -417,6 +419,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public List<HomePageImproveDTO> qcCheckStatistics(FilterOrderVO filterOrderVO);
+
     /**
      * 质控核查统计-科室(内页)
      *
@@ -426,7 +429,6 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public List<ImproveByDeptDTO> qcCheckStatisticsByDept(FilterOrderVO filterOrderVO);
 
 
-
     /**
      * 离院病人质控评分详情页导出到excel
      *
@@ -485,14 +487,13 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public IPage<QualityControlDeptDTO> qualityControlByDept(BehospitalPageVO behospitalPageVO);
 
 
-
     /**
      * 病历稽查表
      *
      * @param filterVO
      * @return
      */
-    public IPage<MedicalCheckDTO>  getMedicalCheck(@Param("filterVO")FilterMedicalCheckVO filterVO);
+    public IPage<MedicalCheckDTO> getMedicalCheck(@Param("filterVO") FilterMedicalCheckVO filterVO);
 
     /**
      * 病历稽查表-科室
@@ -500,9 +501,9 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public IPage<MedicalCheckDTO>  getMedicalCheckByDept(@Param("filterVO")FilterMedicalCheckVO filterVO);
+    public IPage<MedicalCheckDTO> getMedicalCheckByDept(@Param("filterVO") FilterMedicalCheckVO filterVO);
 
-    public List<MedicalCheckIdNameDTO>  getMedicalEntryIds(@Param("casesEntryIds")List<Long> casesEntryIds);
+    public List<MedicalCheckIdNameDTO> getMedicalEntryIds(@Param("casesEntryIds") List<Long> casesEntryIds);
 
     /**
      * 病历稽查表导出
@@ -510,7 +511,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public List<MedicalCheckExportDTO>  getMedicalCheckExport(@Param("filterVO")FilterMedicalCheckVO filterVO);
+    public List<MedicalCheckExportDTO> getMedicalCheckExport(@Param("filterVO") FilterMedicalCheckVO filterVO);
 
     /**
      * 病历稽查表导出-科室
@@ -518,7 +519,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public List<MedicalDeptDTO>  medicalCheckExportByDept(@Param("filterVO")FilterMedicalCheckVO filterVO);
+    public List<MedicalDeptDTO> medicalCheckExportByDept(@Param("filterVO") FilterMedicalCheckVO filterVO);
 
 
     /**
@@ -554,7 +555,6 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public IPage<QcResultShortDTO> badLevelXYPage(@Param("qcResultPageVO") QcResultPageXYVO qcResultPageVO);
 
 
-
     /**
      * 未整改病历缺陷评分详情页导出
      *
@@ -677,7 +677,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param timeVo
      * @return
      */
-    public Map<String,Object> getBaseIndex( MedIndexFilterVO timeVo);
+    public Map<String, Object> getBaseIndex(MedIndexFilterVO timeVo);
 
     /**
      * 病案管理规则质控参数查询
@@ -685,7 +685,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @param filterVO
      * @return
      */
-    public Map<String,Object> getCountByEntry( FilterVO filterVO);
+    public Map<String, Object> getCountByEntry(FilterVO filterVO);
 
     /**
      * 病案管理规则质控病历参数查询
@@ -694,7 +694,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
 
-    public  List<MedManageParamsDTO> getMedManageParams( FilterVO filterVO);
+    public List<MedManageParamsDTO> getMedManageParams(FilterVO filterVO);
 
 
     /**
@@ -737,6 +737,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public List<ExportExcelByDeptDTO> qcCheckMRPageExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 入院,手术,出院 24小时完成情况
      *
@@ -744,6 +745,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public Map<String, Long> medicalRecordIndicator(@Param("filterVO") FilterVO filterVO);
+
     /**
      * 手术费,抗菌药物,手术和病理费等含有人数
      *
@@ -754,30 +756,42 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     /**
      * 病理CT/MR触发多规则人数
+     *
      * @param filterVO
      * @return
      */
-    public Map<String,Long> triggeringRules(@Param("filterVO") FilterVO filterVO);
+    public Map<String, Long> triggeringRules(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 病案首页关联的出院病历
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO);
+    public List<Map<String, String>> getMedicalRecords(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 首页恶性肿瘤人数
+     *
      * @param filterVO
      * @return
      */
-    public List<Map<String,String>> malignancy(@Param("filterVO") FilterVO filterVO);
+    public List<Map<String, String>> malignancy(@Param("filterVO") FilterVO filterVO);
 
     /**
      * 获取患者年龄信息(通过出生日期和入院日期重新计算)
+     *
      * @param hospitalId
      * @param behospitalCodes
      * @return
      */
     List<BehospitalInfoAgeDTO> getBehospitalInfoAge(Long hospitalId, List<String> behospitalCodes);
+
+    /**
+     *
+     *
+     * @param doctorAverageStatisticsVO
+     * @Return com.baomidou.mybatisplus.core.metadata.IPage<com.diagbot.dto.DoctorAverageStatisticsDTO>
+     */
+    IPage<DoctorAverageStatisticsDTO> doctorAverageStatistics(@Param("doctorAverageStatisticsVO") DoctorAverageStatisticsVO doctorAverageStatisticsVO);
 }

+ 51 - 0
src/main/java/com/diagbot/vo/DoctorAverageStatisticsVO.java

@@ -0,0 +1,51 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description: 医生质控平均分页面统计-接口入参
+ * @Author songxl
+ * @Date 2022/4/8 13:20
+ */
+@ApiModel(value = "医生质控平均分页面统计-接口入参")
+@Getter
+@Setter
+public class DoctorAverageStatisticsVO extends Page implements Serializable {
+    private static final long serialVersionUID = -6882080859173434502L;
+
+    @ApiModelProperty(value = "是否归档(0:未归档,1:已归档)", required = true)
+    @NotBlank(message = "是否归档为空")
+    private String isPlacefile = "1";
+
+    @ApiModelProperty(value = "起始时间", required = true)
+    @NotBlank(message = "请输入起始时间")
+    private String startDate;
+
+    @ApiModelProperty(value = "结束时间", required = true)
+    @NotBlank(message = "请输入结束时间")
+    private String endDate;
+
+    @ApiModelProperty(value = "科室名称", required = true)
+    @NotBlank(message = "科室名称为空")
+    private String deptName;
+
+    @ApiModelProperty(value = "科室id", required = true)
+    @NotBlank(message = "科室id为空")
+    private String deptId;
+
+    @ApiModelProperty(value = "医生名称")
+    private String doctorName;
+
+    @ApiModelProperty(value = "医生工号")
+    private String doctorId;
+
+    @ApiModelProperty(value = "医院id", hidden = true)
+    private String hospitalId;
+}

+ 66 - 0
src/main/java/com/diagbot/web/ConsoleByDoctorController.java

@@ -0,0 +1,66 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.DoctorAverageStatisticsDTO;
+import com.diagbot.dto.LevelStatisticsDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.ConsoleByDoctorFacade;
+import com.diagbot.facade.ConsoleExportFacade;
+import com.diagbot.vo.DoctorAverageStatisticsVO;
+import com.diagbot.vo.FilterOrderVO;
+import com.diagbot.vo.FilterOrderXYPageVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+/**
+ * @author songxl
+ * @Description: 控制台(医生)统计相关API
+ * @date 2022/4/8 13:20
+ **/
+@RequestMapping("/consoleByDoctor")
+@RestController
+@Api(value = "控制台(医生)统计相关API", tags = { "控制台(医生)统计相关API" })
+@SuppressWarnings("unchecked")
+public class ConsoleByDoctorController {
+    @Autowired
+    private ConsoleByDoctorFacade consoleByDoctorFacade;
+
+    @Autowired
+    private ConsoleExportFacade consoleExportFacade;
+    /**
+     * 医生质控平均分页面统计
+     *
+     * @param doctorAverageStatisticsVO
+     * @return
+     */
+    @ApiOperation(value = "医生质控平均分页面统计[by:songxl]",
+            notes = "医生质控平均分页面统计")
+    @PostMapping("/doctorAverageStatistics")
+    @SysLogger("doctorAverageStatistics")
+    public RespDTO<IPage<DoctorAverageStatisticsDTO>> doctorAverageStatistics(@RequestBody @Valid DoctorAverageStatisticsVO doctorAverageStatisticsVO) {
+        return RespDTO.onSuc(consoleByDoctorFacade.doctorAverageStatistics(doctorAverageStatisticsVO));
+    }
+
+
+    /**
+     * 医生质控平均分页面统计-导出
+     *
+     * @param doctorAverageStatisticsVO
+     * @return
+     */
+    @PostMapping("/doctorAverageStatisticsExport")
+    @SysLogger("doctorAverageStatisticsExport")
+    public void doctorAverageStatisticsExport(HttpServletResponse response, @RequestBody @Valid DoctorAverageStatisticsVO doctorAverageStatisticsVO) {
+        consoleExportFacade.doctorAverageStatisticsExport(response, doctorAverageStatisticsVO);
+    }
+}

+ 155 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -19762,4 +19762,159 @@
             </foreach>
         </if>
     </select>
+    <select id="doctorAverageStatistics" resultType="com.diagbot.dto.DoctorAverageStatisticsDTO">
+        SELECT t1.*,t2.entryNum
+        FROM
+        (
+        SELECT
+        CASE WHEN (a.doctor_id is null OR a.doctor_id = '' OR a.doctor_id = '-') THEN '-' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN (a.doctor_name is null OR a.doctor_name = '' OR a.doctor_name = '-') THEN '-' ELSE a.doctor_name END AS doctorName,
+        CASE WHEN (a.beh_dept_id is null OR a.beh_dept_id = '' OR a.beh_dept_id = '-') THEN '-' ELSE a.beh_dept_id END AS deptId,
+        CASE WHEN (a.beh_dept_name is null OR a.beh_dept_name = '' OR a.beh_dept_name = '-') THEN '-' ELSE a.beh_dept_name END AS deptName,
+        ROUND( avg( CAST(c.score_res as DECIMAL ( 18, 2 )) ), 2 ) AS averageValue,
+        SUM( c.`level` = '甲' ) AS firstLevelNum,
+        SUM( c.`level` = '乙' ) AS secondLevelNum,
+        SUM( c.`level` = '丙' ) AS thirdLevelNum
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        <if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile != ''">
+            and a.is_placefile = #{doctorAverageStatisticsVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="doctorAverageStatisticsVO.hospitalId != null and doctorAverageStatisticsVO.hospitalId != ''">
+            AND a.hospital_id = #{doctorAverageStatisticsVO.hospitalId}
+        </if>
+        <if test="doctorAverageStatisticsVO.deptId != null and doctorAverageStatisticsVO.deptId != ''">
+            AND a.beh_dept_id = #{doctorAverageStatisticsVO.deptId}
+        </if>
+        <if test="doctorAverageStatisticsVO.deptId == '-'">
+            AND (a.beh_dept_id IS NULL OR a.beh_dept_id = '' OR a.beh_dept_id = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.deptName != null and doctorAverageStatisticsVO.deptName != ''">
+            AND a.beh_dept_name = #{doctorAverageStatisticsVO.deptName}
+        </if>
+        <if test="doctorAverageStatisticsVO.deptName == '-'">
+            AND (a.beh_dept_name IS NULL OR a.beh_dept_name = '' OR a.beh_dept_name = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorId != null and doctorAverageStatisticsVO.doctorId != ''">
+            AND a.doctor_id LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorId},'%')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorId == '-'">
+            AND (a.doctor_id IS NULL OR a.doctor_id = '' OR a.doctor_id = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorName != null and doctorAverageStatisticsVO.doctorName != ''">
+            AND a.doctor_name LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorName},'%')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorName == '-'">
+            AND (a.doctor_name IS NULL OR a.doctor_name = '' OR a.doctor_name = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile == 0">
+            <if test="doctorAverageStatisticsVO.startDate != null and doctorAverageStatisticsVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{doctorAverageStatisticsVO.startDate}]]>
+            </if>
+            <if test="doctorAverageStatisticsVO.endDate != null and doctorAverageStatisticsVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{doctorAverageStatisticsVO.endDate}]]>
+            </if>
+        </if>
+        <if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile == 1">
+            <if test="doctorAverageStatisticsVO.startDate != null and doctorAverageStatisticsVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{doctorAverageStatisticsVO.startDate}]]>
+            </if>
+            <if test="doctorAverageStatisticsVO.endDate != null and doctorAverageStatisticsVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{doctorAverageStatisticsVO.endDate}]]>
+            </if>
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name,
+        a.doctor_id,
+        a.doctor_name
+        )t1,
+        (
+        SELECT
+        CASE WHEN (a.doctor_id is null OR a.doctor_id = '' OR a.doctor_id = '-') THEN '-' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN (a.doctor_name is null OR a.doctor_name = '' OR a.doctor_name = '-') THEN '-' ELSE a.doctor_name END AS doctorName,
+        CASE WHEN (a.beh_dept_id is null OR a.beh_dept_id = '' OR a.beh_dept_id = '-') THEN '-' ELSE a.beh_dept_id END AS deptId,
+        CASE WHEN (a.beh_dept_name is null OR a.beh_dept_name = '' OR a.beh_dept_name = '-') THEN '-' ELSE a.beh_dept_name END AS deptName,
+        count( 1 ) AS entryNum
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c,
+        med_qcresult_detail d,
+        qc_cases_entry e
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.hospital_id = d.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND a.behospital_code = d.behospital_code
+        AND d.cases_id = e.cases_id
+        AND d.cases_entry_id = e.id
+        <if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile != ''">
+            and a.is_placefile = #{doctorAverageStatisticsVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="doctorAverageStatisticsVO.hospitalId != null and doctorAverageStatisticsVO.hospitalId != ''">
+            AND a.hospital_id = #{doctorAverageStatisticsVO.hospitalId}
+        </if>
+        <if test="doctorAverageStatisticsVO.deptId != null and doctorAverageStatisticsVO.deptId != ''">
+            AND a.beh_dept_id = #{doctorAverageStatisticsVO.deptId}
+        </if>
+        <if test="doctorAverageStatisticsVO.deptId == '-'">
+            AND (a.beh_dept_id IS NULL OR a.beh_dept_id = '' OR a.beh_dept_id = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.deptName != null and doctorAverageStatisticsVO.deptName != ''">
+            AND a.beh_dept_name = #{doctorAverageStatisticsVO.deptName}
+        </if>
+        <if test="doctorAverageStatisticsVO.deptName == '-'">
+            AND (a.beh_dept_name IS NULL OR a.beh_dept_name = '' OR a.beh_dept_name = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorId != null and doctorAverageStatisticsVO.doctorId != ''">
+            AND a.doctor_id LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorId},'%')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorId == '-'">
+            AND (a.doctor_id IS NULL OR a.doctor_id = '' OR a.doctor_id = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorName != null and doctorAverageStatisticsVO.doctorName != ''">
+            AND a.doctor_name LIKE CONCAT('%',#{doctorAverageStatisticsVO.doctorName},'%')
+        </if>
+        <if test="doctorAverageStatisticsVO.doctorName == '-'">
+            AND (a.doctor_name IS NULL OR a.doctor_name = '' OR a.doctor_name = '-')
+        </if>
+        <if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile == 0">
+            <if test="doctorAverageStatisticsVO.startDate != null and doctorAverageStatisticsVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{doctorAverageStatisticsVO.startDate}]]>
+            </if>
+            <if test="doctorAverageStatisticsVO.endDate != null and doctorAverageStatisticsVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{doctorAverageStatisticsVO.endDate}]]>
+            </if>
+        </if>
+        <if test="doctorAverageStatisticsVO.isPlacefile != null and doctorAverageStatisticsVO.isPlacefile == 1">
+            <if test="doctorAverageStatisticsVO.startDate != null and doctorAverageStatisticsVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{doctorAverageStatisticsVO.startDate}]]>
+            </if>
+            <if test="doctorAverageStatisticsVO.endDate != null and doctorAverageStatisticsVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{doctorAverageStatisticsVO.endDate}]]>
+            </if>
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name,
+        a.doctor_id,
+        a.doctor_name
+        )t2
+        WHERE t1.doctorId = t2.doctorId
+        AND t1.doctorName = t2.doctorName
+        AND t1.deptId = t2.deptId
+        AND t1.deptName = t2.deptName
+    </select>
 </mapper>