Explorar el Código

Merge remote-tracking branch 'origin/dev/20200603_1.3.1' into test

zhaops hace 5 años
padre
commit
7791ae52bf

+ 10 - 2
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -403,12 +403,20 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("behospital_code", analyzeVO.getBehospitalCode())
                 .eq("hospital_id", hospitalId)
-                .in("mode_id", Arrays.asList(53, 54))
+                .in("mode_id", Arrays.asList(53, 54, 16))
                 .orderByAsc("rec_date")
         );
         List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
         Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
-        pageMap.put("知情同意书", recordMap.get(53L));
+        List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
+        if (recordMap.get(53L) != null) {
+            recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
+        }
+        if (recordMap.get(16L) != null) {
+            recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
+        }
+        // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
+        pageMap.put("知情同意书", recordDTOList);
         pageMap.put("谈话告知书", recordMap.get(54L));
 
         String pageData = JSON.toJSONString(pageMap);

+ 4 - 1
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -498,6 +498,9 @@ public class ConsoleByDeptFacade {
                 filterPageByDeptVO.setDeptName(deptList.get(0).getDeptName());
             }
         }
+        if (filterPageByDeptVO.getDeptName().equals(filterPageByDeptVO.getDoctorName())) {
+            filterPageByDeptVO.setDoctorName("");
+        }
         filterPageByDeptVOSet(filterPageByDeptVO);
         IPage<DeptEntryNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryAndDeptPage(filterPageByDeptVO);
         return page;
