All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openurp.edu.clazz.util.ProjectUtils Maven / Gradle / Ivy

The newest version!
/*
 * OpenURP, Agile University Resource Planning Solution.
 *
 * Copyright © 2014, The OpenURP Software.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful.
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 */
package org.openurp.edu.clazz.util;

import java.util.ArrayList;
import java.util.List;

import org.openurp.base.model.Department;
import org.openurp.base.edu.model.Project;

public class ProjectUtils {

  /**
   * 获得项目下的院系
   *
   * @param project
   * @return
   */
  public static List getColleges(Project project) {
    List res = new ArrayList();
    for (Department depart : project.getDepartments()) {
      if (depart.isTeaching()) {
        res.add(depart);
      }
    }
    return res;
  }

  /**
   * 获得项目下的开课院系
   *
   * @param project
   * @return
   */
  public static List getTeachDeparts(Project project) {
    List res = new ArrayList();
    for (Department depart : project.getDepartments()) {
      if (depart.isTeaching()) {
        res.add(depart);
      }
    }
    return res;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy