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

增加课程关联管理功能

xiaofei 2 éve
szülő
commit
9ee337a614

+ 64 - 0
src/main/java/com/qmth/eds/api/ExamCourseMappingController.java

@@ -0,0 +1,64 @@
+package com.qmth.eds.api;
+
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.eds.common.contant.SystemConstant;
+import com.qmth.eds.common.util.Result;
+import com.qmth.eds.common.util.ResultUtil;
+import com.qmth.eds.service.ExamCourseMappingService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/exam_course_mapping")
+public class ExamCourseMappingController {
+
+    @Resource
+    private ExamCourseMappingService examCourseMappingService;
+
+
+    /**
+     * 查询
+     *
+     * @param semesterId             学期
+     * @param examTypeId             考试类型
+     * @param syncCourseCode         考务数据课程代码
+     * @param cloudMarkingCourseCode 云阅卷课程代码
+     * @param pageNumber             分页参数
+     * @param pageSize               分页参数
+     */
+    @ApiOperation(value = "查询")
+    @PostMapping("/page")
+    public Result page(@RequestParam(value = "semesterId", required = false) Long semesterId,
+                       @RequestParam(value = "examTypeId", required = false) Long examTypeId,
+                       @RequestParam(value = "syncCourseCode", required = false) String syncCourseCode,
+                       @RequestParam(value = "cloudMarkingCourseCode", required = false) String cloudMarkingCourseCode,
+                       @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
+                       @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
+        return ResultUtil.ok(examCourseMappingService.pageData(semesterId, examTypeId, syncCourseCode, cloudMarkingCourseCode, pageNumber, pageSize));
+    }
+
+    /**
+     * 导入对照关系文件
+     *
+     * @param semesterId 学期ID
+     * @param examTypeId 考试类型ID
+     * @param md5        文件md5
+     * @param file       导入文件
+     */
+    @ApiOperation(value = "导入")
+    @PostMapping("/import")
+    public void page(@RequestParam("semesterId") Long semesterId,
+                     @RequestParam("examTypeId") Long examTypeId,
+                     @RequestParam("file") MultipartFile file) {
+        examCourseMappingService.importData(semesterId, examTypeId, file);
+    }
+
+}

+ 51 - 0
src/main/java/com/qmth/eds/bean/dto/ExamCourseMappingDto.java

