Parcourir la source

Merge branch 'dev/20200618_1.3.6' into debug

zhoutg il y a 5 ans
Parent
commit
9228fad4b0

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

@@ -59,6 +59,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/bas/dept/getListUser").permitAll()
                 .antMatchers("/qc/behospitalInfo/page_dept").permitAll()
                 .antMatchers("/qc/behospitalInfo/page_person").permitAll()
+                .antMatchers("/qc/behospitalInfo/page_group").permitAll()
                 .antMatchers("/qc/casesEntryHospital/findQcCasesEntry").permitAll()
                 .antMatchers("/qc/dataimport/import").permitAll()
                 .antMatchers("/qc/dataimport/test").permitAll()
@@ -112,6 +113,9 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/consoleByDept/mrCountByDept").permitAll()
                 .antMatchers("/consoleByDept/qcResultShortByDeptPage").permitAll()
                 .antMatchers("/consoleByDept/resultStatisticsByDeptAndDoctorPage").permitAll()
+                .antMatchers("/console/export/homePageLevelExport").permitAll()
+                .antMatchers("/console/export/entryGroupByEntryExport").permitAll()
+                .antMatchers("/console/export/levelExport").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -102,6 +102,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/bas/dept/getListUser", request)
                 || matchers("/qc/behospitalInfo/page_dept", request)
                 || matchers("/qc/behospitalInfo/page_person", request)
+                || matchers("/qc/behospitalInfo/page_group", request)
                 || matchers("/qc/casesEntryHospital/findQcCasesEntry", request)
                 || matchers("/qc/behospitalInfo/exportExcel", request)
                 || matchers("/qc/dataimport/import", request)
@@ -156,6 +157,9 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/consoleByDept/mrCountByDept", request)
                 || matchers("/consoleByDept/qcResultShortByDeptPage", request)
                 || matchers("/consoleByDept/resultStatisticsByDeptAndDoctorPage", request)
+                || matchers("/console/export/homePageLevelExport", request)
+                || matchers("/console/export/entryGroupByEntryExport", request)
+                || matchers("/console/export/levelExport", request)
                 || matchers("/", request)) {
             return true;
         }

+ 32 - 1
src/main/java/com/diagbot/dto/DeptEntryNumDTO.java

@@ -11,26 +11,57 @@ import lombok.Setter;
 @Getter
 @Setter
 public class DeptEntryNumDTO {
+    /**
+     * 条目缺陷id
+     */
+
     private Long id;
     /**
-     * 条目名称
+     * 条目缺陷名称
      */
     private String name;
+    /**
+     * 模块id
+     */
     private Long casesId;
     /**
      * 模块名称
      */
     private String casesName;
+    /**
+     * 科室id
+     */
     private String deptId;
     /**
      * 科室名称
      */
     private String deptName;
+    /**
+     * 条目缺陷总数
+     */
     private Integer totleNum = 0;
+    /**
+     * 条目缺陷数
+     */
     private Integer num = 0;
+    /**
+     * 条目缺陷占比
+     */
     private Double percent = 0.00d;
+    /**
+     * 条目缺陷占比(百分比)
+     */
     private String percentStr = "0.00%";
+    /**
+     * 条目缺陷分值
+     */
     private Double score = 0d;
+    /**
+     * 单项否决标识
+     */
     private Integer isReject;
+    /**
+     * 规则类型(0:无,1:空项,2:错误)
+     */
     private Integer ruleType;
 }

+ 6 - 0
src/main/java/com/diagbot/dto/DeptNumDTO.java

@@ -11,6 +11,12 @@ import lombok.Setter;
 @Getter
 @Setter
 public class DeptNumDTO extends NumDTO {
+    /**
+     * 科室id
+     */
     private String deptId;
+    /**
+     * 科室名称
+     */
     private String deptName;
 }