@@ -718,7 +721,7 @@ public class ConsoleByDeptFacade {
         String errorPercentStr
                 = df.format(BigDecimal.valueOf(errorPercent).multiply(BigDecimal.valueOf(100))) + "%";
 
-        item.setDeptName(deptName);
+        item.setDoctorName(deptName);
         item.setEntryNum(entryNum);
         item.setMrNum(mrNum);
         item.setTotleValue(totleValue);

+ 3 - 0
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -467,6 +467,9 @@ public class ConsoleFacade {
      */
     public IPage<EntryNumDTO> entryCountGroupByEntryPage(FilterPageVO filterPageVO) {
         filterPageVOSet(filterPageVO);
+        if (filterPageVO.getDeptName().equals("全院")) {
+            filterPageVO.setDeptName("");
+        }
         IPage<EntryNumDTO> page = qcresultInfoFacade.entryCountGroupByEntryPage(filterPageVO);
         return page;
     }

+ 24 - 9
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -1662,8 +1662,8 @@
         FROM
         (
         SELECT
-        a.doctor_id AS doctorId,
-        a.doctor_name AS doctorName,
+        CASE WHEN a.doctor_id is NULL OR a.doctor_id ='' THEN '未知' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN a.doctor_name is NULL OR a.doctor_name ='' THEN '未知' ELSE a.doctor_name END AS doctorName,
         count( DISTINCT a.behospital_code ) AS mrNum,
         ROUND( sum( CAST( c.score_res AS DECIMAL ( 18, 2 )) ), 2 ) AS totleValue,
         ROUND( sum( CAST( c.score_res AS DECIMAL ( 18, 2 )) )/ count(*), 2 ) AS averageValue,
@@ -1706,7 +1706,12 @@
             and c.level = #{level}
         </if>
         <if test="name != null and name != ''">
-            and a.doctor_name like CONCAT('%',#{name},'%')
+            <if test="name == '未知'">
+                and (a.doctor_name is null or a.doctor_name='')
+            </if>
+            <if test="name != '未知'">
+                and a.doctor_name like CONCAT('%',#{name},'%')
+            </if>
         </if>
         <if test="userId!=null and userId !=''">
             AND f.user_id = #{userId}
@@ -1720,8 +1725,8 @@
         ) t1,
         (
         SELECT
-        a.doctor_id AS doctorId,
-        a.doctor_name AS doctorName,
+        CASE WHEN a.doctor_id is NULL OR a.doctor_id ='' THEN '未知' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN a.doctor_name is NULL OR a.doctor_name ='' THEN '未知' ELSE a.doctor_name END AS doctorName,
         count( * ) AS entryNum
         FROM
         med_behospital_info a,
@@ -1759,7 +1764,12 @@
             and c.level = #{level}
         </if>
         <if test="name != null and name != ''">
-            and a.doctor_name like CONCAT('%',#{name},'%')
+            <if test="name == '未知'">
+                and (a.doctor_name is null or a.doctor_name='')
+            </if>
+            <if test="name != '未知'">
+                and a.doctor_name like CONCAT('%',#{name},'%')
+            </if>
         </if>
         <if test="userId!=null and userId !=''">
             AND f.user_id = #{userId}
@@ -1786,8 +1796,8 @@
         FROM
         (
         SELECT
-        a.doctor_id AS doctorId,
-        a.doctor_name AS doctorName,
+        CASE WHEN a.doctor_id is NULL OR a.doctor_id ='' THEN '未知' ELSE a.doctor_id END AS doctorId,
+        CASE WHEN a.doctor_name is NULL OR a.doctor_name ='' THEN '未知' ELSE a.doctor_name END AS doctorName,
         sum( d.rule_type = 1 ) AS emptyNum,
         round( sum( d.rule_type = 2 )/ 2, 0 ) AS errorNum,
         count( DISTINCT a.behospital_code ) AS mrNum
@@ -1826,7 +1836,12 @@
             and b.level = #{level}
         </if>
         <if test="name != null and name != ''">
-            and a.doctor_name like CONCAT('%',#{name},'%')
+            <if test="name == '未知'">
+                and (a.doctor_name is null or a.doctor_name='')
+            </if>
+            <if test="name != '未知'">
+                and a.doctor_name like CONCAT('%',#{name},'%')
+            </if>
         </if>
         <if test="userId!=null and userId !=''">
             AND e.user_id = #{userId}

+ 26 - 15
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -149,7 +149,8 @@
         a.beh_dept_id,
         a.beh_dept_name
         ORDER  BY
-        percent DESC
+        percent DESC,
+        a.beh_dept_name ASC
     </select>
 
     <!-- 按模块统计质控缺陷数 -->
@@ -289,7 +290,7 @@
         e.cases_name AS casesName,
         count(*) AS num,
         f.score,
-        f.is_reject AS isReject
+        d.is_reject AS isReject
         FROM
         med_behospital_info a,
         med_qcresult_info c,
@@ -328,7 +329,7 @@
             AND e.cases_name = #{filterPageVO.casesName}
         </if>
         <if test="filterPageVO.isReject != null">
-            AND f.is_reject = #{filterPageVO.isReject}
+            AND d.is_reject = #{filterPageVO.isReject}
         </if>
         GROUP BY
         e.id,
@@ -384,7 +385,7 @@
         e.cases_name AS casesName,
         count(*) AS num,
         f.score,
-        f.is_reject AS isReject
+        d.is_reject AS isReject
         FROM
         med_behospital_info a,
         med_qcresult_info c,
@@ -406,7 +407,7 @@
         AND d.cases_entry_id = e.id
         AND e.id = f.cases_entry_id
         AND a.is_placefile = '1'
-        AND f.is_reject = 1
+        AND d.is_reject = 1
         <![CDATA[AND a.qc_type_id <>0 ]]>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -752,7 +753,7 @@
         e.cases_name AS casesName,
         count(*) AS num,
         g.score,
-        g.is_reject AS isReject
+        d.is_reject AS isReject
         FROM
         med_behospital_info a,
         med_qcresult_info c,
@@ -801,7 +802,7 @@
             AND e.cases_name = #{filterPageByDeptVO.casesName}
         </if>
         <if test="filterPageByDeptVO.isReject != null">
-            AND g.is_reject = #{filterPageByDeptVO.isReject}
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         GROUP BY
         e.id,
@@ -997,7 +998,7 @@
         e.cases_id as casesId,
         e.cases_name as casesName,
         e.rule_type as ruleType,
-        f.is_reject as isReject
+        d.is_reject as isReject
         FROM
         med_behospital_info a,
         <if test="filterPageVO.casesId != null and filterPageVO.casesId ==243">
@@ -1053,7 +1054,7 @@
             AND e.rule_type = #{filterPageVO.ruleType}
         </if>
         <if test="filterPageVO.isReject != null">
-            AND f.is_reject = #{filterPageVO.isReject}
+            AND d.is_reject = #{filterPageVO.isReject}
         </if>
         ) t1,(
         SELECT
@@ -1113,7 +1114,7 @@
             AND e.rule_type = #{filterPageVO.ruleType}
         </if>
         <if test="filterPageVO.isReject != null">
-            AND f.is_reject = #{filterPageVO.isReject}
+            AND d.is_reject = #{filterPageVO.isReject}
         </if>
         ) t2
         GROUP BY
@@ -1374,7 +1375,7 @@
         e.cases_id as casesId,
         e.cases_name as casesName,
         e.rule_type as ruleType,
-        g.is_reject as isReject,
+        d.is_reject as isReject,
         a.beh_dept_id AS deptId,
         a.beh_dept_name AS deptName
         FROM
@@ -1436,13 +1437,18 @@
             AND a.beh_dept_name like CONCAT('%', #{filterPageByDeptVO.deptName},'%')
         </if>
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
-            AND a.doctor_name like CONCAT('%', #{filterPageByDeptVO.doctorName},'%')
+            <if test="filterPageByDeptVO.doctorName=='未知'">
+                AND (a.doctor_name is null OR a.doctor_name='')
+            </if>
+            <if test="filterPageByDeptVO.doctorName!='未知'">
+                AND a.doctor_name like CONCAT('%', #{filterPageByDeptVO.doctorName},'%')
+            </if>
         </if>
         <if test="filterPageByDeptVO.ruleType != null ">
             AND e.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         <if test="filterPageByDeptVO.isReject != null ">
-            AND g.is_reject = #{filterPageByDeptVO.isReject}
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         ) t1,(
         SELECT
@@ -1506,13 +1512,18 @@
             AND a.beh_dept_name like CONCAT('%', #{filterPageByDeptVO.deptName},'%')
         </if>
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
-        AND a.doctor_name like CONCAT('%', #{filterPageByDeptVO.doctorName},'%')
+            <if test="filterPageByDeptVO.doctorName=='未知'">
+                AND (a.doctor_name is null OR a.doctor_name='')
+            </if>
+            <if test="filterPageByDeptVO.doctorName!='未知'">
+                AND a.doctor_name like CONCAT('%', #{filterPageByDeptVO.doctorName},'%')
+            </if>
         </if>
         <if test="filterPageByDeptVO.ruleType != null ">
             AND e.rule_type = #{filterPageByDeptVO.ruleType}
         </if>
         <if test="filterPageByDeptVO.isReject != null">
-            AND g.is_reject = #{filterPageByDeptVO.isReject}
+            AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>
         ) t2
         GROUP BY