|
@@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.googlecode.aviator.AviatorEvaluator;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.eds.bean.dto.ExamSyncStudentDto;
|
|
|
+import com.qmth.eds.bean.dto.coefficient.Coefficient;
|
|
|
+import com.qmth.eds.bean.dto.coefficient.Detail;
|
|
|
import com.qmth.eds.common.contant.SystemConstant;
|
|
|
import com.qmth.eds.common.entity.*;
|
|
|
import com.qmth.eds.common.enums.*;
|
|
@@ -19,20 +21,19 @@ import com.qmth.eds.common.tools.WhuUtils;
|
|
|
import com.qmth.eds.common.util.FileUtil;
|
|
|
import com.qmth.eds.service.*;
|
|
|
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.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.math.BigInteger;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.time.Instant;
|
|
|
import java.time.LocalDate;
|
|
@@ -59,10 +60,8 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
|
|
|
@Resource
|
|
|
private CloudMarkingScoreService cloudMarkingScoreService;
|
|
|
-
|
|
|
@Resource
|
|
|
- private CloudMarkingScoreForeignService cloudMarkingScoreForeignService;
|
|
|
-
|
|
|
+ private ExamCourseMappingService examCourseMappingService;
|
|
|
@Resource
|
|
|
private ExamSyncStudentService examSyncStudentService;
|
|
|
|
|
@@ -77,6 +76,10 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
|
|
|
@Resource
|
|
|
private ExamAssignService examAssignService;
|
|
|
+ @Resource
|
|
|
+ private ExamSemesterService examSemesterService;
|
|
|
+ @Resource
|
|
|
+ private ExamTypeService examTypeService;
|
|
|
|
|
|
@Async
|
|
|
@Override
|
|
@@ -198,6 +201,8 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
Long examTypeId = tbSyncTask.getExamTypeId();
|
|
|
File txtFile = null;
|
|
|
FileInputStream fis = null;
|
|
|
+ ExamSemester examSemester = examSemesterService.getById(semesterId);
|
|
|
+ ExamType examType = examTypeService.getById(examTypeId);
|
|
|
// 汇总表ID
|
|
|
try {
|
|
|
// 同步中
|
|
@@ -206,8 +211,12 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
Map<String, String> mapSource = new HashMap<>();
|
|
|
mapSource.put("examId", String.valueOf(examId));
|
|
|
int totalCount = cloudMarkingUtils.getStudentCount(schoolId, mapSource, collegeId);
|
|
|
+ List<ExamCourseMapping> examCourseMappingList = new ArrayList<>();
|
|
|
List<CloudMarkingScore> cloudMarkingScoreList = new ArrayList<>();
|
|
|
if (totalCount > 0) {
|
|
|
+ // 查询已关联的数据
|
|
|
+ List<ExamCourseMapping> examCourseMappings = examCourseMappingService.listByExamTypeIdAndExamId(examTypeId, examId);
|
|
|
+
|
|
|
int pageSize = SystemConstant.PAGE_SIZE;
|
|
|
int mod = totalCount % pageSize;
|
|
|
int pageNos = mod == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
|
|
@@ -225,27 +234,43 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
cloudMarkingScore.setStudentCode(m.getString("studentCode"));
|
|
|
cloudMarkingScore.setName(m.getString("name"));
|
|
|
cloudMarkingScore.setSubjectCode(m.getString("subjectCode"));
|
|
|
+ cloudMarkingScore.setSyncCourseCode(m.getString("remark"));
|
|
|
cloudMarkingScore.setSubjectName(m.getString("subjectName"));
|
|
|
cloudMarkingScore.setPaperType(m.getString("paperType"));
|
|
|
cloudMarkingScore.setCollege(m.getString("college"));
|
|
|
cloudMarkingScore.setClassName(m.getString("className"));
|
|
|
cloudMarkingScore.setTeacher(m.getString("teacher"));
|
|
|
cloudMarkingScore.setStatus(m.getInteger("status"));
|
|
|
-// cloudMarkingScore.setSheetUrls(m.getString("sheetUrls"));
|
|
|
cloudMarkingScore.setTotalScore(m.getString("totalScore"));
|
|
|
cloudMarkingScore.setObjectiveScore(m.getString("objectiveScore"));
|
|
|
cloudMarkingScore.setSubjectiveScore(m.getString("subjectiveScore"));
|
|
|
cloudMarkingScore.setObjectiveScoreDetail(m.getString("objectiveScoreDetail"));
|
|
|
cloudMarkingScore.setSubjectiveScoreDetail(m.getString("subjectiveScoreDetail"));
|
|
|
-// cloudMarkingScore.setMarkTags(m.getString("markTags"));
|
|
|
+
|
|
|
+ Optional<ExamCourseMapping> optional = examCourseMappings.stream().filter(c -> cloudMarkingScore.getSubjectCode().equals(c.getCloudMarkingCourseCode()) && cloudMarkingScore.getStudentCode().equals(c.getStudentCode())).findFirst();
|
|
|
+ if (optional.isPresent()) {
|
|
|
+ ExamCourseMapping examCourseMapping = optional.get();
|
|
|
+ if (!examCourseMapping.getSyncCourseCode().equals(cloudMarkingScore.getSyncCourseCode())) {
|
|
|
+ examCourseMapping.setSyncCourseCode(cloudMarkingScore.getSyncCourseCode());
|
|
|
+ examCourseMappingList.add(examCourseMapping);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ examCourseMappingList.add(new ExamCourseMapping(schoolId, semesterId, examSemester.getName(), examTypeId, examType.getName(), cloudMarkingScore.getStudentCode(), cloudMarkingScore.getSyncCourseCode(), cloudMarkingScore.getSubjectCode(), examId));
|
|
|
+ }
|
|
|
+
|
|
|
return cloudMarkingScore;
|
|
|
}).collect(Collectors.toList());
|
|
|
cloudMarkingScoreList.addAll(cloudMarkingScores);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 关联关系数据为空,保存
|
|
|
+ if (CollectionUtils.isNotEmpty(examCourseMappingList)) {
|
|
|
+ examCourseMappingService.saveBatch(examCourseMappingList);
|
|
|
+ }
|
|
|
+
|
|
|
//2.调用教务系统接口回传成绩
|
|
|
- if (!cloudMarkingScoreList.isEmpty()) {
|
|
|
+ if (CollectionUtils.isNotEmpty(cloudMarkingScoreList)) {
|
|
|
saveScoreData(schoolId, collegeId, semesterId, examTypeId, examId, cloudMarkingScoreList);
|
|
|
}
|
|
|
|
|
@@ -282,28 +307,79 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
try {
|
|
|
// 选模式
|
|
|
// 解析计算参数
|
|
|
- JSONObject object = JSON.parseObject(examAssign.getCoefficient());
|
|
|
- Boolean all = object.getBoolean("all");
|
|
|
- Double allValue = object.getDoubleValue("value");
|
|
|
+ Coefficient coefficient = JSON.parseObject(examAssign.getCoefficient(), Coefficient.class);
|
|
|
+ // 是否统一设置
|
|
|
+ Boolean all = coefficient.getAll();
|
|
|
+ if (all == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[是否统一设置all]不能为空");
|
|
|
+ }
|
|
|
+ // 统一设置系数
|
|
|
+ Double allValue = coefficient.getValue();
|
|
|
+ if (allValue == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[统一设置系数value]不能为空");
|
|
|
+ }
|
|
|
+ // 重修赋分系数
|
|
|
+ Boolean openRebuild = coefficient.getOpenRebuild();
|
|
|
+ if (openRebuild == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[重修单独设置赋分系数openRebuild]不能为空");
|
|
|
+ }
|
|
|
+ // 重修赋分系数
|
|
|
+ Double rebuildValue = coefficient.getRebuildValue();
|
|
|
+ if (openRebuild && rebuildValue == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[重修赋分系数rebuildValue]不能为空");
|
|
|
+ }
|
|
|
|
|
|
+ if (FormulaEnum.FORMULA1.equals(coefficient.getFormula())) {
|
|
|
+ Boolean openRound = coefficient.getOpenRound();
|
|
|
+ if (openRound == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[赋分后59分自动加1openRound]不能为空");
|
|
|
+ }
|
|
|
+ Boolean open59To58 = coefficient.getOpen59To58();
|
|
|
+ if (open59To58 == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[赋分后59分自动减1open59To58]不能为空");
|
|
|
+ }
|
|
|
+ Boolean openTotalScoreRound = coefficient.getOpenTotalScoreRound();
|
|
|
+ if (openTotalScoreRound == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[原始分四舍五入openTotalScoreRound]不能为空");
|
|
|
+ }
|
|
|
+ Boolean open54To53 = coefficient.getOpen54To53();
|
|
|
+ if (open54To53 == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[赋分后等于54分调整赋分分值为53openRebuild]不能为空");
|
|
|
+ }
|
|
|
+ Boolean open54d5 = coefficient.getOpen54d5();
|
|
|
+ if (open54d5 == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[赋分后如果小于等于54.5的取原始分值open54d5]不能为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (FormulaEnum.FORMULA2.equals(coefficient.getFormula())) {
|
|
|
+ Boolean openFetchOriginScore = coefficient.getOpenFetchOriginScore();
|
|
|
+ if (openFetchOriginScore == null) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("[赋分后小于原始分值取原始分值openFetchOriginScore]不能为空");
|
|
|
+ }
|
|
|
+ }
|
|
|
List<ExamSyncStudentDto> finalList = new ArrayList<>();
|
|
|
List<ExamSyncStudentDto> examSyncStudentDtoList = cloudMarkingScoreService.listExamSyncStudentDtos(examAssign.getSchoolId(), examAssign.getSemesterId(), examAssign.getExamTypeId(), examAssign.getCourseCode(), examAssign.getOpenCollege());
|
|
|
+ if (CollectionUtils.isEmpty(examSyncStudentDtoList)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("需要计算的数据有误,请联系管理员");
|
|
|
+ }
|
|
|
// 初始卷面最高分
|
|
|
Double maxTotalScore = examSyncStudentDtoList.stream().map(m -> Double.parseDouble(m.getTotalScore())).max(Comparator.comparingDouble(x -> x)).get();
|
|
|
if (all) {
|
|
|
// 卷面最高分
|
|
|
- calcProgress(examAssign.getFormula(), allValue, examSyncStudentDtoList, maxTotalScore, finalList);
|
|
|
+ calcProgress(examAssign, allValue, rebuildValue, examSyncStudentDtoList, maxTotalScore, finalList);
|
|
|
} else {
|
|
|
Map<String, List<ExamSyncStudentDto>> collect = examSyncStudentDtoList.stream().collect(Collectors.groupingBy(ExamSyncStudentDto::getJgmc));
|
|
|
for (Map.Entry<String, List<ExamSyncStudentDto>> entry : collect.entrySet()) {
|
|
|
String college = entry.getKey();
|
|
|
- List<JSONObject> details = JSON.parseArray(object.getString("detail"), JSONObject.class);
|
|
|
- Optional<JSONObject> objectOptional = details.stream().filter(m -> m.getString("college").equals(college)).findFirst();
|
|
|
+ List<Detail> details = coefficient.getDetail();
|
|
|
+ Optional<Detail> objectOptional = details.stream().filter(m -> m.getCollege().equals(college)).findFirst();
|
|
|
if (!objectOptional.isPresent()) {
|
|
|
throw ExceptionResultEnum.ERROR.exception(String.format("开课学院[%s]未设置的参数值", college));
|
|
|
}
|
|
|
- double collegeValue = objectOptional.get().getDoubleValue("value");
|
|
|
- calcProgress(examAssign.getFormula(), collegeValue, entry.getValue(), maxTotalScore, finalList);
|
|
|
+ double collegeValue = objectOptional.get().getValue();
|
|
|
+ double collegeRebuildValue = objectOptional.get().getRebuildValue();
|
|
|
+ calcProgress(examAssign, collegeValue, collegeRebuildValue, entry.getValue(), maxTotalScore, finalList);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -333,23 +409,38 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
/**
|
|
|
* 计算公共方法
|
|
|
*
|
|
|
- * @param formula 公式
|
|
|
+ * @param examAssign examAssign
|
|
|
* @param value 系数
|
|
|
+ * @param rebuildValue 重修系数
|
|
|
* @param examSyncStudentDtoList 源数据
|
|
|
* @param finalList 计算后数据
|
|
|
* 备注:AviatorEvaluator.compile(formula).execute(paramMap),paramMap中的参数值不能为String类型
|
|
|
*/
|
|
|
- private void calcProgress(FormulaEnum formula, Double value, List<ExamSyncStudentDto> examSyncStudentDtoList, Double maxTotalScore, List<ExamSyncStudentDto> finalList) {
|
|
|
+ private void calcProgress(ExamAssign examAssign, Double value, Double rebuildValue, List<ExamSyncStudentDto> examSyncStudentDtoList, Double maxTotalScore, List<ExamSyncStudentDto> finalList) {
|
|
|
+ Coefficient coefficient = JSON.parseObject(examAssign.getCoefficient(), Coefficient.class);
|
|
|
// 公式1(赋值分=卷面成绩+ (100- 卷面成绩)/赋分系数)
|
|
|
- if (FormulaEnum.FORMULA1.equals(formula)) {
|
|
|
+ if (FormulaEnum.FORMULA1.equals(examAssign.getFormula())) {
|
|
|
// a为卷面成绩,y为赋分系数
|
|
|
String formula1 = "a+(100-a)/b";
|
|
|
for (ExamSyncStudentDto studentDto : examSyncStudentDtoList) {
|
|
|
+ double totalScoreDouble = Double.parseDouble(studentDto.getTotalScore());
|
|
|
+ // 开启原始分四舍五入,先将分数四舍五入后再进行赋分计算
|
|
|
+ if (coefficient.getOpenTotalScoreRound()) {
|
|
|
+ totalScoreDouble = new BigDecimal(totalScoreDouble).setScale(0, RoundingMode.HALF_UP).doubleValue();
|
|
|
+ }
|
|
|
+ // 0分不参与赋分计算
|
|
|
+ if (totalScoreDouble == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Map<String, Object> paramMap = new HashMap<>();
|
|
|
- paramMap.put("a", Double.parseDouble(studentDto.getTotalScore()));
|
|
|
- paramMap.put("b", value);
|
|
|
+ paramMap.put("a", totalScoreDouble);
|
|
|
+ // 判断是否重修
|
|
|
+ Double bValue = StringUtils.isNotBlank(studentDto.getCxbj()) && "1".equals(studentDto.getCxbj()) && rebuildValue != null && rebuildValue.doubleValue() != 0 ? rebuildValue : value;
|
|
|
+ paramMap.put("b", bValue);
|
|
|
String assignScore = AviatorEvaluator.compile(formula1).execute(paramMap).toString();
|
|
|
- studentDto.setAssignScore(stripTrailingZerosFormula1(assignScore));
|
|
|
+ // studentDto.setAssignScore(roundOff59(stripTrailingZerosFormula1(assignScore), examAssign.getOpenRound()));
|
|
|
+ // 计算赋分值后,四舍五入
|
|
|
+ studentDto.setAssignScore(roundScoreForFormula1(valueRoundUp(assignScore), totalScoreDouble, coefficient));
|
|
|
finalList.add(studentDto);
|
|
|
}
|
|
|
}
|
|
@@ -359,31 +450,38 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
说明:1.如果初始卷面最高的大于99时,则x=100,否则x=99;
|
|
|
2.参数根据每次总体初始成绩的不及格率进行调整。
|
|
|
*/
|
|
|
- else if (FormulaEnum.FORMULA2.equals(formula)) {
|
|
|
+ else if (FormulaEnum.FORMULA2.equals(examAssign.getFormula())) {
|
|
|
int x = maxTotalScore.doubleValue() > 99 ? 100 : 99;
|
|
|
// a:初始卷面,b:参数,c:初始卷面最高分,x:说明1中参数
|
|
|
String formula2_1 = "(55+(a-b)/(c-b)*(x-55))*2";
|
|
|
String formula2_2 = "(a*50/b)*2";
|
|
|
|
|
|
for (ExamSyncStudentDto studentDto : examSyncStudentDtoList) {
|
|
|
- Map<String, Object> paramMap = new HashMap<>();
|
|
|
Double totalScore = Double.valueOf(studentDto.getTotalScore());
|
|
|
+ // 0分不参与赋分计算
|
|
|
+ if (totalScore.doubleValue() == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 判断是否重修
|
|
|
+ Double bValue = StringUtils.isNotBlank(studentDto.getCxbj()) && "1".equals(studentDto.getCxbj()) && rebuildValue != null && rebuildValue.doubleValue() != 0 ? rebuildValue : value;
|
|
|
+ Map<String, Object> paramMap = new HashMap<>();
|
|
|
String tempAssignScore;
|
|
|
if (totalScore >= value) {
|
|
|
paramMap.put("a", totalScore.doubleValue());
|
|
|
- paramMap.put("b", value);
|
|
|
+ paramMap.put("b", bValue.doubleValue());
|
|
|
paramMap.put("c", maxTotalScore.doubleValue());
|
|
|
paramMap.put("x", x);
|
|
|
tempAssignScore = AviatorEvaluator.compile(formula2_1).execute(paramMap).toString();
|
|
|
} else {
|
|
|
paramMap.put("a", totalScore.doubleValue());
|
|
|
- paramMap.put("b", value.doubleValue());
|
|
|
+ paramMap.put("b", bValue.doubleValue());
|
|
|
tempAssignScore = AviatorEvaluator.compile(formula2_2).execute(paramMap).toString();
|
|
|
}
|
|
|
|
|
|
BigDecimal bigDecimal = new BigDecimal(tempAssignScore).setScale(0, RoundingMode.HALF_UP);
|
|
|
String assignScore = bigDecimal.divide(new BigDecimal("2")).toString();
|
|
|
- studentDto.setAssignScore(stripTrailingZeros(assignScore));
|
|
|
+ // studentDto.setAssignScore(roundOff59(stripTrailingZeros(assignScore), examAssign.getOpenRound()));
|
|
|
+ studentDto.setAssignScore(roundScoreForFormula2(valueRoundUp(assignScore), totalScore, coefficient));
|
|
|
finalList.add(studentDto);
|
|
|
}
|
|
|
}
|
|
@@ -422,6 +520,67 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
return new BigDecimal(value).stripTrailingZeros().toPlainString();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 四舍五入后只保留整数
|
|
|
+ *
|
|
|
+ * @param value
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String valueRoundUp(String value) {
|
|
|
+ return new BigDecimal(value).setScale(0, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 满59进1到60
|
|
|
+ *
|
|
|
+ * @param assignScore
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String roundOff59(String assignScore, Coefficient coefficient) {
|
|
|
+ Boolean openRound = coefficient.getOpenRound();
|
|
|
+ Boolean open54To53 = coefficient.getOpen54To53();
|
|
|
+ Boolean open54d5 = coefficient.getOpen54d5();
|
|
|
+ // 分数>59,进1为60
|
|
|
+ int intValue = new BigDecimal(assignScore).setScale(0, RoundingMode.FLOOR).intValue();
|
|
|
+ if (openRound && intValue == 59) {
|
|
|
+ return "60";
|
|
|
+ } else {
|
|
|
+ return assignScore;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String roundScoreForFormula1(String assignScore, double studentScore, Coefficient coefficient) {
|
|
|
+ Boolean openRound = coefficient.getOpenRound();
|
|
|
+ Boolean open54To53 = coefficient.getOpen54To53();
|
|
|
+ Boolean open54d5 = coefficient.getOpen54d5();
|
|
|
+ int intValue = new BigDecimal(assignScore).setScale(0, RoundingMode.FLOOR).intValue();
|
|
|
+ // 分数=59,进1为60
|
|
|
+ if (openRound && intValue == 59) {
|
|
|
+ return "60";
|
|
|
+ }
|
|
|
+ // 赋分后等于54分调整赋分分值为53
|
|
|
+ else if (open54To53 && intValue == 54) {
|
|
|
+ return "53";
|
|
|
+ }
|
|
|
+ // 赋分后如果小于54.5的取原始分值
|
|
|
+ else if (open54d5 && intValue < 54.5) {
|
|
|
+ return String.valueOf(studentScore);
|
|
|
+ } else {
|
|
|
+ return assignScore;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String roundScoreForFormula2(String assignScore, double studentScore, Coefficient coefficient) {
|
|
|
+ Boolean openFetchOriginScore = coefficient.getOpenFetchOriginScore();
|
|
|
+ double doubleValue = new BigDecimal(assignScore).setScale(0, RoundingMode.FLOOR).doubleValue();
|
|
|
+ // 赋分后小于原始分值取原始分值
|
|
|
+ if (openFetchOriginScore && doubleValue < studentScore) {
|
|
|
+ return String.valueOf(studentScore);
|
|
|
+ } else {
|
|
|
+ return assignScore;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional
|
|
|
public void saveScoreData(Long schoolId, Long collegeId, Long semesterId, Long examTypeId, Integer examId, List<CloudMarkingScore> cloudMarkingScoreList) {
|
|
|
// 查询对外数据
|
|
@@ -431,14 +590,12 @@ public class WhuDataSyncServiceImpl implements WhuDataSyncService {
|
|
|
}
|
|
|
List<ExamSyncStudent> examSyncStudents = examSyncStudentService.listByExamSyncTotalId(examSyncTotal);
|
|
|
for (CloudMarkingScore cloudMarkingScore : cloudMarkingScoreList) {
|
|
|
- Optional<ExamSyncStudent> optional = examSyncStudents.stream()
|
|
|
- .filter(s ->
|
|
|
- ((StringUtils.isBlank(s.getCloudMarkingCourseCode()) && s.getKch().equals(cloudMarkingScore.getSubjectCode())) || (StringUtils.isNotBlank(s.getCloudMarkingCourseCode()) && s.getCloudMarkingCourseCode().equals(cloudMarkingScore.getSubjectCode())))
|
|
|
- && s.getXh().equals(cloudMarkingScore.getStudentCode())).findFirst();
|
|
|
+ // 通过课程号+学号进行云阅卷数据和考务数据匹配
|
|
|
+ Optional<ExamSyncStudent> optional = examSyncStudents.stream().filter(s -> s.getKch().equals(cloudMarkingScore.getSyncCourseCode()) && s.getXh().equals(cloudMarkingScore.getStudentCode())).findFirst();
|
|
|
if (optional.isPresent()) {
|
|
|
ExamSyncStudent examSyncStudent = optional.get();
|
|
|
// 匹配上,保存考务数据表ID
|
|
|
- cloudMarkingScore.setSyncCourseCode(examSyncStudent.getKch());
|
|
|
+// cloudMarkingScore.setSyncCourseCode(examSyncStudent.getKch());
|
|
|
cloudMarkingScore.setOpenCollege(examSyncStudent.getKkbm());
|
|
|
cloudMarkingScore.setExamSyncStudentId(examSyncStudent.getId());
|
|
|
}
|