Pārlūkot izejas kodu

3.3.0 删除同步云阅卷代码

xiaofei 1 gadu atpakaļ
vecāks
revīzija
f509ab59bf
22 mainītis faili ar 40 papildinājumiem un 2752 dzēšanām
  1. 0 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailCourseMapper.java
  2. 0 28
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/DataSyncService.java
  3. 0 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailCourseService.java
  4. 0 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperStructureService.java
  5. 0 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPrintPlanService.java
  6. 0 865
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DataSyncServiceImpl.java
  7. 0 51
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java
  8. 1 42
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPaperStructureServiceImpl.java
  9. 4 50
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java
  10. 4 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradePaperStructServiceImpl.java
  11. 27 36
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/SsoServiceImpl.java
  12. 4 38
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TBSyncTaskServiceImpl.java
  13. 0 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TSyncExamLogServiceImpl.java
  14. 0 142
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCloudMarkingTaskService.java
  15. 0 90
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScorePushService.java
  16. 0 21
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/PushLogicService.java
  17. 0 142
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PushLogicServiceImpl.java
  18. 0 141
      distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml
  19. 0 28
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPaperStructureController.java
  20. 0 93
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanSyncController.java
  21. 0 43
      distributed-print/src/test/java/com/qmth/distributed/print/SyncHelpTest.java
  22. 0 920
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/CloudMarkingTaskUtils.java

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailCourseMapper.java

