Bladeren bron

Merge branch 'dev_v1.2.5' into dev_v1.2.4
merge

wangliang 2 jaren geleden
bovenliggende
commit
a0ac2dba42

BIN
themis-admin/src/main/.DS_Store


+ 4 - 4
themis-admin/src/main/java/com/qmth/themis/admin/api/TBOrgController.java

@@ -91,8 +91,8 @@ public class TBOrgController {
                 tbOrg.setUpdateId(tbUser.getId());
             }
             tbOrgService.saveOrUpdate(tbOrg);
-            cacheService.removeOrgCache(tbOrg.getId());
-            cacheService.removeOrgCodeCache(tbOrg.getCode());
+            cacheService.updateOrgCache(tbOrg.getId());
+            cacheService.updateOrgCodeCache(tbOrg.getCode());
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof DuplicateKeyException) {
@@ -131,8 +131,8 @@ public class TBOrgController {
         //保存机构
         tbOrg.setEnable(enable);
         tbOrgService.updateById(tbOrg);
-        cacheService.removeOrgCache(orgId);
-        cacheService.removeOrgCodeCache(tbOrg.getCode());
+        cacheService.updateOrgCache(orgId);
+        cacheService.updateOrgCodeCache(tbOrg.getCode());
         return ResultUtil.ok(true);
     }
 }

+ 11 - 10
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -225,13 +225,10 @@ public class TEExamController {
                     teExamActivity.setOpeningSeconds((int) ((teExam.getEndTime() - teExam.getStartTime()) / 1000));
                     teExamActivity.setStartTime(teExam.getStartTime());
                     teExamActivity.setFinishTime(teExam.getEndTime());
-                    teExamActivity.setEnable(teExam.getEnable());
                     teExamActivity.setUpdateId(tbUser.getId());
                 }
                 teExamActivityService.saveOrUpdate(teExamActivity);
-                if (Objects.isNull(teExamActivityService.updateExamActivityCacheBean(teExamActivity.getId()))) {
-                    teExamActivityService.deleteExamActivityCacheBean(teExamActivity.getId());
-                }
+                teExamActivityService.updateExamActivityCacheBean(teExamActivity.getId());
             }
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
@@ -255,9 +252,7 @@ public class TEExamController {
                 throw new RuntimeException(e);
             }
         }
-        if (Objects.isNull(teExamService.updateExamCacheBean(teExam.getId()))) {
-            teExamService.deleteExamCacheBean(teExam.getId());
-        }
+        teExamService.updateExamCacheBean(teExam.getId());
         examPaperService.disposeObjectiveAnswer(teExam.getId());
         return ResultUtil.ok(true);
     }
@@ -338,9 +333,7 @@ public class TEExamController {
         teExam.setEnable(enable);
         teExam.setUpdateId(tbUser.getId());
         teExamService.updateById(teExam);
-        if (Objects.isNull(teExamService.updateExamCacheBean(teExam.getId()))) {
-            teExamService.deleteExamCacheBean(teExam.getId());
-        }
+        teExamService.updateExamCacheBean(teExam.getId());
         return ResultUtil.ok(true);
     }
 
@@ -716,6 +709,14 @@ public class TEExamController {
         if (Objects.nonNull(examStudentId)) {
             tOeExamRecordQueryWrapper.lambda().eq(TOeExamRecord::getExamStudentId, examStudentId);
         }
+//        List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.list(tOeExamRecordQueryWrapper);
+//        if (!CollectionUtils.isEmpty(tOeExamRecordList)) {
+//            for (TOeExamRecord t : tOeExamRecordList) {
+//                ExamStudentCacheBean examStudentCacheBean = teExamStudentService.getExamStudentCacheBean(t.getExamStudentId());
+//                TEStudentCacheDto teStudent = cacheService.addStudentAccountCache(examStudentCacheBean.getStudentId());
+//                commonService.deleteExamStudentCache(t.getId(), teStudent.getId());
+//            }
+//        }
         tOeExamRecordQueryWrapper.lambda().isNotNull(TOeExamRecord::getFirstStartTime)
                 .isNotNull(TOeExamRecord::getFinishTime)
                 .eq(TOeExamRecord::getStatus, ExamRecordStatusEnum.FINISHED);

+ 1 - 3
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamCourseController.java

@@ -70,9 +70,7 @@ public class TEExamCourseController {
                 throw new RuntimeException(e);
             }
         }
