|
@@ -77,11 +77,7 @@ public class TCFinalScoreController {
|
|
public void finalScoreTemplateDownload(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
public void finalScoreTemplateDownload(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
@ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
@ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
@ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
|
|
@ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
|
|
- String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber;
|
|
|
|
- Object o = redisUtil.get(lockKey);
|
|
|
|
- if (Objects.nonNull(o)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("正在同步数据,请稍候再试!");
|
|
|
|
- }
|
|
|
|
|
|
+ tcFinalScoreService.getFinalScoreSyncLock(examId, courseCode, paperNumber);
|
|
TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
|
|
TCPaperStruct tcPaperStruct = tcPaperStructService.queryByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
|
|
List<ExcelField> excelFieldList = new ArrayList<>();
|
|
List<ExcelField> excelFieldList = new ArrayList<>();
|
|
excelFieldList.addAll(new ArrayList<>(Arrays.asList(new ExcelField("studentCode", "学号", true), new ExcelField("name", "姓名", true), new ExcelField("score", "成绩", true))));
|
|
excelFieldList.addAll(new ArrayList<>(Arrays.asList(new ExcelField("studentCode", "学号", true), new ExcelField("name", "姓名", true), new ExcelField("score", "成绩", true))));
|
|
@@ -116,11 +112,7 @@ public class TCFinalScoreController {
|
|
@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
|
|
@ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
@ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
|
|
@ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
|
|
@ApiParam(value = "试卷编号", required = true) @RequestParam String paperNumber) throws IOException {
|
|
- String lockSyncKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + examId + "_" + courseCode + "_" + paperNumber;
|
|
|
|
- Object o = redisUtil.get(lockSyncKey);
|
|
|
|
- if (Objects.nonNull(o)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("正在同步数据,请稍候再试!");
|
|
|
|
- }
|
|
|
|
|
|
+ tcFinalScoreService.getFinalScoreSyncLock(examId, courseCode, paperNumber);
|
|
String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber;
|
|
String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.IMPORT + examId + "_" + courseCode + "_" + paperNumber;
|
|
boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_LOCK_IMPORT_EXAM_DATA_TIME_OUT);
|
|
boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_LOCK_IMPORT_EXAM_DATA_TIME_OUT);
|
|
if (!lock) {
|
|
if (!lock) {
|
|
@@ -205,11 +197,7 @@ public class TCFinalScoreController {
|
|
TCFinalScore tcFinalScoreDb = tcFinalScoreService.getById(tcFinalScore.getId());
|
|
TCFinalScore tcFinalScoreDb = tcFinalScoreService.getById(tcFinalScore.getId());
|
|
Objects.requireNonNull(tcFinalScoreDb, "未找到期末成绩信息");
|
|
Objects.requireNonNull(tcFinalScoreDb, "未找到期末成绩信息");
|
|
|
|
|
|
- String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + tcFinalScoreDb.getExamId() + "_" + tcFinalScoreDb.getCourseCode() + "_" + tcFinalScoreDb.getPaperNumber();
|
|
|
|
- Object o = redisUtil.get(lockKey);
|
|
|
|
- if (Objects.nonNull(o)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("正在同步数据,请稍候再试!");
|
|
|
|
- }
|
|
|
|
|
|
+ tcFinalScoreService.getFinalScoreSyncLock(tcFinalScoreDb.getExamId(), tcFinalScoreDb.getCourseCode(), tcFinalScoreDb.getPaperNumber());
|
|
|
|
|
|
TCFinalScore tcFinalScoreSource = new TCFinalScore();
|
|
TCFinalScore tcFinalScoreSource = new TCFinalScore();
|
|
BeanUtils.copyProperties(tcFinalScoreDb, tcFinalScoreSource);
|
|
BeanUtils.copyProperties(tcFinalScoreDb, tcFinalScoreSource);
|
|
@@ -233,11 +221,7 @@ public class TCFinalScoreController {
|
|
TCFinalScore tcFinalScoreDb = tcFinalScoreService.getById(id);
|
|
TCFinalScore tcFinalScoreDb = tcFinalScoreService.getById(id);
|
|
Objects.requireNonNull(tcFinalScoreDb, "未找到期末成绩信息");
|
|
Objects.requireNonNull(tcFinalScoreDb, "未找到期末成绩信息");
|
|
|
|
|
|
- String lockKey = SystemConstant.REDIS_FINAL_SCORE_DATA_FLOW_PREFIX + SystemConstant.SYNC + tcFinalScoreDb.getExamId() + "_" + tcFinalScoreDb.getCourseCode() + "_" + tcFinalScoreDb.getPaperNumber();
|
|
|
|
- Object o = redisUtil.get(lockKey);
|
|
|
|
- if (Objects.nonNull(o)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("正在同步数据,请稍候再试!");
|
|
|
|
- }
|
|
|
|
|
|
+ tcFinalScoreService.getFinalScoreSyncLock(tcFinalScoreDb.getExamId(), tcFinalScoreDb.getCourseCode(), tcFinalScoreDb.getPaperNumber());
|
|
|
|
|
|
TCFinalScore tcFinalScoreSource = new TCFinalScore();
|
|
TCFinalScore tcFinalScoreSource = new TCFinalScore();
|
|
BeanUtils.copyProperties(tcFinalScoreDb, tcFinalScoreSource);
|
|
BeanUtils.copyProperties(tcFinalScoreDb, tcFinalScoreSource);
|