Explorar o código

修改对外评分接口

songxinlu %!s(int64=3) %!d(string=hai) anos
pai
achega
41ce872d9c

+ 19 - 0
src/main/java/com/diagbot/dto/MsgApiDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -13,6 +14,8 @@ import java.math.BigDecimal;
 @Getter
 @Setter
 public class MsgApiDTO {
+    //明细主键
+    private Long id;
     //得分
     private BigDecimal score;
     //提示信息
@@ -21,4 +24,20 @@ public class MsgApiDTO {
     private String isReject;
     //模块名称
     private String modelName;
+
+    //模块ID
+    private Long casesId;
+    //模块分数
+    private BigDecimal casesScore;
+    // 条目ID
+    private Long casesEntryId;
+
+    @ApiModelProperty("申诉条目id")
+    private Long appealInfoId;
+
+    @ApiModelProperty("审核状态 0:待审核|1:驳回|2:通过")
+    private String exampleStatus;
+
+    @ApiModelProperty(value = "操作类型")
+    private String appealOperationType;
 }

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

@@ -1773,8 +1773,19 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             Map<String, Object> resMap = calScore(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
             algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
         }
-
+        QcresultInfo qcresultInfo = qcresultInfoFacade.getOne(new QueryWrapper<QcresultInfo>()
+                .eq("hospital_id", analyzeVO.getHospitalId())
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+                .eq("is_deleted", IsDeleteEnum.N.getKey()));
+        if (qcresultInfo != null && qcresultInfo.getId() != null) {
+            analyzeVO.setQcresultInfoId(qcresultInfo.getId());
+        }
         List<MsgDTO> msgDTOList = this.getBaseMapper().getForeignMsg(analyzeVO);
+        if (ListUtil.isEmpty(msgDTOList)) {
+            analyzeVO.setQcresultInfoId(null);
+            msgDTOList = this.getBaseMapper().getForeignMsg(analyzeVO);
+        }
+
         if (ListUtil.isNotEmpty(msgDTOList)) {
             msgDTOList.forEach(msgDTO -> {
                 if (StringUtils.isNotEmpty(msgDTO.getInfo()) && StringUtils.isNotEmpty(msgDTO.getInfo().trim()) &&

+ 79 - 17
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -707,7 +707,9 @@
         c.is_deleted,
         c.explain_info AS explainInfo,
         a.type,
-        a.drgs
+        a.drgs,
+        c.hospital_id,
+        c.behospital_code
         FROM
         `qc_cases_entry` a,
         qc_mode b,
@@ -736,7 +738,9 @@
         LEFT JOIN (
         SELECT
         appeal.id,
-        appeal.qcresult_detail_id,
+        appeal.cases_entry_id,
+        appeal.behospital_code,
+        appeal.hospital_id,
         appeal.appeal_operation_type,
         examine.example_status
         FROM
@@ -744,26 +748,84 @@
         JOIN med_appeal_examine_info examine ON examine.appeal_info_id = appeal.id
         WHERE
         appeal.is_deleted = 'N'
-        ) appeal ON a.id = appeal.qcresult_detail_id
+        ) appeal ON a.cases_entry_id = appeal.cases_entry_id
+        AND a.hospital_id = appeal.hospital_id
+        AND a.behospital_code = appeal.behospital_code
     </select>
 
     <select id="getForeignMsg" resultType="com.diagbot.dto.MsgDTO">
-        SELECT a.*, u.linkman
+        SELECT
+        a.*, u.linkman,
+        appeal.id appealInfoId,
+        appeal.appeal_operation_type appealOperationType,
+        appeal.example_status exampleStatus
         FROM
         (
-        SELECT DISTINCT b.`name` model_name,c.score,c.msg,c.cases_entry_id,c.is_reject,c.id id,c.info, a.cases_id cases_id, d.score cases_score,
-        b.id model_id, a.name standard_msg, c.opt_type, c.grade_type,
-         c.gmt_create, c.gmt_modified, c.modifier,c.is_deleted,c.explain_info as explainInfo,
-        a.type, a.drgs
-        FROM
-        `qc_cases_entry` a, qc_mode b, med_qcresult_detail c, qc_cases_hospital d
-        where a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N' and d.is_deleted = 'N'
-        and a.id = c.cases_entry_id and a.mode_id = b.id
-        AND c.cases_id = d.cases_id and c.hospital_id = d.hospital_id
-        and c.hospital_id = #{hospitalId}
-        and c.behospital_code = #{behospitalCode}
-        order by b.order_no, c.grade_type desc, a.order_no) a
-        LEFT JOIN sys_user u  on u.id = a.modifier  and u.is_deleted = 'N'
+        SELECT DISTINCT
+        b.`name` model_name,
+        c.score,
+        c.msg,
+        c.cases_entry_id,
+        c.is_reject,
+        c.id id,
+        c.info,
+        a.cases_id cases_id,
+        d.score cases_score,
+        b.id model_id,
+        a. NAME standard_msg,
+        c.opt_type,
+        c.grade_type,
+        c.gmt_create,
+        c.gmt_modified,
+        c.modifier,
+        c.is_deleted,
+        c.explain_info AS explainInfo,
+        a.type,
+        a.drgs,
+        c.hospital_id,
+        c.behospital_code
+        FROM
+        `qc_cases_entry` a,
+        qc_mode b,
+        med_qcresult_detail c,
+        qc_cases_hospital d
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.id = c.cases_entry_id
+        AND a.mode_id = b.id
+        AND c.cases_id = d.cases_id
+        AND c.hospital_id = d.hospital_id
+        AND c.hospital_id = #{hospitalId}
+        <if test="qcresultInfoId != null">
+            AND c.qcresult_info_id = #{qcresultInfoId}
+        </if>
+        AND c.behospital_code = #{behospitalCode}
+        ORDER BY
+        b.order_no,
+        c.grade_type DESC,
+        a.order_no
+        ) a
+        LEFT JOIN sys_user u ON u.id = a.modifier
+        AND u.is_deleted = 'N'
+        LEFT JOIN (
+        SELECT
+        appeal.id,
+        appeal.cases_entry_id,
+        appeal.behospital_code,
+        appeal.hospital_id,
+        appeal.appeal_operation_type,
+        examine.example_status
+        FROM
+        med_appeal_info appeal
+        JOIN med_appeal_examine_info examine ON examine.appeal_info_id = appeal.id
+        WHERE
+        appeal.is_deleted = 'N'
+        ) appeal ON a.cases_entry_id = appeal.cases_entry_id
+        AND a.hospital_id = appeal.hospital_id
+        AND a.behospital_code = appeal.behospital_code
     </select>