package com.zrgk.web.action;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import com.google.gson.Gson;
import com.zrgk.bean.Resume;
import com.zrgk.bean.Standard;
import com.zrgk.bean.Student;
import com.zrgk.bean.StudentStandard;
import com.zrgk.bean.Welfare;
import com.zrgk.service.StandardService;
@Controller
@RequestMapping("StandardAction.do")
public class StandardAction {
@Autowired
private StandardService ss;
public StandardService getSs() {
return ss;
}
public void setSs(StandardService ss) {
this.ss = ss;
}
@RequestMapping(params="flag=findAllStandard")//首页搜索功能
public String findAllStandard(HttpServletRequest request, ModelMap mm){
String jobplace=request.getParameter("jobplace");
String jobname=request.getParameter("jobname");
Map<String,Object> map=new HashMap<String,Object>();
map.put("jobplace", jobplace);
map.put("jobname", jobname);
List<Standard> list=ss.findAllStandard(map);//查找所有职位信息
List<Standard> list1=ss.findAllJobplace();//查找所有工作地点
mm.put("map", map);
mm.put("list", list);
mm.put("list1", list1);
return "web-index.jsp";
}
@RequestMapping(params="flag=findAllStandard1")//求职页面搜索功能
public void findAllStandard(HttpServletRequest request,HttpServletResponse response){
response.setContentType("text/html;charset=utf-8");
String jobplace=request.getParameter("jobplace");
String jobname=request.getParameter("jobname");
Map<String,Object> map=new HashMap<String,Object>();
map.put("jobplace", jobplace);
map.put("jobname", jobname);
List<Standard> list=ss.findAllStandard(map);//查找所有职位信息
// List<Standard> list1=ss.findAllJobplace();//查找所有工作地点
Gson g = new Gson();
String json = g.toJson(list);
try {
response.getWriter().write(json);
// mm.put("list1", list1);
} catch (IOException e) {
e.printStackTrace();
}
}
@RequestMapping(params="flag=standardSortByRcount")
public void standardSortByRcount(HttpServletRequest request,ModelMap mm,HttpServletResponse response){
response.setContentType("text/html;charset=utf-8");
String jobplace=request.getParameter("jobplace");
String jobname=request.getParameter("jobname");
Map<String,Object> map=new HashMap<String,Object>();
map.put("jobplace", jobplace);
map.put("jobname", jobname);
List<Standard> list=ss.standardSortByRcount(map);//查找所有职位信息
// List<Standard> list1=ss.findAllJobplace();//查找所有工作地点
Gson g = new Gson();
String json = g.toJson(list);
try {
response.getWriter().write(json);
// mm.put("list1", list1);
} catch (IOException e) {
e.printStackTrace();
}
// mm.put("list", list);
// mm.put("list1", list1);
// return "web-index.jsp";
}
@RequestMapping(params="flag=standardSortByReleaseTime")
public void standardSortByReleaseTime(String jobplace,String jobname,ModelMap mm,HttpServletResponse response){
response.setContentType("text/html;charset=utf-8");
Map<String,Object> map=new HashMap<String,Object>();
map.put("jobplace", jobplace);
map.put("jobname", jobname);
List<Standard> list=ss.standardSortByReleaseTime(map);//查找所有职位信息
// List<Standard> list1=ss.findAllJobplace();//查找所有工作地点
Gson g = new Gson();
String json = g.toJson(list);
try {
response.getWriter().write(json);
// mm.put("list1", list1);
} catch (IOException e) {
e.printStackTrace();
}
// mm.put("list", list);
// return "web-index.jsp";
}
@RequestMapping(params="flag=login")
public void login(HttpServletRequest request,HttpServletResponse response){
response.setContentType("text/plain; charset=UTF-8");//设置返回值编码放到最顶部,一定要在out前。
response.setCharacterEncoding("UTF-8");//设置返回值编码放到最顶部,一定要在out前。
String username=request.getParameter("username");
String st_password=request.getParameter("st_password");
HttpSession session = request.getSession();
//判断是邮箱还是手机号的正则表达式
String em = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
String ph = "^[1][34578]\\d{9}$";
PrintWriter out=null;
if(username.matches(ph)){//手机号登录
Student student=new Student();
student.setPhone(username);
student.setSt_password(st_password);
Student stu=ss.login(student);
try {
out =response.getWriter();
if(stu!=null){ //用于判断是否已经登录
session.setAttribute("student", stu);
response.getWriter().write("yes-"+stu.getSt_name()+"-"+stu.getSt_id()+"-"+stu.getImgurl()+"-"+stu.getEmail()+"-"+stu.getPhone());
}else{
out.write("no");
}
} catch (IOException e) {
e.printStackTrace();
}
}else if(username.matches(em)){//邮箱登录
Student student=new Student();
student.setEmail(username);
student.setSt_password(st_password);
Student stu=ss.login(student);
try {
out =response.getWriter();
if(stu!=null){//用于判断是否已经登录
session.setAttribute("student", stu);
response.getWriter().write("yes-"+stu.getSt_name()+"-"+stu.getSt_id()+"-"+stu.getImgurl()+"-"+stu.getEmail()+"-"+stu.getPhone());
}else{
out.write("no");
}
} catch (IOException e) {
e.printStackTrace();
}
}else {
try {
out =response.getWriter();
out.write("no");
} catch (IOException e) {
e.printStackTrace();
}
}
out.flush();
out.close();
}
@RequestMapping(params="flag=standardDetails") //通过id查找职位详细信息
public String standardDetails(HttpServletRequest request, ModelMap mm){
String stand_id=request.getParameter("stand_id");
int stand_id1=Integer.parseInt(stand_id);
Standard sta=ss.standardDetails(stand_id1);
List<Welfare> list=ss.findWelfareById(stand_id1);
Map<String,Object> map=new HashMap<String,Object>();
map.put("jobname", sta.getJobname());
List<Standard> list1=ss.standardSortByRcount(map);//查找所有职位信息
//从相似职位中去除当前页面的职位信息
for(int i=0;i<list1.size();i++){
if(list1.get(i).getStand_id()==stand_id1){
list1.remove(i);
}
}
mm.put("standard", sta);
mm.put("list", list);
mm.put("list1",list1);
return "web-details.jsp";
}
@RequestMapping(params="flag=yanzhengusername") //验证用户名
public void yanzhengusername(String username,HttpServletResponse response) throws IOException{
//判断是邮箱还是手机号的正则表达式
String em = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
String ph = "^[1][34578]\\d{9}$";
PrintWriter out=response.getWriter();
if(username.matches(em)){
Student student=new Student();
student.setEmail(username);
int num=ss.yanzhengusername(student.getEmail());
if(num==0){
out.write("1");
}else{
out.write("2");
}
}else if(username.matches(ph)){
Student student=new Student();
student.setPhone(username);
int num=ss.yanzhengusername(student.getPhone());
if(num==0){
out.write("1");
}else{
out.write("2");
没有合适的资源?快使用搜索试试~ 我知道了~
就业管理前台(SSM+mysql+tomcat)
共484个文件
svn-base:245个
png:35个
jar:34个
5星 · 超过95%的资源 需积分: 12 29 下载量 154 浏览量
2018-05-10
10:47:39
上传
评论 2
收藏 26.3MB ZIP 举报
温馨提示
就业管理前台的源代码,数据库也在里面,直接安装就好了!
资源推荐
资源详情
资源评论
收起资源包目录
就业管理前台(SSM+mysql+tomcat) (484个子文件)
all-wcprops 5KB
all-wcprops 4KB
all-wcprops 3KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 950B
all-wcprops 828B
all-wcprops 548B
all-wcprops 398B
all-wcprops 378B
all-wcprops 358B
all-wcprops 352B
all-wcprops 347B
all-wcprops 342B
all-wcprops 315B
all-wcprops 293B
all-wcprops 196B
all-wcprops 93B
all-wcprops 90B
all-wcprops 86B
all-wcprops 82B
all-wcprops 77B
StandardAction.class 11KB
EnterpriseAud.class 8KB
StudentAction.class 8KB
Standard.class 6KB
Student.class 6KB
Resume.class 5KB
StandardServiceImpl.class 3KB
User.class 3KB
StudentServiceImpl.class 3KB
CodeController.class 3KB
StudentStandard.class 2KB
Page.class 1KB
Welfare.class 1KB
StandardService.class 1KB
StandardDao.class 1KB
WelfareStandard.class 948B
StudentDao.class 741B
StudentService.class 725B
.classpath 1KB
org.eclipse.wst.common.component 476B
org.eclipse.wst.jsdt.ui.superType.container 49B
font-awesome.css 37KB
font-awesome.min.css 30KB
core.css 12KB
index.css 7KB
details.css 6KB
foundation-datepicker.css 4KB
web_index1.css 2KB
css.css 2KB
reset.css 2KB
entries 7KB
entries 6KB
entries 4KB
entries 2KB
entries 2KB
entries 1KB
entries 1KB
entries 1KB
entries 857B
entries 708B
entries 705B
entries 573B
entries 570B
entries 569B
entries 564B
entries 562B
entries 533B
entries 389B
entries 283B
entries 268B
entries 255B
entries 249B
entries 244B
fontawesome-webfont.eot 162KB
web-core1-edit.html 11KB
web-core1-companyList-apply.html 10KB
web-core1-companyList-collection.html 9KB
web-details.html 8KB
web-core1.html 8KB
web-core1-companyContent.html 6KB
web-index.html 5KB
web-core2.html 4KB
web-core1-map.html 4KB
web-core1-wather.html 3KB
web-core3.html 2KB
login.html 2KB
aspectjweaver-1.6.12.jar 1.67MB
mysql-connector-java-5.1.13-bin.jar 1.36MB
mybatis-3.3.0.jar 1.35MB
log4j-core-2.2.jar 807KB
jackson-mapper-asl-1.9.13.jar 762KB
org.springframework.context-3.0.7.RELEASE.jar 655KB
org.springframework.beans-3.0.7.RELEASE.jar 544KB
log4j-1.2.17.jar 478KB
org.springframework.web.servlet-3.0.7.RELEASE.jar 410KB
org.springframework.web-3.0.7.RELEASE.jar 389KB
org.springframework.jdbc-3.0.7.RELEASE.jar 377KB
共 484 条
- 1
- 2
- 3
- 4
- 5
资源评论
- zrp8882019-05-04祈祷好处。可以用。
努力工作,快乐生活
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功