@@ -37,8 +37,6 @@ public interface ExamDetailCourseMapper extends BaseMapper<ExamDetailCourse> {
 
     List<ExamDetailCourseDto> listByPrintPlanIdAndExamTaskId(@Param("printPlanIds") List<Long> printPlanIds, @Param("examTaskId") Long examTaskId, @Param("paperType") String paperType);
 
-    IPage<SyncExamTaskDto> listSyncCourseByPrintPlanId(@Param("ipage") Page<SyncExamTaskDto> ipage, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("roomOrgIds") Set<Long> roomOrgIds, @Param("orgIds") Set<Long> orgIds, @Param("cardType") String cardType, @Param("syncStatus") String syncStatus, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
-
     List<ExamDetailCourse> listExamDetailByExamIdAndPaperNumber(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("paperNumber") String paperNumber);
 
     TbTaskDetailResult getByExamDetailId(Long examDetailId);

+ 0 - 28
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/DataSyncService.java

@@ -1,28 +0,0 @@
-package com.qmth.distributed.print.business.service;
-
-import com.qmth.distributed.print.business.entity.ExamPaperStructure;
-import com.qmth.distributed.print.business.entity.TBSyncTask;
-import com.qmth.teachcloud.common.entity.SysUser;
-
-import java.util.List;
-
-/**
- * 同步数据到云阅卷 服务类
- */
-public interface DataSyncService {
-    void syncExamAndStudentAndCard(String orgCode, String thirdRelateName, String examTime, List<TBSyncTask> tbSyncTaskList, SysUser sysUser);
-
-    void syncPaperStructureAndGroup(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
-
-    void syncPaperAndAnswer(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
-
-    void syncObjectiveStructure(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
-
-    void syncMarkLeader(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
-
-    void syncMarkerAndClass(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask);
-
-    Long saveExam(Long schoolId, Long objectId, String orgCode, Long thirdRelateId, String thirdRelateName, String examTime);
-
-    Integer saveSchool(Long schoolId, String orgCode, String orgName);
-}

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailCourseService.java

@@ -36,8 +36,6 @@ public interface ExamDetailCourseService extends IService<ExamDetailCourse> {
 
     List<ExamDetailCourse> listByCourseCodeAndPaperNumber(Long schoolId, Long examId, String courseCode, String paperNumber);
 
-    IPage<SyncExamTaskDto> listSyncCourseByPrintPlanId(Long semesterId, Long examId, Long orgId, String cardType, String syncStatus, String courseCode, String paperNumber, Long startTime, Long endTime, Integer pageNumber, Integer pageSize);
-
     List<ExamDetailCourseDto> listByPrintPlanIdAndExamTaskId(List<Long> printPlanIds, Long examTaskId, String paperType);
 
     List<ExamDetailCourse> listExamDetailByExamIdAndPaperNumber(Long schoolId, Long examId, String paperNumber);

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPaperStructureService.java

@@ -32,8 +32,6 @@ public interface ExamPaperStructureService extends IService<ExamPaperStructure>
 
     ExamPaperStructure uploadAnswer(String id, String md5, MultipartFile file);
 
-    List<Map> preStructure(Long id);
-
     /**
      * 解析云阅卷试卷结构
      *

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

@@ -88,8 +88,6 @@ public interface ExamPrintPlanService extends IService<ExamPrintPlan> {
 
     ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber);
 
-    void syncDataCloud(SyncDataParam syncDataParam);
-
     /**
      * 根据考场详情表查找印刷计划
      *
@@ -111,9 +109,5 @@ public interface ExamPrintPlanService extends IService<ExamPrintPlan> {
 
     List<ExamPrintPlan> listBySchoolId(Long schoolId);
 
-    IPage<SyncExamTaskDto> listSyncExamTask(Long semesterId, Long examId, Long orgId, String cardType, String syncStatus, String courseCode, String paperNumber, Long startTime, Long endTime, Integer pageNumber, Integer pageSize);
-
-    void checkSyncMode(SyncDataParam syncDataParam);
-
     void updateAttachmentIdByTemplateId(Long templateId, Long attachmentId);
 }

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

@@ -1,865 +0,0 @@
-package com.qmth.distributed.print.business.service.impl;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.qmth.boot.api.exception.ApiException;
-import com.qmth.distributed.print.business.bean.dto.ExamDetailCourseDto;
-import com.qmth.distributed.print.business.bean.dto.SyncExamStudentDto;
-import com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto;
-import com.qmth.distributed.print.business.bean.marking.status.ExamPaperStructureStatus;
-import com.qmth.distributed.print.business.entity.*;
-import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
-import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
-import com.qmth.distributed.print.business.service.*;
-import com.qmth.teachcloud.common.bean.dto.stmms.GroupDetailDTO;
-import com.qmth.teachcloud.common.bean.dto.stmms.PicConfig;
-import com.qmth.teachcloud.common.bean.dto.stmms.QuestionBaseDTO;
-import com.qmth.teachcloud.common.bean.dto.stmms.QuestionDTO;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.BasicAttachment;
-import com.qmth.teachcloud.common.entity.SysOrg;
-import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.*;
-import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
-import com.qmth.teachcloud.common.service.BasicAttachmentService;
-import com.qmth.teachcloud.common.service.SysOrgService;
-import com.qmth.teachcloud.common.service.SysUserService;
-import com.qmth.teachcloud.common.service.TeachcloudCommonService;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import javax.annotation.Resource;
-import java.io.File;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * 同步服务类
- */
-@Service
-public class DataSyncServiceImpl implements DataSyncService {
-
-    private final static Logger log = LoggerFactory.getLogger(DataSyncServiceImpl.class);
-
-    @Resource
-    private ExamTaskSyncService examTaskSyncService;
-
-
-    @Resource
-    private TBSyncTaskService tbSyncTaskService;
-
-    @Resource
-    private ExamStudentService examStudentService;
-
-    @Resource
-    private ExamDetailCourseService examDetailCourseService;
-
-    @Resource
-    private ExamCardService examCardService;
-
-    @Resource
-    private ExamPaperStructureService examPaperStructureService;
-
-    @Resource
-    private TeachcloudCommonService teachcloudCommonService;
-
-    @Resource
-    private BasicAttachmentService basicAttachmentService;
-
-    @Resource
-    private SysOrgService sysOrgService;
-
-    @Resource
-    private SysUserService sysUserService;
-
-    @Resource
-    private ExamPaperGroupService examPaperGroupService;
-
-    @Resource
-    private ExamPaperGroupMarkerService examPaperGroupMarkerService;
-
-    @Resource
-    private ExamPaperClassMarkerService examPaperClassMarkerService;
-
-    @Resource
-    ExamTaskService examTaskService;
-
-    @Resource
-    private ExamTaskDetailService examTaskDetailService;
-
-    @Resource
-    private CloudMarkingTaskUtils cloudMarkingTaskUtils;
-
-    @Resource
-    DictionaryConfig dictionaryConfig;
-
-    @Async
-    @Override
-    public void syncExamAndStudentAndCard(String orgCode, String thirdRelateName, String examTime, List<TBSyncTask> tbSyncTaskList, SysUser sysUser) {
-        for (TBSyncTask tbSyncTask : tbSyncTaskList) {
-            // 同步初始参数
-            TaskResultEnum result = null;
-            TaskStatusEnum status;
-            String errorMessage = null;
-            Long schoolId = tbSyncTask.getSchoolId();
-            Long objectId = tbSyncTask.getObjectId();
-            SyncExamTaskDto syncExamTaskDto = JSON.parseObject(tbSyncTask.getRemark(), SyncExamTaskDto.class);
-            Long thirdRelateId = null;
-
-            // 各步骤状态
-            try {
-                // 同步中
-                status = TaskStatusEnum.RUNNING;
-                tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), null, status, null, null);
-
-                if (StringUtils.isNotBlank(orgCode)) {
-                    SysOrg byCode = sysOrgService.findByCode(schoolId, orgCode);
-                    // 同步机构
-                    saveSchool(schoolId, orgCode, byCode.getName());
-                }
-                // 查询本地库中云阅卷考试Id是否存在
-//                TSyncStmmsExam tSyncStmmsExam = tSyncStmmsExamService.getBySchoolIdAndOrgCodeAndExamName(schoolId, orgCode, thirdRelateName);
-//                if (tSyncStmmsExam != null) {
-//                    thirdRelateId = Long.valueOf(tSyncStmmsExam.getExamId());
-//                }
-
-                // 前置方法已经校验过各课程下是否有学院代码
-                // 同步考试
-                String saveExamErrorMessage = null;
-                try {
-                    thirdRelateId = saveExam(schoolId, objectId, orgCode, thirdRelateId, thirdRelateName, examTime);
-                } catch (Exception e) {
-                    saveExamErrorMessage = e.getMessage();
-                }
-
-                Long examTaskId = Long.valueOf(syncExamTaskDto.getExamTaskId());
-                ExamTask examTask = examTaskService.getById(examTaskId);
-
-                Set<String> errorMsgSet = new HashSet<>();
-                for (String paperType : syncExamTaskDto.getPaperType().split(",")) {
-                    ExamTaskSync examTaskSync = examTaskSyncService.getBySchoolIdAndOrgCodeAndPaperNumberAndPaperType(schoolId, examTask.getExamId(), orgCode, examTask.getPaperNumber(), paperType);
-                    if (examTaskSync != null && ExamTaskSyncStatusEnum.STARTING.equals(examTaskSync.getSyncStatus())) {
-                        throw ExceptionResultEnum.ERROR.exception("任务中有课程正在同步,请刷新列表查看最新状态");
-                    }
-                    ExamTaskSyncStatusEnum syncStatus = ExamTaskSyncStatusEnum.STARTING;
-                    if (examTaskSync == null) {
-                        examTaskSync = new ExamTaskSync(schoolId, examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), paperType, syncExamTaskDto.getPaperType(), orgCode, thirdRelateId, syncStatus, sysUser.getId(), System.currentTimeMillis(), null);
-                    } else {
-                        examTaskSync.setThirdRelateId(thirdRelateId != null ? Math.toIntExact(thirdRelateId) : null);
-                        examTaskSync.setSyncStatus(syncStatus);
-                        examTaskSync.setSyncStartTime(System.currentTimeMillis());
-                        examTaskSync.setSyncUserId(sysUser.getId());
-                        examTaskSync.setErrorMsg(null);
-                    }
-                    examTaskSyncService.saveOrUpdate(examTaskSync);
-
-                    String errorMsg = null;
-                    ExamTaskSyncStatusEnum taskSyncStatusEnum = null;
-                    try {
-                        // 考试未创建成功,则抛出异常,把数据状态改为失败
-                        if (thirdRelateId == null && StringUtils.isNotBlank(saveExamErrorMessage)) {
-                            throw ExceptionResultEnum.ERROR.exception(saveExamErrorMessage);
-                        }
-                        List<Long> printPlanIds = Arrays.asList(syncExamTaskDto.getPrintPlanIds().split(",")).stream().map(m -> Long.parseLong(m)).collect(Collectors.toList());
-                        List<ExamDetailCourseDto> examDetailCourseList = examDetailCourseService.listByPrintPlanIdAndExamTaskId(printPlanIds, examTaskId, paperType);
-                        // 同步考生
-                        List<SyncExamStudentDto> syncExamStudentDtoList = examStudentService.listStudentByExamDetailCourseId(examDetailCourseList, paperType);
-
-                        // 没有考生就单独推送科目
-                        if (CollectionUtils.isEmpty(syncExamStudentDtoList)) {
-                            for (ExamDetailCourseDto examDetailCourseDto : examDetailCourseList) {
-                                // 只同步当前卷型
-                                saveSubject(schoolId, thirdRelateId, examDetailCourseDto.getCourseCode(), examDetailCourseDto.getCourseName(), examDetailCourseDto.getSequence(), paperType);
-                            }
-                        } else {
-                            long count = syncExamStudentDtoList.stream().filter(m -> StringUtils.isBlank(m.getPaperType())).count();
-                            if (count > 0) {
-                                throw ExceptionResultEnum.ERROR.exception("部分学生未关联试卷类型,数量[" + count + "]");
-                            }
-                            // 同步考生
-                            saveStudent(schoolId, thirdRelateId, syncExamStudentDtoList);
-                        }
-
-                        // 同步题卡(只上传当前卷型)
-                        cardUpload(schoolId, thirdRelateId, examTask, paperType);
-                    } catch (Exception e) {
-                        errorMsg = e.getMessage();
-                        errorMsgSet.add(errorMsg);
-                        taskSyncStatusEnum = ExamTaskSyncStatusEnum.FAIL;
-                    } finally {
-                        examTaskSync.setErrorMsg(errorMsg);
-                        taskSyncStatusEnum = taskSyncStatusEnum == null ? ExamTaskSyncStatusEnum.FINISH : taskSyncStatusEnum;
-                        examTaskSync.setSyncStatus(taskSyncStatusEnum);
-                    }
-                    examTaskSync.setSyncEndTime(System.currentTimeMillis());
-                    examTaskSyncService.saveOrUpdate(examTaskSync);
-                }
-                if (!CollectionUtils.isEmpty(errorMsgSet)) {
-                    throw ExceptionResultEnum.ERROR.exception(String.join(";", errorMsgSet));
-                }
-                // 任务结果
-                result = TaskResultEnum.SUCCESS;
-            } catch (Exception e) {
-                result = TaskResultEnum.ERROR;
-                errorMessage = e.getMessage();
-            } finally {
-                // 同步结束
-                status = TaskStatusEnum.FINISH;
-                tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), thirdRelateId, status, result, errorMessage);
-
-                // 同步成功,发送短信
-//            if (ExamPrintPlanSyncStatusEnum.FINISH.equals(syncStatus)) {
-//                examPrintPlanService.sendNoticeUploadStructure(printPlanId, sysUser);
-//            }
-            }
-        }
-    }
-
-    @Async
-    @Override
-    public void syncPaperStructureAndGroup(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
-        // 同步初始参数
-        TaskResultEnum result = null;
-        String mainProgress = "<b>步骤:删除分组->主观题结构->主观题分组->绑定评卷员</b><br>";
-        String errorMessage = "";
-
-        Long schoolId = examPaperStructure.getSchoolId();
-        // 云阅卷考试ID
-        String examId = String.valueOf(examPaperStructure.getThirdRelateId());
-        // 科目代码(课程代码+卷型+课程序号)
-        String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
-
-        // 同步中
-        tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.RUNNING, null, null);
-
-        try {
-            // 同步分组(检查,若存在,先删除)
-            errorMessage = "[删除分组]";
-            int i = 0;
-            deleteGroup(schoolId, examId, subjectCode, i);
-
-            // 同步主观题
-            errorMessage = "[主观题结构]";
-            String subjectiveStructure = examPaperStructure.getSubjectiveStructure();
-            if (StringUtils.isNotBlank(subjectiveStructure)) {
-                List<JSONObject> subjectiveJsons = JSONObject.parseArray(subjectiveStructure, JSONObject.class);
-                List<QuestionDTO> syncSubjectiveStructureDatas = subjectiveJsons.stream().map(m -> {
-                    QuestionDTO syncStructureData = new QuestionDTO();
-                    syncStructureData.setMainNumber(m.getInteger("mainNumber"));
-                    syncStructureData.setSubNumber(m.getString("subNumber"));
-                    syncStructureData.setMainTitle(m.getString("mainTitle"));
-                    syncStructureData.setTotalScore(m.getDouble("totalScore"));
-                    return syncStructureData;
-                }).collect(Collectors.toList());
-
-                // 主观题不传试卷类型 update by 20220711
-                boolean syncPaperStructure = cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, false, null, syncSubjectiveStructureDatas);
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.STRUCTURE.getType(), "sync", syncPaperStructure));
-            }
-
-            // 清掉云阅卷主观题答案
-            String objectiveStructure = examPaperStructure.getObjectiveStructure();
-            if (StringUtils.isNotBlank(objectiveStructure)) {
-                List<JSONObject> objectiveJsons = JSONObject.parseArray(objectiveStructure, JSONObject.class);
-                long count = objectiveJsons.stream().filter(m -> m.containsKey("answer")).count();
-                if (objectiveJsons.size() == 0 || count == 0) {
-                    List<QuestionDTO> syncObjectiveStructureDatas = new ArrayList<>();
-                    cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, null, syncObjectiveStructureDatas);
-                }
-            }
-
-            errorMessage = "[主观题分组]";
-            List<ExamPaperGroup> examPaperGroups = examPaperGroupService.listByExamPaperStructureId(examPaperStructure.getId());
-            if (!CollectionUtils.isEmpty(examPaperGroups)) {
-                List<GroupDetailDTO> groupDetailDTOS = new ArrayList<>();
-                for (ExamPaperGroup examPaperGroup : examPaperGroups) {
-                    GroupDetailDTO groupDetailDTO = new GroupDetailDTO();
-                    groupDetailDTO.setNumber(examPaperGroup.getGroupNumber());
-                    String picListString = examPaperGroup.getPictureConfig();
-                    if (StringUtils.isNotBlank(picListString)) {
-                        List<PicConfig> picConfigs = JSONObject.parseArray(picListString, PicConfig.class);
-                        groupDetailDTO.setPicConfig(picConfigs);
-                    }
-                    groupDetailDTO.setDoubleRate(examPaperGroup.getDoubleRate());
-                    groupDetailDTO.setArbitrateThreshold(examPaperGroup.getArbitrateThreshold());
-                    groupDetailDTO.setScorePolicy(examPaperGroup.getScorePolicy().getValue());
-                    String questionsString = examPaperGroup.getQuestionInfo();
-                    if (StringUtils.isNotBlank(questionsString)) {
-                        List<JSONObject> jsonObjects = JSONObject.parseArray(questionsString, JSONObject.class);
-                        List<QuestionBaseDTO> questionBaseDTOS = jsonObjects.stream().map(m -> {
-                            QuestionBaseDTO questionBaseDTO = new QuestionBaseDTO();
-                            questionBaseDTO.setMainNumber(m.getInteger("mainNumber"));
-                            questionBaseDTO.setSubNumber(m.getString("subNumber"));
-                            return questionBaseDTO;
-                        }).collect(Collectors.toList());
-                        groupDetailDTO.setQuestions(questionBaseDTOS);
-                    }
-                    groupDetailDTOS.add(groupDetailDTO);
-                }
-                boolean saveMarkerGroup = cloudMarkingTaskUtils.saveMarkerGroup(schoolId, examId, subjectCode, 0, groupDetailDTOS);
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.GROUP.getType(), "sync", saveMarkerGroup));
-            } else {
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.GROUP.getType(), "sync", true));
-            }
-
-            // 所有分组下评卷员集合(分班阅使用)
-            List<ExamPaperGroupMarker> examPaperGroupMarkerList = new ArrayList<>();
-            // 同步绑定评卷员
-            try {
-                errorMessage = "[绑定评卷员]";
-                String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
-                for (ExamPaperGroup examPaperGroup : examPaperGroups) {
-                    List<ExamPaperGroupMarker> examPaperGroupMarkers = examPaperGroupMarkerService.listByGroupId(examPaperGroup.getId());
-                    for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkers) {
-                        // 推送用户
-                        SysUser markerUser = sysUserService.getById(examPaperGroupMarker.getMarkerId());
-                        cloudMarkingTaskUtils.syncUser(SpecialPrivilegeEnum.MARKER.getPrefix() + markerUser.getLoginName(), markerUser.getRealName(), SpecialPrivilegeEnum.MARKER.getValue(), markerUser.getEnable(), schoolId, orgCode);
-                        // 绑定评卷员
-                        cloudMarkingTaskUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
-
-                        examPaperGroupMarkerList.add(examPaperGroupMarker);
-                    }
-                }
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", true));
-            } catch (IllegalAccessException e) {
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", false));
-            }
-
-            errorMessage = "[分班阅]";
-            try {
-                if (examPaperStructure.getOpenClassReading()) {
-                    List<ExamPaperClassMarker> examPaperClassMarkers = examPaperClassMarkerService.listByExamPaperStructureId(examPaperStructure.getId());
-                    if (!CollectionUtils.isEmpty(examPaperClassMarkers)) {
-
-                        for (ExamPaperClassMarker examPaperClassMarker : examPaperClassMarkers) {
-                            String className = examPaperClassMarker.getClassName();
-                            List<String> classNames = Arrays.asList(className.split(","));
-                            cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
-                        }
-                    }
-                } else {
-                    // 同步空集合对象,就是删除云阅卷分班阅班级信息
-                    List<String> classNames = new ArrayList<>();
-                    for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkerList) {
-                        cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperGroupMarker.getLoginName(), classNames);
-                    }
-                }
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", true));
-            } catch (Exception e) {
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", false));
-            }
-            result = TaskResultEnum.SUCCESS;
-        } catch (Exception e) {
-            result = TaskResultEnum.ERROR;
-            errorMessage = errorMessage + e.getMessage();
-        } finally {
-            String status = examPaperStructure.getStatus();
-            ExamPaperStructureStatus examPaperStructureStatus = JSON.parseObject(status, ExamPaperStructureStatus.class);
-            if (examPaperStructureStatus.getStructure().getSave() && examPaperStructureStatus.getStructure().getSync()
-                    && examPaperStructureStatus.getGroup().getSave() && examPaperStructureStatus.getGroup().getSync()) {
-                if (examPaperStructure.getOpenClassReading()) {
-                    if (examPaperStructureStatus.getMarkerClass().getSave() && examPaperStructureStatus.getMarkerClass().getSync()) {
-                        examPaperStructure.setFinish(true);
-                    }
-                } else {
-                    examPaperStructure.setFinish(true);
-                }
-            }
-
-            examPaperStructureService.updateById(examPaperStructure);
-            tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, mainProgress + errorMessage);
-        }
-    }
-
-    /**
-     * 云阅卷分组删除是异步任务
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     */
-    private boolean deleteGroup(Long schoolId, String examId, String subjectCode, int i) {
-        if (i >= 5) {
-            throw ExceptionResultEnum.ERROR.exception("云阅卷分组未删除");
-        }
-        // 同步分组
-        int countGroup = cloudMarkingTaskUtils.countGroup(schoolId, examId, subjectCode);
-        // 如果存在分组,先删掉
-        boolean deleteGroup = false;
-        if (countGroup > 0) {
-            // 第一次进行调用删除
-            if (i == 0) {
-                deleteGroup = cloudMarkingTaskUtils.deleteGroup(schoolId, examId, subjectCode);
-            }
-        } else {
-            return true;
-        }
-        // 调用成功,再查询判断是否还有分组
-        if (deleteGroup) {
-            countGroup = cloudMarkingTaskUtils.countGroup(schoolId, examId, subjectCode);
-            if (countGroup > 0) {
-                // 等待3秒
-                try {
-                    Thread.sleep(3000);
-                } catch (InterruptedException ignored) {
-                }
-                i++;
-                deleteGroup(schoolId, examId, subjectCode, i);
-            }
-        } else {
-            throw ExceptionResultEnum.ERROR.exception("云阅卷分组删除异常");
-        }
-        return false;
-    }
-
-    @Async
-    @Override
-    public void syncPaperAndAnswer(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
-        // 同步初始参数
-        TaskResultEnum result = null;
-        String errorMessage = null;
-        File paperFile = null;
-        File answerFile = null;
-        try {
-            Long schoolId = examPaperStructure.getSchoolId();
-            // 云阅卷考试ID
-            String examId = String.valueOf(examPaperStructure.getThirdRelateId());
-            // 科目代码(课程代码+卷型+课程序号)
-            String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
-
-            // 同步中
-            tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.RUNNING, null, null);
-
-            String paperAnswer = examPaperStructure.getPaperAnswer();
-            if (StringUtils.isNotBlank(paperAnswer)) {
-                List<JSONObject> paperAnswerJsons = JSONObject.parseArray(paperAnswer, JSONObject.class);
-                for (JSONObject paperAnswerJson : paperAnswerJsons) {
-                    if (paperAnswerJson.containsKey("paperType") && paperAnswerJson.containsKey("paper")) {
-                        String paperType = paperAnswerJson.getString("paperType");
-                        // 同步试卷
-                        String paper = paperAnswerJson.getString("paper");
-                        if (StringUtils.isAnyBlank(paperType, paper)) {
-                            continue;
-                        }
-                        // 同步试卷文件
-                        try {
-                            paperFile = downFileFromFss(paper, paperType, SyncFileTypeEnum.PAPER);
-                            String syncPaperFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.PAPER, paperFile);
-                            // 试卷文件保存url
-                            paperAnswerJson.put("paperUrl", syncPaperFileUrl);
-                        } catch (Exception e) {
-                            log.error("试卷文件上传失败,不作处理");
-                        }
-
-                        // 同步标答
-                        String answer = paperAnswerJson.getString("answer");
-                        if (StringUtils.isAnyBlank(paperType, answer)) {
-                            continue;
-                        }
-                        // 同步标答文件
-                        answerFile = downFileFromFss(answer, paperType, SyncFileTypeEnum.ANSWER);
-                        String syncAnswerFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.ANSWER, answerFile);
-                        // 标答文件保存url
-                        paperAnswerJson.put("answerUrl", syncAnswerFileUrl);
-                    }
-                }
-                String paperAnswerUrl = JSONObject.toJSONString(paperAnswerJsons);
-                // 更新url
-                examPaperStructure.setPaperAnswer(paperAnswerUrl);
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.ANSWER_FILE.getType(), "sync", true));
-            }
-            result = TaskResultEnum.SUCCESS;
-        } catch (ApiException e) {
-            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.ANSWER_FILE.getType(), "sync", false));
-            result = TaskResultEnum.ERROR;
-            errorMessage = e.getMessage();
-        } finally {
-            tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
-            examPaperStructureService.updateById(examPaperStructure);
-            if (paperFile != null) {
-                paperFile.delete();
-            }
-            if (answerFile != null) {
-                answerFile.delete();
-            }
-        }
-    }
-
-    @Async
-    @Override
-    public void syncObjectiveStructure(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
-        // 同步初始参数
-        TaskResultEnum result = null;
-        String errorMessage = null;
-        try {
-            Long schoolId = examPaperStructure.getSchoolId();
-            // 云阅卷考试ID
-            String examId = String.valueOf(examPaperStructure.getThirdRelateId());
-            // 科目代码(课程代码+卷型+课程序号)
-            String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
-            // 同步客观题
-            String objectiveStructure = examPaperStructure.getObjectiveStructure();
-            if (StringUtils.isNotBlank(objectiveStructure)) {
-                List<JSONObject> objectiveJsons = JSONObject.parseArray(objectiveStructure, JSONObject.class);
-                List<QuestionDTO> syncObjectiveStructureDatas = objectiveJsons.stream().map(m -> {
-                    QuestionDTO syncStructureData = new QuestionDTO();
-                    syncStructureData.setMainNumber(m.getInteger("mainNumber"));
-                    syncStructureData.setSubNumber(m.getString("subNumber"));
-                    syncStructureData.setMainTitle(m.getString("mainTitle"));
-                    syncStructureData.setTotalScore(m.getDouble("totalScore"));
-                    syncStructureData.setAnswer(m.getString("answer"));
-                    if (m.containsKey("type")) {
-                        syncStructureData.setType(ObjectiveTypeEnum.getByType(m.getInteger("type")));
-                    }
-                    if (m.containsKey("objectivePolicy")) {
-                        syncStructureData.setObjectivePolicy(m.getString("objectivePolicy"));
-                    }
-                    return syncStructureData;
-                }).collect(Collectors.toList());
-                cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, null, syncObjectiveStructureDatas);
-            }
-
-            String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, null);
-            examPaperStructure.setCloudInfoJson(cloudInfoJson);
-            examPaperStructure.setStructureChange(false);
-            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.OBJECTIVE.getType(), "sync", true));
-            result = TaskResultEnum.SUCCESS;
-        } catch (ApiException e) {
-            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.OBJECTIVE.getType(), "sync", false));
-            result = TaskResultEnum.ERROR;
-            errorMessage = e.getMessage();
-        } finally {
-            tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
-            examPaperStructureService.updateById(examPaperStructure);
-        }
-    }
-
-    @Async
-    @Override
-    public void syncMarkLeader(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
-        // 同步初始参数
-        TaskResultEnum result = null;
-        String errorMessage = null;
-        try {
-            Long schoolId = examPaperStructure.getSchoolId();
-            // 科目代码(课程代码+卷型+课程序号)
-            String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
-            // 同步客观题
-            String markLeader = examPaperStructure.getMarkLeader();
-            if (StringUtils.isNotBlank(markLeader)) {
-                List<JSONObject> objectiveJsons = JSONObject.parseArray(markLeader, JSONObject.class);
-                for (JSONObject object : objectiveJsons) {
-                    // 推送用户
-                    String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
-                    SysUser markerUser = sysUserService.getById(object.getLong("id"));
-                    cloudMarkingTaskUtils.syncUser(SpecialPrivilegeEnum.SUBJECT_HEADER.getPrefix() + markerUser.getLoginName(), markerUser.getRealName(), SpecialPrivilegeEnum.SUBJECT_HEADER.getValue(), markerUser.getEnable(), schoolId, orgCode);
-                    cloudMarkingTaskUtils.saveMarkLeader(schoolId, subjectCode, object.getString("loginName"), orgCode);
-                }
-            }
-            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_LEADER.getType(), "sync", true));
-            result = TaskResultEnum.SUCCESS;
-        } catch (Exception e) {
-            examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_LEADER.getType(), "sync", false));
-            result = TaskResultEnum.ERROR;
-            errorMessage = e.getMessage();
-        } finally {
-            tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
-            examPaperStructureService.updateById(examPaperStructure);
-        }
-    }
-
-    @Async
-    @Override
-    public void syncMarkerAndClass(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
-        // 云阅卷考试ID
-        String examId = String.valueOf(examPaperStructure.getThirdRelateId());
-        // 同步初始参数
-        TaskResultEnum result = null;
-        String errorMessage = null;
-        try {
-            Long schoolId = examPaperStructure.getSchoolId();
-            // 科目代码(课程代码+卷型+课程序号)
-            String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
-            // 同步客观题
-            String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
-
-            List<ExamPaperGroupMarker> examPaperGroupMarkerList = new ArrayList<>();
-            try {
-                List<ExamPaperGroup> examPaperGroups = examPaperGroupService.listByExamPaperStructureId(examPaperStructure.getId());
-                for (ExamPaperGroup examPaperGroup : examPaperGroups) {
-                    List<ExamPaperGroupMarker> examPaperGroupMarkers = examPaperGroupMarkerService.listByGroupId(examPaperGroup.getId());
-                    for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkers) {
-                        // 推送用户
-                        SysUser markerUser = sysUserService.getById(examPaperGroupMarker.getMarkerId());
-                        cloudMarkingTaskUtils.syncUser(SpecialPrivilegeEnum.MARKER.getPrefix() + markerUser.getLoginName(), markerUser.getRealName(), SpecialPrivilegeEnum.MARKER.getValue(), markerUser.getEnable(), schoolId, orgCode);
-                        // 绑定评卷员
-                        cloudMarkingTaskUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
-
-                        examPaperGroupMarkerList.add(examPaperGroupMarker);
-                    }
-                }
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", true));
-            } catch (IllegalAccessException e) {
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", false));
-            }
-
-            try {
-                if (examPaperStructure.getOpenClassReading()) {
-                    List<ExamPaperClassMarker> examPaperClassMarkers = examPaperClassMarkerService.listByExamPaperStructureId(examPaperStructure.getId());
-                    if (!CollectionUtils.isEmpty(examPaperClassMarkers)) {
-                        for (ExamPaperClassMarker examPaperClassMarker : examPaperClassMarkers) {
-                            String className = examPaperClassMarker.getClassName();
-                            List<String> classNames = Arrays.asList(className.split(","));
-                            cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
-                        }
-                    }
-                } else {
-                    List<String> classNames = new ArrayList<>();
-                    for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkerList) {
-                        cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperGroupMarker.getLoginName(), classNames);
-                    }
-                }
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", true));
-            } catch (Exception e) {
-                examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", false));
-            }
-            result = TaskResultEnum.SUCCESS;
-        } catch (Exception e) {
-            result = TaskResultEnum.ERROR;
-            errorMessage = e.getMessage();
-        } finally {
-            tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
-            examPaperStructureService.updateById(examPaperStructure);
-        }
-    }
-
-    /**
-     * 创建考试
-     *
-     * @param schoolId 学校ID
-     * @param orgCode  学院代码
-     * @param orgName  学院名称
-     */
-    @Override
-    public Integer saveSchool(Long schoolId, String orgCode, String orgName) {
-        Integer thirdRelateOrgId;
-        try {
-            thirdRelateOrgId = cloudMarkingTaskUtils.syncSchool(schoolId, orgCode, orgName);
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-        try {
-            UpdateWrapper<SysOrg> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(SysOrg::getThirdRelateId, thirdRelateOrgId)
-                    .eq(SysOrg::getSchoolId, schoolId)
-                    .eq(SysOrg::getCode, orgCode);
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception("保存云阅卷机构数据失败");
-        }
-        return thirdRelateOrgId;
-    }
-
-    /**
-     * 创建考试
-     *
-     * @param schoolId        学校ID
-     * @param objectId        计划ID
-     * @param orgCode         学院代码
-     * @param thirdRelateId   云阅卷考试ID
-     * @param thirdRelateName 云阅卷考试名称
-     * @param examTime        考试时间
-     */
-    @Override
-    public Long saveExam(Long schoolId, Long objectId, String orgCode, Long thirdRelateId, String thirdRelateName, String examTime) {
-        try {
-            if (Objects.isNull(thirdRelateId)) {
-                String code = String.valueOf(objectId);
-                thirdRelateId = cloudMarkingTaskUtils.syncExam(schoolId, code, thirdRelateName, examTime, orgCode);
-            }
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-        try {
-//            TSyncStmmsExam tSyncStmmsExam = tSyncStmmsExamService.getBySchoolIdAndExamId(schoolId, orgCode, thirdRelateId);
-//            if (tSyncStmmsExam == null) {
-//                tSyncStmmsExam = new TSyncStmmsExam();
-//                tSyncStmmsExam.setId(SystemConstant.getDbUuid());
-//                tSyncStmmsExam.setSchoolId(schoolId);
-//                if (StringUtils.isNotBlank(orgCode)) {
-//                    tSyncStmmsExam.setOrgCode(orgCode);
-//                }
-//                tSyncStmmsExam.setExamId(thirdRelateId.intValue());
-//                tSyncStmmsExam.setExamName(thirdRelateName);
-//                tSyncStmmsExamService.save(tSyncStmmsExam);
-//            }
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception("保存云阅卷考试数据失败");
-        }
-        return thirdRelateId;
-    }
-
-    /**
-     * 创建科目
-     *
-     * @param schoolId      学校ID
-     * @param thirdRelateId 云阅卷考试ID
-     * @param courseCode    课程代码
-     * @param sequence      课程序号
-     * @param paperType     卷型
-     */
-    public Boolean saveSubject(Long schoolId, Long thirdRelateId, String courseCode, String courseName, String sequence, String paperType) {
-        try {
-            // 支持多卷型
-            String[] paperTypes = paperType.split(",");
-            for (String type : paperTypes) {
-                //参数
-                String examId = String.valueOf(thirdRelateId);
-                String subjectCode = courseCode + type + sequence;
-                cloudMarkingTaskUtils.syncSubject(schoolId, examId, subjectCode, courseName);
-            }
-        } catch (Exception e) {
-            log.error("保存云阅卷科目数据失败");
-        }
-        return true;
-    }
-
-    /**
-     * 新增考生
-     *
-     * @param schoolId      学校ID
-     * @param thirdRelateId 云阅卷考试ID
-     */
-    public void saveStudent(Long schoolId, Long thirdRelateId, List<SyncExamStudentDto> syncExamStudentDtoList) {
-        for (SyncExamStudentDto examStudent : syncExamStudentDtoList) {
-            try {
-                //参数
-                String examId = String.valueOf(thirdRelateId);
-                String examNumber = examStudent.getTicketNumber();
-                String studentCode = examStudent.getStudentCode();
-                String name = examStudent.getStudentName();
-                String college = examStudent.getCollegeName();
-                if (StringUtils.isBlank(college)) {
-                    SysOrg sysOrg = examStudentService.getBasicCollegeByBelongOrgId(studentCode, schoolId);
-                    college = Objects.nonNull(sysOrg) && StringUtils.isNotBlank(sysOrg.getName()) ? sysOrg.getName() : "无";
-                }
-                String className = StringUtils.isBlank(examStudent.getClazzName()) ? getClassName(examStudent.getExtendFields()) : examStudent.getClazzName();
-                String teacher = "无";
-                String subjectCode = examStudent.getCourseCode() + examStudent.getPaperType() + examStudent.getSequence(); // 取试卷编号
-                String subjectName = examStudent.getCourseName();
-                String packageCode = examStudent.getPackageCode();
-                // 试卷类型和客观题试卷类型一致  update by 20220713
-//                String paperType = examStudent.getPaperType();
-                String paperType = null;
-                boolean syncStudent = cloudMarkingTaskUtils.syncStudent(schoolId, examId, examNumber, studentCode, name, college, className, teacher, subjectCode, subjectName, packageCode, paperType, null, null);
-
-                if (syncStudent) {
-                    UpdateWrapper<ExamStudent> updateWrapper = new UpdateWrapper<>();
-                    updateWrapper.lambda().set(ExamStudent::getSyncStatus, true).eq(ExamStudent::getId, examStudent.getId());
-                    examStudentService.update(updateWrapper);
-                }
-            } catch (Exception e) {
-                throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-            }
-        }
-    }
-
-    /**
-     * 同步题卡
-     *
-     * @param schoolId      学校ID
-     * @param thirdRelateId 云阅卷考试ID
-     */
-    public void cardUpload(Long schoolId, Long thirdRelateId, ExamTask examTask, String paperType) {
-        ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskId(examTask.getId());
-        List<JSONObject> paperAttachmentIds = JSON.parseArray(examTaskDetail.getPaperAttachmentIds(), JSONObject.class);
-        if (paperAttachmentIds.isEmpty()) {
-            throw ExceptionResultEnum.ERROR.exception(String.format("[上传题卡格式]数据异常,试卷编号[%s]未查询到题卡信息", examTask.getPaperNumber()));
-        }
-
-        if (StringUtils.isBlank(paperType)) {
-            throw ExceptionResultEnum.ERROR.exception("[上传题卡格式]数据异常,考场科目信息中绑定卷型为空");
-        }
-        for (String s : paperType.split(",")) {
-            Optional<JSONObject> optional = paperAttachmentIds.stream().filter(m -> m.getString("name").equals(s)).findFirst();
-            if (!optional.isPresent()) {
-                throw ExceptionResultEnum.ERROR.exception(String.format("[上传题卡格式]数据异常,未找到卷型[%s]绑定题卡ID", s));
-            }
-            Long cardId = optional.get().getLong("cardId");
-            ExamCard examCard = examCardService.getById(cardId);
-            if (examCard == null || StringUtils.isBlank(examCard.getContent())) {
-                continue;
-            }
-
-            //生成json文件
-            File file = null;
-            try {
-                // 文件临时目录
-                String dirName = dictionaryConfig.fssPrivateDomain().getConfig() + File.separator + "upload-temp" + File.separator + SyncFileTypeEnum.CARD.name().toLowerCase() + File.separator + System.currentTimeMillis();
-                file = new File(dirName, SystemConstant.getNanoId() + SystemConstant.JSON_PREFIX);
-                file = SystemConstant.createJsonFile(file.getPath(), examCard.getContent());
-                if (file.exists()) {
-                    String uploadCardUrl = cloudMarkingTaskUtils.syncFile(schoolId, String.valueOf(thirdRelateId), examTask.getCourseCode() + s + examTask.getSequence(), SyncFileTypeEnum.CARD, file);
-                    if (StringUtils.isNotBlank(uploadCardUrl)) {
-                        UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();
-                        updateWrapper.lambda().set(ExamCard::getSyncStatus, true).eq(ExamCard::getId, cardId);
-                        examCardService.update(updateWrapper);
-                    }
-                }
-            } catch (Exception e) {
-                throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-            } finally {
-                if (file != null && file.exists()) {
-                    file.delete();
-                }
-            }
-        }
-    }
-
-    /**
-     * 通过扩展字段,获取班级名称
-     *
-     * @param extendColumn 扩展字段
-     */
-    private String getClassName(String extendColumn) {
-        List<Map> mapList = JSONObject.parseArray(extendColumn, Map.class);
-        for (Map map : mapList) {
-            if (Objects.equals("className", map.get("code").toString())
-                    || Objects.equals("clazzName", map.get("code").toString())) {
-                return map.get("value").toString();
-            }
-        }
-        return "无";
-    }
-
-    /**
-     * 下载附件临时文件
-     *
-     * @param attachmentId 附件ID
-     * @param name         文件名称
-     * @param type         文件类型
-     */
-    private File downFileFromFss(String attachmentId, String name, SyncFileTypeEnum type) {
-        try {
-            if (Objects.nonNull(attachmentId)) {
-                BasicAttachment attachment = basicAttachmentService.getById(attachmentId);
-                if (attachment == null) {
-                    throw ExceptionResultEnum.ERROR.exception("附件数据异常");
-                }
-                String fileName = attachment.getName() + SystemConstant.HYPHEN + name + attachment.getType();
-                String dirName = dictionaryConfig.fssPrivateDomain().getConfig() + File.separator + "upload-temp" + File.separator + type.name().toLowerCase() + File.separator + System.currentTimeMillis();
-//                File file = SystemConstant.getFileTempDirVar(dirName, SystemConstant.getNanoId() + attachment.getType());
-                return teachcloudCommonService.copyFile(dirName, fileName, attachment);
-            }
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-        return null;
-    }
-}

+ 0 - 51
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java

@@ -92,57 +92,6 @@ public class ExamDetailCourseServiceImpl extends ServiceImpl<ExamDetailCourseMap
         return this.baseMapper.listByAndCourseCodeAndPaperNumber(schoolId, examId, courseCode, paperNumber);
     }
 
-    @Override
-    public IPage<SyncExamTaskDto> listSyncCourseByPrintPlanId(Long semesterId, Long examId, Long orgId, String cardType, String syncStatus, String courseCode, String paperNumber, Long startTime, Long endTime, Integer pageNumber, Integer pageSize) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        Page<SyncExamTaskDto> ipage = new Page<>(pageNumber, pageSize);
-        // 顶级机构
-        SysOrg rootOrg = sysOrgService.findRootOrg(sysUser.getSchoolId());
-        // 查询用户所在机构及以下机构
-        Set<Long> roomOrgIds = null;
-        if (orgId != null) {
-            roomOrgIds = teachcloudCommonService.listSubOrgIds(orgId);
-        }
-        Set<Long> orgIds = sysOrgService.findDeepOrgIdListByUserId(sysUser.getId());
-        IPage<SyncExamTaskDto> examTaskDtos = this.baseMapper.listSyncCourseByPrintPlanId(ipage, semesterId, examId, roomOrgIds, orgIds, cardType, syncStatus, courseCode, paperNumber, startTime, endTime);
-        for (SyncExamTaskDto examTaskDto : examTaskDtos.getRecords()) {
-            String paperType = examTaskDto.getPaperType();
-            List<String> paperTypes = Arrays.asList(paperType.split(","));
-            List<JSONObject> paperAttachments = JSON.parseArray(examTaskDto.getPaperAttachmentIds(), JSONObject.class).stream().filter(m -> paperTypes.contains(m.getString("name"))).collect(Collectors.toList());
-
-            Set<String> stringSet = new HashSet<>();
-            for (JSONObject jsonObject : paperAttachments) {
-                String cardTypeString = jsonObject.getString("cardType");
-                String createMethod = jsonObject.getString("createMethod");
-                if (cardTypeString.equals(CardTypeEnum.GENERIC.name()) && StringUtils.isNotBlank(createMethod) && createMethod.equals(CardCreateMethodEnum.UPLOAD.name())) {
-                    stringSet.add(SyncCardTypeEnum.GENERIC.getDesc());
-                } else {
-                    stringSet.add(SyncCardTypeEnum.CUSTOM.getDesc());
-                }
-            }
-            if (stringSet.size() > 0) {
-                examTaskDto.setSyncCardType(String.join(",", stringSet));
-            }
-
-            List<SysOrg> sysOrgList = sysOrgService.findByConnectByParentId(Long.valueOf(examTaskDto.getTeachingRoomId()), false, false);
-            if (sysOrgList.isEmpty()) {
-                throw ExceptionResultEnum.ERROR.exception(String.format("未找到课程[%s(%s)]所属机构及上级机构", examTaskDto.getCourseName(), examTaskDto.getCourseCode()));
-            }
-            Optional<SysOrg> optionalSysOrg = sysOrgList.stream().filter(m -> rootOrg.getId().equals(m.getParentId())).findFirst();
-            if (optionalSysOrg.isPresent()) {
-                SysOrg collegeOrg = optionalSysOrg.get();
-                examTaskDto.setCollegeId(String.valueOf(collegeOrg.getId()));
-                examTaskDto.setCollegeCode(collegeOrg.getCode());
-                examTaskDto.setCollegeName(collegeOrg.getName());
-            } else {
-                examTaskDto.setCollegeId("-");
-                examTaskDto.setCollegeCode("-");
-                examTaskDto.setCollegeName("-");
-            }
-        }
-        return examTaskDtos;
-    }
-
     @Override
     public List<ExamDetailCourseDto> listByPrintPlanIdAndExamTaskId(List<Long> printPlanIds, Long examTaskId, String paperType) {
         return this.baseMapper.listByPrintPlanIdAndExamTaskId(printPlanIds, examTaskId, paperType);

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

@@ -15,7 +15,6 @@ import com.qmth.distributed.print.business.bean.dto.ExamPaperStructureDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
 import com.qmth.distributed.print.business.bean.dto.ExamPaperSubjectiveStructureDto;
 import com.qmth.distributed.print.business.bean.marking.*;
-import com.qmth.distributed.print.business.bean.marking.status.ExamPaperStructureStatus;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
 import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
@@ -34,7 +33,6 @@ import com.qmth.teachcloud.common.enums.PushTypeEnum;
 import com.qmth.teachcloud.common.enums.QuestionType;
 import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.service.*;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
@@ -76,9 +74,6 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
     @Resource
     BasicAttachmentService basicAttachmentService;
 
-    @Resource
-    CloudMarkingTaskUtils cloudMarkingTaskUtils;
-
     @Resource
     BasicSemesterService basicSemesterService;
 
@@ -296,27 +291,6 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
         return examPaperStructure;
     }
 
