⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 onlinestatserviceimp.java

📁 天乙社区6.0是一套基于JAVA技术的网络虚拟社区
💻 JAVA
字号:
package com.laoer.bbscs.business.service;

import com.laoer.bbscs.business.IOnlineStatService;
import com.laoer.bbscs.dao.IOnlineStatDAO;
import com.laoer.bbscs.bean.OnlineStat;
import com.laoer.bbscs.sys.PageList;
import com.laoer.bbscs.sys.Pages;
import java.lang.reflect.*;
import java.util.*;

/**
 * <p>Title: TianYi BBS</p>
 *
 * <p>Description: TianYi BBS System</p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: LAOER.COM/TIANYISOFT.NET</p>
 *
 * @author laoer
 * @version 6.0
 */
public class OnlineStatServiceImp
    implements IOnlineStatService {

  private IOnlineStatDAO onlineStatDAO;

  public OnlineStatServiceImp() {
  }

  /**
   * getOnlineStatDAO
   *
   * @return IOnlineStatDAO
   * @todo Implement this com.laoer.bbscs.business.IOnlineStatService method
   */
  public IOnlineStatDAO getOnlineStatDAO() {
    return this.onlineStatDAO;
  }

  /**
   * setOnlineStatDAO
   *
   * @param onlineStatDAO IOnlineStatDAO
   * @todo Implement this com.laoer.bbscs.business.IOnlineStatService method
   */
  public void setOnlineStatDAO(IOnlineStatDAO onlineStatDAO) {
    this.onlineStatDAO = onlineStatDAO;
  }

  /**
   * findOnlineStatByRecDate
   *
   * @param recDate String
   * @return OnlineStat
   * @todo Implement this com.laoer.bbscs.business.IOnlineStatService method
   */
  public OnlineStat findOnlineStatByRecDate(String recDate) {
    return this.getOnlineStatDAO().findOnlineStatByRecDate(recDate);
  }

  /**
   * recOnlineNum
   *
   * @param recDate String
   * @param hour int
   * @param num int
   * @todo Implement this com.laoer.bbscs.business.IOnlineStatService method
   */
  public void recOnlineNum(String recDate, int hour, int num) {
    OnlineStat os = this.findOnlineStatByRecDate(recDate);
    if (os == null) {
      os = new OnlineStat();
    }
    os.setRecDate(recDate);
    Integer i = new Integer(num);
    Class[] c = new Class[1];
    c[0] = Integer.TYPE;
    try {
      Method m = os.getClass().getMethod("setHour" + hour, c);
      Object[] o = new Object[1];
      o[0] = i;
      m.invoke(os, o);
    }
    catch (Exception ex) {
    }
    this.getOnlineStatDAO().saveOnlineStat(os);
  }

  /**
   * getOnlineStatNum
   *
   * @return int
   * @todo Implement this com.laoer.bbscs.business.IOnlineStatService method
   */
  public int getOnlineStatNum() {
    return this.getOnlineStatDAO().getOnlineStatNum();
  }

  /**
   * getOnlineStatList
   *
   * @param pages Pages
   * @return PageList
   * @todo Implement this com.laoer.bbscs.business.IOnlineStatService method
   */
  public PageList getOnlineStatList(Pages pages) {
    PageList pl = new PageList();
    if (pages.getTotals() == -1) {
      pages.setTotals(this.getOnlineStatNum());
    }
    pages.doPageBreak();
    List l = this.getOnlineStatDAO().getOnlineStatList(pages.getSpage(),
        pages.getPerPageNum());
    pl.setObjectList(l);
    pl.setPageShowString(pages.getListPageBreak());
    pl.setPages(pages);
    return pl;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -