|
@@ -76,6 +76,7 @@ public class MarkAiQuestionParamController {
|
|
if (!lock) {
|
|
if (!lock) {
|
|
throw ExceptionResultEnum.ERROR.exception("正在设置AI评卷参数,请稍候再试!");
|
|
throw ExceptionResultEnum.ERROR.exception("正在设置AI评卷参数,请稍候再试!");
|
|
}
|
|
}
|
|
|
|
+ boolean update = false;
|
|
try {
|
|
try {
|
|
switch (markAiQuestionParam.getMode()) {
|
|
switch (markAiQuestionParam.getMode()) {
|
|
case POINT://按得分点
|
|
case POINT://按得分点
|
|
@@ -92,12 +93,17 @@ public class MarkAiQuestionParamController {
|
|
} else {//修改
|
|
} else {//修改
|
|
List<MarkAiQuestionPoint> markAiQuestionPointDbList = markAiQuestionPointService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
List<MarkAiQuestionPoint> markAiQuestionPointDbList = markAiQuestionPointService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
List<MarkAiQuestionLevel> markAiQuestionLevelDbList = markAiQuestionLevelService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
List<MarkAiQuestionLevel> markAiQuestionLevelDbList = markAiQuestionLevelService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
|
|
+
|
|
//删除档次的数据
|
|
//删除档次的数据
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionLevelDbList)) {
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionLevelDbList)) {
|
|
|
|
+ update = true;
|
|
markAiQuestionLevelService.removeByIds(markAiQuestionLevelDbList.stream().map(MarkAiQuestionLevel::getId).collect(Collectors.toList()));
|
|
markAiQuestionLevelService.removeByIds(markAiQuestionLevelDbList.stream().map(MarkAiQuestionLevel::getId).collect(Collectors.toList()));
|
|
}
|
|
}
|
|
//全删point数据全增
|
|
//全删point数据全增
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionPointDbList)) {
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionPointDbList)) {
|
|
|
|
+ if (!CollectionUtils.isEqualCollection(markAiQuestionPointDbList, markAiQuestionParam.getPointList())) {
|
|
|
|
+ update = true;
|
|
|
|
+ }
|
|
markAiQuestionPointService.removeByIds(markAiQuestionPointDbList.stream().map(MarkAiQuestionPoint::getId).collect(Collectors.toList()));
|
|
markAiQuestionPointService.removeByIds(markAiQuestionPointDbList.stream().map(MarkAiQuestionPoint::getId).collect(Collectors.toList()));
|
|
}
|
|
}
|
|
markAiQuestionPointService.saveBatch(markAiQuestionParam.getPointList());
|
|
markAiQuestionPointService.saveBatch(markAiQuestionParam.getPointList());
|
|
@@ -118,12 +124,17 @@ public class MarkAiQuestionParamController {
|
|
} else {
|
|
} else {
|
|
List<MarkAiQuestionPoint> markAiQuestionPointDbList = markAiQuestionPointService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
List<MarkAiQuestionPoint> markAiQuestionPointDbList = markAiQuestionPointService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
List<MarkAiQuestionLevel> markAiQuestionLevelDbList = markAiQuestionLevelService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
List<MarkAiQuestionLevel> markAiQuestionLevelDbList = markAiQuestionLevelService.listByAiQuestionId(markAiQuestionParam.getId());
|
|
|
|
+
|
|
//删除得分点的数据
|
|
//删除得分点的数据
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionPointDbList)) {
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionPointDbList)) {
|
|
|
|
+ update = true;
|
|
markAiQuestionPointService.removeByIds(markAiQuestionPointDbList.stream().map(MarkAiQuestionPoint::getId).collect(Collectors.toList()));
|
|
markAiQuestionPointService.removeByIds(markAiQuestionPointDbList.stream().map(MarkAiQuestionPoint::getId).collect(Collectors.toList()));
|
|
}
|
|
}
|
|
//全删level数据全增
|
|
//全删level数据全增
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionLevelDbList)) {
|
|
if (CollectionUtils.isNotEmpty(markAiQuestionLevelDbList)) {
|
|
|
|
+ if (!CollectionUtils.isEqualCollection(markAiQuestionLevelDbList, markAiQuestionParam.getLevelList())) {
|
|
|
|
+ update = true;
|
|
|
|
+ }
|
|
markAiQuestionLevelService.removeByIds(markAiQuestionLevelDbList.stream().map(MarkAiQuestionLevel::getId).collect(Collectors.toList()));
|
|
markAiQuestionLevelService.removeByIds(markAiQuestionLevelDbList.stream().map(MarkAiQuestionLevel::getId).collect(Collectors.toList()));
|
|
}
|
|
}
|
|
markAiQuestionLevelService.saveBatch(markAiQuestionParam.getLevelList());
|
|
markAiQuestionLevelService.saveBatch(markAiQuestionParam.getLevelList());
|
|
@@ -133,8 +144,9 @@ public class MarkAiQuestionParamController {
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- // todo 知识点或者档位变动,更新
|
|
|
|
-// markQuestionService.updateClearOcrResult(markAiQuestionParam.getQuestionId(), true);
|
|
|
|
|
|
+ if (update) {
|
|
|
|
+ markQuestionService.updateClearOcrResult(markAiQuestionParam.getQuestionId(), true);
|
|
|
|
+ }
|
|
markAiQuestionParamService.saveOrUpdate(markAiQuestionParam);
|
|
markAiQuestionParamService.saveOrUpdate(markAiQuestionParam);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(SystemConstant.LOG_ERROR, e);
|
|
log.error(SystemConstant.LOG_ERROR, e);
|