示例#1
0
  /**
   * Function: 初始化编辑相片对话框
   *
   * <p>Produce describe:
   *
   * @param fr
   * @author: JT 2008-4-2
   */
  public void initEditdialog(EditPhotoForm fr) {

    Photo photoPo = photoDao.load(fr.getSeq());
    if (photoPo != null) {

      // 相片名称
      fr.setPhotoName(DoText.dealNull(photoPo.getPhotoName()));

      // 所属相册
      fr.setPhotoAlbumId(photoPo.getPhotoAlbumId());

      // 描述
      fr.setDescription(DoText.dealNull(photoPo.getDescription()));

      // 关键字
      fr.setKeyWord(DoText.dealNull(photoPo.getKeyWord()));

      // 查看权限
      fr.setReadPopedom(DoText.dealNull(photoPo.getReadPopedom()));

      // 相片链接地址
      fr.setPhotoLink(photoPo.getPhotoLink());
    }
  }
示例#2
0
  /**
   * Function: 得到发帖数最多的十个用户
   *
   * <p>Produce describe:
   *
   * @return
   * @author: wu3889 2008-4-8
   * @throws DBException
   */
  public List getQuestionTopTenUserVoList() throws DBException {

    List list = dataCountDao.getQuestionTopTenUserList();

    List tpTenUserVoList = new ArrayList();

    DataCount dataCountPo = null;

    // 用户对象
    User userPo = new User();

    QuestionTopTenUserVo questionTopTenUserVo = null;

    if (list != null && list.size() > 0) {

      for (int i = 0; i < list.size(); i++) {

        dataCountPo = (DataCount) list.get(i);

        questionTopTenUserVo = new QuestionTopTenUserVo();

        userPo = new User();
        // 得到用户对象
        userPo = userDao.load(dataCountPo.getUserId());

        if (userPo != null) {

          // 昵称
          if (userPo.getNickName() != null) {
            questionTopTenUserVo.setNickName(userPo.getNickName());
            questionTopTenUserVo.setCutName(
                DoText.getInterceptString(userPo.getNickName(), 5, "..."));
          }

          // 用户头像
          if (userPo.getHeadPhotoLink() != null) {
            questionTopTenUserVo.setUserPhotoLink(userPo.getHeadPhotoLink());
          }

          // 发帖数
          if (dataCountPo.getQuestionTotal() != null)
            questionTopTenUserVo.setQuestionTotal(dataCountPo.getQuestionTotal());

          // Id
          questionTopTenUserVo.setId(userPo.getId());

          // 判断用户角色
          if (treUserRoleBo.checkUserIsRole(
                  userPo.getId(),
                  roleBo.getRoleId(
                      SystemConstant.ROLE_ROLE_KIND_1, SystemConstant.ROLE_ROLE_NO_GARDEN_USER_3))
              || treUserRoleBo.checkUserIsRole(
                  userPo.getId(),
                  roleBo.getRoleId(
                      SystemConstant.ROLE_ROLE_KIND_1,
                      SystemConstant.ROLE_ROLE_NO_GARDEN_USER_1))) {
            // 园长或者老师
            questionTopTenUserVo.setFlag("1");

          } else if (treUserRoleBo.checkUserIsRole(
                  userPo.getId(),
                  roleBo.getRoleId(
                      SystemConstant.ROLE_ROLE_KIND_2, SystemConstant.ROLE_ROLE_NO_MONEY_USER_1))
              || treUserRoleBo.checkUserIsRole(
                  userPo.getId(),
                  roleBo.getRoleId(
                      SystemConstant.ROLE_ROLE_KIND_2, SystemConstant.ROLE_ROLE_NO_MONEY_USER_2))) {
            // 注册会员或者收费会员
            questionTopTenUserVo.setFlag("2");
          }

          tpTenUserVoList.add(questionTopTenUserVo);
        }
      }
    }

    return tpTenUserVoList;
  }