Browse Source

新增超管设置ai智能评卷设置

wangliang 2 tháng trước cách đây
mục cha
commit
e0ec84bc53

+ 7 - 1
distributed-print/install/mysql/upgrade/3.4.5.sql

@@ -68,4 +68,10 @@ INSERT INTO sys_privilege
 VALUES(1222, 'AI评卷参数新增/修改', '/api/admin/mark/ai_question_param/save', 'URL', 897, 1, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
-VALUES(1223, 'AI评卷参数查询', '/api/admin/mark/ai_question_param/info', 'URL', 897, 1, 'AUTH', NULL, 1, 1, 1);
+VALUES(1223, 'AI评卷参数查询', '/api/admin/mark/ai_question_param/info', 'URL', 897, 1, 'AUTH', NULL, 1, 1, 1);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(1224, 'AI智能评卷设置查询', '/api/admin/set/ai/mark/set/select', 'URL', 508, 21, 'AUTH', NULL, 1, 0, 1);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(1225, 'AI智能评卷设置保存', '/api/admin/set/ai/mark/set/save', 'URL', 508, 22, 'AUTH', NULL, 1, 0, 1);

+ 38 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/SysAdminSetController.java

@@ -692,9 +692,9 @@ public class SysAdminSetController {
     public Result objectiveOmrSave(@ApiParam(value = "学校ID", required = true) @RequestParam Long schoolId,
                                    @ApiParam(value = "单选题有且只有一个识别结果时不进客观题检查", required = true) @RequestParam Boolean enable) {
         SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SINGLE_QUESTION_OMR_TASK);
-        if(sysConfig==null){
+        if (sysConfig == null) {
             sysConfig = new SysConfig(schoolId, new SysConfigResult(null, SystemConstant.SINGLE_QUESTION_OMR_TASK, "客观题检查扩展条件", enable, 1));
-        }else {
+        } else {
             sysConfig.setConfigValue(String.valueOf(enable));
         }
         if (sysConfigService.saveOrUpdate(sysConfig)) {
@@ -814,4 +814,40 @@ public class SysAdminSetController {
         }
         return ResultUtil.ok(true);
     }
+
+    @ApiOperation(value = "AI智能评卷设置查询")
+    @ApiResponses({@ApiResponse(code = 200, message = "AI智能评卷设置信息", response = CustomPrivilegeResult.class)})
+    @RequestMapping(value = "/ai/mark/set/select", method = RequestMethod.POST)
+    public Result aiMarkSetSelect(@ApiParam(value = "schoolId") @Param(value = "schoolId") Long schoolId) {
+        SysAdminSetResult sysAdminSetResult = new SysAdminSetResult();
+        List<SysConfigResult> list = new ArrayList<>();
+        SysConfig aiMarkSet = commonCacheService.addSysConfigCache(schoolId, SystemConstant.AI_MARK_SET);
+        list.add(Objects.nonNull(aiMarkSet) ? new SysConfigResult(aiMarkSet) : new SysConfigResult(null, SystemConstant.AI_MARK_SET, "AI智能评卷设置", "false", 1));
+        sysAdminSetResult.setResult(list);
+        return ResultUtil.ok(sysAdminSetResult);
+    }
+
+    @ApiOperation(value = "AI智能评卷设置保存")
+    @ApiResponses({@ApiResponse(code = 200, message = "AI智能评卷设置信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/ai/mark/set/save", method = RequestMethod.POST)
+    @Transactional
+    @OperationLogDetail(operationType = OperationTypeEnum.SAVE)
+    public Result aiMarkSetSave(@Valid @RequestBody SysAdminSetParam sysAdminSetParam, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+        }
+        if (CollectionUtils.isEmpty(sysAdminSetParam.getParam())) {
+            throw ExceptionResultEnum.ERROR.exception("AI智能评卷设置未填写");
+        }
+        List<SysConfigResult> sysConfigResultList = sysAdminSetParam.getParam();
+        List<SysConfig> sysConfigList = new ArrayList<>();
+        for (SysConfigResult s : sysConfigResultList) {
+            sysConfigList.add(new SysConfig(sysAdminSetParam.getSchoolId(), s));
+        }
+        sysConfigService.saveOrUpdateBatch(sysConfigList);
+        for (SysConfigResult s : sysConfigResultList) {
+            commonCacheService.updateSysConfigCache(sysAdminSetParam.getSchoolId(), s.getCode());
+        }
+        return ResultUtil.ok(true);
+    }
 }

+ 1 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -235,6 +235,7 @@ public class SystemConstant {
     public static final String DATA_DATASOURCE_PASSWORD = "data.datasource.password";
     public static final String AI_ROBOT_ENABLE = "ai.robot.enable";
     public static final String AI_ROBOT_URL = "ai.robot.rul";
+    public static final String AI_MARK_SET = "ai.mark.set";
 
     /**
      * 系统常量

+ 1 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/AiMarkServiceImpl.java

@@ -474,7 +474,7 @@ public class AiMarkServiceImpl implements AiMarkService {
             // 处理正常考生
             List<MarkQuestion> markQuestionList = markQuestionService.listByExamIdAndPaperNumberAndObjective(markPaper.getExamId(), markPaper.getPaperNumber(), false);
             for (MarkQuestion markQuestion : markQuestionList) {
-                if (!MarkPaperAiMark.NONE.equals(markQuestion.getAiMark()) && !markAiQuestionParamService.existMarkAiQuestionScoreOrLevel(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId())) {
+                if (!MarkPaperAiMark.NONE.equals(markQuestion.getAiMark()) && !markAiQuestionParamService.existMarkAiQuestionPointOrLevel(markQuestion.getExamId(), markQuestion.getPaperNumber(), markQuestion.getId())) {
                     continue;
                 }
                 // 生成正评任务