|
@@ -146,12 +146,30 @@ public class TreatmentFacade {
|
|
|
|
|
|
//不良反应
|
|
|
List<AdverseReaction> adverseReactionList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "adverseEvent", AdverseReaction.class);
|
|
|
+ List<String> adNameList = adverseReactionList.stream().map(adverseReaction -> adverseReaction.getName()).collect(Collectors.toList());
|
|
|
+ List<QuestionInfo> adList = getTopQuestionList(adNameList, QuestionTypeEnum.AdverseReaction.getKey());
|
|
|
+ Map<String, QuestionInfo> adMap = EntityUtil.makeEntityMap(adList, "tagName");
|
|
|
+ List<Long> adIds = adList.stream().map(ad -> ad.getId()).collect(Collectors.toList());
|
|
|
+ List<IntroduceMap> adIntroduceMapList = getIntroduceMapList(adIds, QuestionTypeEnum.AdverseReaction.getKey());
|
|
|
+ Map<Long, IntroduceMap> adIntroduceMapMap = EntityUtil.makeEntityMap(adIntroduceMapList, "questionId");
|
|
|
+ for (AdverseReaction adverseReaction : adverseReactionList) {
|
|
|
+ adverseReaction.setTagName(adverseReaction.getName());
|
|
|
+ if (null != adMap && adMap.size() > 0) {
|
|
|
+ QuestionInfo adInfo = adMap.get(adverseReaction.getName());
|
|
|
+ if (adInfo != null) {
|
|
|
+ adverseReaction.setId(adInfo.getId());
|
|
|
+ }
|
|
|
+ IntroduceMap adIntorduceMap = adIntroduceMapMap.get(adInfo.getId());
|
|
|
+ if (adIntorduceMap != null) {
|
|
|
+ adverseReaction.setShowInfo("1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
retMap.put("adverseReactions", adverseReactionList);
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 根据展示位置获取提示信息明细列表
|
|
|
*
|
|
@@ -181,7 +199,7 @@ public class TreatmentFacade {
|
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.in("tag_name", tagNameList)
|
|
|
- .eq("sub_type", 0)
|
|
|
+ //.eq("sub_type", 0)
|
|
|
.eq("type", type);
|
|
|
List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
return questionInfoList;
|