Browse Source

报表服务-模块缺陷、出院统计、条目缺陷接口迁移

chengyao 3 years ago
parent
commit
14eb78186d
21 changed files with 3405 additions and 264 deletions
  1. 26 0
      common/src/main/java/com/lantone/common/vo/report/BasDoctorInfoVO.java
  2. 0 53
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/DeptInfoFacade.java
  3. 74 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/BehospitalInfoMapper.java
  4. 1 21
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/DeptInfoMapper.java
  5. 55 0
      dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/QcresultInfoMapper.java
  6. 1327 0
      dblayer-mbg/src/main/resources/mapper/report/BehospitalInfoMapper.xml
  7. 0 88
      dblayer-mbg/src/main/resources/mapper/report/DeptInfoMapper.xml
  8. 501 0
      dblayer-mbg/src/main/resources/mapper/report/QcresultInfoMapper.xml
  9. 7 0
      pom.xml
  10. 4 0
      report-service/pom.xml
  11. 298 0
      report-service/src/main/java/com/lantone/report/aggregate/LeaveHosStatisticsAggregate.java
  12. 0 47
      report-service/src/main/java/com/lantone/report/facade/DeptInfoManagementFacade.java
  13. 109 0
      report-service/src/main/java/com/lantone/report/facade/EntryCaseManagementFacade.java
  14. 551 0
      report-service/src/main/java/com/lantone/report/facade/FilterFacade.java
  15. 156 0
      report-service/src/main/java/com/lantone/report/facade/LeaveHospitalManagementFacade.java
  16. 70 0
      report-service/src/main/java/com/lantone/report/facade/ModuleCaseManagementFacade.java
  17. 0 55
      report-service/src/main/java/com/lantone/report/web/DeptInfoManagementController.java
  18. 74 0
      report-service/src/main/java/com/lantone/report/web/EntryCaseManagementController.java
  19. 74 0
      report-service/src/main/java/com/lantone/report/web/LeaveHospitalManagementController.java
  20. 74 0
      report-service/src/main/java/com/lantone/report/web/ModuleCaseManagementController.java
  21. 4 0
      report-service/src/main/resources/bootstrap.yml

+ 26 - 0
common/src/main/java/com/lantone/common/vo/report/BasDoctorInfoVO.java

@@ -0,0 +1,26 @@
+package com.lantone.common.vo.report;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: cy
+ * @time: 2020/12/24 11:28
+ */
+@Getter
+@Setter
+public class BasDoctorInfoVO {
+    /**
+     * 搜索参数
+     */
+    private String inputStr;
+    private String deptName;
+    @ApiModelProperty(hidden = true)
+    private String deptId;
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+}

+ 0 - 53
dblayer-mbg/src/main/java/com/lantone/dblayermbg/facade/report/DeptInfoFacade.java

@@ -1,15 +1,7 @@
 package com.lantone.dblayermbg.facade.report;
-import com.lantone.common.dto.report.BasDeptInfoDTO;
-import com.lantone.common.dto.report.DeptBaseDTO;
-import com.lantone.common.util.SysUserUtils;
-import com.lantone.common.vo.report.BasDeptInfoVO;
-import com.lantone.common.vo.report.FilterVO;
-import com.lantone.dblayermbg.entity.report.DeptInfo;
 import com.lantone.dblayermbg.service.impl.report.DeptInfoServiceImpl;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
-
 /**
  * <p>
  * 表名:bas_dept_info 业务类
@@ -17,49 +9,4 @@ import java.util.List;
  */
 @Component
 public class DeptInfoFacade extends DeptInfoServiceImpl {
-    /**
-     * 获取医院科室下拉列表信息
-     *
-     * @param basDeptInfoVO 搜索参数
-     * @return 医院科室下拉列表信息
-     */
-    public List<BasDeptInfoDTO> listForUser(BasDeptInfoVO basDeptInfoVO) {
-        basDeptInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalId()));
-        List<BasDeptInfoDTO> basDeptInfoDTOList = baseMapper.getList(basDeptInfoVO);
-        return basDeptInfoDTOList;
-    }
-
-
-    /**
-     * 获取医院用户下拉列表信息
-     *
-     * @param basDeptInfoVO 搜索参数
-     * @return 医院用户下拉列表信息
-     */
-    public List<BasDeptInfoDTO> getListUserFac(BasDeptInfoVO basDeptInfoVO) {
-        basDeptInfoVO.setUserId(Long.valueOf(SysUserUtils.getCurrentPrincipleId()));
-        basDeptInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalId()));
-        List<BasDeptInfoDTO> basDeptInfoDTOList = baseMapper.getListUser(basDeptInfoVO);
-        return basDeptInfoDTOList;
-    }
-
-    /**
-     * 查询用户关联科室
-     *
-     * @param filterVO
-     * @return
-     */
-    public List<DeptBaseDTO> getDeptByUser(FilterVO filterVO) {
-        return baseMapper.getDeptByUser(filterVO);
-    }
-
-
-    /**
-     * 根据科室编码,医院编码,批量修改
-     * @param list
-     */
-    public void updateBatchByKey(List<DeptInfo> list){
-        this.baseMapper.updateBatchByKey(list);
-    }
-
 }

+ 74 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/BehospitalInfoMapper.java

@@ -1,7 +1,17 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.ExportExcelDTO;
+import com.lantone.common.dto.report.QcResultShortDTO;
+import com.lantone.common.dto.report.ReBeHosMergeDTO;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.common.vo.report.QcResultShortPageVO;
+import com.lantone.common.vo.report.ReBeHosPageVO;
 import com.lantone.dblayermbg.entity.report.BehospitalInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -9,5 +19,69 @@ import com.lantone.dblayermbg.entity.report.BehospitalInfo;
  * </p>
  */
 public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
+    /**
+     * 出院总人数统计-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int leaveHosCount(FilterVO filterVO);
+
+    /**
+     * 新生儿出院人数统计-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int newBornCount(FilterVO filterVO);
+
+    /**
+     * 死亡人数统计-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int deathCount(FilterVO filterVO);
+
+    /**
+     * 手术人数统计-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationCount(FilterVO filterVO);
+
+    /**
+     * 非医嘱离院病人记录
+     *
+     * @param filterVO
+     * @return
+     */
+    public int nonAdviceCount(FilterVO filterVO);
+
+    /**
+     * 31天再入院详情页
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
+
+    /**
+     * 离院病人报表统计
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> leaveHosMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    /**
+     * 离院病人质控评分详情页导出到excel
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelDTO> leaveHosMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
 
 }

+ 1 - 21
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/DeptInfoMapper.java

@@ -1,33 +1,13 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.lantone.common.dto.report.BasDeptInfoDTO;
-import com.lantone.common.dto.report.DeptBaseDTO;
-import com.lantone.common.vo.report.BasDeptInfoVO;
-import com.lantone.common.vo.report.FilterVO;
 import com.lantone.dblayermbg.entity.report.DeptInfo;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
 
 /**
  * <p>
  * 表名:bas_dept_info Mapper接口
  * </p>
  */
-@Repository
-public interface DeptInfoMapper extends BaseMapper<DeptInfo> {
-    List<BasDeptInfoDTO> getList(BasDeptInfoVO basDeptInfoVO);
-
-    List<BasDeptInfoDTO> getListUser(BasDeptInfoVO basDeptInfoVO);
 
-    /**
-     * 查询用户关联科室
-     *
-     * @param filterVO
-     * @return
-     */
-    List<DeptBaseDTO> getDeptByUser(FilterVO filterVO);
-
-    void updateBatchByKey(List<DeptInfo> list);
+public interface DeptInfoMapper extends BaseMapper<DeptInfo> {
 }

+ 55 - 0
dblayer-mbg/src/main/java/com/lantone/dblayermbg/mapper/report/QcresultInfoMapper.java

@@ -1,7 +1,16 @@
 package com.lantone.dblayermbg.mapper.report;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.EntryNumDTO;
+import com.lantone.common.dto.report.NumDTO;
+import com.lantone.common.vo.report.FilterPageVO;
+import com.lantone.common.vo.report.FilterVO;
 import com.lantone.dblayermbg.entity.report.QcresultInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
 
 /**
  * <p>
@@ -9,5 +18,51 @@ import com.lantone.dblayermbg.entity.report.QcresultInfo;
  * </p>
  */
 public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
+    /**
+     * 按模块统计缺陷数
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> entryCountGroupByCase(FilterVO filterVO);
+
+    /**
+     * 各模块缺陷占比报表
+     *
+     * @param filterPageVO
+     * @return
+     */
+    public IPage<NumDTO> entryCountGroupByCasePage(@Param("filterPageVO") FilterPageVO filterPageVO);
+
+
+    /**
+     * 条目缺陷分组统计
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<NumDTO> entryCountGroupByEntry(FilterVO filterVO);
+
+    /**
+     * 条目缺陷占比基础数据(内页)
+     *
+     * @return
+     */
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO);
+
+    /**
+     * 条目缺陷总数(内页)
+     *
+     * @return
+     */
+    public Integer entryGroupByEntrySum(@Param("hospitalId") String hospitalId, @Param("isPlacefile") String isPlacefile, @Param("startDate") String startDate, @Param("endDate") String endDate);
+
+    /**
+     * 条目缺陷分值统计(内页)
+     *
+     * @return
+     */
+    public List<EntryNumDTO> entryGroupByEntryScore(@Param("hospitalId") String hospitalId, @Param("isPlacefile") String isPlacefile, @Param("ids") Set<Long> ids);
+
 
 }