-    @Override
-    public List<Map> preStructure(Long id) {
-        if (Objects.isNull(id)) {
-            throw ExceptionResultEnum.ERROR.exception("参数有误");
-        }
-        ExamPaperStructure examPaperStructure = this.getById(id);
-        ExamTask examTask = examTaskService.getByCourseCodeAndPaperNumber(examPaperStructure.getSchoolId(), examPaperStructure.getExamId(), examPaperStructure.getCourseCode(), examPaperStructure.getPaperNumber());
-        String paperType = examPaperStructure.getPaperType();
-        List<Map> list = new ArrayList<>();
-        for (String str : paperType.split(",")) {
-            Map<String, Object> map = new HashMap<>();
-            map.put("paperType", str);
-            String subjectCode = examTask.getCourseCode() + str + examTask.getSequence();
-            String result = cloudMarkingTaskUtils.queryPaperStructure(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), subjectCode, str);
-            List<Map> paperStructure = JSONObject.parseArray(JSONObject.toJSON(result).toString(), Map.class);
-            map.put("content", paperStructure);
-            list.add(map);
-        }
-        return list;
-    }
-
     @Override
     public Map<QuestionType, List<Question>> parseExamCloudPaperStruct(List<ExamCloudPaperStructDto> examCloudPaperStructDtoList) {
         Map<QuestionType, List<Question>> result = new HashMap<>();
@@ -518,22 +492,7 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
 
     @Override
     public void subjectCalculate() {
-        QueryWrapper<ExamPaperStructure> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamPaperStructure::getObjectAnswerChange, true)
-                .orderByAsc(ExamPaperStructure::getSchoolId)
-                .orderByAsc(ExamPaperStructure::getCourseCode)
-                .orderByAsc(ExamPaperStructure::getSequence);
-        List<ExamPaperStructure> examPaperStructureList = this.list(queryWrapper);
-        for (ExamPaperStructure examPaperStructure : examPaperStructureList) {
-            String subjectCode = examPaperStructure.getCourseCode() + examPaperStructure.getPaperType() + examPaperStructure.getSequence();
-            boolean subjectCalculate = cloudMarkingTaskUtils.subjectCalculate(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), subjectCode);
-            // 更新状态
-            if (subjectCalculate) {
-                UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
-                updateWrapper.lambda().set(ExamPaperStructure::getObjectAnswerChange, false).eq(ExamPaperStructure::getId, examPaperStructure.getId());
-                this.update(updateWrapper);
-            }
-        }
+        // todo 3.3.0更新
     }
 
     @Override

