ExecutionPeriod executionPeriod = teacherAdviseServices.getTeacherService() .getExecutionPeriod(); if (executionPeriod.getEndDate().after(advise.getEndExecutionPeriod().getEndDate())) { advise.setEndExecutionPeriod(executionPeriod); } if (executionPeriod.getBeginDate().before(advise.getStartExecutionPeriod().getBeginDate())) { advise.setStartExecutionPeriod(executionPeriod);
if (advise != null) { ExecutionPeriod executionPeriod = teacherAdviseServices.getTeacherService() .getExecutionPeriod(); if (executionPeriod.getEndDate().after(advise.getEndExecutionPeriod().getEndDate())) { advise.setEndExecutionPeriod(executionPeriod); } if (executionPeriod.getBeginDate().before( advise.getStartExecutionPeriod().getBeginDate())) { advise.setStartExecutionPeriod(executionPeriod); }
        public void afterAdd(TeacherAdviseService teacherAdviseServices, Advise advise) {            ExecutionPeriod executionPeriod = teacherAdviseServices.getTeacherService()                .getExecutionPeriod();            if (executionPeriod.getEndDate().after(advise.getEndExecutionPeriod().getEndDate())) {                advise.setEndExecutionPeriod(executionPeriod);            }            if (executionPeriod.getBeginDate().before(advise.getStartExecutionPeriod().getBeginDate())) {                advise.setStartExecutionPeriod(executionPeriod);            }        }