+ 35 - 1
src/main/java/com/diagbot/dto/EntryNumDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -11,21 +12,54 @@ import lombok.Setter;
 @Getter
 @Setter
 public class EntryNumDTO {
+    /**
+     * 条目缺陷id
+     */
     private Long id;
     /**
-     * 条目名称
+     * 条目缺陷名称
      */
+    @Excel(name = "缺陷名称", width = 40, orderNum = "2")
     private String name;
+    /**
+     * 模块id
+     */
     private Long casesId;
     /**
      * 模块名称
      */
+    @Excel(name = "所属模块", width = 20, orderNum = "1")
     private String casesName;
+    /**
+     * 条目缺陷总数
+     */
     private Integer totleNum = 0;
+    /**
+     * 条目缺陷数
+     */
+    @Excel(name = "数量", orderNum = "5")
     private Integer num = 0;
+    /**
+     * 条目缺陷占比
+     */
     private Double percent = 0.00d;
+    /**
+     * 条目缺陷占比(百分比)
+     */
+    @Excel(name = "缺陷占比", orderNum = "6")
     private String percentStr = "0.00%";
+    /**
+     * 条目缺陷分值
+     */
+    @Excel(name = "分值", orderNum = "3")
     private Double score = 0d;
+    /**
+     * 单项否决标识
+     */
+    @Excel(name = "单项否决", orderNum = "4", replace = { "否_0", "是_1" })
     private Integer isReject;
+    /**
+     * 规则类型(0:无,1:空项,2:错误)
+     */
     private Integer ruleType;
 }

+ 79 - 0
src/main/java/com/diagbot/dto/HomePageNumDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -11,27 +12,105 @@ import lombok.Setter;
 @Getter
 @Setter
 public class HomePageNumDTO {
+    /**
+     * 科室id(科室编码)
+     */
     private String deptId;
+    /**
+     * 科室名称
+     */
+    @Excel(name = "科室名称", width = 30, orderNum = "1")
     private String deptName;
+    /**
+     * 主管医生id
+     */
     private String doctorId;
+    /**
+     * 主管医生名称
+     */
     private String doctorName;
+    /**
+     * 缺陷条目数
+     */
+    @Excel(name = "缺陷总数", orderNum = "2")
     private Integer entryNum = 0;
+    /**
+     * 质控病历数
+     */
+    @Excel(name = "质控病历数", orderNum = "9")
     private Integer mrNum = 0;
+    /**
+     * 质控评分(总分)
+     */
     private Double totleValue = 0d;
+    /**
+     * 质控评分(平均分)
+     */
+    @Excel(name = "质控平均分", orderNum = "8")
     private Double averageValue = 0d;
+    /**
+     * 病案首页合格病历数
+     */
     private Integer firstLevelNum = 0;
+    /**
+     * 病案首页不合格病历数
+     */
     private Integer secondLevelNum = 0;
+    /**
+     * 病案首页合格病历占比
+     */
     private Double firstLevelPercent = 0.00d;
+    /**
+     * 病案首页不合格病历占比
+     */
     private Double secondLevelPercent = 0.00d;
+    /**
+     * 病案首页合格病历占比(百分比)
+     */
+    @Excel(name = "合格率", orderNum = "3")
     private String firstLevelPercentStr = "0.00%";
+    /**
+     * 病案首页不合格病历占比(百分比)
+     */
     private String secondLevelPercentStr = "0.00%";
+    /**
+     * 上级科室id(上级科室编码)
+     */
     private String deptClassId;
+    /**
+     * 上级科室名称
+     */
     private String deptClass;
+    /**
+     * 空项数
+     */
+    @Excel(name = "空项数", orderNum = "4")
     private Integer emptyNum = 0;
+    /**
+     * 错误数
+     */
+    @Excel(name = "错误数", orderNum = "6")
     private Integer errorNum = 0;
+    /**
+     * 完整率、完善率分母(质控病历数*病案首页条目数)
+     */
     private Integer entryTotleNum = 0;
+    /**
+     * 完整率
+     */
     private Double emptyPercent = 0.00d;
+    /**
+     * 完善率
+     */
     private Double errorPercent = 0.00d;
+    /**
+     * 完整率(百分比)
+     */
+    @Excel(name = "完整率", orderNum = "5")
     private String emptyPercentStr = "0.00%";
+    /**
+     * 完善率(百分比)
+     */
+    @Excel(name = "完善率", orderNum = "7")
     private String errorPercentStr = "0.00%";
 }

