Sfoglia il codice sorgente

条目缺陷改善统计sql调整、增加科室部分接口

chengyao 3 anni fa
parent
commit
d872b62305

+ 25 - 6
doc/037.20211117_2.1.3/qc_initv2.1.3.sql

@@ -1,23 +1,42 @@
 
 use `qc`;
 -- 执行前请看注意事项!
-
+--全院
 INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据分析', '-1', 'YH-SJFX', '1', '1', '12', '用户-数据分析');
 SET @id =@@identity;
 
-INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '临床质控使用统计', @id , 'YH-ZKK-LCZKSYTJ', '1', '1', '0', '用户-质控科-临床质控使用统计');
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '临床质控使用统计', @id , 'YH-ZKK-LCZKSYTJ', '1', '1', '1', '用户-质控科-临床质控使用统计');
 SET @idSec =@@identity;
-INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', @id , 'YH-ZKK-TMQXGSTJ', '1', '1', '0', '用户-质控科-条目缺陷改善统计');
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', @id , 'YH-ZKK-TMQXGSTJ', '1', '1', '2', '用户-质控科-条目缺陷改善统计');
 SET @idThr =@@identity;
 
 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', @id, NULL);
 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', @id, NULL);
-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', '2', @id, NULL);
+
 
 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', @idSec, NULL);
 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', @idSec, NULL);
-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', '2', @idSec, NULL);
+
 
 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', @idThr, NULL);
 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', @idThr, NULL);
-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', '2', @idThr, NULL);
+
+--科室
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据分析(科室)', '-1', 'YH-SJFXKS', '1', '1', '13', '用户-数据分析(科室)');
+SET @idks =@@identity;
+
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '临床质控使用统计', @idks , 'YH-KSZR-LCZKSYTJ', '1', '1', '1', '用户-质控科-临床质控使用统计(科室)');
+SET @idksSec =@@identity;
+INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', @idks , 'YH-KSZR-TMQXGSTJ', '1', '1', '2', '用户-质控科-条目缺陷改善统计(科室)');
+SET @idksThr =@@identity;
+
+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', @idks, NULL);
+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', '2', @idks, NULL);
+
+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', @idksSec, NULL);
+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', '2', @idksSec, NULL);
+
+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', @idksThr, NULL);
+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', '2', @idksThr, NULL);
+
+

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

@@ -270,6 +270,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/analysis/getQcClickInnerPageByExport").permitAll()
                 .antMatchers("/qc/analysis/getEntryDefectImprove").permitAll()
                 .antMatchers("/qc/analysis/getEntryDefectImproveByExport").permitAll()
+                .antMatchers("/qc/analysisDept/getQcClickDept").permitAll()
+                .antMatchers("/qc/analysisDept/getQcClickByDeptExport").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -314,6 +314,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/analysis/getQcClickInnerPageByExport", request)
                 || matchers("/qc/analysis/getEntryDefectImprove", request)
                 || matchers("/qc/analysis/getEntryDefectImproveByExport", request)
+                || matchers("/qc/analysisDept/getQcClickDept", request)
+                || matchers("/qc/analysisDept/getQcClickByDeptExport", request)
                 || matchers("/", request)) {
             return true;
         }

+ 88 - 0
src/main/java/com/diagbot/web/DataAnalysisDeptController.java

