Package org.fenixedu.academic.dto.student

Examples of org.fenixedu.academic.dto.student.ExecutionPeriodStatisticsBean


        for (Registration registration : registrations) {
            for (StudentCurricularPlan studentCurricularPlan : registration.getStudentCurricularPlansSet()) {
                for (ExecutionSemester executionSemester : studentCurricularPlan.getEnrolmentsExecutionPeriods()) {
                    if (enrolmentsByExecutionPeriod.containsKey(executionSemester)) {
                        ExecutionPeriodStatisticsBean executionPeriodStatisticsBean =
                                enrolmentsByExecutionPeriod.get(executionSemester);
                        executionPeriodStatisticsBean.addEnrolmentsWithinExecutionPeriod(studentCurricularPlan
                                .getEnrolmentsByExecutionPeriod(executionSemester));
                        enrolmentsByExecutionPeriod.put(executionSemester, executionPeriodStatisticsBean);
                    } else {
                        ExecutionPeriodStatisticsBean executionPeriodStatisticsBean =
                                new ExecutionPeriodStatisticsBean(executionSemester);
                        executionPeriodStatisticsBean.addEnrolmentsWithinExecutionPeriod(studentCurricularPlan
                                .getEnrolmentsByExecutionPeriod(executionSemester));
                        enrolmentsByExecutionPeriod.put(executionSemester, executionPeriodStatisticsBean);
                    }
                }
            }
View Full Code Here


                new HashMap<ExecutionSemester, ExecutionPeriodStatisticsBean>();

        for (StudentCurricularPlan studentCurricularPlan : getSortedStudentCurricularPlans(registration)) {
            for (ExecutionSemester executionSemester : studentCurricularPlan.getEnrolmentsExecutionPeriods()) {
                if (enrolmentsByExecutionPeriod.containsKey(executionSemester)) {
                    ExecutionPeriodStatisticsBean executionPeriodStatisticsBean =
                            enrolmentsByExecutionPeriod.get(executionSemester);
                    executionPeriodStatisticsBean.addEnrolmentsWithinExecutionPeriod(studentCurricularPlan
                            .getEnrolmentsByExecutionPeriod(executionSemester));
                    enrolmentsByExecutionPeriod.put(executionSemester, executionPeriodStatisticsBean);
                } else {
                    ExecutionPeriodStatisticsBean executionPeriodStatisticsBean =
                            new ExecutionPeriodStatisticsBean(executionSemester);
                    executionPeriodStatisticsBean.addEnrolmentsWithinExecutionPeriod(studentCurricularPlan
                            .getEnrolmentsByExecutionPeriod(executionSemester));
                    enrolmentsByExecutionPeriod.put(executionSemester, executionPeriodStatisticsBean);
                }
            }
        }
        studentStatistics.addAll(enrolmentsByExecutionPeriod.values());
        Collections.sort(studentStatistics, new BeanComparator("executionPeriod"));

        /* Put all the info in the required JSON format */
        JsonObject curricularInfoJSONObject = new JsonObject();

        JsonArray periodsJSONArray = new JsonArray();
        for (ExecutionPeriodStatisticsBean executionPeriodStatisticsBean : studentStatistics) {
            JsonArray jsonArray = new JsonArray();
            jsonArray.add(new JsonPrimitive(executionPeriodStatisticsBean.getExecutionPeriod().getExecutionYear().getYear()
                    + " - " + executionPeriodStatisticsBean.getExecutionPeriod().getSemester().toString() + "ยบ sem"));
            jsonArray.add(new JsonPrimitive(executionPeriodStatisticsBean.getTotalEnrolmentsNumber()));
            jsonArray.add(new JsonPrimitive(executionPeriodStatisticsBean.getApprovedEnrolmentsNumber()));
            periodsJSONArray.add(jsonArray);
        }
        curricularInfoJSONObject.add("periods", periodsJSONArray);

        /* Serve the JSON object */
 
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.student.ExecutionPeriodStatisticsBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.