Procházet zdrojové kódy

Merge remote-tracking branch 'origin/test' into test

songxinlu před 3 roky
rodič
revize
e19ec29bd8

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 10 - 0
doc/040.20211228_2.1.5/qc_initv2.1.5.sql


+ 129 - 0
src/main/java/com/diagbot/aggregate/LeaveHosCountByDeptAggregate.java

@@ -0,0 +1,129 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.dto.DeptBaseDTO;
+import com.diagbot.dto.NumDTO;
+import com.diagbot.facade.BasDeptInfoFacade;
+import com.diagbot.facade.BehospitalInfoFacade;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+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.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/15 16:03
+ */
+@Component
+public class LeaveHosCountByDeptAggregate {
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    private BasDeptInfoFacade basDeptInfoFacade;
+
+    @DataProvider("setAllLeaveHosCount")
+    public Map<String, Object> setAllLeaveHosCount(
+            @InvokeParameter("filterVO") FilterVO filterVO,
+            @DataConsumer("leaveHosCountByDept") List<NumDTO> totleNumList,
+            @DataConsumer("deathCountByDept") List<NumDTO> deathNumList,
+            @DataConsumer("operationCountByDept") List<NumDTO> operationNumList) {
+        Map<String, Object> retMap = new LinkedHashMap<>();
+        //关联科室
+        Map<String, Object> deptMap = getDeptByUser(filterVO);
+        if (deptMap == null) {
+            return retMap;
+        }
+        Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
+                ? new HashMap<>()
+                : EntityUtil.makeEntityMap(totleNumList, "name");
+
+        Map<String, NumDTO> deathMap = new HashMap<>();
+        Map<String, NumDTO> operationMap = new HashMap<>();
+        deathMap = ListUtil.isEmpty(deathNumList)
+                ? new HashMap<>()
+                : EntityUtil.makeEntityMap(deathNumList, "name");
+        operationMap = ListUtil.isEmpty(operationNumList)
+                ? new HashMap<>()
+                : EntityUtil.makeEntityMap(operationNumList, "name");
+
+
+        for (String deptName : deptMap.keySet()) {
+            Map<String, Object> map = new LinkedHashMap<>();
+            map.put("总人数", 0);
+            map.put("死亡人数", 0);
+            map.put("手术病人数", 0);
+            if (totleMap.containsKey(deptName)) {
+                map.put("总人数", totleMap.get(deptName).getNum());
+            }
+            if (deathMap.containsKey(deptName)) {
+                map.put("死亡人数", deathMap.get(deptName).getNum());
+            }
+            if (operationMap.containsKey(deptName)) {
+                map.put("手术病人数", operationMap.get(deptName).getNum());
+            }
+            retMap.put(deptName, map);
+        }
+        return retMap;
+    }
+
+    /**
+     * 出院总人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("leaveHosCountByDept")
+    public List<NumDTO> leaveHosCountByDept(@InvokeParameter("filterVO") FilterVO filterVO) {
+        List<NumDTO> numDTOS = behospitalInfoFacade.leaveHosCountByDept(filterVO);
+        return numDTOS;
+    }
+
+    /**
+     * 死亡人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("deathCountByDept")
+    public List<NumDTO> deathCountByDept(@InvokeParameter("filterVO") FilterVO filterVO) {
+        List<NumDTO> numDTOS = behospitalInfoFacade.deathCountByDept(filterVO);
+        return numDTOS;
+
+    }
+
+    /**
+     * 手术人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("operationCountByDept")
+    public List<NumDTO> operationCountByDept(@InvokeParameter("filterVO") FilterVO filterVO) {
+        List<NumDTO> numDTOS = behospitalInfoFacade.operationCountByDept(filterVO);
+        return numDTOS;
+    }
+
+    /**
+     * 用户关联科室
+     *
+     * @param filterVO
+     * @return
+     */
+    public Map<String, Object> getDeptByUser(FilterVO filterVO) {
+        List<DeptBaseDTO> deptList = basDeptInfoFacade.getDeptByUser(filterVO);
+        if (ListUtil.isNotEmpty(deptList)) {
+            return EntityUtil.makeMapWithKeyValue(deptList, "deptName", "deptId");
+        } else {
+            return null;
+        }
+    }
+}

+ 76 - 120
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -11,6 +11,7 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.util.*;
 import com.diagbot.vo.*;
 import com.google.common.collect.Lists;
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +45,8 @@ public class ConsoleByDeptFacade {
     private SysHospitalSetFacade sysHospitalSetFacade;
     @Autowired
     private QcCasesEntryFacade qcCasesEntryFacade;
+    @Autowired
+    private DataBeanAggregateQueryFacade dataBeanAggregateQueryFacade;
 
 
     /**
@@ -60,40 +63,13 @@ public class ConsoleByDeptFacade {
         if (deptMap == null) {
             return retMap;
         }
-        //出院总人数
-        List<NumDTO> totleNumList = behospitalInfoFacade.leaveHosCountByDept(filterVO);
-        Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(totleNumList, "name");
-        Map<String, NumDTO> deathMap = new HashMap<>();
-        Map<String, NumDTO> operationMap = new HashMap<>();
-        //终末--死亡人数/手术病人数
-            //死亡人数
-            List<NumDTO> deathNumList = behospitalInfoFacade.deathCountByDept(filterVO);
-             deathMap = ListUtil.isEmpty(deathNumList)
-                    ? new HashMap<>()
-                    : EntityUtil.makeEntityMap(deathNumList, "name");
-            //手术人数
-            List<NumDTO> operationNumList = behospitalInfoFacade.operationCountByDept(filterVO);
-             operationMap = ListUtil.isEmpty(operationNumList)
-                    ? new HashMap<>()
-                    : EntityUtil.makeEntityMap(operationNumList, "name");
-
-        for (String deptName : deptMap.keySet()) {
-            Map<String, Object> map = new LinkedHashMap<>();
-            map.put("总人数", 0);
-            map.put("死亡人数", 0);
-            map.put("手术病人数", 0);
-            if (totleMap.containsKey(deptName)) {
-                map.put("总人数", totleMap.get(deptName).getNum());
-            }
-            if(deathMap.containsKey(deptName)) {
-                map.put("死亡人数", deathMap.get(deptName).getNum());
-            }
-            if(operationMap.containsKey(deptName)) {
-                map.put("手术病人数", operationMap.get(deptName).getNum());
-            }
-            retMap.put(deptName, map);
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("filterVO", filterVO);
+            retMap  = dataBeanAggregateQueryFacade.get("setAllLeaveHosCount", invokeParams, Map.class);
+            long L2 = System.currentTimeMillis();
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
         }
         return retMap;
     }
@@ -123,98 +99,78 @@ public class ConsoleByDeptFacade {
         DecimalFormat df = new DecimalFormat("#0.00");
         Map<String, Object> retMap = new LinkedHashMap<>();
         filterFacade.filterVOSet(filterVO);
-        QcresultFilterVO qcresultFilterVO = new QcresultFilterVO();
-        BeanUtil.copyProperties(filterVO, qcresultFilterVO);
         //关联科室
         Map<String, Object> deptMap = getDeptByUser(filterVO);
         if (deptMap == null) {
             return retMap;
         }
-        //质控病历总数
-        List<NumDTO> totleNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
-        Map<String, NumDTO> totleMap = ListUtil.isEmpty(totleNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(totleNumList, "name");
-        //甲级病历
-        qcresultFilterVO.setLevel("甲");
-        List<NumDTO> firstNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
-        Map<String, NumDTO> firstMap = ListUtil.isEmpty(firstNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(firstNumList, "name");
-        //乙级病历
-        qcresultFilterVO.setLevel("乙");
-        List<NumDTO> secondNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
-        Map<String, NumDTO> secondMap = ListUtil.isEmpty(secondNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(secondNumList, "name");
-        //丙级病历
-        qcresultFilterVO.setLevel("丙");
-        List<NumDTO> thirdNumList = qcresultInfoFacade.resultCountByDept(qcresultFilterVO);
-        Map<String, NumDTO> thirdMap = ListUtil.isEmpty(thirdNumList)
-                ? new HashMap<>()
-                : EntityUtil.makeEntityMap(thirdNumList, "name");
-        for (String deptName : deptMap.keySet()) {
-            List<NumDTO> retList = Lists.newLinkedList();
-            int totleNum = 0;
-            int firstLevelNum = 0;
-            int secondLevelNum = 0;
-            int thirdLevelNum = 0;
-            if (totleMap.containsKey(deptName)) {
-                totleNum = totleMap.get(deptName).getNum();
-            }
-            if (firstMap.containsKey(deptName)) {
-                firstLevelNum = firstMap.get(deptName).getNum();
-            }
-            if (secondMap.containsKey(deptName)) {
-                secondLevelNum = secondMap.get(deptName).getNum();
-            }
-            if (thirdMap.containsKey(deptName)) {
-                thirdLevelNum = thirdMap.get(deptName).getNum();
-            }
-            //总病历数为0
-            if (totleNum == 0) {
-                retMap.put(deptName, Lists.newLinkedList());
-                continue;
+        QcresultFilterVO qcresultFilterVO = new QcresultFilterVO();
+        BeanUtil.copyProperties(filterVO, qcresultFilterVO);
+        //质控病历数
+        List<Map<String,Object>> maps = qcresultInfoFacade.resultMrCountByDept(qcresultFilterVO);
+        if(ListUtil.isEmpty(maps)){
+            return retMap;
+        }
+        for (Map<String, Object> map : maps) {
+            if(null != map.get("NAME") && StringUtils.isNotBlank(map.get("NAME").toString()) && deptMap.containsKey(map.get("NAME").toString())){
+                List<NumDTO> retList = Lists.newLinkedList();
+                int totleNum = 0;
+                int firstLevelNum = 0;
+                int secondLevelNum = 0;
+                int thirdLevelNum = 0;
+                if(null != map.get("num")){
+                    totleNum = Integer.parseInt(map.get("num").toString());
+                }
+                if(null != map.get("firNum")){
+                    firstLevelNum = Integer.parseInt(map.get("firNum").toString());
+                }
+                if(null != map.get("secNum")){
+                    secondLevelNum = Integer.parseInt(map.get("secNum").toString());
+                }
+                if(null != map.get("thrNum")){
+                    thirdLevelNum = Integer.parseInt(map.get("thrNum").toString());
+                }
+
+                NumDTO totleNumDTO = new NumDTO();
+                totleNumDTO.setName("累计质控病历数");
+                totleNumDTO.setTotleNum(totleNum);
+                totleNumDTO.setNum(totleNum);
+                NumDTO firstLevelNumDTO = new NumDTO();
+                firstLevelNumDTO.setName("甲级病历");
+                firstLevelNumDTO.setNum(firstLevelNum);
+                firstLevelNumDTO.setTotleNum(totleNum);
+                Double firstPercent = BigDecimal.valueOf(firstLevelNum)
+                        .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
+                        .doubleValue();
+                String firstPercentStr = df.format(BigDecimal.valueOf(firstPercent).multiply(BigDecimal.valueOf(100))) + "%";
+                firstLevelNumDTO.setPercent(firstPercent);
+                firstLevelNumDTO.setPercentStr(firstPercentStr);
+                NumDTO secondLevelNumDTO = new NumDTO();
+                secondLevelNumDTO.setName("乙级病历");
+                secondLevelNumDTO.setNum(secondLevelNum);
+                secondLevelNumDTO.setTotleNum(totleNum);
+                Double secondPercent = BigDecimal.valueOf(secondLevelNum)
+                        .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
+                        .doubleValue();
+                String secondPercentStr = df.format(BigDecimal.valueOf(secondPercent).multiply(BigDecimal.valueOf(100))) + "%";
+                secondLevelNumDTO.setPercent(secondPercent);
+                secondLevelNumDTO.setPercentStr(secondPercentStr);
+                NumDTO thirdLevelNumDTO = new NumDTO();
+                thirdLevelNumDTO.setName("丙级病历");
+                thirdLevelNumDTO.setNum(thirdLevelNum);
+                thirdLevelNumDTO.setTotleNum(totleNum);
+                Double thirdPercent = BigDecimal.valueOf(thirdLevelNum)
+                        .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
+                        .doubleValue();
+                String thirdPercentStr = df.format(BigDecimal.valueOf(thirdPercent).multiply(BigDecimal.valueOf(100))) + "%";
+                thirdLevelNumDTO.setPercent(thirdPercent);
+                thirdLevelNumDTO.setPercentStr(thirdPercentStr);
+                retList.add(totleNumDTO);
+                retList.add(firstLevelNumDTO);
+                retList.add(secondLevelNumDTO);
+                retList.add(thirdLevelNumDTO);
+                retMap.put(map.get("NAME").toString(), retList);
             }
-            NumDTO totleNumDTO = new NumDTO();
-            totleNumDTO.setName("累计质控病历数");
-            totleNumDTO.setTotleNum(totleNum);
-            totleNumDTO.setNum(totleNum);
-            NumDTO firstLevelNumDTO = new NumDTO();
-            firstLevelNumDTO.setName("甲级病历");
-            firstLevelNumDTO.setNum(firstLevelNum);
-            firstLevelNumDTO.setTotleNum(totleNum);
-            Double firstPercent = BigDecimal.valueOf(firstLevelNum)
-                    .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
-                    .doubleValue();
-            String firstPercentStr = df.format(BigDecimal.valueOf(firstPercent).multiply(BigDecimal.valueOf(100))) + "%";
-            firstLevelNumDTO.setPercent(firstPercent);
-            firstLevelNumDTO.setPercentStr(firstPercentStr);
-            NumDTO secondLevelNumDTO = new NumDTO();
-            secondLevelNumDTO.setName("乙级病历");
-            secondLevelNumDTO.setNum(secondLevelNum);
-            secondLevelNumDTO.setTotleNum(totleNum);
-            Double secondPercent = BigDecimal.valueOf(secondLevelNum)
-                    .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
-                    .doubleValue();
-            String secondPercentStr = df.format(BigDecimal.valueOf(secondPercent).multiply(BigDecimal.valueOf(100))) + "%";
-            secondLevelNumDTO.setPercent(secondPercent);
-            secondLevelNumDTO.setPercentStr(secondPercentStr);
-            NumDTO thirdLevelNumDTO = new NumDTO();
-            thirdLevelNumDTO.setName("丙级病历");
-            thirdLevelNumDTO.setNum(thirdLevelNum);
-            thirdLevelNumDTO.setTotleNum(totleNum);
-            Double thirdPercent = BigDecimal.valueOf(thirdLevelNum)
-                    .divide(BigDecimal.valueOf(totleNum), 4, RoundingMode.HALF_UP)
-                    .doubleValue();
-            String thirdPercentStr = df.format(BigDecimal.valueOf(thirdPercent).multiply(BigDecimal.valueOf(100))) + "%";
-            thirdLevelNumDTO.setPercent(thirdPercent);
-            thirdLevelNumDTO.setPercentStr(thirdPercentStr);
-            retList.add(totleNumDTO);
-            retList.add(firstLevelNumDTO);
-            retList.add(secondLevelNumDTO);
-            retList.add(thirdLevelNumDTO);
-            retMap.put(deptName, retList);
         }
         return retMap;
     }

+ 50 - 1
src/main/java/com/diagbot/facade/QcModuleInfoFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.QcModuleDetailDTO;
@@ -13,6 +14,7 @@ import com.diagbot.service.impl.QcModuleInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleMapVO;
 import com.diagbot.vo.QuestionIdsVO;
@@ -38,6 +40,8 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
     QcModuleDetailFacade qcModuleDetailFacade;
     @Autowired
     QcQuestionFacade qcQuestionFacade;
+    @Autowired
+    SysHospitalSetFacade sysHospitalSetFacade;
 
     /**
      * 根据id获取模板信息
@@ -95,10 +99,55 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
             return new HashMap<>();
         }
         GetModuleInfoOneVO getModuleInfoOneVO = new GetModuleInfoOneVO();
+        String pageShowFlag = sysHospitalSetFacade.getValue(getModuleMapVO.getHospitalId(), "page_show_flag");
+        String pageShowConfig = sysHospitalSetFacade.getValue(getModuleMapVO.getHospitalId(), "page_show_config");
         for (Long id : ids) {
             getModuleInfoOneVO.setModuleId(id);
-            res.put(id, getByIdFac(getModuleInfoOneVO));
+            GetModuleInfoOneDTO oneDTO = getByIdFac(getModuleInfoOneVO);
+            //原文书(超链接)配置
+            originalDocumentConfigure(oneDTO, pageShowFlag, pageShowConfig, getModuleMapVO.getHospitalId());
+            res.put(id, oneDTO);
         }
         return res;
     }
+
+    private void originalDocumentConfigure(GetModuleInfoOneDTO oneDTO, String pageShowFlag, String pageShowConfig, Long hospitalId) {
+        if (StringUtil.isNotEmpty(pageShowFlag) && StringUtil.isNotEmpty(pageShowConfig)) {
+            JSONObject pageShowFlagJSON = JSONObject.parseObject(pageShowFlag);
+            JSONObject pageShowConfigJSON = JSONObject.parseObject(pageShowConfig);
+            try {
+                if (pageShowFlagJSON.containsKey(oneDTO.getModeId().toString())) {
+                    if (pageShowFlagJSON.getBoolean(oneDTO.getModeId().toString())) {
+                        QcModuleDetailDTO qcModuleDetailDTO = createQcModuleDetailDTO(pageShowConfigJSON, hospitalId, oneDTO.getModeId());
+                        oneDTO.getModuleDetail().get(0).add(0,qcModuleDetailDTO);
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private QcModuleDetailDTO createQcModuleDetailDTO(JSONObject pageShowConfigJSON, Long hospitalId, Long modeId) {
+        QcModuleDetailDTO qcModuleDetailDTO = new QcModuleDetailDTO();
+        QuestionDTO questionDTO = new QuestionDTO();
+        qcModuleDetailDTO.setQuestionId(modeId*-1);
+        qcModuleDetailDTO.setGroupId(pageShowConfigJSON.getInteger("groupId"));
+
+        questionDTO.setId(modeId*-1);
+        questionDTO.setName("");
+        questionDTO.setVal(pageShowConfigJSON.getString("val"));
+        questionDTO.setTagName("");
+        questionDTO.setControlType(pageShowConfigJSON.getInteger("controlType"));
+        questionDTO.setTagType(pageShowConfigJSON.getInteger("tagType"));
+        questionDTO.setHospitalId(hospitalId);
+        questionDTO.setModeId(modeId);
+        questionDTO.setRetract(pageShowConfigJSON.getInteger("retract"));
+        questionDTO.setAddLine(pageShowConfigJSON.getInteger("addLine"));
+        questionDTO.setMonoLine(pageShowConfigJSON.getInteger("monoLine"));
+        questionDTO.setBold(pageShowConfigJSON.getInteger("bold"));
+        questionDTO.setPosition(pageShowConfigJSON.getInteger("position"));
+        qcModuleDetailDTO.setQuestionDTO(questionDTO);
+        return qcModuleDetailDTO;
+    }
 }

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

@@ -89,6 +89,8 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      */
     public List<NumDTO> resultCountByDept(QcresultFilterVO qcresultFilterVO);
 
+    public List<Map<String,Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO);
+
     /**
      * 各模块缺陷占比-按科室
      *

+ 3 - 0
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -17,6 +17,7 @@ import com.diagbot.vo.QcresultFilterVO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -86,6 +87,8 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      */
     public List<NumDTO> resultCountByDept(QcresultFilterVO qcresultFilterVO);
 
