initialize.java

来自「spring+hibernate+struts开发的校务oa系统」· Java 代码 · 共 64 行

JAVA
64
字号
package com.yondor.oa.webapp.initialize;

import java.util.List;

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

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

import com.yondor.oa.common.constant.ForwardType;
import com.yondor.oa.common.constant.Property;
import com.yondor.oa.common.constant.Resources;
import com.yondor.oa.common.constant.SysParamLib;
import com.yondor.oa.db.greensysparam.dao.Greensysparam;
import com.yondor.oa.db.greensysparam.dao.GreensysparamVO;
import com.yondor.oa.db.message.dao.MessageVO;
import com.yondor.oa.service.greensysparam.IGreensysparamService;
import com.yondor.oa.webapp.base.BaseDisPatchAction;


public class Initialize extends BaseDisPatchAction {
	public static final Log log=LogFactory.getLog(Initialize.class);
	
	public ActionForward isFirst(ActionMapping mapping,
			ActionForm form,
			HttpServletRequest request,
			HttpServletResponse response)throws Exception {
		
		MessageResources msgResources=getResources(request, Resources.RESOURCES_KEY);
		String sysManager=msgResources.getMessage(Resources.sysManager);
		log.info("exist [Admin]");

		if(null!=sysManager && sysManager.equals(SysParamLib.ADMIN_NAME)){
			IGreensysparamService service=getIgreenSysparamService();
			GreensysparamVO type=service
						.findGCODEAndMCODE(SysParamLib.MESSAGE, SysParamLib.MSG_PUB);
			
			MessageVO paramVO=new MessageVO();
			paramVO.setType(service.convertPojo(type));
			List afficheList=getImessageService().query(paramVO);
			log.info("...afficheList.."+afficheList.size());
			request.getSession().setAttribute(Property.AFFICHELIST, afficheList);
			return mapping.findForward(ForwardType.SUCCESS_KEY);
		}else{
			//转发到第一次登陆时的初始化页面
			return mapping.findForward(ForwardType.FIRSTLOGIN);
		}
	}
	
	public ActionForward next(ActionMapping mapping,
			ActionForm form,
			HttpServletRequest request,
			HttpServletResponse response)throws Exception {
		
	return null;
	}
	
}

⌨️ 快捷键说明

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