|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.client.bean.Medicition;
|
|
|
import com.diagbot.client.bean.MedicitionClass;
|
|
|
+import com.diagbot.dto.IntroduceDetailDTO;
|
|
|
import com.diagbot.entity.IntroduceDetail;
|
|
|
import com.diagbot.entity.IntroduceMap;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
@@ -12,8 +13,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 org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -58,23 +61,25 @@ 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);
|
|
|
//获取知识图谱治疗方案
|
|
|
JSONObject treatmentJson = treatmentMap.get(disease.getTagName());
|
|
|
if (treatmentJson == null || treatmentJson.isEmpty()) {
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
- /*JSONObject treatmentJson = diseaseJson.getJSONObject(disease.getTagName());
|
|
|
- if (treatmentJson == null || treatmentJson.isEmpty()) {
|
|
|
- return retMap;
|
|
|
- }*/
|
|
|
-
|
|
|
List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "treatment", MedicitionClass.class);
|
|
|
|
|
|
List<String> classNameList = drugsList.stream().map(drugs -> drugs.getBigdrugsName()).collect(Collectors.toList());
|