|
@@ -85,13 +85,13 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
|
|
|
}
|
|
|
String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
|
|
|
- PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(examId, courseCode);
|
|
|
+ PaperConfig paperConfig = callPrintOpenApiService.callPaperConfig(schoolId, examId, courseCode);
|
|
|
// md5 检验
|
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
.eq(TBExamCourse::getSchoolId, schoolId)
|
|
|
.eq(TBExamCourse::getExamId, examId)
|
|
|
.eq(TBExamCourse::getCourseCode, courseCode));
|
|
|
- BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
|
|
|
+ BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
|
|
|
String oldMd5 = "";
|
|
|
if (Objects.nonNull(md5)) {
|
|
|
oldMd5 = md5.getPaperMd5();
|
|
@@ -151,16 +151,16 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, courseCode, null)) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
|
|
|
}
|
|
|
- List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(examId, courseCode);
|
|
|
+ List<PaperDimension> paperDimensionList = callPrintOpenApiService.callPaperDimension(schoolId, examId, courseCode);
|
|
|
|
|
|
// md5 检验
|
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
- .eq(TBExamCourse::getSchoolId,schoolId)
|
|
|
- .eq(TBExamCourse::getExamId,examId)
|
|
|
- .eq(TBExamCourse::getCourseCode,courseCode));
|
|
|
- BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
|
|
|
+ .eq(TBExamCourse::getSchoolId, schoolId)
|
|
|
+ .eq(TBExamCourse::getExamId, examId)
|
|
|
+ .eq(TBExamCourse::getCourseCode, courseCode));
|
|
|
+ BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
|
|
|
String oldMd5 = "";
|
|
|
- if (Objects.nonNull(md5)){
|
|
|
+ if (Objects.nonNull(md5)) {
|
|
|
oldMd5 = md5.getDimensionMd5();
|
|
|
}
|
|
|
String currentMd5 = this.buildDimensionDataMd5(paperDimensionList);
|
|
@@ -174,8 +174,8 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
|
|
|
String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
|
|
|
List<TBDimension> old = tbDimensionService.list(new QueryWrapper<TBDimension>().lambda().eq(TBDimension::getExamId, examId).eq(TBDimension::getCourseCode, courseCode));
|
|
|
- if (old != null && old.size() > 0){
|
|
|
- repeat = this.checkTBDimensionRepeat(old,paperDimensionList);
|
|
|
+ if (old != null && old.size() > 0) {
|
|
|
+ repeat = this.checkTBDimensionRepeat(old, paperDimensionList);
|
|
|
}
|
|
|
|
|
|
List<TBDimension> tbDimensionList = paperDimensionList.stream().flatMap(e -> {
|
|
@@ -214,16 +214,16 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
TBPaper tbPaper = tbPaperList.get(0);
|
|
|
Long paperId = tbPaper.getId();
|
|
|
|
|
|
- List<PaperStructure> paperStructureList = callPrintOpenApiService.callPaperStruct(examId, courseCode);
|
|
|
+ List<PaperStructure> paperStructureList = callPrintOpenApiService.callPaperStruct(schoolId, examId, courseCode);
|
|
|
|
|
|
// md5 检验
|
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
- .eq(TBExamCourse::getSchoolId,schoolId)
|
|
|
- .eq(TBExamCourse::getExamId,examId)
|
|
|
- .eq(TBExamCourse::getCourseCode,courseCode));
|
|
|
- BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
|
|
|
+ .eq(TBExamCourse::getSchoolId, schoolId)
|
|
|
+ .eq(TBExamCourse::getExamId, examId)
|
|
|
+ .eq(TBExamCourse::getCourseCode, courseCode));
|
|
|
+ BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
|
|
|
String oldMd5 = "";
|
|
|
- if (Objects.nonNull(md5)){
|
|
|
+ if (Objects.nonNull(md5)) {
|
|
|
oldMd5 = md5.getStructMd5();
|
|
|
}
|
|
|
String currentMd5 = this.buildStructDataMd5(paperStructureList);
|
|
@@ -237,8 +237,8 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
// -- --
|
|
|
List<TBDimension> tbDimensionList = tbDimensionService.list(new QueryWrapper<TBDimension>()
|
|
|
.lambda()
|
|
|
- .eq(TBDimension::getExamId,examId)
|
|
|
- .eq(TBDimension::getCourseCode,courseCode));
|
|
|
+ .eq(TBDimension::getExamId, examId)
|
|
|
+ .eq(TBDimension::getCourseCode, courseCode));
|
|
|
|
|
|
// 知识 - 二级维度
|
|
|
List<String> knowledgeDatasource = tbDimensionList.stream()
|
|
@@ -265,17 +265,17 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
String knowledgeDimension = e.getKnowledgeDimension();
|
|
|
String abilityDimension = e.getAbilityDimension();
|
|
|
// 校验试卷结构每题的维度点都在该科目的维度池中(知识二级能力一级)
|
|
|
- if (SystemConstant.strNotNull(knowledgeDimension)){
|
|
|
+ if (SystemConstant.strNotNull(knowledgeDimension)) {
|
|
|
for (String knowledge : knowledgeDimension.split(",")) {
|
|
|
- if (!knowledgeDatasource.contains(knowledge)){
|
|
|
+ if (!knowledgeDatasource.contains(knowledge)) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷结构知识点二级维度【" + knowledge + "】不在知识维度池中");
|
|
|
}
|
|
|
}
|
|
|
tbPaperStruct.setKnowledgeDimension(knowledgeDimension);
|
|
|
}
|
|
|
- if (SystemConstant.strNotNull(abilityDimension)){
|
|
|
+ if (SystemConstant.strNotNull(abilityDimension)) {
|
|
|
for (String ability : abilityDimension.split(",")) {
|
|
|
- if (!abilityDatasource.contains(ability)){
|
|
|
+ if (!abilityDatasource.contains(ability)) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷结构能力点一级维度【" + ability + "】不在能力维度池中");
|
|
|
}
|
|
|
}
|
|
@@ -300,16 +300,16 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
|
|
|
}
|
|
|
String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
|
|
|
- List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(examId, courseCode);
|
|
|
+ List<PaperEvaluation> paperEvaluationList = callPrintOpenApiService.callPaperModule(schoolId, examId, courseCode);
|
|
|
|
|
|
// md5 检验
|
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
- .eq(TBExamCourse::getSchoolId,schoolId)
|
|
|
- .eq(TBExamCourse::getExamId,examId)
|
|
|
- .eq(TBExamCourse::getCourseCode,courseCode));
|
|
|
- BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
|
|
|
+ .eq(TBExamCourse::getSchoolId, schoolId)
|
|
|
+ .eq(TBExamCourse::getExamId, examId)
|
|
|
+ .eq(TBExamCourse::getCourseCode, courseCode));
|
|
|
+ BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
|
|
|
String oldMd5 = "";
|
|
|
- if (Objects.nonNull(md5)){
|
|
|
+ if (Objects.nonNull(md5)) {
|
|
|
oldMd5 = md5.getModuleMd5();
|
|
|
}
|
|
|
String currentMd5 = this.buildModuleDataMd5(paperEvaluationList);
|
|
@@ -402,21 +402,21 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号为【" + courseCode + "】的课程不能进行数据更改");
|
|
|
}
|
|
|
String courseName = basicCourseService.findByCourseCode(courseCode, schoolId).getName();
|
|
|
- List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(examId, courseCode);
|
|
|
+ List<ExamStudentScore> examStudentScoreList = callPrintOpenApiService.callExamStudentScore(schoolId, examId, courseCode);
|
|
|
// md5 检查
|
|
|
TBExamCourse tbExamCourse = tbExamCourseService.getOne(new QueryWrapper<TBExamCourse>().lambda()
|
|
|
- .eq(TBExamCourse::getSchoolId,schoolId)
|
|
|
- .eq(TBExamCourse::getExamId,examId)
|
|
|
- .eq(TBExamCourse::getCourseCode,courseCode));
|
|
|
- BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(),BasicExamCourseDataMd5.class);
|
|
|
+ .eq(TBExamCourse::getSchoolId, schoolId)
|
|
|
+ .eq(TBExamCourse::getExamId, examId)
|
|
|
+ .eq(TBExamCourse::getCourseCode, courseCode));
|
|
|
+ BasicExamCourseDataMd5 md5 = JSON.parseObject(tbExamCourse.getOpenDataMd5(), BasicExamCourseDataMd5.class);
|
|
|
String oldMd5 = "";
|
|
|
- if (Objects.nonNull(md5)){
|
|
|
+ if (Objects.nonNull(md5)) {
|
|
|
oldMd5 = md5.getStudentScoreMd5();
|
|
|
}
|
|
|
String currentMd5 = this.buildExamStudentDataMd5(examStudentScoreList);
|
|
|
|
|
|
//因为t_b_paper表是做更新操作的所以当学生数据md5一致,即使是t_b_paper的数据改了,也不影响学生数据所绑定的paper_id 所以不用重新算
|
|
|
- if (!currentMd5.equals(oldMd5)){
|
|
|
+ if (!currentMd5.equals(oldMd5)) {
|
|
|
// md5 不一致需要重算
|
|
|
repeat = true;
|
|
|
md5.setStudentScoreMd5(currentMd5);
|
|
@@ -445,7 +445,7 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
boolean repeatForStruct = this.tbPaperStructDispose(examId, courseCode, schoolId);
|
|
|
boolean repeatForModule = this.tbPaperModuleDispose(examId, courseCode, schoolId);
|
|
|
boolean repeatForExamStudentScore = this.tbExamStudentScoreDatasourceDispose(examId, courseCode, schoolId);
|
|
|
- if (repeatForPaper || repeatForDimension || repeatForStruct || repeatForModule || repeatForExamStudentScore){
|
|
|
+ if (repeatForPaper || repeatForDimension || repeatForStruct || repeatForModule || repeatForExamStudentScore) {
|
|
|
repeat = true;
|
|
|
}
|
|
|
return repeat;
|
|
@@ -834,19 +834,21 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
|
|
|
/**
|
|
|
* 构建试卷信息md5
|
|
|
+ *
|
|
|
* @param paperConfig 试卷配置
|
|
|
* @return md5
|
|
|
*/
|
|
|
- private String buildPaperDataMd5(PaperConfig paperConfig){
|
|
|
+ private String buildPaperDataMd5(PaperConfig paperConfig) {
|
|
|
return DigestUtils.md5Hex(JSON.toJSONString(paperConfig));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 构建维度信息md5
|
|
|
+ *
|
|
|
* @param paperDimensionList 维度信息
|
|
|
* @return MD5
|
|
|
*/
|
|
|
- private String buildDimensionDataMd5(List<PaperDimension> paperDimensionList){
|
|
|
+ private String buildDimensionDataMd5(List<PaperDimension> paperDimensionList) {
|
|
|
paperDimensionList = paperDimensionList.stream().sorted(Comparator.comparing(PaperDimension::getDimensionType)
|
|
|
.thenComparing(PaperDimension::getCodePrimary)
|
|
|
.thenComparing(PaperDimension::getCodeSecond))
|
|
@@ -856,10 +858,11 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
|
|
|
/**
|
|
|
* 构建结构信息md5
|
|
|
+ *
|
|
|
* @param paperStructureList 试卷结构信息
|
|
|
* @return MD5
|
|
|
*/
|
|
|
- private String buildStructDataMd5(List<PaperStructure> paperStructureList){
|
|
|
+ private String buildStructDataMd5(List<PaperStructure> paperStructureList) {
|
|
|
paperStructureList = paperStructureList.stream().sorted(Comparator.comparing(PaperStructure::getNumberType)
|
|
|
.thenComparing(PaperStructure::getBigQuestionNumber)
|
|
|
.thenComparing(PaperStructure::getSmallQuestionNumber)).collect(Collectors.toList());
|
|
@@ -868,10 +871,11 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
|
|
|
/**
|
|
|
* 构建模块信息MD5
|
|
|
+ *
|
|
|
* @param paperEvaluationList 试卷模块信息
|
|
|
* @return MD5
|
|
|
*/
|
|
|
- private String buildModuleDataMd5(List<PaperEvaluation> paperEvaluationList){
|
|
|
+ private String buildModuleDataMd5(List<PaperEvaluation> paperEvaluationList) {
|
|
|
paperEvaluationList = paperEvaluationList.stream().sorted(Comparator.comparing(PaperEvaluation::getModuleType))
|
|
|
.collect(Collectors.toList());
|
|
|
return DigestUtils.md5Hex(JSON.toJSONString(paperEvaluationList));
|
|
@@ -879,10 +883,11 @@ public class AnalyzeDataGetAndEditServiceImpl implements AnalyzeDataGetAndEditSe
|
|
|
|
|
|
/**
|
|
|
* 构建学生成绩数据md5
|
|
|
+ *
|
|
|
* @param examStudentScoreList 学生成绩数据
|
|
|
* @return md5
|
|
|
*/
|
|
|
- private String buildExamStudentDataMd5(List<ExamStudentScore> examStudentScoreList){
|
|
|
+ private String buildExamStudentDataMd5(List<ExamStudentScore> examStudentScoreList) {
|
|
|
examStudentScoreList = examStudentScoreList.stream().sorted(Comparator.comparing(ExamStudentScore::getStudentCode)).collect(Collectors.toList());
|
|
|
return DigestUtils.md5Hex(JSON.toJSONString(examStudentScoreList));
|
|
|
}
|