소스 검색

显示info信息

zhoutg 5 년 전
부모
커밋
7075367c37

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

@@ -21,6 +21,8 @@ public class MsgDTO {
     private BigDecimal score;
     //提示信息
     private String msg;
+    //提示信息
+    private String info;
     //标准提示信息
     private String standardMsg;
     //单项否决

+ 7 - 140
src/main/java/com/diagbot/entity/QcresultDetail.java

@@ -3,6 +3,7 @@ package com.diagbot.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -18,6 +19,7 @@ import java.util.Date;
  * @since 2020-04-14
  */
 @TableName("med_qcresult_detail")
+@Data
 public class QcresultDetail implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -60,6 +62,11 @@ public class QcresultDetail implements Serializable {
      */
     private String msg;
 
+    /**
+     * 质控返回提示信息
+     */
+    private String info;
+
     /**
      * 单项否决(1-单项否决 0-非)
      */
@@ -94,144 +101,4 @@ public class QcresultDetail implements Serializable {
      * 备注
      */
     private String remark;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getHospitalId() {
-        return hospitalId;
-    }
-
-    public void setHospitalId(Long hospitalId) {
-        this.hospitalId = hospitalId;
-    }
-
-    public String getBehospitalCode() {
-        return behospitalCode;
-    }
-
-    public void setBehospitalCode(String behospitalCode) {
-        this.behospitalCode = behospitalCode;
-    }
-
-    public Long getCasesId() {
-        return casesId;
-    }
-
-    public void setCasesId(Long casesId) {
-        this.casesId = casesId;
-    }
-
-    public BigDecimal getCasesScore() {
-        return casesScore;
-    }
-
-    public void setCasesScore(BigDecimal casesScore) {
-        this.casesScore = casesScore;
-    }
-
-    public Long getCasesEntryId() {
-        return casesEntryId;
-    }
-
-    public void setCasesEntryId(Long casesEntryId) {
-        this.casesEntryId = casesEntryId;
-    }
-
-    public BigDecimal getScore() {
-        return score;
-    }
-
-    public void setScore(BigDecimal score) {
-        this.score = score;
-    }
-
-    public String getMsg() {
-        return msg;
-    }
-
-    public void setMsg(String msg) {
-        this.msg = msg;
-    }
-
-    public Integer getIsReject() {
-        return isReject;
-    }
-
-    public void setIsReject(Integer isReject) {
-        this.isReject = isReject;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "QcresultDetail{" +
-                "id=" + id +
-                ", hospitalId=" + hospitalId +
-                ", behospitalCode=" + behospitalCode +
-                ", casesId=" + casesId +
-                ", casesScore=" + casesScore +
-                ", casesEntryId=" + casesEntryId +
-                ", score=" + score +
-                ", isReject=" + isReject +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", remark=" + remark +
-                "}";
-    }
 }

+ 38 - 22
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -23,7 +23,6 @@ import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.entity.HomeDiagnoseInfo;
 import com.diagbot.entity.HomeOperationInfo;
 import com.diagbot.entity.HomePage;
-import com.diagbot.entity.QcCasesEntryPagedata;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -34,6 +33,7 @@ import com.diagbot.util.EncrypDES;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.MapUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.AlgorithmVO;
 import com.diagbot.vo.AnalyzeApiVO;
@@ -53,6 +53,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -168,22 +169,22 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             AnalyzeVO analyzeVO = new AnalyzeVO();
             BeanUtil.copyProperties(getDetailVO, analyzeVO);
             List<MsgDTO> msgDTOList = getMsg(analyzeVO);
-            List<Long> caseEntryId = msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList());
-            if (ListUtil.isNotEmpty(caseEntryId)) {
-                List<QcCasesEntryPagedata> qcCasesEntryPagedataList = qcCasesEntryPagedataFacade.list(new QueryWrapper<QcCasesEntryPagedata>()
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", hospitalId)
-                        .in("cases_entry_id", caseEntryId)
-                );
-                Map<Long, List<QcCasesEntryPagedata>> pageKey = EntityUtil.makeEntityListMap(qcCasesEntryPagedataList, "casesEntryId");
-                for (MsgDTO msgDTO : msgDTOList) {
-                    List<QcCasesEntryPagedata> pagedata = pageKey.get(msgDTO.getCasesEntryId());
-                    if (ListUtil.isNotEmpty(pagedata)) {
-                        msgDTO.setPageKeyList(pagedata.stream().map(r -> r.getPageKey()).collect(Collectors.toList()));
-                    }
-                }
-            }
-
+            // 前端直接匹配,不从数据库获取
+//            List<Long> caseEntryId = msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList());
+//            if (ListUtil.isNotEmpty(caseEntryId)) {
+//                List<QcCasesEntryPagedata> qcCasesEntryPagedataList = qcCasesEntryPagedataFacade.list(new QueryWrapper<QcCasesEntryPagedata>()
+//                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+//                        .eq("hospital_id", hospitalId)
+//                        .in("cases_entry_id", caseEntryId)
+//                );
+//                Map<Long, List<QcCasesEntryPagedata>> pageKey = EntityUtil.makeEntityListMap(qcCasesEntryPagedataList, "casesEntryId");
+//                for (MsgDTO msgDTO : msgDTOList) {
+//                    List<QcCasesEntryPagedata> pagedata = pageKey.get(msgDTO.getCasesEntryId());
+//                    if (ListUtil.isNotEmpty(pagedata)) {
+//                        msgDTO.setPageKeyList(pagedata.stream().map(r -> r.getPageKey()).collect(Collectors.toList()));
+//                    }
+//                }
+//            }
             Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
             res.put("msg", msgMap);
         }