-        if (Objects.isNull(teExamCourseService.updateExamCourseCacheBean(teExamCourse.getExamId(), teExamCourse.getCourseCode()))) {
-            teExamCourseService.deleteExamCourseCacheBean(teExamCourse.getExamId(), teExamCourse.getCourseCode());
-        }
+        teExamCourseService.updateExamCourseCacheBean(teExamCourse.getExamId(), teExamCourse.getCourseCode());
         return ResultUtil.ok(true);
     }
 

+ 2 - 4
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamPaperController.java

@@ -113,11 +113,9 @@ public class TEExamPaperController {
             }
         }
         teExamPaperList.forEach(s -> {
-            if (Objects.isNull(teExamPaperService.updateExamPaperCacheBean(s.getId()))) {
-                teExamPaperService.deleteExamPaperCacheBean(s.getId());
-            }
+            teExamPaperService.updateExamPaperCacheBean(s.getId());
             ExamPaperCacheBean paper = teExamPaperService.getExamPaperCacheBean(s.getId());
-            examCourseService.deleteExamCourseCacheBean(paper.getExamId(), paper.getCourseCode());
+            examCourseService.updateExamCourseCacheBean(paper.getExamId(), paper.getCourseCode());
         });
         return ResultUtil.ok(true);
     }

+ 2 - 6
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamReexamController.java

@@ -152,9 +152,7 @@ public class TEExamReexamController {
                             teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getAlreadyExamCount, alreadyExamCount)
                                     .eq(TEExamStudent::getId, s);
                             teExamStudentService.update(teExamStudentUpdateWrapper);
-                            if (Objects.isNull(teExamStudentService.updateExamStudentCacheBean(s))) {
-                                teExamStudentService.deleteExamStudentCacheBean(s);
-                            }
+                            teExamStudentService.updateExamStudentCacheBean(s);
                         }
                     }
                 });
@@ -216,9 +214,7 @@ public class TEExamReexamController {
                                             teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getAlreadyExamCount, alreadyExamCount)
                                                     .eq(TEExamStudent::getId, teExamReexam.getExamStudentId());
                                             teExamStudentService.update(teExamStudentUpdateWrapper);
-                                            if (Objects.isNull(teExamStudentService.updateExamStudentCacheBean(teExamReexam.getExamStudentId()))) {
-                                                teExamStudentService.deleteExamStudentCacheBean(teExamReexam.getExamStudentId());
-                                            }
+                                            teExamStudentService.updateExamStudentCacheBean(teExamReexam.getExamStudentId());
                                         }
                                     }
                                 }

+ 2 - 6
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamStudentController.java

@@ -231,9 +231,7 @@ public class TEExamStudentController {
         }
         teExamStudentService.updateBatchById(teExamStudentList);
         teExamStudentList.forEach(s -> {
-            if (Objects.isNull(teExamStudentService.updateExamStudentCacheBean(s.getId()))) {
-                teExamStudentService.deleteExamStudentCacheBean(s.getId());
-            }
+            teExamStudentService.updateExamStudentCacheBean(s.getId());
         });
         return ResultUtil.ok(true);
     }
@@ -306,9 +304,7 @@ public class TEExamStudentController {
             teExamStudentService.saveOrUpdate(s);
         });
         for (TEExamStudent es : teExamStudentList) {
-            if (Objects.isNull(teExamStudentService.updateExamStudentCacheBean(es.getId()))) {
-                teExamStudentService.deleteExamStudentCacheBean(es.getId());
-            }
+            teExamStudentService.updateExamStudentCacheBean(es.getId());
         }
         return ResultUtil.ok(true);
     }

+ 12 - 0
themis-business/src/main/java/com/qmth/themis/business/dto/MarkResultSimpleExportDto.java

