瀏覽代碼

Merge branch 'develop' into dev/20200716_1.3.9

gaodm 4 年之前
父節點
當前提交
cb88fba30c

+ 4 - 3
doc/017.20200716v1.3.8/qc_inti_check.sql

@@ -1,8 +1,7 @@
 use `qc`;
 ALTER TABLE `med_check_info` ADD COLUMN `check_type` INT(11) NULL COMMENT '核查类型(0病历,1病案首页)' AFTER `status`;
 UPDATE med_check_info a SET check_type =0;
-UPDATE med_check_info a SET check_name = (SELECT linkman FROM sys_user b WHERE a.check_id=b.id) inkman FROM sys_user b WHERE a.check_id=b.id);
-
+UPDATE med_check_info a SET check_name = (SELECT linkman FROM sys_user b WHERE a.check_id=b.id);
 
 DELETE FROM sys_user_pageset WHERE user_id = -1;
 
@@ -129,5 +128,7 @@ WHERE  userId IS NULL
  UPDATE sys_user_pageset a SET a.name = "病历核查状态" WHERE a.user_id <> -1 AND val ="checkStatus";
 
 -- 新增权限
-INSERT INTO `sys_menu`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES (38, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31天再入院人数', 17, 'YH-ZKK-31TZRYRS', 1, 1, 14, '用户-质控科-31天再入院人数');
+INSERT INTO `sys_menu`(`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES (38, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31日再入院病人数', 17, 'YH-ZKK-31TZRYRS', 1, 1, 14, '用户-质控科-31日再入院病人数');
 INSERT INTO `sys_role_menu`(`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', -1, 38, '用户-质控科-31天再入院人数');
+
+update sys_menu set name ='时效性相关统计' where id=37;

+ 116 - 0
src/main/java/com/diagbot/aggregate/HomePageStatisticsAggregate.java

@@ -0,0 +1,116 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.dto.HomePageImproveDTO;
+import com.diagbot.dto.HomePageNumDTO;
+import com.diagbot.dto.NumDTO;
+import com.diagbot.facade.BehospitalInfoFacade;
+import com.diagbot.vo.FilterVO;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import io.github.lvyahui8.spring.annotation.InvokeParameter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/22 11:45
+ */
+@Component
+public class HomePageStatisticsAggregate {
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
+    @DataProvider("setAllHomePage")
+    public Map<String, Object> setAllHomePage(
+            @InvokeParameter("filterVO") FilterVO filterVO,
+            @DataConsumer("getQcNumDTO") HomePageNumDTO qcNumDTO,
+            @DataConsumer("getEmptyNumDTO") HomePageNumDTO emptyNumDTO,
+            @DataConsumer("getImproveDTO") HomePageImproveDTO improveDTO) {
+        Map<String, Object> retMap = new LinkedHashMap<>();
+        retMap.put("合格率", null);
+        retMap.put("不合格率", null);
+        retMap.put("完整率", null);
+        retMap.put("改善率", null);
+
+        if (qcNumDTO != null) {
+            //合格率
+            NumDTO pass = new NumDTO();
+            pass.setName("合格率");
+            pass.setNum(qcNumDTO.getFirstLevelNum());
+            pass.setTotleNum(qcNumDTO.getMrNum());
+            pass.setPercent(qcNumDTO.getFirstLevelPercent());
+            pass.setPercentStr(qcNumDTO.getFirstLevelPercentStr());
+            //不合格率
+            NumDTO unPass = new NumDTO();
+            unPass.setName("不合格率");
+            unPass.setNum(qcNumDTO.getSecondLevelNum());
+            unPass.setTotleNum(qcNumDTO.getMrNum());
+            unPass.setPercent(qcNumDTO.getSecondLevelPercent());
+            unPass.setPercentStr(qcNumDTO.getSecondLevelPercentStr());
+
+            retMap.put("合格率", pass);
+            retMap.put("不合格率", unPass);
+        }
+        if (emptyNumDTO != null) {
+            //完整率
+            NumDTO full = new NumDTO();
+            full.setName("完整率");
+            full.setNum(emptyNumDTO.getEntryTotleNum() - emptyNumDTO.getEmptyNum());
+            full.setTotleNum(emptyNumDTO.getEntryTotleNum());
+            full.setPercent(emptyNumDTO.getEmptyPercent());
+            full.setPercentStr(emptyNumDTO.getEmptyPercentStr());
+
+            retMap.put("完整率", full);
+        }
+
+        if (improveDTO != null) {
+            //改善率
+            NumDTO improve = new NumDTO();
+            improve.setName("改善率");
+            improve.setNum(improveDTO.getImproveNum());
+            improve.setTotleNum(improveDTO.getHomePageMRNum());
+            improve.setPercent(improveDTO.getImprovePercent());
+            improve.setPercentStr(improveDTO.getImprovePercentStr());
+
+            retMap.put("改善率", improve);
+        }
+        return retMap;
+    }
+
+    /**
+     * 合格率
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getQcNumDTO")
+    public HomePageNumDTO getQcNumDTO(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.homePageQcPercent(filterVO);
+    }
+
+    /**
+     * 完整率
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getEmptyNumDTO")
+    public HomePageNumDTO getEmptyNumDTO(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.hmEmptyEntryPercent(filterVO);
+    }
+
+    /**
+     * 改善率
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getImproveDTO")
+    public HomePageImproveDTO getImproveDTO(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.homePageImproveCount(filterVO);
+    }
+}

+ 2 - 0
src/main/java/com/diagbot/dto/BehospitalInfoDTO.java

@@ -122,6 +122,8 @@ public class BehospitalInfoDTO implements Serializable {
     private Integer mrStatus;
     private String chName;
     private String mrName;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date chTime;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date mrTime;
 }

+ 1 - 1
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -199,7 +199,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             mapAllMr.put("hospital_id", hospitalId);
             mapAllMr.put("check_type", 1);
             QueryWrapper<MedCheckInfo> medCheckInfoMr = new QueryWrapper<>();
-            medCheckInfoQuerys.allEq(mapAll);
+            medCheckInfoMr.allEq(mapAllMr);
             int countMr = medCheckInfoFacade.count(medCheckInfoMr);
             if (countMr > 0) {
                 res.put("mrStatus", 1);

+ 8 - 40
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -823,46 +823,14 @@ public class ConsoleFacade {
         retMap.put("完整率", null);
         retMap.put("改善率", null);
         filterFacade.filterVOSet(filterVO);
-        HomePageNumDTO qcNumDTO = behospitalInfoFacade.homePageQcPercent(filterVO);
-        HomePageNumDTO emptyNumDTO = behospitalInfoFacade.hmEmptyEntryPercent(filterVO);
-        HomePageImproveDTO improveDTO = behospitalInfoFacade.homePageImproveCount(filterVO);
-
-        //合格率
-        NumDTO pass = new NumDTO();
-        pass.setName("合格率");
-        pass.setNum(qcNumDTO.getFirstLevelNum());
-        pass.setTotleNum(qcNumDTO.getMrNum());
-        pass.setPercent(qcNumDTO.getFirstLevelPercent());
-        pass.setPercentStr(qcNumDTO.getFirstLevelPercentStr());
-
-        //不合格率
-        NumDTO unPass = new NumDTO();
-        unPass.setName("不合格率");
-        unPass.setNum(qcNumDTO.getSecondLevelNum());
-        unPass.setTotleNum(qcNumDTO.getMrNum());
-        unPass.setPercent(qcNumDTO.getSecondLevelPercent());
-        unPass.setPercentStr(qcNumDTO.getSecondLevelPercentStr());
-
-        //完整率
-        NumDTO full = new NumDTO();
-        full.setName("完整率");
-        full.setNum(emptyNumDTO.getEntryTotleNum() - emptyNumDTO.getEmptyNum());
-        full.setTotleNum(emptyNumDTO.getEntryTotleNum());
-        full.setPercent(emptyNumDTO.getEmptyPercent());
-        full.setPercentStr(emptyNumDTO.getEmptyPercentStr());
-
-        //改善率
-        NumDTO improve = new NumDTO();
-        improve.setName("改善率");
-        improve.setNum(improveDTO.getImproveNum());
-        improve.setTotleNum(improveDTO.getHomePageMRNum());
-        improve.setPercent(improveDTO.getImprovePercent());
-        improve.setPercentStr(improveDTO.getImprovePercentStr());
-
-        retMap.put("合格率", pass);
-        retMap.put("不合格率", unPass);
-        retMap.put("完整率", full);
-        retMap.put("改善率", improve);
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("filterVO", filterVO);
+            retMap
+                    = dataBeanAggregateQueryFacade.get("setAllHomePage", invokeParams, Map.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
         return retMap;
     }