gotoindexaction.java

来自「基于JAVA的学生就业信息网 实现对信息浏览 检索 审核 修改和删除」· Java 代码 · 共 82 行

JAVA
82
字号
/*
 * Created on 2006-7-27
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.ug.sztz.webview.structs.actions.student;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

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

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.ug.sztz.domain.oa.DanWeiInfo;
import org.ug.sztz.domain.oa.StudentBaseInfo;
import org.ug.sztz.domain.oa.ZPHInfo;
import org.ug.sztz.domain.oa.ZYTZ;

/**
 * @author Skywalker
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class GoToIndexAction extends BaseAction {

	/* (non-Javadoc)
	 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		if(request.getSession().getAttribute("baseinfo")!=null){
			List sortlist=this.sortDao.getSortList();//栏目列表
			request.getSession().setAttribute("sortlist",sortlist);
			
			HashMap map=new HashMap();
			map.put("dwstatus","1");
			List dwlist=this.dwxxDao.getDanWeiInfoList(map,0,6);
			for(int i=0;i<dwlist.size();i++){
				DanWeiInfo dw=(DanWeiInfo)dwlist.get(i);
				dw.setDwdate(dw.getDwdate().substring(0,10));
			}
			map.put("zphstatus","1");
			List zphlist=this.zphxxDao.getZPHInfoList(map,0,6);
			for(int i=0;i<zphlist.size();i++){
				ZPHInfo zph=(ZPHInfo)zphlist.get(i);
				Date nowdate=new Date();
				SimpleDateFormat dateformat=new SimpleDateFormat("yyyy-MM-dd");
				dateformat.setLenient(false);
				String sdate=zph.getZphdate();
				Date zphdate=dateformat.parse(sdate);
				if(nowdate.after(zphdate)) {//如果招聘会已过
					zph.setZphbz("@");//用单位名称作标记表示招聘会时间已过
				}
				zph.setZphfbdate(zph.getZphfbdate().substring(0,10));

			}
			
			request.setAttribute("dwlist",dwlist);
			request.setAttribute("zphlist",zphlist);
			 
			String fl1=((StudentBaseInfo)request.getSession().getAttribute("baseinfo")).getXsfl1();
			if(fl1!=null&&!fl1.equals("")){
			ZYTZ zytz=this.zytzDao.getZYTZ(fl1);				
			request.setAttribute("zytz",zytz);
			}
			
			return mapping.findForward("success");
		}else{
		    request.setAttribute("reason","您尚未登录,请先登录!");
		    return mapping.findForward("failure");
		}
	}
}

⌨️ 快捷键说明

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