@@ -78,6 +78,18 @@ public class MarkResultSimpleExportDto implements Serializable {
     @ExcelNotExport
     private Long examId;
 
+    @ApiModelProperty(value = "试卷名称")
+    @ExcelNotExport
+    private String paperName;
+
+    public String getPaperName() {
+        return paperName;
+    }
+
+    public void setPaperName(String paperName) {
+        this.paperName = paperName;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 13 - 1
themis-business/src/main/java/com/qmth/themis/business/dto/MarkResultStandardExportDto.java

@@ -16,7 +16,7 @@ import java.util.Map;
  * @Author: wangliang
  * @Date: 2020/7/20
  */
-public class MarkResultStandardExportDto implements Serializable{
+public class MarkResultStandardExportDto implements Serializable {
 
     @ExcelNote(value = "批次名称")
     private String examName;
@@ -83,6 +83,18 @@ public class MarkResultStandardExportDto implements Serializable{
     @ExcelNotExport
     private Long examId;
 
+    @ApiModelProperty(value = "试卷名称")
+    @ExcelNotExport
+    private String paperName;
+
+    public String getPaperName() {
+        return paperName;
+    }
+
+    public void setPaperName(String paperName) {
+        this.paperName = paperName;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 1 - 4
themis-business/src/main/java/com/qmth/themis/business/forkjoin/ExamStudentImportForkJoin.java

@@ -126,7 +126,6 @@ public class ExamStudentImportForkJoin extends RecursiveTask<Set<String>> {
                 }
                 teExamStudent.setCourseCode(examStudentImportDto.getCourseCode());
                 teExamStudent.setCourseName(examStudentImportDto.getCourseName());
-                teExamStudent.setAlreadyExamCount(0);
                 teExamStudent.setExamActivityId(teExamActivity.getId());
                 if (Objects.nonNull(examStudentImportDto.getPassword()) && !Objects.equals(examStudentImportDto.getPassword(), "")) {
                     try {
@@ -162,9 +161,7 @@ public class ExamStudentImportForkJoin extends RecursiveTask<Set<String>> {
                 if (Objects.nonNull(examCourseCacheBean)) {
                     teExamStudent.setCourseName(examCourseCacheBean.getCourseName());
                 }
-                if (teExamStudent.getAlreadyExamCount() == null) {
-                    teExamStudent.setAlreadyExamCount(0);
-                }
+                teExamStudent.setAlreadyExamCount(Objects.isNull(teExamStudent.getAlreadyExamCount()) ? 0 : teExamStudent.getAlreadyExamCount());
                 roomCodeAndNameSet.add(examId + ":" + teExamStudent.getRoomCode() + ":" + teExamStudent.getRoomName());
                 if (teExamStudentExists) {
                     teExamStudentInsertList.add(teExamStudent);

BIN
themis-business/src/main/java/com/qmth/themis/business/service/.DS_Store


+ 1 - 3
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamActivityServiceImpl.java

@@ -413,9 +413,7 @@ public class TEExamActivityServiceImpl extends ServiceImpl<TEExamActivityMapper,
             teExamActivityService.saveOrUpdateBatch(teExamActivityList);
 
             for (TEExamActivity ac : teExamActivityList) {
-                if (Objects.isNull(teExamActivityService.updateExamActivityCacheBean(ac.getId()))) {
-                    teExamActivityService.deleteExamActivityCacheBean(ac.getId());
-                }
+                teExamActivityService.updateExamActivityCacheBean(ac.getId());
             }
 
             if (!CollectionUtils.isEmpty(teAudioList)) {

+ 2 - 6
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -1504,9 +1504,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
             TEExamService examService = SpringContextHolder.getBean(TEExamService.class);
             teExamMapper.updateScoreStatus(ScoreStatusEnum.CALCULATING, examId);
             teExamMapper.updateScoreProgress(0.0, examId);
-            if (Objects.isNull(examService.updateExamCacheBean(examId))) {
-                examService.deleteExamCacheBean(examId);
-            }
+            examService.updateExamCacheBean(examId);
             task = tbTaskHistoryService.getById(taskId);
             task.setStatus(TaskStatusEnum.RUNNING);
             tbTaskHistoryService.saveOrUpdate(task);
@@ -1535,9 +1533,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
             }
             teExamMapper.updateScoreStatus(ScoreStatusEnum.FINISH, examId);
             teExamMapper.updateScoreProgress(100.0, examId);
-            if (Objects.isNull(examService.updateExamCacheBean(examId))) {
-                examService.deleteExamCacheBean(examId);
-            }
+            examService.updateExamCacheBean(examId);
             task.setSummary("处理成功");
             task.setProgress(100.0);
             task.setStatus(TaskStatusEnum.FINISH);

+ 11 - 6
themis-business/src/main/java/com/qmth/themis/business/templete/impl/TaskMarkResultStandardExportTemplete.java

@@ -9,6 +9,7 @@ import com.qmth.themis.business.annotation.ExcelDynamicExport;
 import com.qmth.themis.business.annotation.ExcelNotExport;
 import com.qmth.themis.business.annotation.ExcelNote;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
+import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.ExcelDto;
 import com.qmth.themis.business.dto.MarkResultSimpleExportDto;
@@ -128,10 +129,14 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
                         TOeExamRecord tOeExamRecord = tOeExamRecordService
                                 .findMarkResult(markResultDto, examCacheBean.getRecordSelectStrategy());
                         if (Objects.nonNull(tOeExamRecord)) {
+                            ExamPaperCacheBean examPaperCacheBean = teExamPaperService.getExamPaperCacheBean(tOeExamRecord.getPaperId());
                             examRecordIdsSet.add(String.valueOf(tOeExamRecord.getId()));
                             markResultSimpleExportDto.setObjectiveScore(Objects.isNull(tOeExamRecord.getObjectiveScore()) ? "0" : String.valueOf(tOeExamRecord.getObjectiveScore()));
                             markResultSimpleExportDto.setRecordId(tOeExamRecord.getId());
                             markResultSimpleExportDto.setPaperId(tOeExamRecord.getPaperId());
+                            if (Objects.nonNull(examPaperCacheBean)) {
+                                markResultSimpleExportDto.setPaperName(examPaperCacheBean.getName());
+                            }
                             markResultSimpleExportDto.setSubjectiveScore(Objects.isNull(markResultSimpleExportDto.getSubjectiveScore()) ? "0" : String.valueOf(markResultSimpleExportDto.getSubjectiveScore()));
                             markResultSimpleExportDto.setSumScore(String.valueOf(Double.parseDouble(markResultSimpleExportDto.getObjectiveScore()) + Double.parseDouble(markResultSimpleExportDto.getSubjectiveScore())));
                         }
@@ -363,7 +368,7 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
                     byte[] bookByteAry = out.toByteArray();
                     inputStream = new ByteArrayInputStream(bookByteAry);
                     StringBuilder stringBuilder = new StringBuilder(excelSj.toString());
-                    File finalFile = new File(stringBuilder.append(File.separator).append(markResultStandardExportDtoTempList.get(0).getCourseName() + "_" + markResultStandardExportDtoTempList.get(0).getCourseCode()).append(SystemConstant.EXCEL_PREFIX).toString());
+                    File finalFile = new File(stringBuilder.append(File.separator).append(markResultStandardExportDtoTempList.get(0).getPaperId() + "_" + markResultStandardExportDtoTempList.get(0).getPaperName() + "_" + markResultStandardExportDtoTempList.get(0).getCourseName() + "_" + markResultStandardExportDtoTempList.get(0).getCourseCode()).append(SystemConstant.EXCEL_PREFIX).toString());
                     if (!finalFile.exists()) {
                         finalFile.getParentFile().mkdirs();
                         finalFile.createNewFile();
@@ -409,11 +414,11 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
             taskExportCommon.getTxtList().removeAll(taskExportCommon.getTxtList().subList(1, taskExportCommon.getTxtList().size()));
             taskExportCommon.getTxtList().add(DateUtil.format(new Date(), Constants.DEFAULT_DATE_PATTERN) + "->数据导出完毕," + taskExportCommon.getTbTaskHistory().getSummary());
             taskExportCommon.writeExportResultTxt(stringJoiner.toString(), taskExportCommon.getTxtList().toString(), zipPath);
-            if (Objects.nonNull(files)) {
-                for (File file : files) {
-                    file.delete();
-                }
-            }
+//            if (Objects.nonNull(files)) {
+//                for (File file : files) {
+//                    file.delete();
+//                }
+//            }
         }
         return ResultUtil.ok(true);
     }

BIN
themis-exam/src/main/.DS_Store


BIN
themis-task/src/main/.DS_Store