+ 69 - 1
src/main/java/com/diagbot/dto/LevelStatisticsDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -11,24 +12,91 @@ import lombok.Setter;
 @Getter
 @Setter
 public class LevelStatisticsDTO {
+    /**
+     * 科室id(科室编码)
+     */
+    @Excel(name = "科室编码", orderNum = "1")
     private String deptId;
+    /**
+     * 科室名称
+     */
+    @Excel(name = "科室名称", width = 30, orderNum = "2")
     private String deptName;
+    /**
+     * 主管医生id
+     */
     private String doctorId;
+    /**
+     * 主管医生名称
+     */
     private String doctorName;
+    /**
+     * 缺陷条目数
+     */
+    @Excel(name = "缺陷总数", orderNum = "3")
     private Integer entryNum;
+    /**
+     * 质控病历数
+     */
+    @Excel(name = "质控病历数", orderNum = "5")
     private Integer mrNum;
+    /**
+     * 质控评分(总分)
+     */
     private Double totleValue;
+    /**
+     * 质控评分(平均分)
+     */
+    @Excel(name = "质控平均分", orderNum = "4")
     private Double averageValue;
+    /**
+     * 甲级病历数/病案首页合格病历数
+     */
+    @Excel(name = "甲级病历数", orderNum = "6")
     private Integer firstLevelNum;
+    /**
+     * 乙级病历数/病案首页不合格病历数
+     */
+    @Excel(name = "乙级病历数", orderNum = "7")
     private Integer secondLevelNum;
+    /**
+     * 丙级病历数
+     */
+    @Excel(name = "丙级病历数", orderNum = "8")
     private Integer thirdLevelNum;
+    /**
+     * 甲级病历占比/病案首页合格病历占比
+     */
     private Double firstLevelPercent;
+    /**
+     * 乙级病历占比/病案首页不合格病历占比
+     */
     private Double secondLevelPercent;
+    /**
+     * 丙级病历占比
+     */
     private Double thirdLevelPercent;
+    /**
+     * 甲级病历占比(百分比)/病案首页合格病历占比(百分比)
+     */
+    @Excel(name = "甲级率", orderNum = "9")
     private String firstLevelPercentStr;
+    /**
+     * 乙级病历占比(百分比)/病案首页不合格病历占比(百分比)
+     */
+    @Excel(name = "乙级率", orderNum = "10")
     private String secondLevelPercentStr;
+    /**
+     * 丙级病历占比(百分比)
+     */
+    @Excel(name = "丙级率", orderNum = "11")
     private String thirdLevelPercentStr;
-
+    /**
+     * 上级科室id(上级科室编码)
+     */
     private String deptClassId;
+    /**
+     * 上级科室名称
+     */
     private String deptClass;
 }

+ 15 - 0
src/main/java/com/diagbot/dto/NumDTO.java

@@ -12,9 +12,24 @@ import lombok.Setter;
 @Setter
 public class NumDTO {
     private String id;
+    /**
+     * 名称
+     */
     private String name;
+    /**
+     * 总数
+     */
     private Integer totleNum = 0;
+    /**
+     * 数量
+     */
     private Integer num = 0;
+    /**
+     * 占比
+     */
     private Double percent = 0.00d;
+    /**
+     * 占比(百分比)
+     */
     private String percentStr = "0.00%";
 }

+ 11 - 0
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -821,6 +821,17 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return res;
     }
 
+    /**
+     * @param behospitalPageVO
+     * @return
+     */
+    public IPage<BehospitalInfoDTO> pageGroup(BehospitalPageVO behospitalPageVO) {
+        behospitalPageSet(behospitalPageVO);
+        behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
+        IPage<BehospitalInfoDTO> res = getPageByGroup(behospitalPageVO);
+        return res;
+    }
+
     public IPage<BehospitalInfoDTO> pageDept(BehospitalPageVO behospitalPageVO) {
         behospitalPageSet(behospitalPageVO);
         behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));

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

