/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.yuntong.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.yuntong.hibernate.database.dao.TDrawInfoDAO;
import com.yuntong.service.Y_IFilialeManagerService;
import com.yuntong.service.Y_IUserManagerService;

/** 
 * MyEclipse Struts
 * Creation date: 04-10-2007
 * 初始化操作员管理
 * XDoclet definition:
 * @struts.action validate="true"
 * @struts.action-forward name="go" path="Y_CZY_1.jsp"
 */
public class Y_GoCZYAction extends Action {
	private static Log log = LogFactory.getLog(Y_GoCZYAction.class);
	private Y_IFilialeManagerService managerService;
	private Y_IUserManagerService userManagerService;
	public Y_IUserManagerService getUserManagerService() {
		return userManagerService;
	}
	public void setUserManagerService(Y_IUserManagerService userManagerService) {
		this.userManagerService = userManagerService;
	}
	public Y_IFilialeManagerService getManagerService() {
		return managerService;
	}
	public void setManagerService(Y_IFilialeManagerService managerService) {
		this.managerService = managerService;
	}
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		//得到分公司信息已初始化查询菜单
		List list=managerService.findAllFilialeInfo();
		HttpSession session=request.getSession();
		//保存信息到session中
		session.setAttribute("Y_Filiale",list);
		log.info("成功得到分公司信息=========");
		//得到第一页用户信息
		//总页数		
		int pageSize=userManagerService.getPageNum(10, 0, 0, null, null);
		log.info("总页数："+pageSize);
		//当前页
		int curPage=1;
		//第一页信息
		List userList=userManagerService.findSplitRegister(10, 1, 0, 0, null, null);
		//得到权限信息
		List rlist=userManagerService.findAllRoleInfo();
		log.info("-------------------------------"+rlist.size());
		//保存信息
		session.setAttribute("Y_userpageSize", pageSize);
		session.setAttribute("Y_usercurPate", curPage);
		session.setAttribute("Y_userinfopage1", userList);
		session.setAttribute("Y_userRoleInfo", rlist);
		return mapping.findForward("go");
	}
}