错题分类优化

dev
caolin 2023-09-04 14:40:27 +08:00
parent 75763435ba
commit 86f663e55f
2 changed files with 15 additions and 3 deletions

View File

@ -45,8 +45,11 @@ public class Constants {
//多选题
public static String QUESTION_TYPE_THREE = "3";
//字典表题目分类标识
public static String QUESTION_CATEGORY = "QusetionCategory";
//字典表题目科一分类标识
public static String QUESTION_CATEGORY_OF_SUBJECT_ONE = "QusetionCategoryOfSubjectOne";
//字典表题目科四分类标识
public static String QUESTION_CATEGORY_OF_SUBJECT_FOUR = "QusetionCategoryOfSubjectFour";
//微信支付
public static String WECHAT_PAY = "weChatPay";

View File

@ -183,8 +183,17 @@ public class TdQuestionServiceImpl extends ServiceImpl<TdQuestionMapper, TdQuest
if (CollectionUtil.isEmpty(tdQuestionVos)) {
return resultList;
}
final Integer carTypeId = tdQuestionVos.get(0).getCarTypeId();
final String subject = tdQuestionVos.get(0).getSubject();
//获取分类
List<TdSysConfigList> categoryList = configListService.querySysConfigList(Constants.QUESTION_CATEGORY, Constants.DEFAULT_CARTYPE_ID);
List<TdSysConfigList> categoryList = new ArrayList<>();
if (StrUtil.equals(Constants.SUBJECT_ONE,subject)){
categoryList = configListService.querySysConfigList(Constants.QUESTION_CATEGORY_OF_SUBJECT_ONE, carTypeId);
} else if (StrUtil.equals(Constants.SUBJECT_FOUR,subject)){
categoryList = configListService.querySysConfigList(Constants.QUESTION_CATEGORY_OF_SUBJECT_FOUR, carTypeId);
}
Map<String, String> categoryMap = categoryList.stream().collect(Collectors.toMap(TdSysConfigList::getConfigItemCode, TdSysConfigList::getConfigItemName, (v1, v2) -> v1));
Map<String, Integer> totalMap = new HashMap<>();
Map<String, List<Long>> errorQuestionIdMap = new HashMap<>();