瀏覽代碼

治疗方案

Zhaops 6 年之前
父節點
當前提交
5d278f258e

+ 16 - 0
icss-service/src/main/java/com/diagbot/dto/IntroduceDetailDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/21 11:28
+ */
+@Getter
+@Setter
+public class IntroduceDetailDTO {
+    private String content;
+    private String text;
+}

+ 13 - 2
icss-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.bean.AdverseReaction;
 import com.diagbot.client.bean.Medicition;
 import com.diagbot.client.bean.MedicitionClass;
+import com.diagbot.dto.IntroduceDetailDTO;
 import com.diagbot.entity.InquiryDrug;
 import com.diagbot.entity.InquiryInfo;
 import com.diagbot.entity.IntroduceDetail;
@@ -16,8 +17,10 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.FastJsonUtils;
+import com.diagbot.util.ListUtil;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -69,11 +72,19 @@ public class TreatmentFacade {
 
         //一般治疗
         List<IntroduceDetail> commonTreatmentDetailList = getIntroduceDetailList(diseaseId, IntroducePositionEnum.CommonTreatment.getKey());
-        retMap.put("commonTreatment", commonTreatmentDetailList.size() > 0 ? commonTreatmentDetailList.get(0).getContent() : "");
+        IntroduceDetailDTO commonDetailDTO = new IntroduceDetailDTO();
+        if (ListUtil.isNotEmpty(commonTreatmentDetailList)) {
+            BeanUtil.copyProperties(commonTreatmentDetailList.get(0), commonDetailDTO);
+        }
+        retMap.put("commonTreatment", commonDetailDTO);
 
         //手术治疗
         List<IntroduceDetail> surgeryTreatmentDetailList = getIntroduceDetailList(diseaseId, IntroducePositionEnum.SurgeryTreatment.getKey());
-        retMap.put("surgeryTreatment", surgeryTreatmentDetailList.size() > 0 ? surgeryTreatmentDetailList.get(0).getContent() : "");
+        IntroduceDetailDTO surgeryDetailDTO = new IntroduceDetailDTO();
+        if (ListUtil.isNotEmpty(surgeryTreatmentDetailList)) {
+            BeanUtil.copyProperties(surgeryTreatmentDetailList.get(0), surgeryDetailDTO);
+        }
+        retMap.put("surgeryTreatment", surgeryDetailDTO);
 
 
         //获取知识图谱治疗方案