|
@@ -1125,6 +1125,23 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
if (markGroupService.countByExamIdAndPaperNumber(examId, paperNumber) > 0) {
|
|
|
paperErrorList.add(String.format("[试卷编号]%s,已存在分组,请先删除该试卷的所有分组再导入试题", paperNumber));
|
|
|
} else {
|
|
|
+ MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
+ Long courseId = markPaper.getCourseId();
|
|
|
+ BasicCourse basicCourse = basicCourseService.getById(courseId);
|
|
|
+ String orgName;
|
|
|
+ Long orgId;
|
|
|
+ if (Objects.isNull(basicCourse)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("无法找到课程");
|
|
|
+ } else {
|
|
|
+ Long teachingRoomId = basicCourse.getTeachingRoomId();
|
|
|
+ SysOrg sysOrg = sysOrgService.getById(teachingRoomId);
|
|
|
+ if (Objects.isNull(sysOrg)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("无法找到机构");
|
|
|
+ }
|
|
|
+ orgName = sysOrg.getName();
|
|
|
+ orgId = sysOrg.getId();
|
|
|
+ }
|
|
|
+
|
|
|
// 优先删除该试卷的主观题
|
|
|
markQuestionService.remove(
|
|
|
new QueryWrapper<MarkQuestion>().lambda().eq(MarkQuestion::getExamId, examId)
|
|
@@ -1145,22 +1162,6 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
String paperNumberGroupNumberNotice = String.format("[试卷编号]%s,[评卷分组(只能用小写数字)]%s,的", paperNumber,
|
|
|
groupNumber);
|
|
|
|
|
|
- String orgName = null;
|
|
|
- Long orgId = null;
|
|
|
- BasicCourse basicCourse = basicCourseService.getOne(
|
|
|
- new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId)
|
|
|
- .eq(BasicCourse::getCode, groupQuestionList.get(0).getCourseCode()));
|
|
|
- if (Objects.isNull(basicCourse)) {
|
|
|
- groupErrorList.add("[课程代码]不存在");
|
|
|
- } else {
|
|
|
- Long teachingRoomId = basicCourse.getTeachingRoomId();
|
|
|
- SysOrg sysOrg = sysOrgService.getById(teachingRoomId);
|
|
|
- if (Objects.isNull(sysOrg)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("无法找到机构");
|
|
|
- }
|
|
|
- orgName = sysOrg.getName();
|
|
|
- orgId = sysOrg.getId();
|
|
|
- }
|
|
|
Integer markerCount = null;
|
|
|
String markerCodes = null;
|
|
|
List<Integer> markerCountList = groupQuestionList.stream().map(SubjectiveStructDto::getMarkerCount).distinct().collect(Collectors.toList());
|