|
@@ -2,6 +2,7 @@ package com.qmth.distributed.print.business.templete.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.qmth.boot.tools.excel.ExcelReader;
|
|
|
import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
|
import com.qmth.boot.tools.excel.model.DataMap;
|
|
@@ -953,20 +954,20 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
// 4.判断答案是否符合题型
|
|
|
if (questionType != null && SystemConstant.strNotNull(answer)) {
|
|
|
switch (questionType) {
|
|
|
- case 1:
|
|
|
- if (answer.length() > 1) {
|
|
|
- logicErrorList.add("单选题答案只能有一个");
|
|
|
- }
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- if (optionCount != 2) {
|
|
|
- logicErrorList.add("判断题[选项个数]只能为2");
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- logicErrorList.add("[题型(1-单选,2-多选,3-判断)]必须从1、2、3中填写");
|
|
|
+ case 1:
|
|
|
+ if (answer.length() > 1) {
|
|
|
+ logicErrorList.add("单选题答案只能有一个");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ if (optionCount != 2) {
|
|
|
+ logicErrorList.add("判断题[选项个数]只能为2");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ logicErrorList.add("[题型(1-单选,2-多选,3-判断)]必须从1、2、3中填写");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1011,6 +1012,12 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
markQuestionService.saveBatch(v);
|
|
|
markQuestionService.updateMarkPaperScore(examId, k, null);
|
|
|
});
|
|
|
+ // 更改试卷结构状态为已提交
|
|
|
+ Set<String> paperNumberSet = markQuestionMap.keySet();
|
|
|
+ if (CollectionUtils.isNotEmpty(paperNumberSet)) {
|
|
|
+ markPaperService.update(new UpdateWrapper<MarkPaper>().lambda().eq(MarkPaper::getExamId, examId)
|
|
|
+ .in(MarkPaper::getPaperNumber, paperNumberSet).set(MarkPaper::getQuestionStatus, true));
|
|
|
+ }
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
@@ -1234,7 +1241,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
userSaveParams.setPassword(SystemConstant.DEFAULT_PASSWORD);
|
|
|
userSaveParams.setOrgId(orgId);
|
|
|
userSaveParams.setEnable(true);
|
|
|
- userSaveParams.setRoleIds(new Long[]{markerRole.getId()});
|
|
|
+ userSaveParams.setRoleIds(new Long[] { markerRole.getId() });
|
|
|
try {
|
|
|
markUser.setUserId(sysUserService.saveUser(userSaveParams, requestUser.getId()));
|
|
|
markUser.setName(markerCode);
|
|
@@ -1284,6 +1291,12 @@ public class ImportLogicServiceImpl implements ImportLogicService {
|
|
|
if (CollectionUtils.isNotEmpty(paperErrorList)) {
|
|
|
throw ExceptionResultEnum.ERROR.exception(String.join(System.lineSeparator(), paperErrorList));
|
|
|
}
|
|
|
+ // 更改试卷结构状态为已提交
|
|
|
+ Set<String> paperNumberSet = paperQuestionsMap.keySet();
|
|
|
+ if (CollectionUtils.isNotEmpty(paperNumberSet)) {
|
|
|
+ markPaperService.update(new UpdateWrapper<MarkPaper>().lambda().eq(MarkPaper::getExamId, examId)
|
|
|
+ .in(MarkPaper::getPaperNumber, paperNumberSet).set(MarkPaper::getQuestionStatus, true));
|
|
|
+ }
|
|
|
}
|
|
|
return map;
|
|
|
}
|