test
parent
81e03460f7
commit
6acb1a44d7
|
|
@ -20,6 +20,7 @@ import org.qinan.cedu.model.entity.PaperQuestionRelDO;
|
|||
import org.qinan.cedu.model.entity.QuestionDO;
|
||||
import org.qinan.cedu.model.entity.QuestionOptionDO;
|
||||
import org.qinan.cedu.service.PaperQuestionRelService;
|
||||
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -81,9 +82,7 @@ public class PaperQuestionRelServiceImpl extends ServiceImpl<PaperQuestionRelMap
|
|||
.map(option -> String.valueOf(option.getId()))
|
||||
.collect(Collectors.joining(",")));
|
||||
|
||||
question.setCreateTime(now);
|
||||
question.setUpdateTime(now);
|
||||
question.setVersion(0);
|
||||
InsertFieldDefaults.applyIgnoreOrgId(question);
|
||||
questionMapper.insert(question);
|
||||
Db.saveBatch(options);
|
||||
|
||||
|
|
@ -91,8 +90,7 @@ public class PaperQuestionRelServiceImpl extends ServiceImpl<PaperQuestionRelMap
|
|||
PaperQuestionRelDO rel = new PaperQuestionRelDO();
|
||||
rel.setPaperId(dto.getPaperId());
|
||||
rel.setQuestionId(question.getId());
|
||||
rel.setCreateTime(now);
|
||||
rel.setUpdateTime(now);
|
||||
InsertFieldDefaults.applyIgnoreOrgId(rel);
|
||||
this.save(rel);
|
||||
}
|
||||
|
||||
|
|
@ -114,9 +112,7 @@ public class PaperQuestionRelServiceImpl extends ServiceImpl<PaperQuestionRelMap
|
|||
option.setOptionKey(key);
|
||||
option.setOptionName(key);
|
||||
option.setSortOrder(sortOrder++);
|
||||
option.setCreateTime(now);
|
||||
option.setUpdateTime(now);
|
||||
option.setVersion(0);
|
||||
InsertFieldDefaults.applyIgnoreOrgId(option);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, QuestionDO>
|
|||
public QuestionVO find(Long questionId) {
|
||||
QuestionVO questionVO = this.baseMapper.findQuestion(questionId);
|
||||
if (questionVO == null) {
|
||||
throw new IllegalArgumentException("试题不存在:id=" + questionId);
|
||||
throw new IllegalArgumentException("试题不存在");
|
||||
}
|
||||
// 查询选项信息(仅查询VO需要的字段)
|
||||
List<QuestionOptionDO> options = questionOptionService.lambdaQuery()
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
, q.analysis, q.tag_type, q.courseware_management_id
|
||||
, cm.courseware_name AS coursewareManagementName
|
||||
FROM question q
|
||||
JOIN courseware_management cm ON q.courseware_management_id = cm.id
|
||||
LEFT JOIN courseware_management cm ON q.courseware_management_id = cm.id
|
||||
WHERE q.id = #{questionId}
|
||||
AND q.delete_enum = 'false'
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue