Forráskód Böngészése

3.1.0-教研增加接口

xiaof 3 éve
szülő
commit
899d936f73

+ 25 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamPaperStructure.java

@@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusEnum;
 import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.enums.TaskStatusEnum;
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -121,6 +122,14 @@ public class ExamPaperStructure extends BaseEntity implements Serializable {
 
     private String markLeader;
 
+    @ApiModelProperty(value = "云阅卷试卷结构json")
+    @TableField("cloud_info_json")
+    private String cloudInfoJson;
+
+    @ApiModelProperty(value = "云阅卷试卷结构和知学知考结构不一样(默认false)")
+    @TableField("structrue_change")
+    private Boolean structrueChange;
+
     @TableField(exist = false)
     private String paperNumberId;
 
@@ -302,4 +311,20 @@ public class ExamPaperStructure extends BaseEntity implements Serializable {
     public void setMarkLeader(String markLeader) {
         this.markLeader = markLeader;
     }
+
+    public String getCloudInfoJson() {
+        return cloudInfoJson;
+    }
+
+    public void setCloudInfoJson(String cloudInfoJson) {
+        this.cloudInfoJson = cloudInfoJson;
+    }
+
+    public Boolean getStructrueChange() {
+        return structrueChange;
+    }
+
+    public void setStructrueChange(Boolean structrueChange) {
+        this.structrueChange = structrueChange;
+    }
 }

+ 10 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncReportServiceImpl.java

@@ -3,13 +3,11 @@ package com.qmth.distributed.print.business.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.qmth.boot.api.exception.ApiException;
+import com.qmth.distributed.print.business.entity.ExamPaperStructure;
 import com.qmth.distributed.print.business.entity.GradeBatch;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
 import com.qmth.distributed.print.business.entity.TBSyncTask;
-import com.qmth.distributed.print.business.service.DataSyncReportService;
-import com.qmth.distributed.print.business.service.GradeBatchPaperService;
-import com.qmth.distributed.print.business.service.GradeBatchService;
-import com.qmth.distributed.print.business.service.TBSyncTaskService;
+import com.qmth.distributed.print.business.service.*;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSemester;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
@@ -53,6 +51,9 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
     @Resource
     private TeachCloudReportTaskUtils teachCloudReportTaskUtils;
 
+    @Resource
+    private ExamPaperStructureService examPaperStructureService;
+
     @Async
     @Override
     public void syncGradeBatch(GradeBatch gradeBatch, TBSyncTask tbSyncTask) {
@@ -174,6 +175,11 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
                 if (SystemConstant.PAPER_STRUCT_EXCEPTION_CODE.equals(apiException.getCode())){
                     // 截取试卷编号当做remark
                     remark = errorMessage.substring(errorMessage.indexOf("【") + 1,errorMessage.indexOf("】"));
+
+                    // 更新状态(structureChange)
+                    UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
+                    updateWrapper.lambda().set(ExamPaperStructure::getStructrueChange, true).eq(ExamPaperStructure::getSchoolId, schoolId).eq(ExamPaperStructure::getPaperNumber, remark);
+                    examPaperStructureService.update(updateWrapper);
                 }
             }
 

+ 6 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncServiceImpl.java

@@ -3,6 +3,7 @@ package com.qmth.distributed.print.business.service.impl;
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.Update;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.bean.dto.SyncExamCardDto;
@@ -404,6 +405,11 @@ public class DataSyncServiceImpl implements DataSyncService {
                 cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, examPaperStructure.getPaperType(), syncObjectiveStructureDatas);
             }
 
+            String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, examPaperStructure.getPaperType());
+            UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.lambda().set(ExamPaperStructure::getCloudInfoJson, cloudInfoJson).set(ExamPaperStructure::getStructrueChange, false).eq(ExamPaperStructure::getId, examPaperStructure.getId());
+            examPaperStructureService.update(updateWrapper);
+
             result = TaskResultEnum.SUCCESS;
         } catch (ApiException e) {
             result = TaskResultEnum.ERROR;

+ 2 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java

@@ -279,7 +279,8 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
         for (String str : paperType.split(",")) {
             Map<String, Object> map = new HashMap<>();
             map.put("paperType", str);
-            List<Map> paperStructure = stmmsUtils.queryPaperStructure(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), examTask.getPaperNumberId() + str, null);
+            String result = stmmsUtils.queryPaperStructure(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), examTask.getPaperNumberId() + str, str);
+            List<Map> paperStructure = JSONObject.parseArray(JSONObject.toJSON(result).toString(), Map.class);
             map.put("content", paperStructure);
             list.add(map);
         }

+ 3 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPaperStructureController.java

@@ -104,14 +104,14 @@ public class ExamPaperStructureController {
     }
 
     /**
-     * 绑定科组长
+     * 设置科组长
      *
      * @param data  data
      * @return Result
      */
-    @ApiOperation(value = "绑定科组长")
+    @ApiOperation(value = "设置科组长")
     @RequestMapping(value = "/bind_mark_leader", method = RequestMethod.POST)
-    public Result uploadAnswer(@RequestBody String data) {
+    public Result bindMarkLeader(@RequestBody String data) {
         ExamPaperStructure examPaperStructure = examPaperStructureService.bindMarkLeader(data);
         // 异步同步到云阅卷
         asyncCloudMarkingTaskService.syncMarkLeader(examPaperStructure);

+ 2 - 3
teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/CloudMarkingTaskUtils.java

@@ -289,7 +289,7 @@ public class CloudMarkingTaskUtils {
      * @param subjectCode 科目代码
      * @param paperType   试卷编号
      */
-    public List<Map> queryPaperStructure(Long schoolId, String examId, String subjectCode, String paperType) {
+    public String queryPaperStructure(Long schoolId, String examId, String subjectCode, String paperType) {
         String hostUrl = dictionaryConfig.syncDataDomain().getHostUrl();
         String queryPaperStructure = dictionaryConfig.syncDataDomain().getQueryPaperStructure();
         validUrl(hostUrl, queryPaperStructure);
@@ -301,8 +301,7 @@ public class CloudMarkingTaskUtils {
             map.put("subjectCode", validParam(subjectCode, null, true, "科目代码")); // 取试卷编号
             map.put("paperType", validParam(paperType, "", false, "试卷类型"));
 
-            String result = HttpKit.sendPost(postUrl, map, getHeaders(schoolId, queryPaperStructure));
-            return JSONObject.parseArray(JSONObject.toJSON(result).toString(), Map.class);
+            return HttpKit.sendPost(postUrl, map, getHeaders(schoolId, queryPaperStructure));
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception(e.getMessage());
         }