|
@@ -6,7 +6,7 @@ import com.diagbot.dto.ConceptWithOrderRes;
|
|
|
import com.diagbot.dto.PartDTO;
|
|
|
import com.diagbot.dto.PartSymptomDTO;
|
|
|
import com.diagbot.entity.Concept;
|
|
|
-import com.diagbot.entity.ConceptDetail;
|
|
|
+import com.diagbot.entity.KlSymptom;
|
|
|
import com.diagbot.entity.Symptom;
|
|
|
import com.diagbot.entity.wrapper.ConceptWrapper;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
@@ -21,9 +21,8 @@ import com.diagbot.vo.PartSymptomVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.lang.reflect.Field;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -42,6 +41,8 @@ public class PartFacade {
|
|
|
ConceptDetailFacade conceptDetailFacade;
|
|
|
@Autowired
|
|
|
private CryptConfiguer cryptConfiguer;
|
|
|
+ @Autowired
|
|
|
+ KlSymptomFacade klSymptomFacade;
|
|
|
|
|
|
/**
|
|
|
* 根据已选部位返回对应的症状
|
|
@@ -79,6 +80,14 @@ public class PartFacade {
|
|
|
.in("lib_name", partList)
|
|
|
);
|
|
|
|
|
|
+ // 正常数据有2条,将全身区域放到最下面
|
|
|
+ String areaStr = cryptConfiguer.cryptFlag ?
|
|
|
+ CryptUtil.encrypt_char( "全身区域") : "全身区域";
|
|
|
+ if (ListUtil.isNotEmpty(conceptList) && conceptList.size() == 2
|
|
|
+ && areaStr.equals(conceptList.get(0).getLibName())) {
|
|
|
+ Collections.reverse(conceptList);
|
|
|
+ }
|
|
|
+
|
|
|
// 设置部位区域
|
|
|
for (Concept c : conceptList) {
|
|
|
PartSymptomDTO partSymptomDTO = new PartSymptomDTO();
|
|
@@ -124,14 +133,14 @@ public class PartFacade {
|
|
|
List<ConceptWithOrderRes> symptomList = conceptFacade.getConceptWithOrder(wrapper);
|
|
|
Map<Long, List<ConceptWithOrderRes>> symptomMap = EntityUtil.makeEntityListMap(symptomList, "startId");
|
|
|
|
|
|
- // 获取症状的简述信息
|
|
|
- List<ConceptDetail> conceptDetailList = conceptDetailFacade.list(
|
|
|
- new QueryWrapper<ConceptDetail>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("concept_id", symptomList.stream().map(row -> row.getEndId()).distinct().collect(Collectors.toList()))
|
|
|
- .apply("find_in_set({0},position)", 7));
|
|
|
- Map<Long, String> descMap = conceptDetailList.stream().collect(Collectors.toMap(row -> row.getConceptId(), row -> row.getText()));
|
|
|
|
|
|
+ // TODO 获取症状的简述信息
|
|
|
+ List<KlSymptom> klSymptomList = klSymptomFacade.list(new QueryWrapper<KlSymptom>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("concept_id",
|
|
|
+ symptomList.stream().map(row -> row.getEndId()).distinct().collect(Collectors.toList()))
|
|
|
+ );
|
|
|
+ Map<Long, KlSymptom> descMap = klSymptomList.stream().collect(Collectors.toMap(row -> row.getConceptId(), row -> row));
|
|
|
|
|
|
// 设置部位下的症状
|
|
|
for (PartSymptomDTO partSymptomDTO : res) {
|
|
@@ -146,7 +155,8 @@ public class PartFacade {
|
|
|
bean.setName(conceptWithOrderRes.getEndName());
|
|
|
bean.setPartConceptId(conceptWithOrderRes.getStartId());
|
|
|
if (descMap.get(conceptWithOrderRes.getEndId()) != null) {
|
|
|
- bean.setDesc(descMap.get(conceptWithOrderRes.getEndId()));
|
|
|
+ bean.setDescription(descMap.get(conceptWithOrderRes.getEndId()).getDescription());
|
|
|
+ bean.setExplains(descMap.get(conceptWithOrderRes.getEndId()).getExplains());
|
|
|
}
|
|
|
symptoms.add(bean);
|
|
|
}
|