File diff suppressed because it is too large
+ 1327 - 0
dblayer-mbg/src/main/resources/mapper/report/BehospitalInfoMapper.xml


+ 0 - 88
dblayer-mbg/src/main/resources/mapper/report/DeptInfoMapper.xml

@@ -1,92 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.report.DeptInfoMapper">
-    <select id="getList" resultType="com.lantone.common.dto.report.BasDeptInfoDTO">
-        SELECT DISTINCT
-        t.dept_id AS deptId,
-        dept_name AS deptName
-        FROM
-        `bas_dept_info` t
-        WHERE
-        t.is_deleted = 'N'
-        AND (t.station = '住院' or t.station = '质管')
-        AND t.hospital_id = #{hospitalId}
-        <if test="inputStr !=null and inputStr != ''">
-            AND (UPPER(t.spell) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%') OR UPPER(t.dept_name) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%'))
-        </if>
-        ORDER BY t.dept_name ASC
-    </select>
-
-    <select id="getListUser" resultType="com.lantone.common.dto.report.BasDeptInfoDTO">
-        SELECT DISTINCT
-        t.dept_id AS deptId,
-        dept_name AS deptName
-        FROM
-        `bas_dept_info` t
-        INNER JOIN sys_user_dept t1 ON t1.is_deleted = 'N'
-        AND t1.dept_id = t.dept_id
-        AND t1.hospital_id = t.hospital_id
-        WHERE
-        t.is_deleted = 'N'
-        AND t.station = '住院'
-        AND t.hospital_id = #{hospitalId}
-        AND t1.user_id = #{userId}
-        <if test="inputStr !=null and inputStr != ''">
-            AND (UPPER(t.spell) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%') OR UPPER(t.dept_name) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%'));
-        </if>
-        ORDER BY t.dept_name ASC
-    </select>
-
-    <!-- 查询用户关联科室 -->
-    <select id="getDeptByUser"  resultType="com.lantone.common.dto.report.DeptBaseDTO">
-        SELECT
-        b.dept_id as deptId,
-        b.dept_name as deptName
-        FROM
-        sys_user_dept a,
-        bas_dept_info b
-        WHERE
-        a.is_deleted = 'N'
-        AND b.is_deleted = 'N'
-        AND a.hospital_id = b.hospital_id
-        AND a.dept_id = b.dept_id
-        AND b.station = '住院'
-        <if test="userId!=null">
-            AND a.user_id = #{userId}
-        </if>
-        <if test="hospitalId != null and hospitalId != ''">
-            AND a.hospital_id = #{hospitalId}
-        </if>
-    </select>
-
-    <update id="updateBatchByKey">
-        <foreach collection="list" item="item"  separator=";">
-            update bas_dept_info
-            <set>
-                <if test="item.parentDeptId != null">
-                    parent_dept_id = #{item.parentDeptId},
-                </if>
-                <if test="item.deptName != null">
-                    dept_name = #{item.deptName},
-                </if>
-                <if test="item.deptType != null">
-                    dept_type = #{item.deptType},
-                </if>
-                <if test="item.spell != null">
-                    spell = #{item.spell},
-                </if>
-                <if test="item.station != null">
-                    station = #{item.station},
-                </if>
-                <if test="item.gmtModified != null">
-                    gmt_modified = #{item.gmtModified},
-                </if>
-                <if test="item.modifier != null">
-                    modifier = #{item.modifier},
-                </if>
-            </set>
-            where dept_id = #{item.deptId} and hospital_id = #{item.hospitalId}
-        </foreach>
-    </update>
-
 </mapper>

+ 501 - 0
dblayer-mbg/src/main/resources/mapper/report/QcresultInfoMapper.xml

@@ -2,4 +2,505 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.lantone.dblayermbg.mapper.report.QcresultInfoMapper">
 
