首页>代码>ssm开发实现简单的oa办公管理系统,maven搭建>/OAA/src/main/java/cn/bdqn/controller/OaController.java
package cn.bdqn.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.bdqn.biz.OaBiz;
import cn.bdqn.entity.Employee;

@Controller
public class OaController {
	@Resource(name = "Oabiz")
	private OaBiz oaBiz;

	public void setOaBiz(OaBiz oaBiz) {
		this.oaBiz = oaBiz;
	}
	@RequestMapping("/servletId")
	public String selectEmployee(HttpSession session,String sn,
			String password, Model model) {
		Employee user = oaBiz.findEmployees(sn, password);
		if (user != null) {
			session.setAttribute("sn", user);
			session.setAttribute("name", user.getName());
			session.setAttribute("stuats", user.getStatus());
			session.setAttribute("position_id",user.getPosition_id());
			System.out.println(user.getName());
			System.out.println(user.getPosition_id());
			return "/index.jsp";
		} else {
			model.addAttribute("登录失败,密码或账号输入错误!");
			return "/login.jsp";
		}
	}
}
最近下载更多
mazihao12138  LV2 2023年7月3日
c469893928  LV2 2023年6月10日
kkkaaaa  LV3 2023年5月16日
微信网友_5963854197018624  LV7 2023年4月6日
微信网友_6164511365238784  LV7 2022年10月10日
赖小宝  LV3 2022年8月26日
最代码-宋家辉  LV61 2022年8月22日
2039995605  LV9 2022年6月5日
www-chrome  LV6 2022年5月20日
cx123123  LV7 2022年5月18日
最近浏览更多
奋斗的小蚂蚁  LV17 10月28日
暂无贡献等级
xiaoaitx  LV8 1月1日
唐唐丶  LV34 2024年9月12日
Impeter  LV2 2024年8月13日
murphy  LV7 2024年7月14日
yunsgui  LV1 2024年6月25日
qwe6002  LV10 2024年5月24日
李俊雄  LV3 2024年5月8日
微信网友_6906962132258816  LV7 2024年4月15日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友