@@ -0,0 +1,66 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.EntryNumDTO;
+import com.diagbot.dto.HomePageNumDTO;
+import com.diagbot.dto.LevelStatisticsDTO;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.vo.FilterOrderVO;
+import com.diagbot.vo.FilterPageVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * @Description: 报表导出装饰层
+ * @author: gaodm
+ * @time: 2020/6/18 10:41
+ */
+@Component
+public class ConsoleExportFacade {
+
+    @Autowired
+    private ConsoleFacade consoleFacade;
+
+
+    /**
+     * 病案首页合格率占比
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public void homePageLevelExport(HttpServletResponse response, FilterOrderVO filterOrderVO) {
+        List<HomePageNumDTO> res = consoleFacade.homePageLevelStatistics(filterOrderVO);
+        String fileName = "病案首页合格率占比.xls";
+        ExcelUtils.exportExcel(res, null, "sheet1", HomePageNumDTO.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 条目缺陷占比(内页)
+     *
+     * @param filterPageVO
+     * @return
+     */
+    public void entryGroupByEntryExport(HttpServletResponse response, FilterPageVO filterPageVO) {
+        filterPageVO.setCurrent(1L);
+        filterPageVO.setSize(Long.MAX_VALUE);
+        IPage<EntryNumDTO> page = consoleFacade.entryGroupByEntryInnerPage(filterPageVO);
+        String fileName = "条目缺陷占比.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", EntryNumDTO.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各科室缺陷占比(组合)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    public void levelExport(HttpServletResponse response, FilterOrderVO filterOrderVO) {
+        List<LevelStatisticsDTO> records = consoleFacade.levelStatistics(filterOrderVO);
+        String fileName = "各科室缺陷占比.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", LevelStatisticsDTO.class, fileName, response, 12.8f);
+    }
+
+}

+ 2 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -64,6 +64,8 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
 
     IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO);
 
+    IPage<BehospitalInfoDTO> getPageByGroup(BehospitalPageVO behospitalPageVO);
+
     /**
      * 出院总人数统计-全院-首页
      *

+ 2 - 0
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -65,6 +65,8 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
 
     IPage<BehospitalInfoDTO> getPageByPerson(BehospitalPageVO behospitalPageVO);
 
+    IPage<BehospitalInfoDTO> getPageByGroup(BehospitalPageVO behospitalPageVO);
+
     /**
      * 出院总人数统计-全院-首页
      *

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

@@ -92,6 +92,11 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.getPageByPerson(behospitalPageVO);
     }
 
+    @Override
+    public IPage<BehospitalInfoDTO> getPageByGroup(BehospitalPageVO behospitalPageVO) {
+        return baseMapper.getPageByGroup(behospitalPageVO);
+    }
+
     /**
      * 出院总人数统计-全院-首页
      *

+ 23 - 5
src/main/java/com/diagbot/util/ExcelUtils.java

@@ -10,8 +10,6 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ExcelExportStylerUserImpl;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -45,6 +43,11 @@ public class ExcelUtils {
         userExport(list, pojoClass, fileName, response, exportParams);
     }
 
+    public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
+                                   HttpServletResponse response, float height) {
+        userExport2(list, pojoClass, fileName, response, new ExportParams(title, sheetName), height);
+    }
+
     public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName,
                                    HttpServletResponse response) {
         defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName));
@@ -64,13 +67,13 @@ public class ExcelUtils {
     }
 
     private static void userExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
-                                      ExportParams exportParams) {
+                                   ExportParams exportParams) {
         Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
         if (workbook != null) {
             Sheet sheet = workbook.getSheetAt(0);
             //列宽设置
-            sheet.setColumnWidth(8, 256*20);
-            sheet.setColumnWidth(9, 256*50);
+            sheet.setColumnWidth(8, 256 * 20);
+            sheet.setColumnWidth(9, 256 * 50);
             int rowNum = sheet.getLastRowNum();
             Row row = sheet.getRow(0);
             for (int i = 1; i <= rowNum; i++) {
@@ -81,6 +84,21 @@ public class ExcelUtils {
         downLoadExcel(fileName, response, workbook);
     }
 
+    private static void userExport2(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response,
+                                    ExportParams exportParams, float height) {
+        Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
+        if (workbook != null) {
+            Sheet sheet = workbook.getSheetAt(0);
+            int rowNum = sheet.getLastRowNum();
+            Row row = sheet.getRow(0);
+            for (int i = 1; i <= rowNum; i++) {
+                row = sheet.getRow(i);
+                row.setHeightInPoints(height);
+            }
+        }
+        downLoadExcel(fileName, response, workbook);
+    }
+
     private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) {
         try {
             response.setCharacterEncoding("UTF-8");

+ 3 - 1
src/main/java/com/diagbot/vo/BehospitalPageVO.java

@@ -79,6 +79,9 @@ public class BehospitalPageVO extends Page implements Serializable {
     @ApiModelProperty(hidden = true)
     private Long userId;
 
+    /**
+     * 医生工号
+     */
     private Long doctorCode;
 
     /**
@@ -86,7 +89,6 @@ public class BehospitalPageVO extends Page implements Serializable {
      */
     private Integer statisticsType;
 