+    <!-- 按模块统计质控缺陷数 -->
+    <select id="entryCountGroupByCase" parameterType="com.lantone.common.vo.report.FilterVO"
+            resultType="com.lantone.common.dto.report.NumDTO">
+        SELECT
+        t1.id AS id,
+        t1.NAME AS NAME,
+        t1.num AS num,
+        t2.mrNum AS mrNum,
+        t3.standardNum AS standardNum,
+        t2.mrNum * t3.standardNum AS totleNum,
+        ROUND( t1.num /( t2.mrNum * t3.standardNum ), 4 ) AS percent,
+        CONCAT( ROUND( t1.num /( t2.mrNum * t3.standardNum )* 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
+        SELECT
+        e.id,
+        f.NAME AS NAME,
+        e.num
+        FROM
+        (
+        SELECT
+        d.cases_id AS id,
+        count(*) AS num
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c,
+        med_qcresult_detail d
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.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
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        GROUP BY
+        d.cases_id
+        ) e,
+        qc_cases f
+        WHERE
+        f.is_deleted = 'N'
+        AND e.id = f.id
+        ) t1,
+        (
+        SELECT
+        COUNT(*) AS mrNum
+        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="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        ) t2,
+        (
+        SELECT
+        a.id,
+        a.NAME,
+        count(*) AS standardNum
+        FROM
+        qc_cases a,
+        qc_cases_entry b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.id = b.cases_id
+        GROUP BY
+        a.id,
+        a.`name`
+        ) t3
+        WHERE
+        t1.id = t3.id
+        AND t1.NAME = t3.NAME
+        ORDER BY
+        percent DESC
+        <if test="limitCount != null">
+            LIMIT 0,
+            #{limitCount}
+        </if>
+    </select>
+
+    <!-- 条目缺陷占比(首页) -->
+    <select id="entryCountGroupByEntry" parameterType="com.lantone.common.vo.report.FilterVO"
+            resultType="com.lantone.common.dto.report.NumDTO">
+        SELECT
+        t1.NAME AS NAME,
+        t1.num AS num,
+        t2.mrNum AS totleNum,
+        Round( t1.num / t2.mrNum, 4 ) AS percent,
+        CONCAT( Round( t1.num / t2.mrNum * 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
+        SELECT
+        tt2.id,
+        tt2.NAME,
+        tt1.num
+        FROM
+        (
+        SELECT
+        d.cases_entry_id,
+        count(*) AS num
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c,
+        med_qcresult_detail d
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.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
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        GROUP BY
+        d.cases_entry_id
+        ) tt1,
+        qc_cases_entry tt2
+        WHERE
+        tt2.is_deleted = 'N'
+        AND tt1.cases_entry_id = tt2.id
+        ) t1,
+        (
+        SELECT
+        count(*) AS mrNum
+        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="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        ) t2
+        ORDER BY
+        percent DESC
+    </select>
+
+    <!-- 按模块统计质控缺陷数(分页) -->
+    <select id="entryCountGroupByCasePage" resultType="com.lantone.common.dto.report.NumDTO">
+        SELECT
+        t.id,
+        t.`NAME`,
+        t.num,
+        t.totleNum,
+        t.percent,
+        t.percentStr
+        FROM
+        (
+        SELECT
+        t1.casesId AS id,
+        t1.casesName AS NAME,
+        t1.num AS num,
+        t2.mrNum,
+        t3.originalNum,
+        t2.mrNum * t3.originalNum AS totleNum,
+        ROUND( t1.num /( t2.mrNum * t3.originalNum ), 4 ) AS percent,
+        CONCAT( ROUND( t1.num /( t2.mrNum * t3.originalNum )* 100, 2 ), '%' ) AS percentStr
+        FROM
+        (
+        SELECT
+        d.casesId,
+        e.NAME AS casesName,
+        d.num
+        FROM
+        (
+        SELECT
+        c.cases_id AS casesId,
+        count(*) AS num
+        FROM
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+            AND a.hospital_id = #{filterPageVO.hospitalId}
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
+            AND a.beh_dept_name like CONCAT('%', #{filterPageVO.deptName},'%')
+        </if>
+        GROUP BY
+        c.cases_id
+        ) d,
+        qc_cases e
+        WHERE
+        e.is_deleted = 'N'
+        AND d.casesId = e.id
+        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
+            AND e.name like CONCAT('%', #{filterPageVO.casesName},'%')
+        </if>
+        ) t1,
+        (
+        SELECT
+        COUNT(*) AS mrNum
+        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="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            and a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+            AND a.hospital_id = #{filterPageVO.hospitalId}
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
+            AND a.beh_dept_name like CONCAT('%', #{filterPageVO.deptName},'%')
+        </if>
+        ) t2,
+        (
+        SELECT
+        a.id AS casesId,
+        a.NAME AS casesName,
+        count(*) AS originalNum
+        FROM
+        qc_cases a,
+        qc_cases_entry b
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND a.id = b.cases_id
+        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
+            AND a.name like CONCAT('%', #{filterPageVO.casesName},'%')
+        </if>
+        GROUP BY
+        a.id,
+        a.`name`
+        ) t3
+        WHERE
+        t1.casesId = t3.casesId
+        AND t1.casesName = t3.casesName
+        ) t
+    </select>
+
+    <!-- 条目缺陷占比(内页) -->
+    <select id="entryGroupByEntryInnerPage" resultType="com.lantone.common.dto.report.EntryNumDTO">
+        SELECT
+        tt2.id as id,
+        tt2.name as name,
+        tt2.cases_id as casesId,
+        tt2.cases_name as casesName,
+        tt1.num as num,
+        tt1.is_reject as isReject
+        FROM
+        (
+        SELECT
+        a.hospital_id,
+        d.cases_entry_id,
+        d.cases_id,
+        count(*) as num,
+        d.is_reject
+        FROM
+        med_behospital_info a,
+        med_qcresult_detail d
+        WHERE
+        a.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = d.hospital_id
+        AND a.behospital_code = d.behospital_code
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile != ''">
+            AND a.is_placefile = #{filterPageVO.isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="filterPageVO.hospitalId != null and filterPageVO.hospitalId != ''">
+            AND a.hospital_id = #{filterPageVO.hospitalId}
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 0">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.isPlacefile != null and filterPageVO.isPlacefile == 1">
+            <if test="filterPageVO.startDate != null and filterPageVO.startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{filterPageVO.startDate}]]>
+            </if>
+            <if test="filterPageVO.endDate != null and filterPageVO.endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
+            </if>
+        </if>
+        <if test="filterPageVO.isReject != null">
+            AND d.is_reject = #{filterPageVO.isReject}
+        </if>
+        GROUP BY
+        d.cases_entry_id,
+        d.is_reject,
+        d.cases_id
+        ) tt1,
+        qc_cases_entry tt2
+        WHERE
+        tt2.is_deleted = 'N'
+        AND tt1.cases_id = tt2.cases_id
+        AND tt1.cases_entry_id = tt2.id
+        <if test="filterPageVO.name != null and filterPageVO.name != ''">
+            AND tt2.name like CONCAT('%', #{filterPageVO.name},'%')
+        </if>
+        <if test="filterPageVO.casesName != null and filterPageVO.casesName != ''">
+            AND tt2.cases_name like CONCAT('%', #{filterPageVO.casesName},'%')
+        </if>
+    </select>
+
+    <!-- 条目缺陷占比缺陷总量(内页) -->
+    <select id="entryGroupByEntrySum" resultType="java.lang.Integer">
+        SELECT
+        count(*) AS mrNum
+        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="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+    </select>
+
+    <!-- 条目缺陷占比分值统计 -->
+    <select id="entryGroupByEntryScore" resultType="com.lantone.common.dto.report.EntryNumDTO">
+        SELECT
+        a.hospital_id as hospitalId,
+
+        <if test="isPlacefile != null and isPlacefile == 0">
+            a.score_run as score,
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            a.score,
+        </if>
+        a.cases_entry_id as id
+        FROM
+        qc_cases_entry_hospital a
+        WHERE
+        a.is_deleted = 'N'
+        AND a.hospital_id = #{hospitalId}
+        AND a.cases_entry_id IN
+        <foreach collection="ids" open="(" separator="," close=")" item="item">
+            ${item}
+        </foreach>
+    </select>
 </mapper>

+ 7 - 0
pom.xml

@@ -58,6 +58,7 @@
         <jackson-databind.version>2.12.3</jackson-databind.version>
         <validation-api.version>2.0.1.Final</validation-api.version>
         <common.version>0.0.1-SNAPSHOT</common.version>
+        <aggregator.version>1.1.0</aggregator.version>
         <dblayer-mbg.version>0.0.1-SNAPSHOT</dblayer-mbg.version>
         <txlcn-tc.version>5.0.2.RELEASE</txlcn-tc.version>
         <txlcn-txmsg-netty.version>5.0.2.RELEASE</txlcn-txmsg-netty.version>
@@ -162,6 +163,12 @@
                 <version>${txlcn-txmsg-netty.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>io.github.lvyahui8</groupId>
+                <artifactId>spring-boot-data-aggregator-starter</artifactId>
+                <version>${aggregator.version}</version>
+            </dependency>
+
             <!--guava Java工具包-->
             <dependency>
                 <groupId>com.google.guava</groupId>

+ 4 - 0
report-service/pom.xml

@@ -23,6 +23,10 @@
             <groupId>eu.bitwalker</groupId>
             <artifactId>UserAgentUtils</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.github.lvyahui8</groupId>
+            <artifactId>spring-boot-data-aggregator-starter</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>

+ 298 - 0
report-service/src/main/java/com/lantone/report/aggregate/LeaveHosStatisticsAggregate.java

@@ -0,0 +1,298 @@
+package com.lantone.report.aggregate;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.lantone.common.dto.report.ReBeHosDTO;
+import com.lantone.common.dto.report.ReBeHosDetailDTO;
+import com.lantone.common.dto.report.ReBeHosMergeDTO;
+import com.lantone.common.util.ListUtil;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.common.vo.report.ReBeHosPageVO;
+import com.lantone.dblayermbg.facade.report.BehospitalInfoFacade;
+import com.lantone.report.facade.FilterFacade;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/15 16:03
+ */
+@Component
+public class LeaveHosStatisticsAggregate {
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    private FilterFacade filterFacade;
+
+    @DataProvider("setAllLeaveHos")
+    public Map<String, Object> setAllLeaveHos(
+            @InvokeParameter("filterVO") FilterVO filterVO,
+            @DataConsumer("getTotleCount") Integer totleNum,
+            @DataConsumer("getDeathCount") Integer deathNum,
+            @DataConsumer("getNewBornCount") Integer newBornNum,
+            @DataConsumer("getOperationCount") Integer operationNum,
+            @DataConsumer("getNonAdviceCount") Integer nonAdviceNum,
+            @DataConsumer("get31DaysBehospitalCount") Integer reBehospitalNum) {
+
+        Map<String, Object> retMap = new LinkedHashMap<>();
+        retMap.put("总人数", totleNum);
+        retMap.put("死亡人数", deathNum);
+        retMap.put("新生儿人数", newBornNum);
+        retMap.put("手术病人数", operationNum);
+        retMap.put("非医嘱离院病人数", nonAdviceNum);
+        retMap.put("31日再入院病历数", reBehospitalNum);
+        return retMap;
+
+    }
+    /**
+     * 总人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getTotleCount")
+    public Integer getTotleCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.getBaseMapper().leaveHosCount(filterVO);
+    }
+
+    /**
+     * 死亡人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getDeathCount")
+    public Integer getDeathCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.getBaseMapper().deathCount(filterVO);
+    }
+
+    /**
+     * 新生儿患者人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getNewBornCount")
+    public Integer getNewBornCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.getBaseMapper().newBornCount(filterVO);
+    }
+
+    /**
+     * 手术人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getOperationCount")
+    public Integer getOperationCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.getBaseMapper().operationCount(filterVO);
+    }
+
+    /**
+     * 非医嘱离院
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getNonAdviceCount")
+    public Integer getNonAdviceCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.getBaseMapper().nonAdviceCount(filterVO);
+    }
+
+    /**
+     * 31天重复入院
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("get31DaysBehospitalCount")
+    public Integer get31DaysBehospitalCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        ReBeHosPageVO reBeHosPageVO = new ReBeHosPageVO();
+        BeanUtil.copyProperties(filterVO,reBeHosPageVO);
+        reBeHosPageVO.setStartDate(timeTrans(filterVO.getStartDate()));
+        reBeHosPageVO.setEndDate(timeTrans(filterVO.getEndDate()));
+        reBeHosPageVO.setFlag(31);
+        IPage<ReBeHosDTO> reBeHosDTOIPage = reHos31DaysPage(reBeHosPageVO);
+        List<ReBeHosDTO> records = reBeHosDTOIPage.getRecords();
+        Set<String> codeList = new HashSet<>();
+        records.forEach(obj->{
+            obj.getDetails().forEach(opj->{
+                codeList.add(opj.getBehospitalCode());
+            });
+        });
+        return codeList.size();
+    }
+
+    /**
+     * 31天再入院详情页
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosDTO> reHos31DaysPage(ReBeHosPageVO reBeHosPageVO) {
+        filterFacade.reBeHosPageVOSet(reBeHosPageVO);
+        long size = reBeHosPageVO.getSize();
+        long current = reBeHosPageVO.getCurrent();
+        reBeHosPageVO.setCurrent(1L);
+        reBeHosPageVO.setSize(Long.MAX_VALUE);
+        IPage<ReBeHosMergeDTO> page = behospitalInfoFacade.getBaseMapper().reHos31DaysPage(reBeHosPageVO);
+        List<ReBeHosMergeDTO> records = page.getRecords();
+        IPage<ReBeHosDTO> retPage = new Page<>();
+        if (ListUtil.isNotEmpty(records)) {
+            BeanUtil.copyProperties(page, retPage);
+            List<ReBeHosDTO> retRecords = Lists.newLinkedList();
+            Iterator<ReBeHosMergeDTO> iterator = records.iterator();
+            while(iterator.hasNext()){
+                ReBeHosMergeDTO record = iterator.next();
+                strTrans(record);
+                Boolean flag = isContainDiagnose(record);
+                if(!flag){
+                    iterator.remove();
+                    continue;
+                }
+                ReBeHosDTO retRecord = new ReBeHosDTO();
+                BeanUtil.copyProperties(record, retRecord);
+                List<ReBeHosDetailDTO> details = Lists.newLinkedList();
+                ReBeHosDetailDTO detailRecord = new ReBeHosDetailDTO();
+                BeanUtil.copyProperties(record, detailRecord);
+                details.add(detailRecord);
+                ReBeHosDetailDTO lastDetailRecord = new ReBeHosDetailDTO();
+                lastDetailRecord.setName(record.getName());
+                lastDetailRecord.setAge(record.getLastAge());
+                lastDetailRecord.setDiagnose(record.getLastDiagnose());
+                lastDetailRecord.setDiagnoseName(record.getLastDiagnoseName());
+                lastDetailRecord.setBehDeptId(record.getLastBehDeptId());
+                lastDetailRecord.setBehDeptName(record.getLastBehDeptName());
+                lastDetailRecord.setBehospitalCode(record.getLastBehospitalCode());
+                lastDetailRecord.setBehospitalDate(record.getLastBehospitalDate());
+                lastDetailRecord.setLeaveHospitalDate(record.getLastLeaveHospitalDate());
+                lastDetailRecord.setLevel(record.getLastLevel());
+                lastDetailRecord.setScoreRes(record.getLastScoreRes());
+                lastDetailRecord.setBehospitalDayNum(record.getLastBehospitalDayNum());
+                lastDetailRecord.setTotleFee(record.getLastTotleFee());
+                details.add(lastDetailRecord);
+                retRecord.setDetails(details);
+                retRecords.add(retRecord);
+            }
+            //首页返回全部数据
+            if(reBeHosPageVO.getFlag()==31){
+                retPage.setRecords(retRecords);
+                return retPage;
+            }
+            //导出操作
+            if(reBeHosPageVO.getFlag()==1){
+                size = retRecords.size();
+            }
+            retPage.setSize(size);
+            retPage.setTotal(retRecords.size());
+            retPage.setCurrent(current);
+            //数据返回索引处理
+            if(0 == current){
+                current = 1;
+            }
+            int startIndex = ((int)current -1)*10;
+            int endIndex = startIndex + (int) size;
+
+            if(retRecords.size()>1){
+                if( retRecords.size()-startIndex<(int)size){
+                    retRecords = retRecords.subList(startIndex,retRecords.size());
+                }else{
+                    retRecords = retRecords.subList(startIndex,endIndex );
+                }
+            }
+            retPage.setRecords(retRecords);
+        }
+        return retPage;
+    }
+
+    static Boolean isContainDiagnose(ReBeHosMergeDTO record){
+        // String lastDiagnoseName = replace(record.getLastDiagnoseName());本身使用,分隔
+        String diagnose =replace(record.getDiagnose());//手动分隔
+        String lastDiagnose = replace(record.getLastDiagnose());
+        record.setDiagnose(diagnose);
+        record.setLastDiagnose(lastDiagnose);
+        Set lastDiagnoseNames = strTranListMethod(record.getLastDiagnoseName());
+        Set diagnoses = strTranListMethod(record.getDiagnose());
+        long count = diagnoses.stream().filter(obj ->null != lastDiagnoseNames && null != obj && lastDiagnoseNames.contains(obj)).count();
+        if(count<=0){
+            return false;
+        }
+        return true;
+    };
+
+
+    static Set strTranListMethod(String str){
+        Set<String> names = new HashSet<>();
+        if(StringUtils.isNotEmpty(str)){
+            if(str.contains(",") && str.length()>1){
+                for (String diagnoseName : str.split(",")) {
+                    names.add(diagnoseName);
+                }
+            }else{
+                names.add(str);
+            }
+        }
+        return names;
+    };
+
+    static String replace(String str){
+        if(StringUtils.isEmpty(str)){
+            return null;
+        }
+        str = str.trim().replace(";", ",").replace(";", ",")
+                .replace("、", ",").replace(",", ",")
+                .replace("|", ",").replace(" ", ",")
+                .replace(":", ",") .replace(":", ",");
+        if(str.startsWith(",")){
+            str = str.substring(1);
+        }
+        if(str.endsWith(",")){
+            str = str.substring(0,str.length()-1);
+        }
+
+        return str;
+    }
+
+    public static Date timeTrans(String time){
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        try {
+            Date date = format.parse(time);
+            return date;
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return new Date();
+    }
+
+
+    public static void strTrans(ReBeHosMergeDTO record) {
+        String replace = record.getLastAgainBehospitalPlan();
+        if(StringUtils.isEmpty(replace)){
+            replace = "否";
+            record.setLastAgainBehospitalPlan(replace);
+            return;
+        }
+        replace = replace.replace("无", "否")
+                .replace("-", "无").replace("是一周后", "是")
+                .replace("1", "否").replace("2", "是")
+                .replace("有", "是");
+        record.setLastAgainBehospitalPlan(replace);
+    }
+}

+ 0 - 47
report-service/src/main/java/com/lantone/report/facade/DeptInfoManagementFacade.java

@@ -1,47 +0,0 @@
-package com.lantone.report.facade;
-
-import com.lantone.common.dto.report.BasDeptInfoDTO;
-import com.lantone.common.util.SysUserUtils;
-import com.lantone.common.vo.report.BasDeptInfoVO;
-import com.lantone.dblayermbg.facade.report.DeptInfoFacade;
-import com.lantone.dblayermbg.service.impl.report.DeptInfoServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-
-
-/**
- * <p>
- * 表名:bas_dept_info 业务类
- * </p>
- */
-@Component
-public class DeptInfoManagementFacade extends DeptInfoServiceImpl {
-    @Autowired
-    private DeptInfoFacade deptInfoFacade;
-    /**
-     * 获取医院科室下拉列表信息
-     *
-     * @param basDeptInfoVO 搜索参数
-     * @return 医院科室下拉列表信息
-     */
-    public List<BasDeptInfoDTO> listForUser(BasDeptInfoVO basDeptInfoVO) {
-        List<BasDeptInfoDTO> basDeptInfoDTOList = deptInfoFacade.listForUser(basDeptInfoVO);
-        return basDeptInfoDTOList;
-    }
-
-
-    /**
-     * 获取医院用户下拉列表信息
-     *
-     * @param basDeptInfoVO 搜索参数
-     * @return 医院用户下拉列表信息
-     */
-    public List<BasDeptInfoDTO> getListUserFac(BasDeptInfoVO basDeptInfoVO) {
-        basDeptInfoVO.setUserId(Long.valueOf(SysUserUtils.getCurrentPrincipleId()));
-        basDeptInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalId()));
-        List<BasDeptInfoDTO> basDeptInfoDTOList = deptInfoFacade.getListUserFac(basDeptInfoVO);
-        return basDeptInfoDTOList;
-    }
-}

+ 109 - 0
report-service/src/main/java/com/lantone/report/facade/EntryCaseManagementFacade.java

@@ -0,0 +1,109 @@
+package com.lantone.report.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.EntryNumDTO;
+import com.lantone.common.dto.report.NumDTO;
+import com.lantone.common.util.ExcelUtils;
+import com.lantone.common.util.ListUtil;
+import com.lantone.common.vo.report.FilterPageVO;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.dblayermbg.facade.report.QcresultInfoFacade;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+
+@Component
+public class EntryCaseManagementFacade {
+
+    @Autowired
+    private FilterFacade filterFacade;
+    @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+
+    /**
+     * 条目缺陷占比-控制台
+     *
+     * @param filterVO
+     * @return
+     */
+    public Map<String, Object> entryCountGroupByEntry(FilterVO filterVO) {
+        Map<String, Object> retMap = new HashMap<>();
+        filterFacade.filterVOSet(filterVO);
+        List<NumDTO> entryList = qcresultInfoFacade.getBaseMapper().entryCountGroupByEntry(filterVO);
+        if (ListUtil.isNotEmpty(entryList)) {
+            retMap.put("条目缺陷占比", entryList);
+        }
+        return retMap;
+    }
+
+    /**
+     * 条目缺陷占比-报表
+     *
+     * @return
+     */
+    public IPage<EntryNumDTO> entryGroupByEntryInnerPage(@Param("filterPageVO") FilterPageVO filterPageVO) {
+        //基础数据
+        IPage<EntryNumDTO> entryNumDTOIPage = qcresultInfoFacade.getBaseMapper().entryGroupByEntryInnerPage(filterPageVO);
+        List<EntryNumDTO> records = entryNumDTOIPage.getRecords();
+        if (CollectionUtils.isEmpty(records)) {
+            return entryNumDTOIPage;
+        }
+        String hospitalId = filterPageVO.getHospitalId();
+        //缺陷总数
+        Integer sumInteget = qcresultInfoFacade.getBaseMapper().entryGroupByEntrySum(filterPageVO.getHospitalId(), filterPageVO.getIsPlacefile(),
+                filterPageVO.getStartDate(), filterPageVO.getEndDate());
+        float nsum = 0;
+        Set<Long> ids = new HashSet<Long>();
+        for (EntryNumDTO record : records) {
+            ids.add(record.getId());
+            int num = record.getNum().intValue();
+            if (sumInteget != null && sumInteget != 0) {
+                int sum = sumInteget.intValue();
+                nsum = (float) num / sum;
+            }
+            DecimalFormat df = new DecimalFormat("0.00");
+            String percent = df.format(nsum * 100);
+            record.setPercentStr(percent + "%");
+            record.setTotleNum(sumInteget);
+        }
+        //缺陷分值
+        String isPlacefile = filterPageVO.getIsPlacefile();
+        List<EntryNumDTO> entryScore = new ArrayList<>();
+        entryScore = qcresultInfoFacade.getBaseMapper().entryGroupByEntryScore(hospitalId, isPlacefile, ids);
+        for (EntryNumDTO record : records) {
+            for (EntryNumDTO entryNumDTO : entryScore) {
+                if (record.getId().equals(entryNumDTO.getId())) {
+                    record.setScore(entryNumDTO.getScore());
+                }
+            }
+        }
+        return entryNumDTOIPage;
+    }
+
+    /**
+     * 条目缺陷占比-报表导出
+     *
+     * @param filterPageVO
+     * @return
+     */
+    public void entryGroupByEntryExport(HttpServletResponse response, FilterPageVO filterPageVO) {
+        filterPageVO.setCurrent(1L);
+        filterPageVO.setSize(Long.MAX_VALUE);
+        filterPageVO.setSearchCount(false);
+        filterFacade.filterPageVOSet(filterPageVO);
+        IPage<EntryNumDTO> page = this.entryGroupByEntryInnerPage(filterPageVO);
+        String fileName = "条目缺陷占比.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", EntryNumDTO.class, fileName, response, 12.8f);
+    }
+}

+ 551 - 0
report-service/src/main/java/com/lantone/report/facade/FilterFacade.java

@@ -0,0 +1,551 @@
+package com.lantone.report.facade;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.lantone.common.util.DateUtil;
+import com.lantone.common.util.StringUtil;
+import com.lantone.common.util.SysUserUtils;
+import com.lantone.common.vo.report.EntryStatisticsVO;
+import com.lantone.common.vo.report.FilterMedicalCheckVO;
+import com.lantone.common.vo.report.FilterOrderByDeptVO;
+import com.lantone.common.vo.report.FilterOrderVO;
+import com.lantone.common.vo.report.FilterPageByAverageVO;
+import com.lantone.common.vo.report.FilterPageByDeptVO;
+import com.lantone.common.vo.report.FilterPageVO;
+import com.lantone.common.vo.report.FilterUnModifyMRVO;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.common.vo.report.QcResultPageVO;
+import com.lantone.common.vo.report.QcResultShortPageVO;
+import com.lantone.common.vo.report.ReBeHosPageVO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/5/7 13:53
+ */
+@Component
+public class FilterFacade {
+    /**
+     * 筛选起始时间
+     *
+     * @param type
+     * @return
+     */
+    public String getStartDateStr(Integer type, Integer optYear) {
+        Date date = new Date();
+        String startDate = "";
+        String year = optYear == null ? DateUtil.getYear(date) : optYear.toString();
+        int month = DateUtil.getMonth(date);
+        if (type.equals(1)) {
+            //本月统计
+            startDate = year + "-" + month + "-1";
+        } else if (type.equals(2)) {
+            //本年统计
+            startDate = year + "-1-1";
+        }
+        return startDate;
+    }
+
+    /**
+     * 筛选截止时间
+     *
+     * @param type
+     * @return
+     */
+    public String getEndDateStr(Integer type, Integer optYear) {
+        Date date = new Date();
+        String endDate = "";
+        String year = optYear == null ? DateUtil.getYear(date) : optYear.toString();
+        int month = DateUtil.getMonth(date);
+        if (type.equals(1)) {
+            //本月统计
+            if (month == 12) {
+                endDate = (Integer.valueOf(year) + 1) + "-1-1";
+            } else {
+                endDate = year + "-" + (month + 1) + "-1";
+            }
+        } else if (type.equals(2)) {
+            //本年统计
+            endDate = (Integer.valueOf(year) + 1) + "-1-1";
+        }
+        return endDate;
+    }
+
+    /**
+     * 上一统计周期(上月/去年)的起始时间
+     *
+     * @param type
+     * @return
+     */
+    public String getLastStartDateStr(Integer type) {
+        Date date = new Date();
+        String dateStr = "";
+        String year = DateUtil.getYear(date);
+        int month = DateUtil.getMonth(date);
+        if (type.equals(1)) {
+            if (month == 1) {
+                dateStr = (Integer.valueOf(year) - 1) + "-12-1";
+            } else {
+                dateStr = year + "-" + (month - 1) + "-1";
+            }
+        } else if (type.equals(2)) {
+            dateStr = (Integer.valueOf(year) - 1) + "-1-1";
+        }
+        return dateStr;
+    }
+
+    /**
+     * 获取上一年同期开始结束时间
+     *
+     * @param date
+     * @return
+     */
+    public String getStaEndDate(String date) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date dateStart = new Date();
+        try {
+            dateStart = formatter.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Calendar c = Calendar.getInstance();
+        c.setTime(dateStart);
+        c.add(Calendar.YEAR, -1);
+        Date y = c.getTime();
+        String newDate = formatter.format(y);
+        return newDate;
+    }
+
+    /**
+     * 获取上一年同期开始结束时间
+     *
+     * @param date
+     * @return
+     */
+    public String getLastStartEndDate(String date) {
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+        Date dateStart = new Date();
+        try {
+            dateStart = formatter.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Calendar c = Calendar.getInstance();
+        c.setTime(dateStart);
+        c.add(Calendar.YEAR, -1);
+        Date y = c.getTime();
+        String newDate = formatter.format(y);
+        return newDate;
+    }
+
+    /**
+     * 获取上一统计周期(上月/去年)的起始时间
+     *
+     * @param type
+     * @return
+     */
+    public String getLastEndDateStr(Integer type) {
+        //上一统计周期的截止时间等于本周期的起始时间
+        return getStartDateStr(type, null);
+    }
+
+    /**
+     * 入参拼接-同比
+     *
+     * @param filterVO
+     */
+    public void filterVOSetSame(FilterVO filterVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        filterVO.setHospitalId(hospitalId);
+        filterVO.setUserId(Long.valueOf(userId));
+        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
+            filterVO.setLimitCount(10);
+        }
+        if (StringUtil.isBlank(filterVO.getStartDate())) {
+            String startDate = getStartDateStr(filterVO.getType(), null);
+            filterVO.setStartDate(startDate);
+            String lastStartDate = getLastStartEndDate(startDate);
+            filterVO.setLastStartDate(lastStartDate);
+        } else {
+            String lastStartDate = getLastStartEndDate(filterVO.getStartDate());
+            filterVO.setLastStartDate(lastStartDate);
+        }
+        if (StringUtil.isBlank(filterVO.getEndDate())) {
+            String endDate = getEndDateStr(filterVO.getType(), null);
+            filterVO.setEndDate(endDate);
+            String lastEndDate = getLastStartEndDate(endDate);
+            filterVO.setLastEndDate(lastEndDate);
+        } else {
+            String lastEndDate = getLastStartEndDate(filterVO.getEndDate());
+            filterVO.setLastEndDate(lastEndDate);
+        }
+    }
+
+    /**
+     * 入参拼接
+     *
+     * @param filterVO
+     */
+    public void filterVOSet(FilterVO filterVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        filterVO.setHospitalId(hospitalId);
+        filterVO.setUserId(Long.valueOf(userId));
+        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
+            filterVO.setLimitCount(10);
+        }
+        if (StringUtil.isBlank(filterVO.getStartDate())) {
+            String startDate = getStartDateStr(filterVO.getType(), null);
+            filterVO.setStartDate(startDate);
+        }
+        if (StringUtil.isBlank(filterVO.getEndDate())) {
+            String endDate = getEndDateStr(filterVO.getType(), null);
+            filterVO.setEndDate(endDate);
+        } /*else {
+            try {
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Date date = dateFormat.parse(filterVO.getEndDate());
+                long interval = date.getTime() + 1000;
+                filterVO.setEndDate(dateFormat.format(new Date(Long.valueOf(interval))));
+            } catch (ParseException e) {
+
+            }
+        }*/
+    }
+
+    /**
+     * 入参拼接
+     *
+     * @param filterVO
+     */
+    public void filterSet(FilterVO filterVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        filterVO.setHospitalId(hospitalId);
+        filterVO.setUserId(Long.valueOf(userId));
+        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
+            filterVO.setLimitCount(10);
+        }
+        try {
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+            SimpleDateFormat dateFormatSec = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date dateStart = dateFormat.parse(filterVO.getStartDate());
+            Date dateEnd = dateFormat.parse(filterVO.getEndDate());
+            filterVO.setStartDate(dateFormatSec.format(dateStart));
+            filterVO.setEndDate(dateFormatSec.format(dateEnd));
+        } catch (ParseException e) {
+
+        }
+
+    }
+
+
+    /**
+     * 入参拼接
+     *
+     * @param filterVO
+     */
+    List<String> getTimeList(FilterVO filterVO) {
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 返回的日期集合
+        List<String> days = new ArrayList<String>();
+        Date start = new Date();
+        Date end = new Date();
+        try {
+            if (StringUtils.isEmpty(filterVO.getHospitalId())) {
+                String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+                String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+                filterVO.setHospitalId(hospitalId);
+                filterVO.setUserId(Long.valueOf(userId));
+                start = dateFormat.parse(filterVO.getStartDate() + " 00:00:00");
+                end = dateFormat.parse(filterVO.getEndDate() + " 00:00:00");
+            } else {
+                //执行上一天的操作
+                Date dNow = new Date(); //当前时间
+                Date dBefore = new Date();
+                Calendar calendar = Calendar.getInstance(); //得到日历
+                calendar.setTime(dNow);//把当前时间赋给日历
+                calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
+                dBefore = calendar.getTime(); //得到前一天的时间
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //设置时间格式
+                String defaultStartDate = sdf.format(dBefore); //格式化前一天
+                filterVO.setStartDate(defaultStartDate);
+                filterVO.setEndDate(defaultStartDate);
+                defaultStartDate = defaultStartDate + " 00:00:00";
+                String defaultEndDate = defaultStartDate;
+                start = dateFormat.parse(defaultStartDate);
+                end = dateFormat.parse(defaultEndDate);
+            }
+            Calendar tempStart = Calendar.getInstance();
+            tempStart.setTime(start);
+            Calendar tempEnd = Calendar.getInstance();
+            tempEnd.setTime(end);
+            tempEnd.add(Calendar.DATE, +1);
+            while (tempStart.before(tempEnd)) {
+                days.add(dateFormat.format(tempStart.getTime()));
+                tempStart.add(Calendar.DAY_OF_YEAR, 1);
+            }
+        } catch (ParseException e) {
+            throw new IllegalArgumentException("参数异常");
+        }
+        return days;
+    }
+
+    /**
+     * 分页入参拼接
+     *
+     * @param filterPageVO
+     */
+    public void filterPageVOSet(FilterPageVO filterPageVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        filterPageVO.setHospitalId(hospitalId);
+        // filterPageVO.setUserId(Long.valueOf(userId));
+        if (StringUtil.isBlank(filterPageVO.getStartDate())) {
+            String startDate = getStartDateStr(filterPageVO.getType(), null);
+            filterPageVO.setStartDate(startDate);
+        }
+        if (StringUtil.isBlank(filterPageVO.getEndDate())) {
+            String endDate = getEndDateStr(filterPageVO.getType(), null);
+            filterPageVO.setEndDate(endDate);
+        }/* else {
+            try {
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                Date date = dateFormat.parse(filterPageVO.getEndDate());
+                long interval = date.getTime() + 1000;
+                filterPageVO.setEndDate(dateFormat.format(new Date(Long.valueOf(interval))));
+            } catch (ParseException e) {
+
+            }
+        }*/
+    }
+
+
+    /**
+     * 过滤条件设置
+     *
+     * @param filterPageByDeptVO
+     */
+    public void filterPageByDeptVOSet(FilterPageByDeptVO filterPageByDeptVO) {
+        FilterPageVO filterPageVO = new FilterPageVO();
+        BeanUtil.copyProperties(filterPageByDeptVO, filterPageVO);
+        filterPageVOSet(filterPageVO);
+        filterPageByDeptVO.setHospitalId(filterPageVO.getHospitalId());
+        filterPageByDeptVO.setUserId(filterPageVO.getUserId());
+        filterPageByDeptVO.setStartDate(filterPageVO.getStartDate());
+        filterPageByDeptVO.setEndDate(filterPageVO.getEndDate());
+    }
+
+    /**
+     * 过滤条件设置
+     *
+     * @param filterOrderVO
+     */
+    public void filterOrderVOSet(FilterOrderVO filterOrderVO) {
+        FilterVO filterVO = new FilterVO();
+        BeanUtil.copyProperties(filterOrderVO, filterVO);
+        filterVOSet(filterVO);
+        filterOrderVO.setHospitalId(filterVO.getHospitalId());
+        filterOrderVO.setUserId(filterVO.getUserId());
+        filterOrderVO.setStartDate(filterVO.getStartDate());
+        filterOrderVO.setEndDate(filterVO.getEndDate());
+        filterOrderVO.setLimitCount(filterVO.getLimitCount());
+    }
+
+    /**
+     * 过滤条件设置
+     *
+     * @param filterVO
+     */
+    public void filterVOSame(FilterVO filterVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        filterVO.setHospitalId(hospitalId);
+        filterVO.setUserId(Long.valueOf(userId));
+        if (filterVO.getLimitCount() == null || filterVO.getLimitCount().equals(0)) {
+            filterVO.setLimitCount(10);
+        }
+        if (StringUtil.isBlank(filterVO.getStartDate())) {
+            String startDate = getStartDateStr(filterVO.getType(), null);
+            filterVO.setStartDate(startDate);
+            String lastStartDate = getStaEndDate(startDate);
+            filterVO.setLastStartDate(lastStartDate);
+        } else {
+            String lastStartDate = getStaEndDate(filterVO.getStartDate());
+            filterVO.setLastStartDate(lastStartDate);
+        }
+        if (StringUtil.isBlank(filterVO.getEndDate())) {
+            String endDate = getEndDateStr(filterVO.getType(), null);
+            filterVO.setEndDate(endDate);
+            String lastEndDate = getStaEndDate(endDate);
+            filterVO.setLastEndDate(lastEndDate);
+        } else {
+            String lastEndDate = getStaEndDate(filterVO.getEndDate());
+            filterVO.setLastEndDate(lastEndDate);
+        }
+    }
+
+    /**
+     * 过滤条件设置
+     *
+     * @param filterOrderVO
+     */
+    public void filterOrderVOSame(FilterOrderVO filterOrderVO) {
+        FilterVO filterVO = new FilterVO();
+        BeanUtil.copyProperties(filterOrderVO, filterVO);
+        filterVOSetSame(filterVO);
+        filterOrderVO.setHospitalId(filterVO.getHospitalId());
+        filterOrderVO.setUserId(filterVO.getUserId());
+        filterOrderVO.setStartDate(filterVO.getStartDate());
+        filterOrderVO.setEndDate(filterVO.getEndDate());
+        filterOrderVO.setLastStartDate(filterVO.getLastStartDate());
+        filterOrderVO.setLastEndDate(filterVO.getLastEndDate());
+        filterOrderVO.setLimitCount(filterVO.getLimitCount());
+    }
+
+    /**
+     * 过滤条件设置-同比
+     *
+     * @param filterOrderByDeptVO
+     */
+    public void filterOrderByDeptVOSet(FilterOrderByDeptVO filterOrderByDeptVO) {
+        FilterVO filterVO = new FilterVO();
+        BeanUtil.copyProperties(filterOrderByDeptVO, filterVO);
+        filterVOSet(filterVO);
+        filterOrderByDeptVO.setHospitalId(filterVO.getHospitalId());
+        filterOrderByDeptVO.setUserId(filterVO.getUserId());
+        filterOrderByDeptVO.setStartDate(filterVO.getStartDate());
+        filterOrderByDeptVO.setEndDate(filterVO.getEndDate());
+        filterOrderByDeptVO.setLimitCount(filterVO.getLimitCount());
+    }
+
+    /**
+     * 平均住院天数、平均花费入参设置
+     *
+     * @param filterPageByAverageVO
+     */
+    public void filterPageByAverageVOSet(FilterPageByAverageVO filterPageByAverageVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        Date date = new Date();
+        String year = DateUtil.getYear(date);
+        String startDate = getStartDateStr(filterPageByAverageVO.getType(), null);
+        String endDate = getEndDateStr(filterPageByAverageVO.getType(), null);
+        String lastStartDate = getLastStartDateStr(filterPageByAverageVO.getType());
+        String lastEndDate = getLastEndDateStr(filterPageByAverageVO.getType());
+        String lastYearStartDate = getStartDateStr(filterPageByAverageVO.getType(), Integer.valueOf(year) - 1);
+        String lastYearEndDate = getEndDateStr(filterPageByAverageVO.getType(), Integer.valueOf(year) - 1);
+        filterPageByAverageVO.setHospitalId(hospitalId);
+        filterPageByAverageVO.setUserId(Long.valueOf(userId));
+        filterPageByAverageVO.setStartDate(startDate);
+        filterPageByAverageVO.setEndDate(endDate);
+        filterPageByAverageVO.setLastStartDate(lastStartDate);
+        filterPageByAverageVO.setLastEndDate(lastEndDate);
+        filterPageByAverageVO.setLastYearStartDate(lastYearStartDate);
+        filterPageByAverageVO.setLastYearEndDate(lastYearEndDate);
+    }
+
+    /**
+     * 入参拼接
+     *
+     * @param qcResultShortPageVO
+     */
+    public void qcResultShortPageVOSet(QcResultShortPageVO qcResultShortPageVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        qcResultShortPageVO.setHospitalId(hospitalId);
+        qcResultShortPageVO.setUserId(Long.valueOf(userId));
+    }
+
+    /**
+     * 不合格数病历号入参拼接
+     *
+     * @param qcResultPageVO
+     */
+    public void badLevelPageVOSet(QcResultPageVO qcResultPageVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        qcResultPageVO.setHospitalId(hospitalId);
+        qcResultPageVO.setUserId(Long.valueOf(userId));
+        if (qcResultPageVO.getDeptName().equals("全院") || StringUtils.isEmpty(qcResultPageVO.getDeptName())) {
+            qcResultPageVO.setDeptName("");
+        }
+        /*long interval = qcResultShortPageVO.getEndDate().getTime() + 1000;
+        qcResultShortPageVO.setEndDate(new Date(Long.valueOf(interval)));*/
+    }
+
+    /**
+     * 合格/不合格数病历号入参拼接-科室
+     *
+     * @param qcResultPageVO
+     */
+    public void OrGoodLevelPageVOSet(QcResultPageVO qcResultPageVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        qcResultPageVO.setHospitalId(hospitalId);
+        qcResultPageVO.setUserId(Long.valueOf(userId));
+    }
+
+
+    /**
+     * 关键条目缺陷占比入参拼接
+     *
+     * @param entryStatisticsVO
+     */
+    public void entryStatisticsVOSet(EntryStatisticsVO entryStatisticsVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        entryStatisticsVO.setHospitalId(hospitalId);
+        entryStatisticsVO.setUserId(Long.valueOf(userId));
+        /*long interval = entryStatisticsVO.getEndDate().getTime() + 1000;
+        entryStatisticsVO.setEndDate(new Date(Long.valueOf(interval)));*/
+    }
+
+    /**
+     * 未整改病历统计入参拼接
+     *
+     * @param filterUnModifyMRVO
+     */
+    public void filterUnModifyMRVOSet(FilterUnModifyMRVO filterUnModifyMRVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        filterUnModifyMRVO.setHospitalId(hospitalId);
+        filterUnModifyMRVO.setUserId(Long.valueOf(userId));
+    }
+
+    /**
+     * 31天再入院参数拼接
+     *
+     * @param reBeHosPageVO
+     */
+    public void reBeHosPageVOSet(ReBeHosPageVO reBeHosPageVO) {
+        if (null == reBeHosPageVO.getUserId() && StringUtils.isEmpty(reBeHosPageVO.getHospitalId())) {
+            String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+            String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+            reBeHosPageVO.setHospitalId(hospitalId);
+            reBeHosPageVO.setUserId(Long.valueOf(userId));
+        }
+    }
+
+    /**
+     * 病历稽查统计入参拼接
+     *
+     * @param filterVO
+     */
+    public void getMedicalCheckVOSet(FilterMedicalCheckVO filterVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        String userId = String.valueOf(SysUserUtils.getCurrentPrincipleId());
+        filterVO.setHospitalId(hospitalId);
+        filterVO.setUserId(Long.valueOf(userId));
+    }
+}

+ 156 - 0
report-service/src/main/java/com/lantone/report/facade/LeaveHospitalManagementFacade.java

@@ -0,0 +1,156 @@
+package com.lantone.report.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.api.ResultCode;
+import com.lantone.common.dto.report.ExportExcelBehospitalDTO;
+import com.lantone.common.dto.report.ExportExcelDTO;
+import com.lantone.common.dto.report.ExportExcelWideBehospitalDTO;
+import com.lantone.common.dto.report.ExportWideExcelDTO;
+import com.lantone.common.dto.report.QcResultShortDTO;
+import com.lantone.common.exception.ApiException;
+import com.lantone.common.util.ExcelUtils;
+import com.lantone.common.util.ListUtil;
+import com.lantone.common.util.StringUtil;
+import com.lantone.common.util.SysUserUtils;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.common.vo.report.QcResultShortPageVO;
+import com.lantone.dblayermbg.facade.report.BehospitalInfoFacade;
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Component
+public class LeaveHospitalManagementFacade {
+
+    @Autowired
+    private FilterFacade filterFacade;
+    @Autowired
+    private DataBeanAggregateQueryFacade dataBeanAggregateQueryFacade;
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    /**
+     * 出院人数统计控制台
+     *
+     * @param filterVO
+     * @return
+     */
+    public Map<String, Object> leaveHosCount(FilterVO filterVO) {
+        Map<String, Object> retMap = new HashMap<>();
+        filterFacade.filterVOSet(filterVO);
+        Map<String, Object> leaveHosMap = new HashMap<>();
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("filterVO", filterVO);
+            leaveHosMap
+                    = dataBeanAggregateQueryFacade.get("setAllLeaveHos", invokeParams, Map.class);
+        } catch (Exception e) {
+            throw new ApiException(ResultCode.SERVER_IS_ERROR);
+        }
+        if (leaveHosMap != null) {
+            retMap.put("出院人数统计", leaveHosMap);
+        }
+        return retMap;
+    }
+
+    /**
+     * 出院人数报表统计
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> leaveHosMRPage(QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        IPage<QcResultShortDTO> page = behospitalInfoFacade.getBaseMapper().leaveHosMRPage(qcResultShortPageVO);
+        return page;
+    }
+
+    /**
+     * 出院人数报表统计导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void leaveHosMrPageExportMethod(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        String hospitalId = String.valueOf(SysUserUtils.getCurrentHospitalId());
+        qcResultShortPageVO.setHospitalId(hospitalId);
+        if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
+                && qcResultShortPageVO.getDeptName().equals("全部")) {
+            qcResultShortPageVO.setDeptName("");
+        }
+        Date startDate = qcResultShortPageVO.getStartDate();
+        Date endDate = qcResultShortPageVO.getEndDate();
+        //时间间隔7天
+        long interval_7 = 7 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
+
+        if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
+            //时间间隔7天
+            if (endDate.getTime() < startDate.getTime()) {
+                throw new ApiException("截止时间不能小于起始时间");
+            }
+            if (endDate.getTime() - startDate.getTime() > interval_7) {
+                throw new ApiException("统计区间不能大于7天");
+            }
+        } else {
+            //时间间隔90天
+            if (endDate.getTime() < startDate.getTime()) {
+                throw new ApiException("截止时间不能小于起始时间");
+            }
+            if (endDate.getTime() - startDate.getTime() > interval_90) {
+                throw new ApiException("统计区间不能大于90天");
+            }
+        }
+
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelDTO> records = behospitalInfoFacade.getBaseMapper().leaveHosMRPageExport(qcResultShortPageVO);
+        List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
+        if ("2".equals(qcResultShortPageVO.getRadioCheck())) {
+            resWide = transList(records, resWide);
+        }
+        String fileName = "出院人数统计.xls";
+        if ("1".equals(qcResultShortPageVO.getRadioCheck())) {
+            ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
+        }
+        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 -> {
+                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 -> {
+                    ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
+                    exportExcelWideBehospitalDTO.setDoctorName(exportExcelBehospitalDTO.getDoctorName());
+                    exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
+                    exportExcelWideBehospitalDTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
+                    exportExcelWideBehospitalDTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
+                    exportExcelWideBehospitalDTO.setPatName(exportExcelBehospitalDTO.getPatName());
+                    exportExcelWideBehospitalDTO.setScore(exportExcelBehospitalDTO.getScore());
+                    exportExcelWideBehospitalDTO.setScoreBn(exportExcelBehospitalDTO.getScoreBn());
+                    exportExcelWideBehospitalDTOs.add(exportExcelWideBehospitalDTO);
+                });
+                exportWideExcelDTO.setExcelBehospitalDTOS(exportExcelWideBehospitalDTOs);
+                resWide.add(exportWideExcelDTO);
+            });
+        }
+        return resWide;
+    }
+}

+ 70 - 0
report-service/src/main/java/com/lantone/report/facade/ModuleCaseManagementFacade.java

@@ -0,0 +1,70 @@
+package com.lantone.report.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.dto.report.NumDTO;
+import com.lantone.common.util.ExcelUtils;
+import com.lantone.common.util.ListUtil;
+import com.lantone.common.vo.report.FilterPageVO;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.dblayermbg.facade.report.QcresultInfoFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+@Component
+public class ModuleCaseManagementFacade {
+
+    @Autowired
+    private FilterFacade filterFacade;
+    @Autowired
+    private QcresultInfoFacade qcresultInfoFacade;
+
+    /**
+     * 各模块缺陷占比排行
+     *
+     * @param filterVO
+     * @return
+     */
+    public Map<String, Object> entryCountGroupByCase(FilterVO filterVO) {
+        Map<String, Object> retMap = new HashMap<>();
+        filterFacade.filterVOSet(filterVO);
+        List<NumDTO> caseList = qcresultInfoFacade.getBaseMapper().entryCountGroupByCase(filterVO);
+        if (ListUtil.isNotEmpty(caseList)) {
+            retMap.put("各模块缺陷占比排行", caseList);
+        }
+        return retMap;
+    }
+
+    /**
+     * 各模块缺陷占比(分页)
+     *
+     * @param filterPageVO
+     * @return
+     */
+    public IPage<NumDTO> entryCountGroupByCasePage(FilterPageVO filterPageVO) {
+        filterFacade.filterPageVOSet(filterPageVO);
+        IPage<NumDTO> page = qcresultInfoFacade.getBaseMapper().entryCountGroupByCasePage(filterPageVO);
+        return page;
+    }
+
+
+    /**
+     * 各模块缺陷占比导出
+     *
+     * @param filterPageVO
+     * @return
+     */
+    public void entryCountGroupByCaseExport(HttpServletResponse response, FilterPageVO filterPageVO) {
+        filterPageVO.setCurrent(1L);
+        filterPageVO.setSize(Long.MAX_VALUE);
+        filterPageVO.setSearchCount(false);
+        IPage<NumDTO> page = this.entryCountGroupByCasePage(filterPageVO);
+        String fileName = "缺陷详情.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", NumDTO.class, fileName, response, 12.8f);
+    }
+}

+ 0 - 55
report-service/src/main/java/com/lantone/report/web/DeptInfoManagementController.java

@@ -1,55 +0,0 @@
-package com.lantone.report.web;
-import com.lantone.common.api.CommonResult;
-import com.lantone.common.dto.report.BasDeptInfoDTO;
-import com.lantone.common.vo.report.BasDeptInfoVO;
-import com.lantone.report.facade.DeptInfoManagementFacade;
-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 java.util.List;
-
-
-/**
- * <p>
- * 医院科室信息 前端控制器
- * </p>
- *
- * @author gaodm
- * @since 2020-04-27
- */
-
-@RestController
-@RequestMapping("/bas/dept")
-@Api(value = "医院科室API", tags = { "医院科室API" })
-@SuppressWarnings("unchecked")
-public class DeptInfoManagementController {
-    @Autowired
-    private DeptInfoManagementFacade deptInfoManagementFacade;
-
-    @ApiOperation(value = "获取用户管理下医院科室下拉列表信息[by:gaodm]",
-            notes = "inputStr: 搜索参数")
-    @PostMapping("/listForUser")
-    public CommonResult<List<BasDeptInfoDTO>> listForUser(@RequestBody BasDeptInfoVO basDeptInfoVO) {
-        return CommonResult.success(deptInfoManagementFacade.listForUser(basDeptInfoVO));
-    }
-
-
-    @ApiOperation(value = "获取病历质控一览下医院科室下拉列表信息[by:gaodm]",
-            notes = "inputStr: 搜索参数")
-    @PostMapping("/getList")
-    public CommonResult<List<BasDeptInfoDTO>> getList(@RequestBody BasDeptInfoVO basDeptInfoVO) {
-        return CommonResult.success(deptInfoManagementFacade.listForUser(basDeptInfoVO));
-    }
-
-    @ApiOperation(value = "获取病历质控一览下用户科室下拉列表信息[by:gaodm]",
-            notes = "inputStr: 搜索参数")
-    @PostMapping("/getListUser")
-    public CommonResult<List<BasDeptInfoDTO>> getListUser(@RequestBody BasDeptInfoVO basDeptInfoVO) {
-        return CommonResult.success(deptInfoManagementFacade.getListUserFac(basDeptInfoVO));
-    }
-}

+ 74 - 0
report-service/src/main/java/com/lantone/report/web/EntryCaseManagementController.java

@@ -0,0 +1,74 @@
+package com.lantone.report.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.api.CommonResult;
+import com.lantone.common.dto.report.EntryNumDTO;
+import com.lantone.common.vo.report.FilterPageVO;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.report.facade.EntryCaseManagementFacade;
+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;
+import java.util.Map;
+
+
+/**
+ * <p>
+ * 条目缺陷管理统计相关API
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-27
+ */
+
+@RestController
+@RequestMapping("/console")
+@Api(value = "条目缺陷管理统计相关API", tags = { "条目缺陷管理统计相关API" })
+@SuppressWarnings("unchecked")
+public class EntryCaseManagementController {
+    @Autowired
+    private EntryCaseManagementFacade entryCaseManagementFacade;
+
+    /**
+     * 条目缺陷占比-控制台
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "条目缺陷占比-控制台[by:zhaops]")
+    @PostMapping("/entryCountGroupByEntry")
+    public CommonResult<Map<String, Object>> entryCountGroupByEntry(@RequestBody @Valid FilterVO filterVO) {
+        return CommonResult.success(entryCaseManagementFacade.entryCountGroupByEntry(filterVO));
+    }
+
+    /**
+     * 条目缺陷占比-报表
+     *
+     * @param filterPageVO
+     * @return
+     */
+    @ApiOperation(value = "条目缺陷占比-报表[by:zhaops]")
+    @PostMapping("/entryGroupByEntryInnerPage")
+    public CommonResult<IPage<EntryNumDTO>> entryGroupByEntryInnerPage(@RequestBody @Valid FilterPageVO filterPageVO) {
+        return CommonResult.success(entryCaseManagementFacade.entryGroupByEntryInnerPage(filterPageVO));
+    }
+
+    /**
+     * 条目缺陷占比-报表导出
+     *
+     * @param filterPageVO
+     * @return
+     */
+    @ApiOperation(value = "条目缺陷占比-报表导出[by:gaodm]")
+    @PostMapping("/entryGroupByEntryExport")
+    public void entryGroupByEntryExport(HttpServletResponse response, @RequestBody @Valid FilterPageVO filterPageVO) {
+        entryCaseManagementFacade.entryGroupByEntryExport(response, filterPageVO);
+    }
+}

+ 74 - 0
report-service/src/main/java/com/lantone/report/web/LeaveHospitalManagementController.java

@@ -0,0 +1,74 @@
+package com.lantone.report.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.api.CommonResult;
+import com.lantone.common.dto.report.QcResultShortDTO;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.common.vo.report.QcResultShortPageVO;
+import com.lantone.report.facade.LeaveHospitalManagementFacade;
+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;
+import java.util.Map;
+
+
+/**
+ * <p>
+ * 出院管理统计相关API
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-27
+ */
+
+@RestController
+@RequestMapping("/console")
+@Api(value = "出院管理统计相关API", tags = { "出院管理统计相关API" })
+@SuppressWarnings("unchecked")
+public class LeaveHospitalManagementController {
+    @Autowired
+    private LeaveHospitalManagementFacade leaveHospitalManagementFacade;
+
+    /**
+     * 出院人数统计
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "出院人数统计-控制台[by:zhaops]")
+    @PostMapping("/leaveHosCount")
+    public CommonResult<Map<String, Object>> leaveHosCount(@RequestBody @Valid FilterVO filterVO) {
+        return CommonResult.success(leaveHospitalManagementFacade.leaveHosCount(filterVO));
+    }
+
+    /**
+     * 出院人数统计-报表
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "出院人数统计-报表[by:zhaops]")
+    @PostMapping("/leaveHosMRPage")
+    public CommonResult<IPage<QcResultShortDTO>> leaveHosMRPage(@RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        return CommonResult.success(leaveHospitalManagementFacade.leaveHosMRPage(qcResultShortPageVO));
+    }
+
+    /**
+     * 出院人数统计-报表导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "出院人数统计-报表导出[by:zhaops]")
+    @PostMapping("/leaveHosMrPageExport")
+    public void leaveHosMrPageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        leaveHospitalManagementFacade.leaveHosMrPageExportMethod(response, qcResultShortPageVO);
+    }
+}

+ 74 - 0
report-service/src/main/java/com/lantone/report/web/ModuleCaseManagementController.java

@@ -0,0 +1,74 @@
+package com.lantone.report.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.lantone.common.api.CommonResult;
+import com.lantone.common.dto.report.NumDTO;
+import com.lantone.common.vo.report.FilterPageVO;
+import com.lantone.common.vo.report.FilterVO;
+import com.lantone.report.facade.ModuleCaseManagementFacade;
+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;
+import java.util.Map;
+
+
+/**
+ * <p>
+ * 模块缺陷管理统计相关API
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-04-27
+ */
+
+@RestController
+@RequestMapping("/console")
+@Api(value = "模块缺陷管理统计相关API", tags = { "模块缺陷管理统计相关API" })
+@SuppressWarnings("unchecked")
+public class ModuleCaseManagementController {
+    @Autowired
+    private ModuleCaseManagementFacade moduleCaseManagementFacade;
+
+    /**
+     * 各模块缺陷占比排行-控制台
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "各模块缺陷占比排行-控制台[by:zhaops]")
+    @PostMapping("/entryCountGroupByCase")
+    public CommonResult<Map<String, Object>> entryCountGroupByCase(@RequestBody @Valid FilterVO filterVO) {
+        return CommonResult.success(moduleCaseManagementFacade.entryCountGroupByCase(filterVO));
+    }
+
+    /**
+     * 各模块缺陷占比排行-报表
+     *
+     * @param filterPageVO
+     * @return
+     */
+    @ApiOperation(value = "各模块缺陷占比排行-报表[by:zhaops]")
+    @PostMapping("/entryCountGroupByCasePage")
+    public CommonResult<IPage<NumDTO>> entryCountGroupByCasePage(@RequestBody @Valid FilterPageVO filterPageVO) {
+        return CommonResult.success(moduleCaseManagementFacade.entryCountGroupByCasePage(filterPageVO));
+    }
+
+    /**
+     * 各模块缺陷占比排行-报表导出
+     *
+     * @param filterPageVO
+     * @return
+     */
+    @ApiOperation(value = "各模块缺陷占比排行-报表导出[by:gaodm]")
+    @PostMapping("/entryCountGroupByCaseExport")
+    public void entryCountGroupByCaseExport(HttpServletResponse response, @RequestBody @Valid FilterPageVO filterPageVO) {
+        moduleCaseManagementFacade.entryCountGroupByCaseExport(response, filterPageVO);
+    }
+}

+ 4 - 0
report-service/src/main/resources/bootstrap.yml

@@ -35,6 +35,10 @@ management:
     health:
       show-details: always
 
+io.github.lvyahui8.spring:
+  base-packages: com.lantone.report.aggregate.LeaveHosStatisticsAggregate
+  thread-number: 12
+
 feign:
   okhttp:
     enabled: true