+ 4 - 50
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java

@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.bean.dto.*;
+import com.qmth.distributed.print.business.bean.dto.ClientPrintStatisticsDto;
+import com.qmth.distributed.print.business.bean.dto.ClientPrintStatisticsTotalDto;
+import com.qmth.distributed.print.business.bean.dto.ClientPrintTaskDto;
+import com.qmth.distributed.print.business.bean.dto.ClientPrintTaskTotalDto;
 import com.qmth.distributed.print.business.bean.params.DeleteParams;
 import com.qmth.distributed.print.business.bean.params.PrintPlanParams;
-import com.qmth.distributed.print.business.bean.params.SyncDataParam;
 import com.qmth.distributed.print.business.bean.result.PrintPlanBrief;
 import com.qmth.distributed.print.business.bean.result.PrintPlanResult;
 import com.qmth.distributed.print.business.bean.result.TemplatePrintInfoResult;
@@ -18,7 +20,6 @@ import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
 import com.qmth.distributed.print.business.mapper.ExamPrintPlanMapper;
 import com.qmth.distributed.print.business.service.*;
-import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
@@ -28,7 +29,6 @@ import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ClassifyEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.*;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -57,9 +57,6 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
     @Resource
     private ExamDetailService examDetailService;
 
-    @Resource
-    private BasicExamService basicExamService;
-
     @Resource
     private SysOrgService sysOrgService;
 
@@ -87,12 +84,6 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
     @Resource
     ExamDetailCourseService examDetailCourseService;
 
-    @Resource
-    AsyncCloudMarkingTaskService asyncCloudMarkingTaskService;
-
-    @Resource
-    CloudMarkingTaskUtils cloudMarkingTaskUtils;
-
     @Resource
     BasicTemplateService basicTemplateService;
 
@@ -424,25 +415,6 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         return clientPrintStatisticsTotalDto;
     }
 
-    @Override
-    public void syncDataCloud(SyncDataParam syncDataParam) {
-        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-
-        List<SyncExamTaskDto> params = syncDataParam.getList();
-        if (CollectionUtils.isEmpty(params)) {
-            throw ExceptionResultEnum.ERROR.exception("请选择需要推送的数据");
-        }
-        if (StringUtils.isBlank(syncDataParam.getThirdRelateName())) {
-            throw ExceptionResultEnum.ERROR.exception("考试名称必填");
-        } else if (StringUtils.isNotBlank(syncDataParam.getThirdRelateName())
-                && Objects.isNull(syncDataParam.getExamTime())) {
-            throw ExceptionResultEnum.ERROR.exception("考试时间必填");
-        }
-        // 校验同步数据的所属学院(机构)是否为空
-        checkSyncMode(syncDataParam);
-        asyncCloudMarkingTaskService.syncExamAndStudentAndCard(schoolId, syncDataParam);
-    }
-
     @Override
     public ExamPrintPlan findByExamDetailId(Long examDetailId) {
         ExamDetail examDetail = examDetailService.getById(examDetailId);
@@ -499,24 +471,6 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         return this.list(queryWrapper);
     }
 
-    @Override
-    public IPage<SyncExamTaskDto> listSyncExamTask(Long semesterId, Long examId, Long orgId, String cardType, String syncStatus, String courseCode, String paperNumber, Long startTime, Long endTime, Integer pageNumber, Integer pageSize) {
-        return examDetailCourseService.listSyncCourseByPrintPlanId(semesterId, examId, orgId, cardType, syncStatus, courseCode, paperNumber, startTime, endTime, pageNumber, pageSize);
-    }
-
-    @Override
-    public void checkSyncMode(SyncDataParam syncDataParam) {
-        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        if (cloudMarkingTaskUtils.isCollegeMode(schoolId)) {
-            // 查询科目所属学院是否一致
-            for (SyncExamTaskDto param : syncDataParam.getList()) {
-                if (param.getCollegeCode() == null) {
-                    throw ExceptionResultEnum.ERROR.exception(String.format("未找到课程[%s(%s)]所属学院", param.getCourseName(), param.getCourseCode()));
-                }
-            }
-        }
-    }
-
     @Override
     public void updateAttachmentIdByTemplateId(Long templateId, Long attachmentId) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());

+ 4 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradePaperStructServiceImpl.java

@@ -24,7 +24,6 @@ import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.QuestionType;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.jetbrains.annotations.NotNull;
@@ -56,8 +55,6 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
     private ExamPaperStructureService examPaperStructureService;
     @Resource
     private ExamTaskService examTaskService;
-    @Resource
-    private CloudMarkingTaskUtils cloudMarkingTaskUtils;
 
     @Override
     public List<GradePaperStructResult> findGradePaperStructureResultList(Long examId, String paperNumber, String paperType, SysUser requestUser) {
@@ -191,7 +188,7 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
                 throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(finalExcelErrorList));
             }
             return finalExcelList;
-        },1);
+        }, 1);
         GradePaperStructParam gradePaperStructParam = new GradePaperStructParam();
         gradePaperStructParam.setPaperNumber(paperNumber);
         gradePaperStructParam.setPaperType(paperType);
@@ -293,8 +290,9 @@ public class GradePaperStructServiceImpl extends ServiceImpl<GradePaperStructMap
 //            }
 //        }
 
-        String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, paperType);
-        examPaperStructure.setCloudInfoJson(cloudInfoJson);
+        // todo 3.3.0待更新
+//        String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, paperType);
+//        examPaperStructure.setCloudInfoJson(cloudInfoJson);
         examPaperStructure.setStructureChange(false);
         examPaperStructureService.updateById(examPaperStructure);
 

+ 27 - 36
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/SsoServiceImpl.java

@@ -13,7 +13,6 @@ import com.qmth.teachcloud.common.enums.OrgTypeEnum;
 import com.qmth.teachcloud.common.enums.RoleTypeEnum;
 import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
 import com.qmth.teachcloud.common.service.*;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
 import com.qmth.teachcloud.common.util.JacksonUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.slf4j.Logger;
