示例#1
0
 private void validateDoExamExpired(ExamResult examResult) {
   if (BeanUtils.isNotEmpty(examResult.getExamExpireDate())) {
     Date nowToday = new Date();
     if (nowToday.after(examResult.getExamExpireDate())) {
       throw new CoreException(CoreExceptionMessage.EXAM_EXPIRED);
     }
   }
 }
示例#2
0
 private void validateSaveExamExpired(ExamResult examResult) {
   if (BeanUtils.isNotEmpty(examResult.getExamExpireDate())) {
     Calendar cal = Calendar.getInstance();
     cal.setTime(examResult.getExamExpireDate());
     cal.add(Calendar.MINUTE, 3);
     Date nowToday = new Date();
     if (nowToday.after(cal.getTime())) {
       throw new CoreException(CoreExceptionMessage.EXAM_EXPIRED);
     }
   }
 }
示例#3
0
 private List<ExamResultAnswer> convertExamData(String examResultAnswerData) {
   ObjectMapper mapper = new ObjectMapper();
   List<ExamResultAnswer> results = null;
   if (BeanUtils.isNotEmpty(examResultAnswerData)) {
     try {
       results =
           mapper.readValue(
               examResultAnswerData, new TypeReference<ArrayList<ExamResultAnswer>>() {});
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
   return results;
 }
示例#4
0
 private void validateParameter() {
   if (BeanUtils.isEmpty(this.getExamResultId())) {
     throw new CoreException(CoreExceptionMessage.PARAMETER_NOT_FOUND);
   }
 }