|
|
@@ -152,6 +152,15 @@ public class KmtExerciseQuestionServiceImpl extends BaseServiceImpl<KmtExerciseQ
|
|
|
q.setIsCommonFlag(q.getIsCommonFlag() == 0 ? 1 : 0);
|
|
|
}
|
|
|
}
|
|
|
+ } else if(request.getBookPartType() == 2) {
|
|
|
+ //查询不同的题目
|
|
|
+ String temp = kmtExerciseMapper.findDifferentExerciseBookId(request.getQuestionId().trim());
|
|
|
+ questions = kmtExerciseMapper.findPartQuestionByBookCourseId(request.getPeriodId(), request.getExerciseBookId(), page);
|
|
|
+ if (StringUtil.isNotBlank(temp)){
|
|
|
+ for (ExerciseQuetionDto q : questions){
|
|
|
+ q.setIsCommonFlag(q.getIsCommonFlag() == 0 ? 1 : 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
String temp = kmtExerciseMapper.findDifferentExerciseBookIdByBookId(request.getBookId());
|
|
|
questions = kmtExerciseMapperService.findQuestionByBookCourseIdAndUserId(request, page, userId);
|
|
|
@@ -191,9 +200,10 @@ public class KmtExerciseQuestionServiceImpl extends BaseServiceImpl<KmtExerciseQ
|
|
|
if (CollectionUtils.isNotEmpty(list)){
|
|
|
List<String> questionIds = list.stream().map(ExerciseQuetionDto::getQuestionId).collect(Collectors.toList());
|
|
|
List<QuestionListKnowModel> questionKnows = kmtExerciseMapper.findQuestionKnowByQuestionIds(questionIds);
|
|
|
-
|
|
|
+ List<TbLibManager> users = getDealUsers(list); //加工审核员用户信息
|
|
|
for (ExerciseQuetionDto exerciseQuestionDto : list){
|
|
|
this.setQuestionStatus(exerciseQuestionDto);
|
|
|
+ exerciseQuestionDto.appendUserNameByIds(users);
|
|
|
exerciseQuestionDto.setParentId(StringUtil.isBlank(exerciseQuestionDto.getParentId()) ?
|
|
|
exerciseQuestionDto.getQuestionId() : exerciseQuestionDto.getParentId());
|
|
|
if (questionKnows != null){
|
|
|
@@ -224,6 +234,21 @@ public class KmtExerciseQuestionServiceImpl extends BaseServiceImpl<KmtExerciseQ
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 查询题目的加工审核员
|
|
|
+ * @param list
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<TbLibManager> getDealUsers (List<ExerciseQuetionDto> list){
|
|
|
+ List<String> userIds = this.findUserIdsInExerciseQuestionList(list);
|
|
|
+ List<TbLibManager> users = null;
|
|
|
+ if (CollectionUtils.isNotEmpty(userIds)){
|
|
|
+ Integer[] types = {17, 18};
|
|
|
+ users = libManagerMapper.findTbLibManagerByUserIdsAndType(userIds, Arrays.asList(types));
|
|
|
+ }
|
|
|
+ return users;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 题目转成二级结构
|
|
|
* @param list
|
|
|
* @param questionKnows
|
|
|
@@ -233,12 +258,7 @@ public class KmtExerciseQuestionServiceImpl extends BaseServiceImpl<KmtExerciseQ
|
|
|
private List<ExerciseBookCourseClassDto> getCommonQuestionGroupList (List<ExerciseQuetionDto> list, List<QuestionListKnowModel> questionKnows, boolean hasBigQuestionIndex){
|
|
|
List<ExerciseBookCourseClassDto> result = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(list)){
|
|
|
- List<String> userIds = this.findUserIdsInExerciseQuestionList(list);
|
|
|
- List<TbLibManager> users = null;
|
|
|
- if (CollectionUtils.isNotEmpty(userIds)){
|
|
|
- Integer[] types = {17, 18};
|
|
|
- users = libManagerMapper.findTbLibManagerByUserIdsAndType(userIds, Arrays.asList(types));
|
|
|
- }
|
|
|
+ List<TbLibManager> users = getDealUsers(list);
|
|
|
for (ExerciseQuetionDto exerciseQuestionDto : list){
|
|
|
this.setQuestionStatus(exerciseQuestionDto);
|
|
|
exerciseQuestionDto.setParentId(StringUtil.isBlank(exerciseQuestionDto.getParentId()) ?
|