@@ -0,0 +1,51 @@
+package com.qmth.eds.bean.dto;//package com.qmth.teachcloud.data.store.bean.dto;
+
+
+import com.qmth.boot.tools.excel.annotation.ExcelColumn;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+public class ExamCourseMappingDto implements Serializable {
+
+    /**
+     * 云阅卷课程代码
+     */
+    @ExcelColumn(name = "课程代码*", index = 1, nullable = true)
+    String cloudMarkingCourseCode;
+
+    /**
+     * 武大考务数据课程代码
+     */
+    @ExcelColumn(name = "考生备注信息", index = 9, nullable = true)
+    String syncCourseCode;
+
+    public String getCloudMarkingCourseCode() {
+        return cloudMarkingCourseCode;
+    }
+
+    public void setCloudMarkingCourseCode(String cloudMarkingCourseCode) {
+        this.cloudMarkingCourseCode = cloudMarkingCourseCode;
+    }
+
+    public String getSyncCourseCode() {
+        return syncCourseCode;
+    }
+
+    public void setSyncCourseCode(String syncCourseCode) {
+        this.syncCourseCode = syncCourseCode;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        ExamCourseMappingDto that = (ExamCourseMappingDto) o;
+        return cloudMarkingCourseCode.equals(that.cloudMarkingCourseCode) && syncCourseCode.equals(that.syncCourseCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(cloudMarkingCourseCode, syncCourseCode);
+    }
+}

+ 127 - 0
src/main/java/com/qmth/eds/common/entity/ExamCourseMapping.java

@@ -0,0 +1,127 @@
+package com.qmth.eds.common.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.eds.common.contant.SystemConstant;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * 武大考务数据和云阅卷课程代码映射关系表
+ */
+@ApiModel(value = "BasicCourseMapping对象", description = "武大考务数据和云阅卷课程代码映射关系表")
+public class ExamCourseMapping implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "学校ID")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long schoolId;
+
+    @ApiModelProperty(value = "学期ID")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long semesterId;
+
+    @ApiModelProperty(value = "学期名称")
+    private String semesterName;
+
+
+    @ApiModelProperty(value = "考试类型ID")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long examTypeId;
+
+    @ApiModelProperty(value = "考试类型名称")
+    private String examTypeName;
+
+    @ApiModelProperty(value = "武大考务数据课程代码")
+    private String syncCourseCode;
+
+    @ApiModelProperty(value = "云阅卷课程代码")
+    private String cloudMarkingCourseCode;
+
+    public ExamCourseMapping() {
+    }
+
+    public ExamCourseMapping(Long schoolId, Long semesterId, String semesterName, Long examTypeId, String examTypeName, String syncCourseCode, String cloudMarkingCourseCode) {
+        this.id = SystemConstant.getDbUuid();
+        this.schoolId = schoolId;
+        this.semesterId = semesterId;
+        this.semesterName = semesterName;
+        this.examTypeId = examTypeId;
+        this.examTypeName = examTypeName;
+        this.syncCourseCode = syncCourseCode;
+        this.cloudMarkingCourseCode = cloudMarkingCourseCode;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public Long getSemesterId() {
+        return semesterId;
+    }
+
+    public void setSemesterId(Long semesterId) {
+        this.semesterId = semesterId;
+    }
+
+    public String getSemesterName() {
+        return semesterName;
+    }
+
+    public void setSemesterName(String semesterName) {
+        this.semesterName = semesterName;
+    }
+
+    public Long getExamTypeId() {
+        return examTypeId;
+    }
+
+    public void setExamTypeId(Long examTypeId) {
+        this.examTypeId = examTypeId;
+    }
+
+    public String getExamTypeName() {
+        return examTypeName;
+    }
+
+    public void setExamTypeName(String examTypeName) {
+        this.examTypeName = examTypeName;
+    }
+
+    public String getSyncCourseCode() {
+        return syncCourseCode;
+    }
+
+    public void setSyncCourseCode(String syncCourseCode) {
+        this.syncCourseCode = syncCourseCode;
+    }
+
+    public String getCloudMarkingCourseCode() {
+        return cloudMarkingCourseCode;
+    }
+
+    public void setCloudMarkingCourseCode(String cloudMarkingCourseCode) {
+        this.cloudMarkingCourseCode = cloudMarkingCourseCode;
+    }
+}

+ 13 - 0
src/main/java/com/qmth/eds/common/entity/ExamSyncStudent.java

@@ -1,6 +1,7 @@
 package com.qmth.eds.common.entity;
 
 import com.alibaba.excel.annotation.ExcelIgnore;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModel;