@@ -0,0 +1,88 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.GetQcClickDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.DataAnalysisFacade;
+import com.diagbot.vo.GetQcClickInnerPageVO;
+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.List;
+
+/**
+ * @Description:数据分析(科室)
+ * @Author: cy
+ * @time: 2021/11/25 11:42
+ */
+@RestController
+@Api(value = "数据分析(科室)相关API", tags = { "数据分析(科室)相关API" })
+@RequestMapping("/qc/analysisDept")
+public class DataAnalysisDeptController {
+
+    @Autowired
+    DataAnalysisFacade dataAnalysisFacade;
+
+    /**
+     * 临床质控使用统计(科室)
+     *
+     * @param getQcClickInnerPageVO
+     * @return
+     */
+    @ApiOperation(value = "临床质控使用统计(科室)[by:cy]")
+    @PostMapping("/getQcClickDept")
+    @SysLogger("getQcClickDept")
+    public RespDTO<List<GetQcClickDTO>> getQcClickDept(@RequestBody @Valid GetQcClickInnerPageVO getQcClickInnerPageVO) {
+        return RespDTO.onSuc(dataAnalysisFacade.getQcClickInnerPage(getQcClickInnerPageVO));
+    }
+
+    /**
+     * 临床质控使用统计(科室)-导出
+     *
+     * @param getQcClickInnerPageVO
+     * @return
+     */
+    @ApiOperation(value = "临床质控使用统计(科室)-导出[by:cy]")
+    @PostMapping("/getQcClickByDeptExport")
+    @SysLogger("getQcClickByDeptExport")
+    public void getQcClickByDeptExport(HttpServletResponse response, @RequestBody @Valid GetQcClickInnerPageVO getQcClickInnerPageVO) {
+         dataAnalysisFacade.getQcClickInnerPageByExport(response,getQcClickInnerPageVO);
+    }
+
+
+    /**
+     * 条目缺陷改善统计
+     *
+     * @param getEntryDefectImproveVO
+     * @return
+     */
+/*
+    @ApiOperation(value = "条目缺陷改善统计[by:cy]")
+    @PostMapping("/getEntryDefectImprove")
+    @SysLogger("getEntryDefectImprove")
+    public RespDTO<IPage<GetEntryDefectImproveDTO>> getEntryDefectImprove(@RequestBody @Valid GetEntryDefectImproveVO getEntryDefectImproveVO) {
+        return RespDTO.onSuc(dataAnalysisFacade.getEntryDefectImprove(getEntryDefectImproveVO));
+    }
+*/
+
+    /**
+     * 条目缺陷改善统计(科室)-导出
+     *
+     * @param getEntryDefectImproveVO
+     * @return
+     */
+  /*  @ApiOperation(value = "条目缺陷改善统计(科室)-导出[by:cy]")
+    @PostMapping("/getEntryDefectImproveByExport")
+    @SysLogger("getEntryDefectImproveByExport")
+    public void getEntryDefectImproveByExport(HttpServletResponse response,@RequestBody @Valid GetEntryDefectImproveVO getEntryDefectImproveVO) {
+       dataAnalysisFacade.getEntryDefectImproveByExport(response,getEntryDefectImproveVO);
+    }*/
+
+}

+ 32 - 1
src/main/resources/mapper/MedClickInfoMapper.xml

@@ -248,6 +248,37 @@
         q.beh_dept_id,
         q.beh_dept_name,
         q.behospital_code
+        UNION
+        SELECT
+        q.hospital_id,
+        q.beh_dept_id AS dept_id,
+        q.beh_dept_name AS dept_name,
+        w.behospital_code,
+        min(w.qcresult_info_id) AS beforeQcresultInfoId
+        FROM
+        med_behospital_info q,
+        med_click_info w
+        WHERE
+        q.is_deleted = 'N'
+        AND w.is_deleted = 'N'
+        AND q.hospital_id = w.hospital_id
+        AND q.behospital_code = w.behospital_code
+        AND q.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND q.hospital_id = #{hospitalId}
+        </if>
+        <if test="deptId != null and deptId != ''">
+            and q.beh_dept_id = #{deptId}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            and q.beh_dept_name like CONCAT('%',#{deptName},'%')
+        </if>
+        GROUP BY
+        q.beh_dept_id,
+        q.beh_dept_name,
+        q.behospital_code
+        HAVING
+        count(q.behospital_code) = 1
         ) t ON e.hospital_id = t.hospital_id
         AND e.behospital_code = t.behospital_code
         LEFT JOIN med_qcresult_detail u ON t.hospital_id = u.hospital_id
@@ -265,7 +296,7 @@
         LEFT JOIN qc_cases_entry o ON o.id = k.beforeCasesEntryId
         AND o.is_deleted = 'N'
         WHERE
-        (y.grade_type = 1 OR y.grade_type IS NULL)
+        (y.grade_type = 1 OR y.cases_entry_id IS NULL)
         <if test="casesName != null and casesName != ''">
             and i.name like CONCAT('%',#{casesName},'%')
         </if>