@@ -36,9 +35,6 @@ public class SsoServiceImpl implements SsoService {
     @Autowired
     private SysUserService sysUserService;
 
-    @Autowired
-    CloudMarkingTaskUtils stmmsUtils;
-
     @Resource
     CommonCacheService commonCacheService;
 
@@ -51,9 +47,6 @@ public class SsoServiceImpl implements SsoService {
     @Resource
     SysUserRoleService sysUserRoleService;
 
-    @Resource
-    CloudMarkingTaskUtils cloudMarkingTaskUtils;
-
     @Override
     public Map<String, Object> markerLoginInfo() {
         try {
@@ -64,22 +57,20 @@ public class SsoServiceImpl implements SsoService {
                 throw ExceptionResultEnum.ERROR.exception("该用户没有评卷员角色,无法登录");
             }
 
-            String orgCode = null;
-            if (cloudMarkingTaskUtils.isCollegeMode(sysUser.getSchoolId())) {
-                // 顶级机构
-                SysOrg rootOrg = sysOrgService.findRootOrg(sysUser.getSchoolId());
-                List<SysOrg> sysOrgList = sysOrgService.findByConnectByParentId(sysUser.getOrgId(), false, false);
-                if (sysOrgList.isEmpty()) {
-                    throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属机构及上级机构", sysUser.getLoginName()));
-                }
-                Optional<SysOrg> orgOptional = sysOrgList.stream().filter(m -> m.getParentId() != null && m.getParentId().equals(rootOrg.getId())).findFirst();
-                if (!orgOptional.isPresent()) {
-                    throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属学院", sysUser.getLoginName()));
-                }
-                SysOrg collegeOrg = orgOptional.get();
-                orgCode = collegeOrg.getCode();
+            // 顶级机构
+            SysOrg rootOrg = sysOrgService.findRootOrg(sysUser.getSchoolId());
+            List<SysOrg> sysOrgList = sysOrgService.findByConnectByParentId(sysUser.getOrgId(), false, false);
+            if (sysOrgList.isEmpty()) {
+                throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属机构及上级机构", sysUser.getLoginName()));
+            }
+            Optional<SysOrg> orgOptional = sysOrgList.stream().filter(m -> m.getParentId() != null && m.getParentId().equals(rootOrg.getId())).findFirst();
+            if (!orgOptional.isPresent()) {
+                throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属学院", sysUser.getLoginName()));
             }
-            return stmmsUtils.markLogin(sysUser, orgCode);
+            SysOrg collegeOrg = orgOptional.get();
+            // 3.3.0待更新
+//            return stmmsUtils.markLogin(sysUser, orgCode);
+            return null;
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception(e.getMessage());
         }
@@ -96,21 +87,21 @@ public class SsoServiceImpl implements SsoService {
             }
 
             String orgCode = null;
-            if (cloudMarkingTaskUtils.isCollegeMode(sysUser.getSchoolId())) {
-                // 顶级机构
-                SysOrg rootOrg = sysOrgService.findRootOrg(sysUser.getSchoolId());
-                List<SysOrg> sysOrgList = sysOrgService.findByConnectByParentId(sysUser.getOrgId(), false, false);
-                if (sysOrgList.isEmpty()) {
-                    throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属机构及上级机构", sysUser.getLoginName()));
-                }
-                Optional<SysOrg> orgOptional = sysOrgList.stream().filter(m -> m.getParentId() != null && m.getParentId().equals(rootOrg.getId())).findFirst();
-                if (!orgOptional.isPresent()) {
-                    throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属学院", sysUser.getLoginName()));
-                }
-                SysOrg collegeOrg = orgOptional.get();
-                orgCode = collegeOrg.getCode();
+            // 顶级机构
+            SysOrg rootOrg = sysOrgService.findRootOrg(sysUser.getSchoolId());
+            List<SysOrg> sysOrgList = sysOrgService.findByConnectByParentId(sysUser.getOrgId(), false, false);
+            if (sysOrgList.isEmpty()) {
+                throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属机构及上级机构", sysUser.getLoginName()));
+            }
+            Optional<SysOrg> orgOptional = sysOrgList.stream().filter(m -> m.getParentId() != null && m.getParentId().equals(rootOrg.getId())).findFirst();
+            if (!orgOptional.isPresent()) {
+                throw ExceptionResultEnum.ERROR.exception(String.format("未找到用户账号[%s]所属学院", sysUser.getLoginName()));
             }
-            return stmmsUtils.markLeaderLogin(sysUser, orgCode);
+            SysOrg collegeOrg = orgOptional.get();
+            orgCode = collegeOrg.getCode();
+            //todo 3.3.0待更新
+//            return stmmsUtils.markLeaderLogin(sysUser, orgCode);
+            return null;
         } catch (Exception e) {
             throw ExceptionResultEnum.ERROR.exception(e.getMessage());
         }

+ 4 - 38
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TBSyncTaskServiceImpl.java

@@ -8,11 +8,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.entity.ExamPaperStructure;
 import com.qmth.distributed.print.business.entity.TBSyncTask;
 import com.qmth.distributed.print.business.mapper.TBSyncTaskMapper;
-import com.qmth.distributed.print.business.service.*;
-import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
+import com.qmth.distributed.print.business.service.ExamPaperStructureService;
+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.templete.execute.AsyncTeachCloudReportService;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
-import com.qmth.teachcloud.common.bean.params.UserPushParam;
 import com.qmth.teachcloud.common.bean.result.SyncListResult;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.SysUser;
@@ -21,14 +22,12 @@ import com.qmth.teachcloud.common.enums.PushTypeEnum;
 import com.qmth.teachcloud.common.enums.TaskResultEnum;
 import com.qmth.teachcloud.common.enums.TaskStatusEnum;
 import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
-import com.qmth.teachcloud.common.service.SysUserService;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -39,9 +38,6 @@ import java.util.Objects;
 @Service
 public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncTask> implements TBSyncTaskService {
 
-    @Resource
-    AsyncCloudMarkingTaskService asyncCloudMarkingTaskService;
-
     @Resource
     ExamPaperStructureService examPaperStructureService;
 
@@ -54,15 +50,6 @@ public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncT
     @Resource
     GradeBatchPaperService gradeBatchPaperService;
 
-    @Resource
-    CloudUserPushService cloudUserPushService;
-
-    @Resource
-    DataSyncService dataSyncService;
-
-    @Resource
-    SysUserService sysUserService;
-
     @Resource
     BasicRoleDataPermissionService basicRoleDataPermissionService;
 
@@ -258,20 +245,6 @@ public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncT
             throw ExceptionResultEnum.ERROR.exception("任务同步成功");
         }
         switch (tbSyncTask.getType()) {
-            case EXAM_PUSH:
-                List<TBSyncTask> tbSyncTaskList = Arrays.asList(tbSyncTask);
-                dataSyncService.syncExamAndStudentAndCard(tbSyncTask.getOrgCode(), tbSyncTask.getThirdRelateName(), tbSyncTask.getExamTime(), tbSyncTaskList, requestUser);
-
-                break;
-            case STRUCTURE_GROUP_PUSH:
-                asyncCloudMarkingTaskService.syncPaperStructureAndGroup(examPaperStructureService.getById(tbSyncTask.getObjectId()));
-                break;
-            case PAPER_ANSWER_FILE_PUSH:
-                asyncCloudMarkingTaskService.syncPaperAndAnswer(examPaperStructureService.getById(tbSyncTask.getObjectId()));
-                break;
-            case OBJECTIVE_ANSWER_PUSH:
-                asyncCloudMarkingTaskService.syncObjectiveStructure(examPaperStructureService.getById(tbSyncTask.getObjectId()));
-                break;
             case GRADE_BATCH_PUSH:
                 asyncTeachCloudReportService.syncGradeBatch(gradeBatchService.getById(tbSyncTask.getObjectId()));
                 break;
@@ -280,13 +253,6 @@ public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncT
                 break;
             case CALCULATE:
                 asyncTeachCloudReportService.startCalc(gradeBatchService.getById(tbSyncTask.getObjectId()));
-                break;
-            case MARKER_PUSH:
-                asyncCloudMarkingTaskService.syncMarkerAndClass(examPaperStructureService.getById(tbSyncTask.getObjectId()));
-                break;
-            case MARK_LEADER_PUSH:
-                asyncCloudMarkingTaskService.syncMarkLeader(examPaperStructureService.getById(tbSyncTask.getObjectId()));
-                break;
             default:
                 break;
         }

+ 0 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TSyncExamLogServiceImpl.java

@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.entity.TSyncExamLog;
 import com.qmth.distributed.print.business.mapper.TSyncExamLogMapper;
 import com.qmth.distributed.print.business.service.TSyncExamLogService;
-import com.qmth.distributed.print.business.templete.execute.AsyncScorePushService;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.TaskStatusEnum;
@@ -25,9 +24,6 @@ import java.util.stream.Collectors;
 @Service
 public class TSyncExamLogServiceImpl extends ServiceImpl<TSyncExamLogMapper, TSyncExamLog> implements TSyncExamLogService {
 
-    @Resource
-    AsyncScorePushService asyncScorePushService;
-
     @Resource
     private TeachcloudCommonService teachcloudCommonService;
 

+ 0 - 142
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncCloudMarkingTaskService.java

@@ -1,142 +0,0 @@
-package com.qmth.distributed.print.business.templete.execute;
-
-import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSON;
-import com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto;
-import com.qmth.distributed.print.business.bean.params.SyncDataParam;
-import com.qmth.distributed.print.business.entity.ExamPaperStructure;
-import com.qmth.distributed.print.business.entity.TBSyncTask;
-import com.qmth.distributed.print.business.service.DataSyncService;
-import com.qmth.distributed.print.business.service.TBSyncTaskService;
-import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.enums.PushTypeEnum;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
-import com.qmth.teachcloud.common.util.ServletUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * 异步同步云阅卷
- */
-@Service
-public class AsyncCloudMarkingTaskService {
-
-    private final static Logger log = LoggerFactory.getLogger(AsyncCloudMarkingTaskService.class);
-
-    @Lazy
-    @Resource
-    private DataSyncService dataSyncService;
-
-    @Resource
-    private TBSyncTaskService tbSyncTaskService;
-
-    @Resource
-    private CloudMarkingTaskUtils cloudMarkingTaskUtils;
-
-    /**
-     * 同步考试、考生、科目、题卡
-     *
-     * @param schoolId 学校ID
-     */
-    public void syncExamAndStudentAndCard(Long schoolId, SyncDataParam syncDataParam) {
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        String thirdRelateName = syncDataParam.getThirdRelateName();
-        String examTime = Objects.isNull(syncDataParam.getExamTime()) ? null : DateUtil.format(new Date(syncDataParam.getExamTime()), CloudMarkingTaskUtils.DATE_FORMAT);
-
-        // 分学院
-        if (cloudMarkingTaskUtils.isCollegeMode(schoolId)) {
-            // 按学院code进行分组,并按学院进行循环同步
-            Map<String, List<SyncExamTaskDto>> byCollegeCodeMap = syncDataParam.getList().stream().collect(Collectors.groupingBy(SyncExamTaskDto::getCollegeCode));
-            for (Map.Entry<String, List<SyncExamTaskDto>> entry : byCollegeCodeMap.entrySet()) {
-                // 本行为,若为按学校同步,则后续方法都传null,方便校验
-                String orgCode = entry.getKey();
-                List<SyncExamTaskDto> syncExamTaskDtos = entry.getValue();
-                List<TBSyncTask> tbSyncTaskList = new ArrayList<>();
-                for (SyncExamTaskDto syncExamTaskDto : syncExamTaskDtos) {
-                    TBSyncTask tbSyncTask = tbSyncTaskService.saveTaskBaseData(schoolId, syncExamTaskDto.getSemesterId(), syncExamTaskDto.getExamId(), syncExamTaskDto.getCourseCode(), syncExamTaskDto.getCourseName(), syncExamTaskDto.getPaperNumber(), Long.valueOf(syncExamTaskDto.getExamTaskId()), orgCode, thirdRelateName, examTime, PushTypeEnum.EXAM_PUSH, JSON.toJSONString(syncExamTaskDto));
-                    tbSyncTaskList.add(tbSyncTask);
-                }
-                dataSyncService.syncExamAndStudentAndCard(orgCode, thirdRelateName, examTime, tbSyncTaskList, sysUser);
-            }
-        } else {
-            List<TBSyncTask> tbSyncTaskList = new ArrayList<>();
-            for (SyncExamTaskDto syncExamTaskDto : syncDataParam.getList()) {
-                TBSyncTask tbSyncTask = tbSyncTaskService.saveTaskBaseData(schoolId, syncExamTaskDto.getSemesterId(), syncExamTaskDto.getExamId(), syncExamTaskDto.getCourseCode(), syncExamTaskDto.getCourseName(), syncExamTaskDto.getPaperNumber(), Long.valueOf(syncExamTaskDto.getExamTaskId()), null, thirdRelateName, examTime, PushTypeEnum.EXAM_PUSH, JSON.toJSONString(syncExamTaskDto));
-                tbSyncTaskList.add(tbSyncTask);
-            }
-            dataSyncService.syncExamAndStudentAndCard(null, thirdRelateName, examTime, tbSyncTaskList, sysUser);
-        }
-    }
-
-    /**
-     * 同步试卷结构、分组信息、评卷员绑定关系
-     *
-     * @param examPaperStructure 试卷结构对象
-     */
-    public void syncPaperStructureAndGroup(ExamPaperStructure examPaperStructure) {
-        if (examPaperStructure == null) {
-            throw ExceptionResultEnum.ERROR.exception("未找到同步数据");
-        }
-        TBSyncTask tbSyncTask = tbSyncTaskService.saveTaskStructure(examPaperStructure.getSchoolId(), examPaperStructure, examPaperStructure.getId(), PushTypeEnum.STRUCTURE_GROUP_PUSH, null);
-        dataSyncService.syncPaperStructureAndGroup(examPaperStructure, tbSyncTask);
-    }
-
-    /**
-     * 同步试卷文件、标签文件
-     *
-     * @param examPaperStructure 试卷结构对象
-     */
-    public void syncPaperAndAnswer(ExamPaperStructure examPaperStructure) {
-        if (examPaperStructure == null) {
-            throw ExceptionResultEnum.ERROR.exception("请先设置评卷参数");
-        }
-        TBSyncTask tbSyncTask = tbSyncTaskService.saveTaskStructure(examPaperStructure.getSchoolId(), examPaperStructure, examPaperStructure.getId(), PushTypeEnum.PAPER_ANSWER_FILE_PUSH, null);
-        dataSyncService.syncPaperAndAnswer(examPaperStructure, tbSyncTask);
-    }
-
-    /**
-     * 同步客观题答案
-     *
-     * @param examPaperStructure 试卷结构对象
-     */
-    public void syncObjectiveStructure(ExamPaperStructure examPaperStructure) {
-        if (examPaperStructure == null) {
-            throw ExceptionResultEnum.ERROR.exception("请先设置评卷参数");
-        }
-        TBSyncTask tbSyncTask = tbSyncTaskService.saveTaskStructure(examPaperStructure.getSchoolId(), examPaperStructure, examPaperStructure.getId(), PushTypeEnum.OBJECTIVE_ANSWER_PUSH, null);
-        dataSyncService.syncObjectiveStructure(examPaperStructure, tbSyncTask);
-    }
-
-    /**
-     * 绑定科组长
-     *
-     * @param examPaperStructure 试卷结构对象
-     */
-    public void syncMarkLeader(ExamPaperStructure examPaperStructure) {
-        if (examPaperStructure == null) {
-            throw ExceptionResultEnum.ERROR.exception("请先设置评卷参数");
-        }
-        TBSyncTask tbSyncTask = tbSyncTaskService.saveTaskStructure(examPaperStructure.getSchoolId(), examPaperStructure, examPaperStructure.getId(), PushTypeEnum.MARK_LEADER_PUSH, null);
-        dataSyncService.syncMarkLeader(examPaperStructure, tbSyncTask);
-    }
-
-    /**
-     * 同步试卷结构、分组信息、评卷员绑定关系
-     *
-     * @param examPaperStructure 试卷结构对象
-     */
-    public void syncMarkerAndClass(ExamPaperStructure examPaperStructure) {
-        if (examPaperStructure == null) {
-            throw ExceptionResultEnum.ERROR.exception("未找到同步数据");
-        }
-        TBSyncTask tbSyncTask = tbSyncTaskService.saveTaskStructure(examPaperStructure.getSchoolId(), examPaperStructure, examPaperStructure.getId(), PushTypeEnum.MARKER_PUSH, null);
-        dataSyncService.syncMarkerAndClass(examPaperStructure, tbSyncTask);
-    }
-}

+ 0 - 90
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncScorePushService.java

@@ -1,90 +0,0 @@
-package com.qmth.distributed.print.business.templete.execute;
-
-import cn.hutool.core.date.DateUtil;
-import com.qmth.boot.api.exception.ApiException;
-import com.qmth.distributed.print.business.entity.TBSyncTask;
-import com.qmth.distributed.print.business.entity.TSyncExamLog;
-import com.qmth.distributed.print.business.service.TBSyncTaskService;
-import com.qmth.distributed.print.business.service.TSyncExamLogService;
-import com.qmth.distributed.print.business.templete.push.AsyncPushTaskTemplate;
-import com.qmth.distributed.print.business.templete.service.PushLogicService;
-import com.qmth.teachcloud.common.contant.SpringContextHolder;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.enums.TaskResultEnum;
-import com.qmth.teachcloud.common.enums.TaskStatusEnum;
-import com.qmth.teachcloud.common.util.Result;
-import com.qmth.teachcloud.common.util.ResultUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.Map;
-import java.util.Objects;
-import java.util.StringJoiner;
-
-/**
- * @Description: 成绩查询推送模板
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2021/11/2
- */
-@Service
-public class AsyncScorePushService extends AsyncPushTaskTemplate {
-
-    private final static Logger log = LoggerFactory.getLogger(AsyncSysUserDataImportService.class);
-
-    public static final String OBJ_TITLE = "成绩信息";
-
-    @Override
-    public Result pushTask(TSyncExamLog tSyncExamLog) {
-        StringJoiner stringJoinerSummary = new StringJoiner("\n")
-                .add(MessageFormat.format("{0}{1}{2}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), BEGIN_TITLE, OBJ_TITLE));
-        tSyncExamLog.setStatus(TaskStatusEnum.RUNNING);
-        tSyncExamLog.setStartTime(System.currentTimeMillis());
-        TSyncExamLogService tSyncExamLogService = SpringContextHolder.getBean(TSyncExamLogService.class);
-        tSyncExamLogService.updateById(tSyncExamLog);
-        try {
-            PushLogicService pushLogicService = SpringContextHolder.getBean(PushLogicService.class);
-            Map<String, Object> result = pushLogicService.executeScorePushLogic(tSyncExamLog);
-            // 总考生数
-            Integer count = Integer.parseInt(String.valueOf(result.get("count")));
-            tSyncExamLog.setTotalStudents(count);
-
-            // 成功考生数
-            Integer correct = Integer.parseInt(String.valueOf(result.get("correct")));
-            tSyncExamLog.setSuccessStudents(correct);
-            // 失败考生数
-            if(result.containsKey("errorCount")){
-                Integer errorCount = Integer.parseInt(String.valueOf(result.get("errorCount")));
-                tSyncExamLog.setFailStudents(errorCount);
-            } else {
-                tSyncExamLog.setFailStudents(0);
-            }
-
-            // 总课程数
-            Integer courses = Integer.parseInt(String.valueOf(result.get("courses")));
-            tSyncExamLog.setTotalCourses(courses);
-
-            stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}{4}{5}{6}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), FINISH_TITLE, count, SUCCESS_TITLE, Integer.parseInt(String.valueOf(result.get("correct"))), FINISH_SIZE, Objects.nonNull(result.get("error")) ? (String) result.get("error") : ""));
-            tSyncExamLog.setEndTime(System.currentTimeMillis());
-            tSyncExamLog.setResult(TaskResultEnum.SUCCESS);
-        } catch (Exception e) {
-            log.error(SystemConstant.LOG_ERROR, e);
-            stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), EXCEPTION_TITLE, EXCEPTION_DATA, e.getMessage()));
-            tSyncExamLog.setEndTime(System.currentTimeMillis());
-            tSyncExamLog.setResult(TaskResultEnum.ERROR);
-            if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        } finally {//生成txt文件
-            tSyncExamLog.setSummary(stringJoinerSummary.toString());
-            super.createTxt(tSyncExamLog);
-        }
-        return ResultUtil.ok(tSyncExamLog);
-    }
-}

+ 0 - 21
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/PushLogicService.java

@@ -1,21 +0,0 @@
-package com.qmth.distributed.print.business.templete.service;
-
-import com.qmth.distributed.print.business.entity.TSyncExamLog;
-
-import java.util.Map;
-
-/**
- * @Description: 同步推送处理逻辑接口
- * @Author: CaoZixuan
- * @Date: 2021-11-01
- */
-public interface PushLogicService {
-
-    /**
-     * 成绩查询推送异步任务处理方法
-     *
-     * @param tSyncExamLog 任务源
-     * @return 结果
-     */
-    Map<String, Object> executeScorePushLogic(TSyncExamLog tSyncExamLog) throws Exception;
-}

+ 0 - 142
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PushLogicServiceImpl.java

@@ -1,142 +0,0 @@
-package com.qmth.distributed.print.business.templete.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.qmth.distributed.print.business.entity.TSyncExamLog;
-import com.qmth.distributed.print.business.entity.TSyncExamStudentScore;
-import com.qmth.distributed.print.business.service.ExamStudentService;
-import com.qmth.distributed.print.business.service.TSyncExamStudentScoreService;
-import com.qmth.distributed.print.business.templete.service.PushLogicService;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.util.*;
-
-/**
- * @Description: 同步推送处理逻辑接口实现类
- * @Author: CaoZixuan
- * @Date: 2021-11-01
- */
-@Service
-public class PushLogicServiceImpl implements PushLogicService {
-    private final static Logger log = LoggerFactory.getLogger(PushLogicServiceImpl.class);
-
-    @Resource
-    CloudMarkingTaskUtils cloudMarkingTaskUtils;
-
-    @Resource
-    TSyncExamStudentScoreService tSyncExamStudentScoreService;
-
-    @Resource
-    ExamStudentService examStudentService;
-
-    /**
-     * 成绩查询推送异步任务处理方法
-     *
-     * @param tSyncExamLog 任务源
-     * @return
-     */
-    @Override
-    @Transactional
-    public Map<String, Object> executeScorePushLogic(TSyncExamLog tSyncExamLog) {
-        Long schoolId = tSyncExamLog.getSchoolId();
-        Long semesterId = tSyncExamLog.getSemesterId();
-        Long examId = tSyncExamLog.getExamId();
-        Integer thirdRelateId = Integer.valueOf(String.valueOf(tSyncExamLog.getThirdRelateId()));
-        List<TSyncExamStudentScore> tSyncExamStudentScoreList = new ArrayList<>();
-        List<String> errorTSyncExamStudentScoreList = new ArrayList<>();
-        Set<String> courseList = new HashSet<>();
-        Map<String, Object> map = new HashMap<>();
-        try {
-            int totalCount = cloudMarkingTaskUtils.getStudentCount(schoolId, thirdRelateId, null, null, null, null, null, null, null);
-            log.info("云阅卷:考试成绩考生数量查询接口调用,返回数量:{}", totalCount);
-            if (totalCount > 0) {
-                int pageSize = cloudMarkingTaskUtils.getDefaultPageSize();
-                int mod = totalCount % pageSize;
-                int pageNos = mod == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
-                for (int i = 1; i <= pageNos; i++) {
-                    List<Map> students = cloudMarkingTaskUtils.getStudentScore(schoolId, thirdRelateId, null, null, null, null, null, null, null, true, i, pageSize);
-                    for (Map student : students) {
-                        try {
-                            Long orgId = null, clazzId = null;
-                            String clazzName = "";
-                            String majorName = "";
-                            String paperNumber = "";
-                            if (Objects.nonNull(student.get("studentCode")) && !Objects.equals("无", student.get("studentCode"))) {
-                                String studentCode = String.valueOf(student.get("studentCode"));
-                                String subjectCode = String.valueOf(student.get("subjectCode"));
-                                String examNumber = String.valueOf(student.get("examNumber"));
-
-                                courseList.add(subjectCode);
-
-                                // 分布式印刷系统内部考生信息
-                                List<Map> studentInfos = examStudentService.listStudentScoreSync(schoolId, studentCode, examNumber, subjectCode);
-                                if (studentInfos == null || studentInfos.size() == 0) {
-                                    throw ExceptionResultEnum.ERROR.exception("未找到此考生信息");
-                                }
-                                Map dpsPrintStuMap = studentInfos.get(0);
-
-                                // 组装本系统内考生信息
-                                clazzId = dpsPrintStuMap.get("clazzId") == null || "".equals(dpsPrintStuMap.get("clazzId")) ? null : Long.parseLong(String.valueOf(dpsPrintStuMap.get("clazzId")));
-                                clazzName = dpsPrintStuMap.get("clazzName") != null ? String.valueOf(dpsPrintStuMap.get("clazzName")) : null;
-                                majorName = dpsPrintStuMap.get("majorName") != null ? String.valueOf(dpsPrintStuMap.get("majorName")) : null;
-                                paperNumber = String.valueOf(dpsPrintStuMap.get("paperNumber"));
-                                student.put("clazzId", clazzId);
-                                student.put("clazzName", clazzName);
-                                student.put("majorName", majorName);
-                                student.put("paperNumber", paperNumber);
-                            }
-
-                            student.put(SystemConstant.SCHOOL_ID, schoolId);
-                            student.put("semesterId", semesterId);
-                            student.put("examId", examId);
-                            student.put("thirdRelateId", thirdRelateId);
-                            student.put("orgId", orgId);
-                            student.put("userId", tSyncExamLog.getCreateId());
-                            // 成功数据
-                            tSyncExamStudentScoreList.add(new TSyncExamStudentScore(student));
-                        } catch (Exception e) {
-                            log.info("同步学生成绩信息失败:{}", e.getMessage());
-                            // 失败数据
-                            errorTSyncExamStudentScoreList.add(student.get("name") + "," + student.get("examNumber") + ",错误原因:[" + e.getMessage() + "]" + "\r\n");
-                        }
-                    }
-                }
-                if (tSyncExamStudentScoreList.size() > 0) {
-                    tSyncExamStudentScoreService.remove(new QueryWrapper<TSyncExamStudentScore>().lambda().eq(TSyncExamStudentScore::getSchoolId, schoolId)
-                            .eq(TSyncExamStudentScore::getSemesterId, semesterId)
-                            .eq(TSyncExamStudentScore::getExamId, Long.parseLong(String.valueOf(examId)))
-                            .eq(TSyncExamStudentScore::getThirdRelateId, thirdRelateId));
-                    tSyncExamStudentScoreService.saveOrUpdateBatch(tSyncExamStudentScoreList);
-                }
-            }
-
-            map.putIfAbsent("count", totalCount);
-            map.putIfAbsent("courses", courseList.size());
-            map.computeIfAbsent("correct", e -> tSyncExamStudentScoreList.size());
-            if (Objects.nonNull(errorTSyncExamStudentScoreList) && errorTSyncExamStudentScoreList.size() > 0) {
-                map.computeIfAbsent("errorCount", e -> errorTSyncExamStudentScoreList.size());
-                map.computeIfAbsent("error", e -> "未同步成功数据" + errorTSyncExamStudentScoreList.size() + "条:\r\n" + errorTSyncExamStudentScoreList.toString());
-            }
-        } catch (Exception e) {
-            log.info("云阅卷:接口调用失败:{}", e.getMessage());
-            throw new RuntimeException("云阅卷:接口调用失败:" + e.getMessage());
-        }
-
-//        if (!tSyncExamStudentScoreList.isEmpty()) {
-//            try {
-//                for (TSyncExamStudentScore tSyncExamStudentScore : tSyncExamStudentScoreList) {
-//                    tSyncExamStudentScoreService.createImageTrajectory(tSyncExamStudentScore, ImageTrajectoryEnum.PREVIEW, true, tSyncExamLog.getCreateId());
-//                }
-//            } catch (Exception e) {
-//
-//            }
-//        }
-        return map;
-    }
-}