+    public  List<Map<String,Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO);
+
     /**
      * 各模块缺陷占比-按科室
      *

+ 4 - 0
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -113,6 +113,10 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public List<NumDTO> resultCountByDept(QcresultFilterVO qcresultFilterVO) {
         return baseMapper.resultCountByDept(qcresultFilterVO);
     }
+    @Override
+    public List<Map<String,Object>> resultMrCountByDept(QcresultFilterVO qcresultFilterVO){
+        return baseMapper.resultMrCountByDept(qcresultFilterVO);
+    }
 
     /**
      * 各模块缺陷占比-按科室

+ 1 - 1
src/main/resources/application-dev.yml

@@ -59,7 +59,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.237:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.237:3307/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: lantone
       # 连接池的配置信息

+ 1 - 1
src/main/resources/application-local.yml

@@ -59,7 +59,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.237:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.237:3307/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: lantone
       # 连接池的配置信息

+ 3 - 3
src/main/resources/application-pro.yml

@@ -59,7 +59,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.125:3308/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.129:3307/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: LangT0ng@122lt
       # 连接池的配置信息
@@ -111,8 +111,8 @@ spring:
     database:
       cache: 8 # cache索引
       token: 8 # Token索引
-    host: 192.168.2.125  #Redis服务器地址
-    port: 63791 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
+    host: 192.168.2.129  #Redis服务器地址
+    port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce:
       pool:

+ 1 - 1
src/main/resources/application-test.yml

@@ -59,7 +59,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.126:3307/qc_xy?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.126:3307/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: Lat0ne@tesT
       # 连接池的配置信息

+ 57 - 1
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -1040,7 +1040,7 @@
         SELECT
         a.beh_dept_id AS id,
         a.beh_dept_name AS NAME,
-        COUNT(*) AS num
+        COUNT(distinct a.behospital_code) AS num
         FROM
         med_behospital_info a,
         med_qcresult_info c,
@@ -1090,6 +1090,62 @@
         a.beh_dept_name
     </select>
 
+
+    <!-- 按科室统计质控病历数 -->
+    <select id="resultMrCountByDept" parameterType="com.diagbot.vo.QcresultFilterVO" resultType="java.util.Map">
+        SELECT
+        a.beh_dept_id AS id,
+        a.beh_dept_name AS NAME,
+        COUNT(distinct a.behospital_code) AS num,
+        COUNT(distinct case when c.level ='甲' then a.behospital_code end) AS firNum,
+        COUNT(distinct case when c.level ='乙' then a.behospital_code end) AS secNum,
+        COUNT(distinct case when c.level ='丙' then a.behospital_code end) AS thrNum
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c,
+        sys_user_dept 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.beh_dept_id = d.dept_id
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="userId!=null">
+            AND d.user_id = #{userId}
+        </if>
+        <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>
+        <if test="gradeType != null and gradeType != ''">
+            AND c.grade_type = #{gradeType}
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name
+    </select>
+
     <!-- 按模块统计质控缺陷数 -->
     <select id="entryCountGroupByCaseAndDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
         SELECT