Exemplo n.º 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);
     }
   }
 }
Exemplo n.º 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);
     }
   }
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 private void validateParameter() {
   if (BeanUtils.isEmpty(this.getExamResultId())) {
     throw new CoreException(CoreExceptionMessage.PARAMETER_NOT_FOUND);
   }
 }