+ 0 - 141
distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml

@@ -120,147 +120,6 @@
                 AND a.course_code = #{courseCode}
                 AND a.paper_number = #{paperNumber}
     </select>
-    <select id="listSyncCourseByPrintPlanId"
-            resultType="com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto">
-        SELECT
-            ets.semester_id semesterId,
-            ets.exam_id examId,
-            et.id examTaskId,
-            et.course_code courseCode,
-            et.course_name courseName,
-            et.paper_number paperNumber,
-            t.paper_type paperType,
-            et.sequence,
-            t.exam_start_time startTime,
-            t.exam_end_time endTime,
-            t.total_subjects totalSubjects,
-            t.print_plan_ids printPlanIds,
-            ets.third_relate_id thirdRelateId,
-            tsse.exam_name thirdRelateName,
-            ifnull(ets.sync_status, 'INIT') syncStatus,
-            su.real_name syncUserName,
-            bc.teaching_room_id teachingRoomId,
-            etd.paper_attachment_ids paperAttachmentIds
-        FROM
-            exam_task et
-                 JOIN
-                (SELECT
-                 b.school_id,
-                 c.exam_id,
-                 b.paper_number,
-                 b.paper_type,
-                 c.exam_start_time,
-                 c.exam_end_time,
-                 SUM(b.total_subjects) total_subjects,
-                 group_concat(c.print_plan_id) print_plan_ids,
-                 sum(case c.status when 'FINISH' then 0 else 1 end) notFinishCount
-             FROM
-                 exam_detail_course b
-                     LEFT JOIN exam_detail c ON b.exam_detail_id = c.id
-                     LEFT JOIN exam_print_plan epp ON c.print_plan_id = epp.id
-                     LEFT JOIN basic_exam be ON epp.exam_id = be.id
-            <where>
-                 and be.enable = true
-                <if test="semesterId != null">
-                    and be.semester_id = #{semesterId}
-                </if>
-                <if test="examId != null">
-                    and be.id = #{examId}
-                </if>
-                <if test="courseCode != null and courseCode != ''">
-                    and b.course_code = #{courseCode}
-                </if>
-                <if test="paperNumber != null and paperNumber != ''">
-                    and b.paper_number = #{paperNumber}
-                </if>
-            </where>
-             GROUP BY b.school_id , c.exam_id,  b.paper_number , b.paper_type, c.exam_start_time, c.exam_end_time having notFinishCount = 0) t
-                ON t.school_id = et.school_id
-                AND t.exam_id = et.exam_id
-                AND t.paper_number = et.paper_number
-                LEFT JOIN
-                (select
-                     a.school_id,
-                     b.semester_id,
-                     a.exam_id,
-                     a.course_code,
-                     a.paper_number,
-                     a.org_code,
-                     a.third_relate_id,
-                     a.sync_user_id,
-                     a.total_paper_type,
-                     CASE
-                        WHEN LOCATE('STARTING', GROUP_CONCAT(DISTINCT a.sync_status)) THEN 'STARTING'
-                        WHEN LOCATE('FAIL', GROUP_CONCAT(DISTINCT a.sync_status)) THEN 'FAIL'
-                        WHEN LOCATE('FINISH', GROUP_CONCAT(DISTINCT a.sync_status)) THEN 'FINISH'
-                        ELSE 'INIT'
-                        END sync_status
-                    from exam_task_sync a
-                        left join
-                    basic_exam b on a.exam_id = b.id
-                    <where>
-                        and b.enable = true
-                        <if test="semesterId != null">
-                            and b.semester_id = #{semesterId}
-                        </if>
-                        <if test="examId != null">
-                            and a.exam_id = #{examId}
-                        </if>
-                        <if test="courseCode != null and courseCode != ''">
-                            and a.course_code = #{courseCode}
-                        </if>
-                        <if test="paperNumber != null and paperNumber != ''">
-                            and a.paper_number = #{paperNumber}
-                        </if>
-                    </where>
-                    GROUP BY a.school_id , a.exam_id , a.course_code , a.paper_number , a.org_code , a.third_relate_id ,a.sync_user_id, a.total_paper_type
-                ) ets ON et.school_id = ets.school_id
-                AND et.exam_id = ets.exam_id
-                AND et.paper_number = ets.paper_number
-                AND t.paper_type = ets.total_paper_type
-                LEFT JOIN
-            t_sync_stmms_exam tsse ON ets.school_id = tsse.school_id
-                and ets.third_relate_id = tsse.exam_id
-                LEFT JOIN
-            sys_user su ON ets.sync_user_id = su.id
-                LEFT JOIN
-            basic_course bc ON et.school_id = bc.school_id
-                AND et.course_code = bc.code
-                LEFT JOIN
-            exam_task_detail etd ON et.id = etd.exam_task_id
-            <where>
-                <if test="orgIds != null">
-                    and et.org_id in
-                    <foreach collection="orgIds" separator="," open="(" close=")" item="orgId">
-                        #{orgId}
-                    </foreach>
-                </if>
-                <if test="syncStatus != null">
-                    <if test="syncStatus == 'INIT'">
-                        and ets.sync_status is null
-                    </if>
-                    <if test="syncStatus != 'INIT'">
-                        and ets.sync_status = #{syncStatus}
-                    </if>
-                </if>
-                <if test="startTime != null">
-                    and t.exam_start_time &gt;= #{startTime}
-                </if>
-                <if test="endTime != null">
-                    and t.exam_end_time &lt;= #{endTime}
-                </if>
-                <if test="roomOrgIds != null">
-                    and bc.teaching_room_id in
-                    <foreach collection="roomOrgIds" separator="," open="(" close=")" item="orgId">
-                        #{orgId}
-                    </foreach>
-                </if>
-                <if test="cardType != null and cardType != ''">
-                    and locate(#{cardType}, etd.paper_attachment_ids) > 0
-                </if>
-            </where>
-        ORDER BY et.create_time desc
-    </select>
     <select id="listByPrintPlanIdAndExamTaskId"
             resultType="com.qmth.distributed.print.business.bean.dto.ExamDetailCourseDto">
         SELECT b.id,

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

@@ -8,7 +8,6 @@ import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
 import com.qmth.distributed.print.business.bean.result.EditResult;
 import com.qmth.distributed.print.business.entity.ExamPaperStructure;
 import com.qmth.distributed.print.business.service.ExamPaperStructureService;
-import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.SysUser;
@@ -23,8 +22,6 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
-import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
@@ -41,8 +38,6 @@ public class ExamPaperStructureController {
     @Resource
     private ExamPaperStructureService examPaperStructureService;
 
-    @Resource
-    private AsyncCloudMarkingTaskService asyncCloudMarkingTaskService;
 
     /**
      * 查询
@@ -97,8 +92,6 @@ public class ExamPaperStructureController {
     public Result submitExamPaperParams(@RequestBody String evaluationParameters) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         ExamPaperStructure examPaperStructure = examPaperStructureService.submitExamPaperParams(evaluationParameters, sysUser);
-        // 异步同步到云阅卷
-        asyncCloudMarkingTaskService.syncPaperStructureAndGroup(examPaperStructure);
         return ResultUtil.ok(String.valueOf(examPaperStructure.getId()), null);
     }
 
@@ -116,8 +109,6 @@ public class ExamPaperStructureController {
                                @RequestParam("md5") String md5,
                                @RequestParam("file") MultipartFile file) {
         ExamPaperStructure examPaperStructure = examPaperStructureService.uploadAnswer(id, md5, file);
-        // 异步同步到云阅卷
-        asyncCloudMarkingTaskService.syncPaperAndAnswer(examPaperStructure);
         return ResultUtil.ok(true);
     }
 
@@ -132,8 +123,6 @@ public class ExamPaperStructureController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     public Result bindMarkLeader(@RequestBody String data) {
         ExamPaperStructure examPaperStructure = examPaperStructureService.bindMarkLeader(data);
-        // 异步同步到云阅卷
-        asyncCloudMarkingTaskService.syncMarkLeader(examPaperStructure);
         return ResultUtil.ok(true);
     }
 
@@ -149,8 +138,6 @@ public class ExamPaperStructureController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     public Result bindMarker(@RequestBody String data) {
         ExamPaperStructure examPaperStructure = examPaperStructureService.saveMarkerAndClass(data);
-        // 异步同步到云阅卷
-        asyncCloudMarkingTaskService.syncMarkerAndClass(examPaperStructure);
         return ResultUtil.ok(true);
     }
 
@@ -167,24 +154,9 @@ public class ExamPaperStructureController {
         Long id = object.getLong("id");
         String objectiveStructure = object.getString("objectiveStructure");
         ExamPaperStructure examPaperStructure = examPaperStructureService.updateObjectiveAnswer(id, objectiveStructure);
-        // 异步同步到云阅卷
-        asyncCloudMarkingTaskService.syncObjectiveStructure(examPaperStructure);
         return ResultUtil.ok(true);
     }
 
-    /**
-     * 试卷结构预览
-     *
-     * @param id id
-     */
-    @ApiOperation(value = "试卷结构预览")
-    @RequestMapping(value = "/preview_structure", method = RequestMethod.POST)
-    public Result preStructure(@RequestParam("id") Long id) {
-        List<Map> list = examPaperStructureService.preStructure(id);
-        return ResultUtil.ok(list);
-    }
-
-
     @ApiOperation(value = "评卷参数设置-获取题卡图片")
     @RequestMapping(value = "/find_jpg_file", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})

+ 0 - 93
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanSyncController.java

@@ -1,93 +0,0 @@
-package com.qmth.distributed.print.api;
-
-import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.distributed.print.business.bean.params.SyncDataParam;
-import com.qmth.distributed.print.business.bean.result.EditResult;
-import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
-import com.qmth.distributed.print.business.service.ExamPrintPlanService;
-import com.qmth.teachcloud.common.annotation.OperationLogDetail;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
-import com.qmth.teachcloud.common.util.Result;
-import com.qmth.teachcloud.common.util.ResultUtil;
-import io.swagger.annotations.*;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-
-/**
- * <p>
- * 印刷计划推送管理 前端控制器
- * </p>
- *
- * @author xf
- * @since 2021-03-23
- */
-@Api(tags = "印刷计划推送管理Controller")
-@RestController
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_EXAM + "/print_sync")
-@Validated
-public class ExamPrintPlanSyncController {
-    @Resource
-    private ExamPrintPlanService examPrintPlanService;
-
-    /**
-     * 查询需要同步的命题任务
-     */
-    @ApiOperation(value = "印刷计划推送管理-推送数据查询")
-    @RequestMapping(value = "/list_sync", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
-    public Result listSyncExamTask(@ApiParam(value = "学期ID") @RequestParam(required = false) Long semesterId,
-                                   @ApiParam(value = "考试ID") @RequestParam(required = false) Long examId,
-                                   @ApiParam(value = "学院ID") @RequestParam(required = false) Long orgId,
-                                   @ApiParam(value = "题卡类型") @RequestParam(required = false) String cardType,
-                                   @ApiParam(value = "推送状态") @RequestParam(required = false) String syncStatus,
-                                   @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
-                                   @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber,
-                                   @ApiParam(value = "计划创建时间段开始时间") @RequestParam(required = false) Long startTime,
-                                   @ApiParam(value = "计划创建时间段结束时间") @RequestParam(required = false) Long endTime,
-                                   @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                                   @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        if (semesterId == null) {
-            throw ExceptionResultEnum.ERROR.exception("请选择学期");
-        }
-        return ResultUtil.ok(examPrintPlanService.listSyncExamTask(semesterId, examId, orgId, cardType, syncStatus, courseCode, paperNumber, startTime, endTime, pageNumber, pageSize));
-    }
-
-    /**
-     * 推送、批量推送-检验同步规则,并返回学院代码
-     *
-     * @param syncDataParam
-     * @return
-     * @throws Exception
-     */
-    @ApiOperation(value = "印刷计划推送管理-检验同步规则,并返回学院代码")
-    @RequestMapping(value = "/check_sync_mode", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = EditResult.class)})
-    public Result checkSyncMode(@RequestBody SyncDataParam syncDataParam) {
-        examPrintPlanService.checkSyncMode(syncDataParam);
-        return ResultUtil.ok(true, "");
-    }
-
-    /**
-     * 多计划合并同步
-     *
-     * @param syncDataParam
-     * @return
-     * @throws Exception
-     */
-    @ApiOperation(value = "印刷计划推送管理-开始推送")
-    @RequestMapping(value = "/sync_data_cloud", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = EditResult.class)})
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
-    public Result syncDataCloud(@RequestBody SyncDataParam syncDataParam) {
-        examPrintPlanService.syncDataCloud(syncDataParam);
-        return ResultUtil.ok(true);
-    }
-
-}
-

+ 0 - 43
distributed-print/src/test/java/com/qmth/distributed/print/SyncHelpTest.java

@@ -1,43 +0,0 @@
-package com.qmth.distributed.print;
-
-import com.qmth.teachcloud.common.bean.params.UserPushParam;
-import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
-import com.qmth.teachcloud.common.service.SysUserService;
-import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-
-/**
- * @Description: 推送云阅卷帮助类
- * @Author: CaoZixuan
- * @Date: 2021-10-27
- */
-@SpringBootTest
-@RunWith(SpringRunner.class)
-public class SyncHelpTest {
-
-    @Resource
-    private CloudMarkingTaskUtils stmmsUtils;
-
-    @Test
-    public void testSyncUser() throws IllegalAccessException {
-        int x = 0;
-        while (x < 10){
-            x ++;
-            UserPushParam userPushParam = new UserPushParam();
-            if (x < 7){
-                userPushParam.setAccount(String.valueOf(x));
-            }
-            if (x % 2 == 1){
-                userPushParam.setRole(SpecialPrivilegeEnum.MARKER);
-            }else {
-                userPushParam.setRole(SpecialPrivilegeEnum.SUBJECT_HEADER);
-            }
-            userPushParam.setSchoolId(2L);
-        }
-    }
-}

+ 0 - 920
teachcloud-common/src/main/java/com/qmth/teachcloud/common/sync/CloudMarkingTaskUtils.java

@@ -1,920 +0,0 @@
-package com.qmth.teachcloud.common.sync;
-
-import com.alibaba.fastjson.JSONObject;
-import com.qmth.boot.tools.signature.SignatureType;
-import com.qmth.teachcloud.common.SignatureEntityTest;
-import com.qmth.teachcloud.common.bean.dto.stmms.*;
-import com.qmth.teachcloud.common.bean.result.PushResult;
-import com.qmth.teachcloud.common.config.DictionaryConfig;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.BasicSchool;
-import com.qmth.teachcloud.common.entity.SysConfig;
-import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.enums.SyncFileTypeEnum;
-import com.qmth.teachcloud.common.enums.SyncModeEnum;
-import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
-import com.qmth.teachcloud.common.service.CommonCacheService;
-import com.qmth.teachcloud.common.util.Base64Util;
-import com.qmth.teachcloud.common.util.HttpKit;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileInputStream;
-import java.math.BigDecimal;
-import java.util.*;
-
-/**
- * 同步云阅卷接口工具类
- * <p>
- * Date: 2021/10/29.
- */
-@Component
-public class CloudMarkingTaskUtils {
-    private final static Logger log = LoggerFactory.getLogger(CloudMarkingTaskUtils.class);
-
-    // 考试类型(逸教云默认是纸笔"SCAN_IMAGE")
-    private static final String SAVE_EXAM_TYPE = "SCAN_IMAGE";
-    // 所有请求方法默认为"POST"
-    private static final String POST_METHOD = "POST";
-
-    // 默认分页数量
-    private static final int defaultPageSize = 100;
-
-    // 时间格式化
-    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
-
-    @Resource
-    private CommonCacheService commonCacheService;
-
-    @Resource
-    private DictionaryConfig dictionaryConfig;
-
-    /**
-     * 同步规则是否为按学院同步
-     *
-     * @param schoolId 学校ID
-     */
-    public boolean isCollegeMode(Long schoolId) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_SYNC_MODE);
-        if (sysConfig == null || StringUtils.isBlank(sysConfig.getConfigValue())) {
-            return false;
-        }
-        return SyncModeEnum.BY_COLLEGE.name().equals(sysConfig.getConfigValue());
-    }
-
-    /**
-     * 学院创建/更新接口
-     *
-     * @param code 学院代码
-     * @param name 学院名称
-     * @return 机构ID
-     */
-    public Integer syncSchool(Long schoolId, String code, String name) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String schoolSaveUrl = SystemConstant.CLOUD_MARK_SCHOOL_SAVE_API;
-        validUrl(hostUrl, schoolSaveUrl);
-        String postUrl = hostUrl.concat(schoolSaveUrl);
-        //参数
-        Map<String, Object> map = new HashMap<>();
-        map.put("code", validParam(code, null, true, "唯一标识"));
-        map.put("name", validParam(name, null, true, "显示名称"));
-
-        String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, schoolSaveUrl), map, null, null, null);
-        JSONObject jsonObject = JSONObject.parseObject(result);
-        if (jsonObject.containsKey("id")) {
-            return Integer.valueOf(jsonObject.get("id").toString());
-        } else {
-            throw ExceptionResultEnum.ERROR.exception("学院(机构)同步失败");
-        }
-    }
-
-    /**
-     * 考试创建/更新接口
-     *
-     * @param code     唯一标识
-     * @param name     考试名称
-     * @param examTime 考试时间
-     * @return 考试ID
-     */
-    public Long syncExam(Long schoolId, String code, String name, String examTime, String orgCode) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String examSaveUrl = SystemConstant.CLOUD_MARK_EXAM_SAVE_API;
-        validUrl(hostUrl, examSaveUrl);
-        String postUrl = hostUrl.concat(examSaveUrl);
-        //参数
-        Map<String, Object> map = new HashMap<>();
-        map.put("code", validParam(code, null, true, "唯一标识"));
-        map.put("name", validParam(name, null, true, "考试名称"));
-        map.put("examTime", validParam(examTime, null, true, "考试时间"));
-        map.put("type", SAVE_EXAM_TYPE);
-        if (StringUtils.isNotBlank(orgCode)) {
-            map.put("schoolCode", orgCode);
-        }
-
-        String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, examSaveUrl), map, null, null, null);
-        JSONObject jsonObject = JSONObject.parseObject(result);
-        if (jsonObject.containsKey("id")) {
-            return Long.valueOf(jsonObject.get("id").toString());
-        } else {
-            throw ExceptionResultEnum.ERROR.exception("考试同步失败");
-        }
-    }
-
-    /**
-     * 科目创建/更新接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      云阅卷考试ID
-     * @param subjectCode 科目代码
-     * @param subjectName 科目名称
-     */
-    public Boolean syncSubject(Long schoolId, String examId, String subjectCode, String subjectName) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String examSubjectSaveUrl = SystemConstant.CLOUD_MARK_SUBJECT_SAVE_API;
-        validUrl(hostUrl, examSubjectSaveUrl);
-        String postUrl = hostUrl.concat(examSubjectSaveUrl);
-        //参数
-        Map<String, Object> map = new HashMap<>();
-        map.put("examId", validParam(examId, null, true, "云阅卷考试ID"));
-        map.put("code", validParam(subjectCode, null, true, "科目代码"));
-        map.put("name", validParam(subjectName, null, true, "科目名称"));
-
-        String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, examSubjectSaveUrl), map, null, null, null);
-        JSONObject jsonObject = JSONObject.parseObject(result);
-        if (jsonObject.containsKey("updateTime")) {
-            return true;
-        } else {
-            throw ExceptionResultEnum.ERROR.exception("科目同步失败");
-        }
-    }
-
-    /**
-     * 考试成绩考生查询接口
-     *
-     * @param pageNo   分页参数
-     * @param pageSize 分页参数
-     */
-    public List<JSONObject> getExam(Long schoolId, String orgCode, int pageNo, int pageSize) {
-        Map<String, String> paramMap = new HashMap<>();
-        if (StringUtils.isNotBlank(orgCode)) {
-            paramMap.put("schoolCode", orgCode);
-        }
-        paramMap.put("pageNumber", String.valueOf(pageNo));
-        paramMap.put("pageSize", String.valueOf(pageSize));
-
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String yyjRootUrl = sysConfig.getConfigValue();
-        String examUrl = SystemConstant.CLOUD_MARK_EXAM_LIST_API;
-
-        if (StringUtils.isAnyBlank(yyjRootUrl, examUrl)) {
-            throw ExceptionResultEnum.ERROR.exception("考试查询接口url未设置");
-        }
-
-        Map<String, String> header = getHeaders(schoolId, examUrl);
-        //请求
-        String examObject = HttpKit.sendPost(yyjRootUrl + examUrl, paramMap, header);
-        return JSONObject.parseArray(JSONObject.toJSON(examObject).toString(), JSONObject.class);
-    }
-
-    public PushResult syncUser(String account, String name, int roleValue, Boolean enable, Long schoolId, String orgCode) throws IllegalAccessException {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String userSaveUrl = SystemConstant.CLOUD_MARK_USER_EXTERNAL_SAVE_API;
-        String postUrl = hostUrl.concat(userSaveUrl);
-
-        BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
-        String password = basicSchool != null && StringUtils.isNotBlank(basicSchool.getInitPassword()) ? new String(Base64Util.decode(basicSchool.getInitPassword())) : "123456";
-        // 参数
-        Map<String, Object> map = new HashMap<>();
-        map.put("account", validParam(account, null, true, "关联名称(唯一标识)"));
-        map.put("name", validParam(name, null, false, "名称"));
-        map.put("password", validParam(password, null, false, "密码"));
-        map.put("role", validParam(String.valueOf(roleValue), null, true, "类型:MARKER、SUBJECT_HEADER"));
-        map.put("enable", validParam(enable, true, false, "是否启用"));
-        if (StringUtils.isNotBlank(orgCode)) {
-            map.put("schoolCode", validParam(orgCode, null, false, "子机构编号"));
-        }
-
-        PushResult pushResult = new PushResult();
-        boolean pushStatus = false;
-        String errorMessage = "";
-        try {
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, userSaveUrl), map, null, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            if (jsonObject.containsKey("updateTime")) {
-                pushStatus = true;
-            }
-        } catch (Exception e) {
-            errorMessage = e.getMessage();
-        } finally {
-            pushResult.setSuccess(pushStatus);
-            pushResult.setMessage(errorMessage);
-        }
-        return pushResult;
-    }
-
-    /**
-     * 考生创建/更新接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param examNumber  准考证号
-     * @param studentCode 学号
-     * @param name        姓名
-     * @param college     学院
-     * @param className   班级名称
-     * @param teacher     教师姓名
-     * @param subjectCode 科目代码
-     * @param subjectName 科目名称
-     * @param packageCode 签到表编号
-     * @param paperType   试卷类型
-     * @param examSite    考点
-     * @param examRoom    考场
-     */
-    public boolean syncStudent(Long schoolId, String examId, String examNumber, String studentCode, String name, String college,
-                               String className, String teacher, String subjectCode, String subjectName,
-                               String packageCode, String paperType, String examSite, String examRoom) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String studentSaveUrl = SystemConstant.CLOUD_MARK_EXAM_STUDENT_SAVE_API;
-        validUrl(hostUrl, studentSaveUrl);
-        String postUrl = hostUrl.concat(studentSaveUrl);
-        try {
-            //参数
-            Map<String, Object> map = new HashMap<>();
-            map.put("examId", validParam(examId, null, true, "考试ID"));
-            map.put("examNumber", validParam(examNumber, null, true, "准考证号"));
-            map.put("studentCode", validParam(studentCode, null, true, "学号"));
-            map.put("name", validParam(name, null, true, "姓名"));
-            map.put("college", validParam(college, "无", true, "学院"));
-            map.put("className", validParam(className, null, true, "班级名称"));
-            map.put("teacher", validParam(teacher, "无", true, "教师姓名"));
-            map.put("subjectCode", validParam(subjectCode, null, true, "科目代码")); // 取试卷编号
-            map.put("subjectName", validParam(subjectName, null, true, "科目名称"));
-            map.put("packageCode", validParam(packageCode, "", false, "签到表编号"));
-            map.put("paperType", validParam(paperType, "", false, "试卷类型"));
-            map.put("examSite", validParam(examSite, "", false, "考点"));
-            map.put("examRoom", validParam(examRoom, "", false, "考场"));
-
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, studentSaveUrl), map, null, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            if (jsonObject.containsKey("updateTime")) {
-                return true;
-            }
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-        return false;
-    }
-
-
-    /**
-     * 文件公共上传接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     * @param type        文件类型  SyncFileTypeEnum枚举
-     * @param file        文件
-     */
-    public String syncFile(Long schoolId, String examId, String subjectCode, SyncFileTypeEnum type, File file) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String fileUploadUrl = SystemConstant.CLOUD_MARK_FILE_UPLOAD_API;
-        validUrl(hostUrl, fileUploadUrl);
-        fileUploadUrl = fileUploadUrl.replace("{type}", type.name().toLowerCase());
-        String postUrl = hostUrl.concat(fileUploadUrl);
-        try {
-            Map<String, String> files = new HashMap<>();
-            if (file.exists()) {
-                files.put(file.getName(), file.getPath());
-            }
-            //表单数据
-            Map<String, Object> formText = new HashMap<>();
-            formText.put("examId", validParam(examId, null, true, "考试ID"));
-            formText.put("subjectCode", validParam(subjectCode, null, true, "科目代码"));
-            String fileName = file.getName();
-            String suffix = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
-            if (type.equals(SyncFileTypeEnum.CARD)) {
-                if (!"zip".equals(suffix) && !"json".equals(suffix)) {
-                    throw ExceptionResultEnum.ERROR.exception("文件类型有误");
-                }
-            } else if (type.equals(SyncFileTypeEnum.PAPER) || type.equals(SyncFileTypeEnum.ANSWER)) {
-                if (!"pdf".equals(suffix) && !"json".equals(suffix)) {
-                    throw ExceptionResultEnum.ERROR.exception("文件类型有误");
-                }
-            } else {
-                throw ExceptionResultEnum.ERROR.exception("请传入文件上传类型");
-            }
-            formText.put("format", suffix);
-            formText.put("md5", DigestUtils.md5Hex(new FileInputStream(file)));
-
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, fileUploadUrl), formText, files, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            if (jsonObject.containsKey("success")) {
-                String success = jsonObject.get("success").toString();
-                if (Boolean.parseBoolean(success)) {
-                    if (jsonObject.containsKey("url")) {
-                        return jsonObject.get("url").toString();
-                    } else {
-                        return success;
-                    }
-                }
-            }
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        } finally {
-            if (Objects.nonNull(dictionaryConfig.sysDomain()) && dictionaryConfig.sysDomain().isOss()) {
-                if (file != null && file.exists()) {
-                    file.delete();
-                }
-            }
-        }
-        return "";
-    }
-
-    /**
-     * 试卷结构创建/更新接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     * @param objective   是否客观题
-     * @param paperType   试卷类型
-     * @param questions   试卷结构JSON
-     */
-    public boolean syncPaperStructure(Long schoolId, String examId, String subjectCode, Boolean objective,
-                                      String paperType, List<QuestionDTO> questions) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String structureUrl = SystemConstant.CLOUD_MARK_EXAM_PAPER_SAVE_API;
-        validUrl(hostUrl, structureUrl);
-        String postUrl = hostUrl.concat(structureUrl);
-        try {
-            //参数
-            PaperDTO paperDTO = new PaperDTO();
-            paperDTO.setExamId(Integer.valueOf(validParam(examId, null, true, "考试ID")));
-            paperDTO.setSubjectCode(validParam(subjectCode, null, true, "科目代码"));
-            paperDTO.setObjective(validParam(objective, true, true, "是否客观题"));
-            paperDTO.setPaperType(validParam(paperType, "#", false, "试卷类型"));
-            paperDTO.setQuestions(validStructureParam(objective, questions));
-
-            String jsonData = JSONObject.toJSONString(paperDTO);
-
-            String result = HttpKit.sendPost(postUrl, jsonData, getHeaders(schoolId, structureUrl));
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject.containsKey("updateTime");
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 试卷结构查询接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     * @param paperType   试卷编号
-     */
-    public String queryPaperStructure(Long schoolId, String examId, String subjectCode, String paperType) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String queryPaperStructure = SystemConstant.CLOUD_MARK_EXAM_PAPER_QUERY_API;
-        validUrl(hostUrl, queryPaperStructure);
-        String postUrl = hostUrl.concat(queryPaperStructure);
-        try {
-            //参数
-            Map<String, String> map = new HashMap<>();
-            map.put("examId", validParam(examId, null, true, "考试ID"));
-            map.put("subjectCode", validParam(subjectCode, null, true, "科目代码")); // 取试卷编号
-            map.put("paperType", validParam(paperType, "", false, "试卷类型"));
-
-            return HttpKit.sendPost(postUrl, map, getHeaders(schoolId, queryPaperStructure));
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 创建评卷分组接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     * @param groups      试卷结构JSON
-     */
-    public boolean saveMarkerGroup(Long schoolId, String examId, String subjectCode, Integer trialCount, List<GroupDetailDTO> groups) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String groupSaveUrl = SystemConstant.CLOUD_MARK_EXAM_MARK_GROUP_SAVE_API;
-        validUrl(hostUrl, groupSaveUrl);
-        String postUrl = hostUrl.concat(groupSaveUrl);
-        try {
-            //参数
-            GroupDTO groupDTO = new GroupDTO();
-            groupDTO.setExamId(Integer.valueOf(validParam(examId, null, true, "考试ID")));
-            groupDTO.setSubjectCode(validParam(subjectCode, null, true, "科目代码"));
-            groupDTO.setTrialCount(Integer.valueOf(validParam(String.valueOf(trialCount), "0", true, "试评数量")));
-            groupDTO.setGroups(validGroupParam(groups));
-
-            String jsonData = JSONObject.toJSONString(groupDTO);
-
-            String result = HttpKit.sendPost(postUrl, jsonData, getHeaders(schoolId, groupSaveUrl));
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject.containsKey("updateTime");
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 分组数量查询接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     */
-    public int countGroup(Long schoolId, String examId, String subjectCode) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String groupCountUrl = SystemConstant.CLOUD_MARK_EXAM_MARK_GROUP_COUNT_API;
-        validUrl(hostUrl, groupCountUrl);
-        String postUrl = hostUrl.concat(groupCountUrl);
-        try {
-            //参数
-            Map<String, Object> map = new HashMap<>();
-            map.put("examId", validParam(examId, null, true, "考试ID"));
-            map.put("subjectCode", validParam(subjectCode, null, true, "科目代码"));
-
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, groupCountUrl), map, null, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            if (jsonObject.containsKey("totalCount")) {
-                return jsonObject.getIntValue("totalCount");
-            }
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-        return 0;
-    }
-
-    /**
-     * 分组数量查询接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     */
-    public boolean deleteGroup(Long schoolId, String examId, String subjectCode) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String groupDeleteUrl = SystemConstant.CLOUD_MARK_EXAM_MARK_GROUP_DELETE_API;
-        validUrl(hostUrl, groupDeleteUrl);
-        String postUrl = hostUrl.concat(groupDeleteUrl);
-        try {
-            //参数
-            Map<String, Object> map = new HashMap<>();
-            map.put("examId", validParam(examId, null, true, "考试ID"));
-            map.put("subjectCode", validParam(subjectCode, null, true, "科目代码"));
-
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, groupDeleteUrl), map, null, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject.containsKey("updateTime");
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 绑定评卷员接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     * @param groupNumber 分组序号
-     * @param loginName   用户名
-     */
-    public boolean saveMarker(Long schoolId, String examId, String subjectCode, Integer groupNumber, String loginName) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String markerSaveUrl = SystemConstant.CLOUD_MARK_EXAM_MARKER_SAVE_API;
-        validUrl(hostUrl, markerSaveUrl);
-        String postUrl = hostUrl.concat(markerSaveUrl);
-        try {
-            //参数
-            Map<String, Object> map = new HashMap<>();
-            map.put("examId", validParam(examId, null, true, "考试ID"));
-            map.put("subjectCode", validParam(subjectCode, null, true, "科目代码"));
-            map.put("groupNumber", validParam(String.valueOf(groupNumber), null, true, "分组序号"));
-            map.put("account", SpecialPrivilegeEnum.MARKER.getPrefix() + validParam(loginName, null, true, "用户名"));
-
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, markerSaveUrl), map, null, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject.containsKey("updateTime");
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 绑定科组长接口
-     *
-     * @param schoolId    学校ID
-     * @param subjectCode 科目代码
-     * @param loginName   用户名
-     */
-    public boolean saveMarkLeader(Long schoolId, String subjectCode, String loginName, String orgCode) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String markLeaderSaveUrl = SystemConstant.CLOUD_MARK_EXAM_SUBJECT_HEADER_SAVE_API;
-        validUrl(hostUrl, markLeaderSaveUrl);
-        String postUrl = hostUrl.concat(markLeaderSaveUrl);
-        try {
-            //参数
-            Map<String, Object> map = new HashMap<>();
-            map.put("subjectCode", validParam(subjectCode, null, true, "科目代码"));
-            map.put("account", SpecialPrivilegeEnum.SUBJECT_HEADER.getPrefix() + validParam(loginName, null, true, "用户名"));
-            if (StringUtils.isNotBlank(orgCode)) {
-                map.put("schoolCode", validParam(orgCode, null, false, "子机构编号"));
-            }
-
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, markLeaderSaveUrl), map, null, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject.containsKey("updateTime");
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 用户班级绑定接口
-     *
-     * @param schoolId  学校ID
-     * @param examId    考试ID
-     * @param loginName 用户名
-     * @param className 分组序号
-     */
-    public boolean saveUserClass(Long schoolId, String examId, String loginName, List<String> className) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String userClassSaveUrl = SystemConstant.CLOUD_MARK_USER_CLASS_SAVE_API;
-        validUrl(hostUrl, userClassSaveUrl);
-        String postUrl = hostUrl.concat(userClassSaveUrl);
-        try {
-            //参数
-            ClassMarkerDTO classMarkerDTO = new ClassMarkerDTO();
-            classMarkerDTO.setExamId(Integer.valueOf(validParam(examId, null, true, "考试ID")));
-            classMarkerDTO.setAccount(SpecialPrivilegeEnum.MARKER.getPrefix() + validParam(loginName, null, true, "用户名"));
-            classMarkerDTO.setClassName(validParam(className, new ArrayList<>(), false, "班级名称"));
-
-            String jsonData = JSONObject.toJSONString(classMarkerDTO);
-            String result = HttpKit.sendPost(postUrl, jsonData, getHeaders(schoolId, userClassSaveUrl));
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject.containsKey("updateTime");
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 科目客观题统分接口
-     *
-     * @param schoolId    学校ID
-     * @param examId      考试ID
-     * @param subjectCode 科目代码
-     */
-    public boolean subjectCalculate(Long schoolId, String examId, String subjectCode) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String subjectCalculateUrl = SystemConstant.CLOUD_MARK_EXAM_SUBJECT_CALCULATE_API;
-        validUrl(hostUrl, subjectCalculateUrl);
-        String postUrl = hostUrl.concat(subjectCalculateUrl);
-        try {
-            //参数
-            Map<String, Object> map = new HashMap<>();
-            map.put("examId", validParam(examId, null, true, "考试ID"));
-            map.put("subjectCode", validParam(subjectCode, null, true, "科目代码"));
-
-            String result = HttpKit.sendPost(postUrl, getHeaders(schoolId, subjectCalculateUrl), map, null, null, null);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject.containsKey("updateTime");
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 评卷员登录
-     */
-    public Map<String, Object> markLogin(SysUser sysUser, String orgCode) {
-        if (this.isCollegeMode(sysUser.getSchoolId()) && StringUtils.isBlank(orgCode)) {
-            throw ExceptionResultEnum.ERROR.exception(String.format("用户账号[%s]所属学院代码为空,请联系管理员", sysUser.getLoginName()));
-        }
-        String markLoginUrl = SystemConstant.CLOUD_MARK_OPEN_MARK_LOGIN_API;
-        try {
-            //参数
-            return openLogin(sysUser, orgCode, markLoginUrl, SpecialPrivilegeEnum.MARKER.getPrefix());
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 科组长登录
-     */
-    public Map<String, Object> markLeaderLogin(SysUser sysUser, String orgCode) {
-        if (this.isCollegeMode(sysUser.getSchoolId()) && StringUtils.isBlank(orgCode)) {
-            throw ExceptionResultEnum.ERROR.exception(String.format("用户账号[%s]所属学院代码为空,请联系管理员", sysUser.getLoginName()));
-        }
-        String markLeaderLoginUrl = SystemConstant.CLOUD_MARK_OPEN_SUBJECT_HEADER_LOGIN_API;
-        try {
-            //参数
-            return openLogin(sysUser, orgCode, markLeaderLoginUrl, SpecialPrivilegeEnum.SUBJECT_HEADER.getPrefix());
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
-        }
-    }
-
-    /**
-     * 组装登录参数
-     *
-     * @param loginUrl 登录url
-     * @param prefix   账号前缀
-     */
-    private Map<String, Object> openLogin(SysUser sysUser, String orgCode, String loginUrl, String prefix) {
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(sysUser.getSchoolId(), SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        validUrl(hostUrl, loginUrl);
-        String postUrl = hostUrl.concat(loginUrl);
-
-        try {
-            long time = System.currentTimeMillis();
-            Map<String, Object> map = new HashMap<>();
-            map.put("redirectUrl", postUrl);
-            map.put("account", prefix + sysUser.getLoginName());
-            map.put("name", sysUser.getRealName());
-            map.put("time", time);
-            if (this.isCollegeMode(sysUser.getSchoolId())) {
-                map.put("schoolCode", orgCode);
-            }
-            map.put("authorization", createSign(sysUser.getSchoolId(), time, loginUrl));
-            return map;
-        } catch (Exception e) {
-            throw ExceptionResultEnum.ERROR.exception("登录信息获取失败");
-        }
-    }
-
-    /**
-     * http请求头
-     *
-     * @param url 请求URL
-     */
-    private Map<String, String> getHeaders(Long schoolId, String url) {
-        long time = System.currentTimeMillis();
-        Map<String, String> header = new HashMap<>();
-        header.put(SystemConstant.HEADER_AUTHORIZATION, createSign(schoolId, time, url));
-        header.put(SystemConstant.HEADER_TIME, String.valueOf(time));
-        return header;
-    }
-
-    /**
-     * 签名
-     *
-     * @param time 时间戳
-     * @param url  请求URL
-     */
-    private String createSign(Long schoolId, long time, String url) {
-        BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
-        if (basicSchool == null) {
-            throw ExceptionResultEnum.ERROR.exception("学校不存在");
-        }
-        if (!basicSchool.getEnable()) {
-            throw ExceptionResultEnum.ERROR.exception("学校已禁用");
-        }
-
-        return SignatureEntityTest.build(SignatureType.SECRET, POST_METHOD, url, time, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-    }
-
-    /**
-     * 校验参数值并返回(字符型)
-     *
-     * @param value        参数值
-     * @param defaultValue 默认值
-     * @param require      是否必填(true:是,false:否)
-     * @param name         参数名称
-     */
-    private String validParam(String value, String defaultValue, boolean require, String name) {
-        if (require && StringUtils.isAllBlank(value, defaultValue)) {
-            throw ExceptionResultEnum.ERROR.exception((StringUtils.isBlank(name) ? "" : name) + "值必填");
-        }
-        return StringUtils.isBlank(value) ? defaultValue : value;
-
-    }
-
-    /**
-     * 校验参数值并返回 (布尔型)
-     *
-     * @param value        参数值
-     * @param defaultValue 默认值
-     * @param require      是否必填
-     * @param name         描述
-     */
-    private Boolean validParam(Boolean value, Boolean defaultValue, Boolean require, String name) {
-        if (require && value == null && defaultValue == null) {
-            throw ExceptionResultEnum.ERROR.exception((StringUtils.isBlank(name) ? "" : name) + "值必填");
-        }
-        return value == null ? defaultValue : value;
-
-    }
-
-    /**
-     * 校验参数值并返回(集合型)
-     *
-     * @param value        参数值
-     * @param defaultValue 默认值
-     * @param require      是否必填(true:是,false:否)
-     * @param name         参数名称
-     */
-    private List<String> validParam(List<String> value, List<String> defaultValue, boolean require, String name) {
-        if (require && CollectionUtils.isEmpty(value) && CollectionUtils.isEmpty(defaultValue)) {
-            throw ExceptionResultEnum.ERROR.exception((StringUtils.isBlank(name) ? "" : name) + "值必填");
-        }
-        return CollectionUtils.isEmpty(value) ? defaultValue : value;
-
-    }
-
-    /**
-     * 校验试卷结构值
-     *
-     * @param objective 是否客观题
-     * @param questions 试卷结构JSON
-     */
-    private List<QuestionDTO> validStructureParam(Boolean objective, List<QuestionDTO> questions) {
-        for (QuestionDTO question : questions) {
-            validParam(String.valueOf(question.getMainNumber()), null, true, "大题号");
-            validParam(question.getSubNumber(), null, true, "小题号");
-            validParam(question.getMainTitle(), null, true, "大题名称");
-            validParam(String.valueOf(question.getTotalScore()), null, true, "满分");
-            if (objective) {
-                validParam(question.getAnswer(), null, true, "标答");
-                validParam(question.getType(), null, true, "客观题类型");
-                validParam(question.getObjectivePolicy(), "NONE", true, "客观题判分规则");
-            }
-        }
-        return questions;
-    }
-
-    /**
-     * 校验分组参数
-     *
-     * @param groups 分组
-     */
-    private List<GroupDetailDTO> validGroupParam(List<GroupDetailDTO> groups) {
-        for (GroupDetailDTO group : groups) {
-            validParam(String.valueOf(group.getNumber()), null, true, "分组序号");
-//            validParam(group.getPicList(), null, true, "小题号");
-            validParam(String.valueOf(group.getDoubleRate()), "0", true, "双评比例");
-            if (new BigDecimal(1).compareTo(BigDecimal.valueOf(group.getDoubleRate())) == 0) {
-                validParam(String.valueOf(group.getArbitrateThreshold()), "0", true, "仲裁阈值");
-                validParam(String.valueOf(group.getScorePolicy()), "AVG", true, "合分策略");
-            }
-            // 允许全零分、评卷模式非必填
-            /*validParam(group.getEnableAllZero(), false, false, "允许全零分");
-            validParam(group.getMarkMode(), "", false, "评卷模式");*/
-            for (QuestionBaseDTO question : group.getQuestions()) {
-                validParam(String.valueOf(question.getMainNumber()), null, true, "大题号");
-                validParam(question.getSubNumber(), null, true, "小题号");
-            }
-        }
-        return groups;
-    }
-
-    /**
-     * 校验url是否配置
-     *
-     * @param urls URL数组
-     */
-    private void validUrl(String... urls) {
-        if (StringUtils.isAnyBlank(urls)) {
-            throw ExceptionResultEnum.ERROR.exception("云阅卷同步接口未正确配置");
-        }
-    }
-
-    /**
-     * 考试成绩考生数量查询接口
-     *
-     * @param schoolId
-     * @param examId
-     * @param examCode
-     * @param examNumber
-     * @param studentCode
-     * @param subjectCode
-     * @param college
-     * @param className
-     * @param teacher
-     * @return
-     */
-    public int getStudentCount(Long schoolId, Integer examId, String examCode, String examNumber, String studentCode, String subjectCode, String college, String className, String teacher) {
-        Map<String, Object> map = new HashMap<>();
-        map.put("examId", validParam(String.valueOf(examId), null, true, "考试ID"));
-
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String studentCountUrl = SystemConstant.CLOUD_MARK_EXAM_STUDENT_COUNT_API;
-        validUrl(hostUrl, studentCountUrl);
-        String postUrl = hostUrl.concat(studentCountUrl);
-
-        //请求
-        String res;
-        try {
-            res = HttpKit.sendPost(postUrl, getHeaders(schoolId, studentCountUrl), map, null, null, null);
-        } catch (Exception e) {
-            log.info("云阅卷:调用考试成绩考生数量查询接口请求异常,{}", e.getMessage());
-            throw new RuntimeException("云阅卷:调用考试成绩考生数量查询接口请求异常," + e.getMessage());
-        }
-        if (Objects.isNull(res)) {
-            log.info("云阅卷:调用考试成绩考生数量查询接口返回值为null");
-            throw new RuntimeException("云阅卷:调用考试成绩考生数量查询接口返回值为null");
-        }
-        JSONObject object = JSONObject.parseObject(res);
-        return Integer.parseInt(object.get("totalCount").toString());
-    }
-
-    /**
-     * 考试成绩考生查询接口
-     *
-     * @param schoolId
-     * @param examId
-     * @param examCode
-     * @param examNumber
-     * @param studentCode
-     * @param subjectCode
-     * @param college
-     * @param className
-     * @param teacher
-     * @param withMarkTrack
-     * @param pageNo
-     * @param pageSize
-     * @return
-     */
-    public List<Map> getStudentScore(Long schoolId, Integer examId, String examCode, String examNumber, String studentCode, String subjectCode, String college, String className, String teacher, boolean withMarkTrack, int pageNo, int pageSize) {
-        Map<String, Object> map = new HashMap<>();
-        map.put("examId", validParam(String.valueOf(examId), null, true, "考试ID"));
-        map.put("withMarkTrack", validParam(withMarkTrack, true, false, "评分标记"));
-        map.put("pageNumber", validParam(String.valueOf(pageNo), null, true, "页码"));
-        map.put("pageSize", validParam(String.valueOf(pageSize), null, true, "数量"));
-
-        SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
-        Optional.ofNullable(sysConfig).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未配置云阅卷地址"));
-        String hostUrl = sysConfig.getConfigValue();
-        String studentScoreUrl = SystemConstant.CLOUD_MARK_EXAM_STUDENT_SCORE_API;
-        validUrl(hostUrl, studentScoreUrl);
-        String postUrl = hostUrl.concat(studentScoreUrl);
-        //请求
-        String res;
-        try {
-            res = HttpKit.sendPost(postUrl, getHeaders(schoolId, studentScoreUrl), map, null, null, null);
-        } catch (Exception e) {
-            log.info("云阅卷:调用考试成绩考生查询接口请求异常,{}", e.getMessage());
-            throw new RuntimeException("云阅卷:调用考试成绩考生查询接口请求异常," + e.getMessage());
-        }
-        if (Objects.isNull(res)) {
-            log.info("云阅卷:调用考试成绩考生查询接口返回值为null");
-            throw new RuntimeException("云阅卷:调用考试成绩考生查询接口返回值为null");
-        }
-        log.info("云阅卷返回考生数据:{}", JSONObject.toJSON(res).toString());
-        return JSONObject.parseArray(JSONObject.toJSON(res).toString(), Map.class);
-    }
-
-    public int getDefaultPageSize() {
-        return defaultPageSize;
-    }
-}