|
@@ -208,8 +208,8 @@ public class TEExamPaperController {
|
|
ExamCourseCacheBean examCourseCacheBean = examCourseService.getExamCourseCacheBean(examPaperCacheBean.getExamId(), examPaperCacheBean.getCourseCode());
|
|
ExamCourseCacheBean examCourseCacheBean = examCourseService.getExamCourseCacheBean(examPaperCacheBean.getExamId(), examPaperCacheBean.getCourseCode());
|
|
Optional.ofNullable(examCourseCacheBean).orElseThrow(() -> new BusinessException("科目数据为空"));
|
|
Optional.ofNullable(examCourseCacheBean).orElseThrow(() -> new BusinessException("科目数据为空"));
|
|
|
|
|
|
- Integer paperCount = examCourseCacheBean.getPaperCount();
|
|
|
|
- paperCount = paperCount - 1;
|
|
|
|
|
|
+ Integer paperCount = Objects.nonNull(examCourseCacheBean.getPaperCount()) ? examCourseCacheBean.getPaperCount() : 0;
|
|
|
|
+ paperCount = paperCount.intValue() - 1;
|
|
examCourseCacheBean.setPaperCount(Objects.isNull(paperCount) || paperCount.intValue() < 0 ? 0 : paperCount);
|
|
examCourseCacheBean.setPaperCount(Objects.isNull(paperCount) || paperCount.intValue() < 0 ? 0 : paperCount);
|
|
TEExamCourse teExamCourse = GsonUtil.fromJson(GsonUtil.toJson(examCourseCacheBean), TEExamCourse.class);
|
|
TEExamCourse teExamCourse = GsonUtil.fromJson(GsonUtil.toJson(examCourseCacheBean), TEExamCourse.class);
|
|
teExamCourse.setUpdateTime(System.currentTimeMillis());
|
|
teExamCourse.setUpdateTime(System.currentTimeMillis());
|