@@ -88,6 +89,10 @@ public class ExamSyncStudent implements Serializable {
     @ApiModelProperty(value = "考试备注")
     private String ksbz;
 
+    @ApiModelProperty(value = "对应云阅卷课程代码")
+    @TableField(exist = false)
+    private String cloudMarkingCourseCode;
+
     public Long getId() {
         return id;
     }
@@ -263,4 +268,12 @@ public class ExamSyncStudent implements Serializable {
     public void setKsbz(String ksbz) {
         this.ksbz = ksbz;
     }
+
+    public String getCloudMarkingCourseCode() {
+        return cloudMarkingCourseCode;
+    }
+
+    public void setCloudMarkingCourseCode(String cloudMarkingCourseCode) {
+        this.cloudMarkingCourseCode = cloudMarkingCourseCode;
+    }
 }

+ 16 - 0
src/main/java/com/qmth/eds/mapper/ExamCourseMappingMapper.java

@@ -0,0 +1,16 @@
+package com.qmth.eds.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.eds.bean.dto.CloudMarkingScoreDto;
+import com.qmth.eds.common.entity.CloudMarkingScore;
+import com.qmth.eds.common.entity.ExamCourseMapping;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 考务课程代码和云阅卷课程代码关系表 Mapper 接口
+ */
+public interface ExamCourseMappingMapper extends BaseMapper<ExamCourseMapping> {
+
+}

+ 18 - 0
src/main/java/com/qmth/eds/service/ExamCourseMappingService.java

@@ -0,0 +1,18 @@
+package com.qmth.eds.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.eds.common.entity.ExamCourseMapping;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ * 武大考务数据和云阅卷课程代码映射关系表 服务类
+ * </p>
+ */
+public interface ExamCourseMappingService extends IService<ExamCourseMapping> {
+
+    IPage<ExamCourseMapping> pageData(Long semesterId, Long examTypeId, String syncCourseCode, String cloudMarkingCourseCode, Integer pageNumber, Integer pageSize);
+
+    void importData(Long semesterId, Long examTypeId, MultipartFile file);
+}

+ 2 - 1
src/main/java/com/qmth/eds/service/ExamSyncStudentService.java

@@ -2,6 +2,7 @@ package com.qmth.eds.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.eds.common.entity.ExamSyncStudent;
+import com.qmth.eds.common.entity.ExamSyncTotal;
 
 import java.util.List;
 
@@ -10,5 +11,5 @@ import java.util.List;
  */
 public interface ExamSyncStudentService extends IService<ExamSyncStudent> {
 
-    List<ExamSyncStudent> listByExamSyncTotalId(Long examSyncTotalId);
+    List<ExamSyncStudent> listByExamSyncTotalId(ExamSyncTotal examSyncTotal);
 }

+ 7 - 5
src/main/java/com/qmth/eds/service/impl/DataSyncServiceImpl.java

@@ -71,7 +71,6 @@ public class DataSyncServiceImpl implements DataSyncService {
     @Resource
     private BasicMessageService basicMessageService;
 
-
     @Async
     @Override
     public void syncWuhanUniversityExamData(ExamScheduleTask examScheduleTask, TBSyncTask tbSyncTask, boolean isAuto) {
@@ -299,11 +298,14 @@ public class DataSyncServiceImpl implements DataSyncService {
         List<CloudMarkingScoreForeign> cloudMarkingScoreForeigns = new ArrayList<>();
         if (!examSyncTotalList.isEmpty()) {
             ExamSyncTotal examSyncTotal = examSyncTotalList.get(0);
-            List<ExamSyncStudent> examSyncStudents = examSyncStudentService.listByExamSyncTotalId(examSyncTotal.getId());
+            List<ExamSyncStudent> examSyncStudents = examSyncStudentService.listByExamSyncTotalId(examSyncTotal);
             for (CloudMarkingScore cloudMarkingScore : cloudMarkingScoreList) {
-                Optional<ExamSyncStudent> optional = examSyncStudents.stream().filter(s -> s.getJxbmc().equals(cloudMarkingScore.getClassName()) && s.getKch().equals(cloudMarkingScore.getSubjectCode()) && s.getXh().equals(cloudMarkingScore.getStudentCode())).findFirst();
+                Optional<ExamSyncStudent> optional = examSyncStudents.stream()
+                        .filter(s -> s.getJxbmc().equals(cloudMarkingScore.getClassName())
+                                && ((StringUtils.isBlank(s.getCloudMarkingCourseCode()) && s.getKch().equals(cloudMarkingScore.getSubjectCode())) || (StringUtils.isNotBlank(s.getCloudMarkingCourseCode()) && s.getCloudMarkingCourseCode().equals(cloudMarkingScore.getSubjectCode())))
+                                && s.getXh().equals(cloudMarkingScore.getStudentCode())).findFirst();
                 if (!optional.isPresent()) {
-                    cloudMarkingScoreForeigns.add(new CloudMarkingScoreForeign(collegeId, semesterId, examTypeId, examId, null, null, cloudMarkingScore.getClassName(), cloudMarkingScore.getSubjectCode(), cloudMarkingScore.getSubjectName(), cloudMarkingScore.getStudentCode(), cloudMarkingScore.getTotalScore()));
+                    cloudMarkingScoreForeigns.add(new CloudMarkingScoreForeign(collegeId, semesterId, examTypeId, examId, null, null, null, cloudMarkingScore.getSubjectCode(), cloudMarkingScore.getSubjectName(), cloudMarkingScore.getStudentCode(), cloudMarkingScore.getTotalScore()));
                 } else {
                     ExamSyncStudent examSyncStudent = optional.get();
                     cloudMarkingScoreForeigns.add(new CloudMarkingScoreForeign(collegeId, semesterId, examTypeId, examId, examSyncStudent.getXnm(), examSyncStudent.getXqm(), examSyncStudent.getJxbId(), examSyncStudent.getKch(), examSyncStudent.getKcmc(), examSyncStudent.getXh(), cloudMarkingScore.getTotalScore()));
@@ -311,7 +313,7 @@ public class DataSyncServiceImpl implements DataSyncService {
             }
         } else {
             for (CloudMarkingScore cloudMarkingScore : cloudMarkingScoreList) {
-                cloudMarkingScoreForeigns.add(new CloudMarkingScoreForeign(collegeId, semesterId, examTypeId, examId, null, null, cloudMarkingScore.getClassName(), cloudMarkingScore.getSubjectCode(), cloudMarkingScore.getSubjectName(), cloudMarkingScore.getStudentCode(), cloudMarkingScore.getTotalScore()));
+                cloudMarkingScoreForeigns.add(new CloudMarkingScoreForeign(collegeId, semesterId, examTypeId, examId, null, null, null, cloudMarkingScore.getSubjectCode(), cloudMarkingScore.getSubjectName(), cloudMarkingScore.getStudentCode(), cloudMarkingScore.getTotalScore()));
             }
         }
 

+ 101 - 0
src/main/java/com/qmth/eds/service/impl/ExamCourseMappingServiceImpl.java

@@ -0,0 +1,101 @@
+package com.qmth.eds.service.impl;
+
+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.boot.tools.excel.ExcelReader;
+import com.qmth.boot.tools.excel.enums.ExcelType;
+import com.qmth.eds.bean.dto.ExamCourseMappingDto;
+import com.qmth.eds.common.entity.ExamCourseMapping;
+import com.qmth.eds.common.entity.ExamSemester;
+import com.qmth.eds.common.entity.ExamType;
+import com.qmth.eds.common.enums.ExceptionResultEnum;
+import com.qmth.eds.common.util.ServletUtil;
+import com.qmth.eds.mapper.ExamCourseMappingMapper;
+import com.qmth.eds.service.ExamCourseMappingService;
+import com.qmth.eds.service.ExamSemesterService;
+import com.qmth.eds.service.ExamTypeService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.InputStream;
+import java.util.*;
+
+@Service
+public class ExamCourseMappingServiceImpl extends ServiceImpl<ExamCourseMappingMapper, ExamCourseMapping> implements ExamCourseMappingService {
+
+    @Resource
+    ExamSemesterService examSemesterService;
+
+    @Resource
+    ExamTypeService examTypeService;
+
+    @Override
+    public IPage<ExamCourseMapping> pageData(Long semesterId, Long examTypeId, String syncCourseCode, String cloudMarkingCourseCode, Integer pageNumber, Integer pageSize) {
+        QueryWrapper<ExamCourseMapping> queryWrapper = new QueryWrapper<>();
+        if (semesterId != null) {
+            queryWrapper.lambda().eq(ExamCourseMapping::getSemesterId, semesterId);
+        }
+        if (examTypeId != null) {
+            queryWrapper.lambda().eq(ExamCourseMapping::getExamTypeId, examTypeId);
+        }
+        if (StringUtils.isNotBlank(syncCourseCode)) {
+            queryWrapper.lambda().likeRight(ExamCourseMapping::getSyncCourseCode, syncCourseCode);
+        }
+        if (StringUtils.isNotBlank(cloudMarkingCourseCode)) {
+            queryWrapper.lambda().likeRight(ExamCourseMapping::getCloudMarkingCourseCode, cloudMarkingCourseCode);
+        }
+        queryWrapper.lambda().orderByAsc(ExamCourseMapping::getSyncCourseCode);
+        Page<ExamCourseMapping> page = new Page<>(pageNumber, pageSize);
+        return this.page(page, queryWrapper);
+    }
+
+    @Override
+    public void importData(Long semesterId, Long examTypeId, MultipartFile file) {
+        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+        try {
+            ExamSemester examSemester = examSemesterService.getById(semesterId);
+            ExamType examType = examTypeService.getById(examTypeId);
+
+            InputStream inputStream = file.getInputStream();
+            ExcelReader excelReader = ExcelReader.create(ExcelType.XLSX, inputStream, 1);
+            // 读取文件内容
+            List<ExamCourseMappingDto> examCourseMappingDtos = excelReader.getObjectList(ExamCourseMappingDto.class);
+            // 数据去重
+            Set<ExamCourseMappingDto> courseMappingDtoHashSet = new HashSet<>(examCourseMappingDtos);
+
+            // 查询学期+考试下所有对应关系
+            QueryWrapper<ExamCourseMapping> queryWrapper = new QueryWrapper<>();
+            queryWrapper.lambda().eq(ExamCourseMapping::getSchoolId, schoolId)
+                    .eq(ExamCourseMapping::getSemesterId, semesterId)
+                    .eq(ExamCourseMapping::getExamTypeId, examTypeId);
+            List<ExamCourseMapping> examCourseMappingList = this.list(queryWrapper);
+            List<ExamCourseMapping> examCourseMappings = new ArrayList<>();
+            for (ExamCourseMappingDto examCourseMappingDto : courseMappingDtoHashSet) {
+                ExamCourseMapping examCourseMapping = null;
+                Optional<ExamCourseMapping> optionalExamCourseMapping = examCourseMappingList.stream().filter(m -> examCourseMappingDto.getSyncCourseCode().equals(m.getSyncCourseCode())).findFirst();
+                if (optionalExamCourseMapping.isPresent()) {
+                    examCourseMapping = optionalExamCourseMapping.get();
+                }
+                // 不存在,新增
+                if (examCourseMapping == null) {
+                    examCourseMapping = new ExamCourseMapping(schoolId, semesterId, examSemester.getName(), examTypeId, examType.getName(), examCourseMappingDto.getSyncCourseCode(), examCourseMappingDto.getCloudMarkingCourseCode());
+                }
+                // 存在且云阅卷课程代码不一致,更新
+                else if (!examCourseMapping.getCloudMarkingCourseCode().equals(examCourseMappingDto.getCloudMarkingCourseCode())) {
+                    examCourseMapping.setCloudMarkingCourseCode(examCourseMappingDto.getCloudMarkingCourseCode());
+                }
+                // 存在且云阅卷课程代码一致,不处理
+
+                examCourseMappings.add(examCourseMapping);
+            }
+            // 批量新增、修改
+            this.saveOrUpdateBatch(examCourseMappings);
+        } catch (Exception e) {
+            throw ExceptionResultEnum.ERROR.exception("导入异常:" + e.getMessage());
+        }
+    }
+}

+ 32 - 2
src/main/java/com/qmth/eds/service/impl/ExamSyncStudentServiceImpl.java

@@ -2,19 +2,49 @@ package com.qmth.eds.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.eds.common.entity.ExamCourseMapping;
 import com.qmth.eds.common.entity.ExamSyncStudent;
+import com.qmth.eds.common.entity.ExamSyncTotal;
 import com.qmth.eds.mapper.ExamSyncStudentMapper;
+import com.qmth.eds.service.ExamCourseMappingService;
 import com.qmth.eds.service.ExamSyncStudentService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.List;
+import java.util.Optional;
 
 @Service
 public class ExamSyncStudentServiceImpl extends ServiceImpl<ExamSyncStudentMapper, ExamSyncStudent> implements ExamSyncStudentService {
+
+    @Resource
+    private ExamCourseMappingService examCourseMappingService;
+
     @Override
-    public List<ExamSyncStudent> listByExamSyncTotalId(Long examSyncTotalId) {
+    public List<ExamSyncStudent> listByExamSyncTotalId(ExamSyncTotal examSyncTotal) {
+        Long examSyncTotalId = examSyncTotal.getId();
+        Long schoolId = examSyncTotal.getSchoolId();
+        Long semesterId = examSyncTotal.getSemesterId();
+        Long examTypeId = examSyncTotal.getExamTypeId();
+
         QueryWrapper<ExamSyncStudent> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(ExamSyncStudent::getExamSyncTotalId, examSyncTotalId);
-        return this.list(queryWrapper);
+        List<ExamSyncStudent> examSyncStudents = this.list(queryWrapper);
+
+        QueryWrapper<ExamCourseMapping> examCourseMappingQueryWrapper = new QueryWrapper<>();
+        examCourseMappingQueryWrapper.lambda().eq(ExamCourseMapping::getSchoolId, schoolId)
+                .eq(ExamCourseMapping::getSemesterId, semesterId)
+                .eq(ExamCourseMapping::getExamTypeId, examTypeId);
+        List<ExamCourseMapping> examCourseMappings = examCourseMappingService.list(examCourseMappingQueryWrapper);
+        if (!examCourseMappings.isEmpty()) {
+            for (ExamSyncStudent examSyncStudent : examSyncStudents) {
+                Optional<ExamCourseMapping> examCourseMapping = examCourseMappings.stream().filter(m -> m.getSyncCourseCode().equals(examSyncStudent.getKch())).findFirst();
+                if (examCourseMapping.isPresent()) {
+                    examSyncStudent.setCloudMarkingCourseCode(examCourseMapping.get().getCloudMarkingCourseCode());
+                }
+            }
+        }
+
+        return examSyncStudents;
     }
 }

+ 4 - 0
src/main/resources/mapper/ExamCourseMappingMapper.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.qmth.eds.mapper.ExamCourseMappingMapper">
+</mapper>