示例#1
0
 public Integer addSite(Integer parentId, String siteName, Integer organId) {
   Site vo = new Site();
   vo.setSiteName(siteName);
   if (parentId != null) vo.setParent(siteDAO.get(parentId));
   Organ organVo = new Organ();
   organVo.setId(organId);
   vo.setOrgan(organVo);
   siteDAO.persist(vo);
   return vo.getId();
 }
示例#2
0
 public Integer updSite(Site vo) {
   siteDAO.merge(vo);
   Site currSite = getCurSite();
   if (currSite != null) {
     if (currSite.getId() == vo.getId()) {
       initSiteInContext(vo);
     }
   }
   return vo.getId();
 }
示例#3
0
  /** 获取子站点. */
  public List<TreeNode> getSiteChildren(Integer parentId, Integer organId) {
    List<TreeNode> tnList = new ArrayList<TreeNode>();
    List<Site> siteList = siteDAO.getSiteChildren(parentId, organId);
    for (Site vo : siteList) {
      TreeNode tnVo = new TreeNode();
      tnVo.setId(vo.getId().toString());
      tnVo.setText(vo.getSiteName());

      if (vo.hasChildren()) {
        tnVo.setState("closed");
      } else {
        tnVo.setState("open");
      }
      tnList.add(tnVo);
    }
    return tnList;
  }
示例#4
0
 public void updSiteParent(Integer organId, Integer parentId, Integer newParentId) {
   siteDAO.updSiteParent(organId, parentId, newParentId);
 }
示例#5
0
 public List<Site> getSiteListByOrgans(Integer[] organs, Boolean publicenable) {
   return siteDAO.getSiteListByOrgans(organs, publicenable);
 }
示例#6
0
 public Site getSite(Integer id) {
   return siteDAO.get(id);
 }
示例#7
0
 public void delSite(Integer id) {
   siteDAO.removeByPK(id);
 }