-
     /**
      * 是否归档(0:未归档,1:已归档)
      */

+ 26 - 2
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -49,13 +49,18 @@ public class BehospitalInfoController {
     private QcresultInfoFacade qcresultInfoFacade;
 
     @ApiOperation(value = "病历分页列表[by:zhoutg]",
-            notes = "name:姓名<br>" +
+            notes = "behospitalCode:病人住院序号<br>" +
+                    "name:病人姓名<br>" +
                     "fileCode:档案号<br>" +
                     "statisticsType: 统计维度 1-本月,2-本年<br>" +
                     "behosDateStart:入院时间开始时间<br>" +
                     "behosDateEnd:入院时间结束时间<br>" +
                     "leaveHosDateStart:出院时间开始时间<br>" +
-                    "leaveHosDateEnd:出院时间结束时间<br>")
+                    "leaveHosDateEnd:出院时间结束时间<br>" +
+                    "doctorName:医生姓名<br>" +
+                    "doctorCode:医生工号<br>" +
+                    "level:等级<br>" +
+                    "deptId:科室id<br>")
     @PostMapping("/page")
     @SysLogger("page")
     public RespDTO<IPage<BehospitalInfoDTO>> page(@RequestBody BehospitalPageVO behospitalPageVO) {
@@ -193,6 +198,25 @@ public class BehospitalInfoController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "病历分页列表(个人)[by:zhoutg]",
+            notes = "behospitalCode:病人住院序号<br>" +
+                    "name:病人姓名<br>" +
+                    "fileCode:档案号<br>" +
+                    "statisticsType: 统计维度 1-本月,2-本年<br>" +
+                    "behosDateStart:入院时间开始时间<br>" +
+                    "behosDateEnd:入院时间结束时间<br>" +
+                    "leaveHosDateStart:出院时间开始时间<br>" +
+                    "leaveHosDateEnd:出院时间结束时间<br>" +
+                    "doctorName:医生姓名<br>" +
+                    "doctorCode:医生工号<br>" +
+                    "level:等级<br>" +
+                    "deptId:科室id<br>")
+    @PostMapping("/page_group")
+    @SysLogger("page_group")
+    public RespDTO<IPage<BehospitalInfoDTO>> pageGroup(@RequestBody BehospitalPageVO behospitalPageVO) {
+        IPage<BehospitalInfoDTO> data = behospitalInfoFacade.pageGroup(behospitalPageVO);
+        return RespDTO.onSuc(data);
+    }
 
     @ApiOperation(value = "导出病历[by:gaodm]",
             notes = "")

