package cn.bsystem.ptConst.action;

 import cn.bsystem.ptConst.service.XtbhlService;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import cn.base.aspect.OperateType;
import cn.base.bean.BaseAction;
import cn.base.excel.ExcelCol;
import cn.base.excel.ExportEngine;
import cn.base.util.CommUtils;
import cn.base.util.Constants;
import cn.base.util.LogConstants;
import cn.base.util.StringUtil;
import cn.base.util.Struts2Utils;

@SuppressWarnings({"all"})
@Component("xtbhlAction")
public class XtbhlAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	private static Logger iLog = Logger.getLogger(XtbhlAction.class);
	
	@Autowired
	private XtbhlService service;
	
	/**
	 * ·ÖÒ³
	 */
	@OperateType(value = LogConstants.LOG_QUERY ,info ="listXtbhlByPage")
	public void listXtbhlByPage(){
		Map map = Struts2Utils.getRequestParameterMap();
		try {
			int page = Integer.parseInt(Struts2Utils.getParameter("page"));
			int rows = Integer.parseInt(Struts2Utils.getParameter("rows"));
			int start = ( (page == 0 ?  1 : page ) - 1) * rows ;
			map.put("start",start );
			map.put("limit",rows );
			Struts2Utils.renderJson(this.service.listXtbhlByPage(map));
		} catch (Exception e) {
			e.printStackTrace();
			iLog.error("XtbhlAction-listXtbhlByPage-error:" +e);
			Struts2Utils.renderJson(null);
		}
	}
}
