|
@@ -6,6 +6,7 @@ import com.diagbot.entity.QuestionDetail;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.entity.wrapper.QuestionInfoWrapper;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.enums.QuestionTypeEnum;
|
|
|
import com.diagbot.service.impl.QuestionInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
@@ -118,8 +119,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
if (ListUtil.isEmpty(questionIds2VO.getIds())) {
|
|
|
return data;
|
|
|
}
|
|
|
- // TODO 删除
|
|
|
- data.put(0L, "00000000000000");
|
|
|
|
|
|
Map paramMap = new HashMap<>();
|
|
|
paramMap.put("sexType", sexType);
|
|
@@ -129,6 +128,15 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
List<QuestionInfo> questionInfoList = this.getByParam2(paramMap);
|
|
|
List<Long> questionId = questionInfoList.stream().map(r -> r.getId()).collect(Collectors.toList());
|
|
|
|
|
|
+ //获取uniqueName
|
|
|
+ List<QuestionInfo> lisQuestion = questionInfoList.stream().filter(r -> r.getType() == QuestionTypeEnum.Lis.getKey()).collect(Collectors.toList());
|
|
|
+ Map<String, String> proMap = new LinkedHashMap<>();
|
|
|
+ Map<String, Map<String, String>> proDetailMap = new LinkedHashMap<>();
|
|
|
+ if (ListUtil.isNotEmpty(lisQuestion)) {
|
|
|
+ proMap = lisMappingFacade.getLisConfig_EmptyItemName();
|
|
|
+ proDetailMap = lisMappingFacade.getLisMapping_NotEmptyItemName();
|
|
|
+ }
|
|
|
+
|
|
|
// 获取第一层明细项
|
|
|
Map<Long, List<QuestionDetail>> detailMap = getQuestionDetailWithMap(questionInfoList.stream().filter(r -> r.getTagType() == 1).map(r -> r.getId()).collect(Collectors.toList()));
|
|
|
|
|
@@ -179,27 +187,26 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // TODO 优化
|
|
|
- //获取uniqueName
|
|
|
-// if (res != null && res.getType() != null &&
|
|
|
-// QuestionTypeEnum.Lis.getKey() == res.getType().intValue()) {
|
|
|
-// String project = res.getName();
|
|
|
-// List<String> details = new ArrayList<>();
|
|
|
-// if (ListUtil.isNotEmpty(res.getQuestionMapping())) {
|
|
|
-// details = res.getQuestionMapping().stream().map(row -> row.getName()).collect(Collectors.toList());
|
|
|
-// }
|
|
|
-// Map<String, Map<String, String>> map = lisMappingFacade.getLisMappingByQuestion(project, details);
|
|
|
-// if (map != null) {
|
|
|
-// if (map.get("project") != null) {
|
|
|
-// res.setUniqueName(map.get("project").get(res.getName()));
|
|
|
-// }
|
|
|
-// if (map.get("details") != null) {
|
|
|
-// for (QuestionDTO bean : res.getQuestionMapping()) {
|
|
|
-// bean.setUniqueName(map.get("details").get(bean.getName()));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ // 设置uniqueName
|
|
|
+ if (res != null && res.getType() != null &&
|
|
|
+ QuestionTypeEnum.Lis.getKey() == res.getType().intValue()) {
|
|
|
+ String project = res.getName();
|
|
|
+ List<String> details = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(res.getQuestionMapping())) {
|
|
|
+ details = res.getQuestionMapping().stream().map(row -> row.getName()).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ Map<String, Map<String, String>> map = lisMappingFacade.getLisMappingByQuestion(project, details, proMap, proDetailMap);
|
|
|
+ if (map != null) {
|
|
|
+ if (map.get("project") != null) {
|
|
|
+ res.setUniqueName(map.get("project").get(res.getName()));
|
|
|
+ }
|
|
|
+ if (map.get("details") != null) {
|
|
|
+ for (QuestionDTO bean : res.getQuestionMapping()) {
|
|
|
+ bean.setUniqueName(map.get("details").get(bean.getName()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
data.put(res.getId(), res);
|
|
|
}
|