+ 82 - 0
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -0,0 +1,82 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.facade.ConsoleExportFacade;
+import com.diagbot.vo.FilterOrderVO;
+import com.diagbot.vo.FilterPageVO;
+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;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/4/13 16:45
+ */
+@RequestMapping("/console/export")
+@RestController
+@Api(value = "数据报表明细导出相关API", tags = { "数据报表明细导出相关API" })
+@SuppressWarnings("unchecked")
+public class ConsoleExportController {
+
+    @Autowired
+    private ConsoleExportFacade consoleExportFacade;
+
+    /**
+     * 病案首页合格率占比导出
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页合格率占比导出[by:gaodm]",
+            notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
+                    "level: 病历等级 <br>" +
+                    "name: 科室名称 <br>" +
+                    "asc: 排序(升序) <br>" +
+                    "desc: 排序(降序) <br>")
+    @PostMapping("/homePageLevelExport")
+    @SysLogger("homePageLevelExport")
+    public void homePageLevelExport(HttpServletResponse response, @RequestBody @Valid FilterOrderVO filterOrderVO) {
+        consoleExportFacade.homePageLevelExport(response, filterOrderVO);
+    }
+
+
+    /**
+     * 条目缺陷占比(内页)
+     *
+     * @param filterPageVO
+     * @return
+     */
+    @ApiOperation(value = "条目缺陷占比导出[by:gaodm]",
+            notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
+    @PostMapping("/entryGroupByEntryExport")
+    @SysLogger("entryGroupByEntryExport")
+    public void entryGroupByEntryExport(HttpServletResponse response, @RequestBody @Valid FilterPageVO filterPageVO) {
+        consoleExportFacade.entryGroupByEntryExport(response, filterPageVO);
+    }
+
+    /**
+     * 各科室缺陷占比(组合)
+     *
+     * @param filterOrderVO
+     * @return
+     */
+    @ApiOperation(value = "各科室缺陷占比(组合)导出[by:gaodm]",
+            notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
+                    "level: 病历等级 <br>" +
+                    "name: 科室名称 <br>" +
+                    "asc: 排序(升序) <br>" +
+                    "desc: 排序(降序) <br>")
+    @PostMapping("/levelExport")
+    @SysLogger("levelExport")
+    public void levelExport(HttpServletResponse response, @RequestBody @Valid FilterOrderVO filterOrderVO) {
+        consoleExportFacade.levelExport(response, filterOrderVO);
+    }
+}

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

@@ -391,6 +391,75 @@
         and t.is_placefile = 1
     </select>
 
+    <!--质控评分(医疗组)分页-->
+    <select id="getPageByGroup" resultType="com.diagbot.dto.BehospitalInfoDTO">
+        select * from (
+        select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
+        grade_time, c.age from med_behospital_info a
+        LEFT JOIN med_qcresult_info b
+        on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
+        left join med_home_page c
+        on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
+        ) t
+        where t.is_deleted = 'N' and
+            t.doctor_id in (
+                SELECT doctor_id FROM `bas_doctor_info`
+                where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
+                    select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
+                    where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
+                    and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
+                    and c1.username = c3.doctor_id
+                    and c2.hospital_id = #{hospitalId}
+                    and c1.id = #{userId}
+                )
+            )
+        <if test="deptId != null and deptId != ''">
+            and t.beh_dept_id = #{deptId}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            and (t.doctor_name like CONCAT('%',#{doctorName},'%')
+            or t.beh_doctor_name like CONCAT('%',#{doctorName},'%')
+            or t.director_doctor_name like CONCAT('%',#{doctorName},'%'))
+        </if>
+        <if test="name != null and name != ''">
+            and t.name like CONCAT('%',#{name},'%')
+        </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            and (t.doctor_id = #{doctorCode}
+            or t.beh_doctor_id = #{doctorCode}
+            or t.director_doctor_id = #{doctorCode})
+        </if>
+        <if test="fileCode != null and fileCode != ''">
+            and t.file_code like CONCAT('%',#{fileCode},'%')
+        </if>
+        <if test="hospitalId != null">
+            and t.hospital_id = #{hospitalId}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and t.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+        <if test="behosDateStart != null">
+            <![CDATA[ and t.behospital_date >= #{behosDateStart}]]>
+        </if>
+        <if test="behosDateEnd != null">
+            <![CDATA[ and t.behospital_date < #{behosDateEnd}]]>
+        </if>
+        <if test="leaveHosDateStart != null">
+            <![CDATA[ and t.leave_hospital_date >= #{leaveHosDateStart}]]>
+        </if>
+        <if test="leaveHosDateEnd != null">
+            <![CDATA[ and t.leave_hospital_date < #{leaveHosDateEnd}]]>
+        </if>
+        <if test="level != null and level != ''">
+            and t.level = #{level}
+        </if>
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and t.is_placefile = #{isPlacefile}
+        </if>
+        and t.qc_type_id != 0
+        and t.is_placefile = 1
+    </select>
+
     <!-- 出院总人数统计-全院-首页 -->
     <select id="leaveHosCount" parameterType="com.diagbot.vo.FilterVO" resultType="int">
         SELECT