package com.hfxt.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfxt.biz.OAUserdaoBiz;
import com.hfxt.pojo.OAStudent;
import com.hfxt.pojo.PagerMySQL;
import com.hfxt.pojo.UserOA;
@Controller
public class ControllerOA {
private OAUserdaoBiz oaUserdaoBiz;
@Resource(name = "oaUserdaoBiz")
public void setBiz(OAUserdaoBiz oaUserdaoBiz) {
this.oaUserdaoBiz = oaUserdaoBiz;
}
//登录
@RequestMapping("/logindo")
public ModelAndView oaLogin(HttpServletRequest request,String username,String password,Model model){
ModelAndView modelAndView=new ModelAndView();
UserOA userOA=oaUserdaoBiz.OaLogin(username, password);
if(userOA!=null){
modelAndView.addObject("userOA",userOA);
modelAndView.addObject("mainpage",null);
modelAndView.setViewName("/Index.jsp");
}else{
request.setAttribute("error","请输入正确的用户名或密码!");
modelAndView.setViewName("/login.jsp");
}
return modelAndView;
}
//Student信息查询
@RequestMapping("StudentOAselect")
public String getSelectMess(String text1,String text2,Model model,
@RequestParam(value = "pageNo", defaultValue = "1") Integer curPage,
@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize){
PageHelper.startPage(curPage, pageSize);
List<OAStudent> list=oaUserdaoBiz.getSelectMess(text1, text2);
PageInfo<OAStudent> pageInfo = new PageInfo<OAStudent>(list);
PagerMySQL<OAStudent> pager = new PagerMySQL<OAStudent>(
curPage, pageSize, new Long(pageInfo.getTotal()).intValue());
pager.setEntitiesList(list);
if (text1!= null && text2!=null) {
model.addAttribute("huixianName", text1);
model.addAttribute("huixianNames", text2);
}
model.addAttribute("pagerBooks", pager);
model.addAttribute("mainPage", "/StudentManager.jsp");
return "/StudentManager.jsp";
}
}
最近下载更多
微信网友_7321633020284928 LV2
1月1日
微信网友_7057477252747264 LV1
2024年6月28日
hongdongdong LV14
2024年6月18日
1401560552 LV2
2024年6月15日
xingxiu LV1
2024年6月9日
17693282606 LV12
2024年5月30日
wzb123 LV1
2023年7月4日
liaaaaaa LV1
2023年6月24日
gecongkai LV8
2023年6月22日
微信网友_6260196253601792 LV7
2023年6月7日
最近浏览更多
vinlon
6月17日
暂无贡献等级
holyprint123
6月17日
暂无贡献等级
甜心冰淇淋 LV4
6月15日
shhhhhh
6月13日
暂无贡献等级
llxxyy
6月9日
暂无贡献等级
云间不羁客qq
5月26日
暂无贡献等级
微信网友_7321633020284928 LV2
1月1日
ma406805131 LV19
2024年12月27日
三秋桂子 LV1
2024年12月21日
TTThai LV1
2024年12月17日

