Пример #1
0
  /* (非 Javadoc)
   * <p>Title: persistenceFunction</p>
   * <p>Description:持久化程式 </p>
   * @param list
   * @return
   */
  public boolean persistenceFunction(List<Permission> list) {
    logger.debug("f");
    Integer userId = Constants.getCurrendUser().getUserId();
    for (Permission function : list) {
      function.setLastmod(new Date());
      function.setModifyer(userId);
      if (Constants.TREE_GRID_ADD_STATUS.equals(function.getStatus())) {
        function.setPermissionId(null);
        function.setCreated(new Date());
        function.setLastmod(new Date());
        function.setModifyer(userId);
        function.setCreater(userId);
        function.setStatus(Constants.PERSISTENCE_STATUS);
      }

      permissionPublicDao.saveOrUpdate(function);
    }
    return true;
  }