@@ -317,12 +318,28 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         //根据质控结果获取质控条目
         QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
         List<String> codeList = new ArrayList<>();
-        for (Map.Entry<String, Map<String, String>> output : outputInfo.getResult().entrySet()) {
-            codeList.add(output.getKey());
+        // code和info的映射map
+        Map<String, String> codeToInfoMap = new LinkedHashMap<>();
+        Map<String, Map<String, String>> codeMap = outputInfo.getResult();
+        for (String key : codeMap.keySet()) {
+            codeList.add(key);
+            Map<String, String> mapInfo = codeMap.get(key);
+            if (mapInfo != null && StringUtil.isNotBlank(mapInfo.get("info"))) {
+                codeToInfoMap.put(key, mapInfo.get("info"));
+            }
         }
         qcResultAlgQueryVO.setCodeList(codeList);
         qcResultAlgQueryVO.setHospitalId(hospitalId);
         List<QcResultAlgVO> qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
+
+        // 对info赋值
+        for(QcResultAlgVO bean : qcResultAlgVOList) {
+            String info = codeToInfoMap.get(bean.getCode());
+            if (StringUtil.isNotBlank(info)) {
+                bean.setInfo(info);
+            }
+        }
+
         // 评分
         AlgorithmVO algorithmVO = new AlgorithmVO();
         algorithmVO.setType(0);
@@ -338,9 +355,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask());
 
         // 返回提示信息
-        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
-        Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
-
+//        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
+//        Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
 
         //返回参数组装
         AnalyzeDTO analyzeDTO = new AnalyzeDTO();

+ 4 - 0
src/main/java/com/diagbot/vo/QcResultAlgVO.java

@@ -25,6 +25,10 @@ public class QcResultAlgVO {
     private BigDecimal score;
     //条目提示信息
     private String msg;
+    //code
+    private String code;
+    //质控返回info
+    private String info;
     //单项否决(1-单项否决 0-非)
     private Integer isReject;
 }

+ 15 - 0
src/main/java/com/diagbot/vo/QuestionVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class QuestionVO {
+    private Long id;
+}

+ 1 - 1
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -77,7 +77,7 @@
     </select>
 
     <select id="getMsg" resultType="com.diagbot.dto.MsgDTO">
-        SELECT b.`name` model_name,c.score,c.msg,c.cases_entry_id,c.is_reject,c.id id,
+        SELECT 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
         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'

+ 2 - 1
src/main/resources/mapper/QcCasesEntryMapper.xml

@@ -55,7 +55,8 @@
             t1.cases_entry_id AS casesEntryId,
             t1.score AS score,
             t1.msg AS msg,
-            t1.is_reject AS isReject
+            t1.is_reject AS isReject,
+            t2.code
         FROM
             qc_cases_entry_hospital t1,
             qc_cases_entry t2,