基于javaweb的SpringBoot兼职平台系统(java+springboot+ssm+html+thymeleaf+maven+ajax+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

360023242402

370023242402

380023242402

390023242402

400023242402

410023242402

420023242402

1
2
3
管理员:后台管理
雇主:发布兼职任务、指派兼职人
兼职者:竞标接单

基于javaweb的SpringBoot兼职平台系统(java+springboot+ssm+html+thymeleaf+maven+ajax+mysql)

一、项目运行 环境配置:

Jdk1.8 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)

项目技术:

HTML +Springboot+ SpringMVC + MyBatis + ThymeLeaf + JavaScript + JQuery + Ajax + maven等等.  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    // 放置到域对象中,方便页面展示
model.addAttribute("bookMarks", bookMarks);

return "employee/bookmarks";
}

/**
* 删除收藏任务
*
* @param taskId 任务 ID
* @return
*/
@PostMapping("bookmarks/remove")
@ResponseBody
public String bookmarks(Long taskId, HttpSession session) {
// 获取雇员登录信息
Employee employee = (Employee) session.getAttribute("employee");

// 删除收藏信息
employeeBookmarkedService.remove(employee.getId(), taskId);

return "删除收藏信息";
}


/**
* 查询已完成任务
*
* @param session
* @return
*/
@GetMapping("/task/completed")
public String completedTask(HttpSession session, Model model) {
// 获取雇员登录信息
Employee employee = (Employee) session.getAttribute("employee");

// 查询出已完成的订单
List<TaskVo> taskVos = taskService.getCompletedByEmployeeId(employee.getId());

// 放置到域对象中
model.addAttribute("tasks", taskVos);
return "employee/completed_task";
}

/**
* 跳转到待完成任务
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
public class EmployeeLoginInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
HttpSession session = request.getSession();
// 从 session 中获取雇员登录信息
Employee employee = (Employee) session.getAttribute("employee");
// 未登录
if (employee == null) {
// ajax 请求返回 401
if ("XMLHttpRequest".equalsIgnoreCase(request.getHeader("X-Requested-With"))) {
response.sendError(401);
}

// 普通请求
else {
// 跳转到登录页面
response.sendRedirect("/login");
}
return false;
}
return true;
}
}
package com.yuu.recruit.controller;



/**
* 管理员雇员管理控制器
*
* @Classname AdminEmployeeController
* @see com.yuu.recruit.controller
*/
@Controller
@RequestMapping("admin/employee")
public class AdminEmployeeController {

@Resource
private EmployeeService employeeService;

/**
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    }

return "admin/task_category_form";
}

/**
* 保存任务分类信息,编辑和添加任务人类
*
* @param taskCategory 任务分类
* @return
*/
@PostMapping("save")
public String save(TaskCategory taskCategory) {
// 保存任务分类信息
taskCategoryService.save(taskCategory);
// 保存完,重定向到任务分类列表页
return "redirect:/admin/task/category";
}

/**
* 设为热门
* @PathVariable 为路径参数,代表参数可以直接写在路径上
*
* @param id 任务分类ID
* @return
*/
@GetMapping("onPopular/{id}")
public String onPopular(@PathVariable Long id) {
taskCategoryService.onPopular(id);
// 重定向到任务分类列表页
return "redirect:/admin/task/category";
}

/**
* 解除热门
*
* @param id
* @return
*/
@GetMapping("closePopular/{id}")
public String closePopular(@PathVariable Long id) {
taskCategoryService.closePopular(id);
return "redirect:/admin/task/category";
}

/**
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

/**
* 管理员管理任务分类控制器
*
* @Classname AdminTaskCategoryController
* @see com.yuu.recruit.controller
*/
@Controller
@RequestMapping("admin/task/category")
public class AdminTaskCategoryController {

@Resource
private TaskCategoryService taskCategoryService;

/**
* 跳转到任务分类列表页
*
* @return
*/
@GetMapping("")
public String taskCategory(Model model) {
// 查询所有分类
List<TaskCategoryVo> taskCategories = taskCategoryService.getAll();

// 设置到域对象中,提供给页面展示
model.addAttribute("taskCategories", taskCategories);
return "admin/task_category";
}

/**
* 跳转到任务分类列表页,添加/编辑都在这个页面,通过 ID 判断是编辑还是删除
*
* @return
*/
@GetMapping("form")
public String form(Long id, Model model) {

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    List<TaskCategoryVo> taskCategoryVos = taskCategoryService.getAll();

// 查询任务发布总数
Integer taskCount = taskService.getAllCount();

// 查询自由职业者(雇员)总数
Integer employeeCount = employeeService.getAllCount();

// 雇主数量
Integer employerCount = employerService.getAllCount();

// 查询热门分类,分类状态为 1 则为人们分类
List<TaskCategoryVo> popularCategories = taskCategoryService.getPopular();

// 查询近期任务(查询 5 条),根据创建时间来查询
List<TaskVo> recentTaskVos = taskService.getRecently();

// 添加到 Model 域对象中,供页面展示
model.addAttribute("taskCategories", taskCategoryVos);
model.addAttribute("taskCount", taskCount);
model.addAttribute("employeeCount", employeeCount);
model.addAttribute("employerCount", employerCount);
model.addAttribute("popularCategories", popularCategories);
model.addAttribute("recentTasks", recentTaskVos);

return "index";
}

/**
* 跳转到注册页面
*
* @return
*/
@GetMapping("register")
public String register() {
return "register";
}

/**
* 用户注册,包括雇员和雇主,通过传过来的 accountType 判断
*
* @return
*/
@PostMapping("register")
public String register(Integer accountType, String username, String password, RedirectAttributes redirectAttributes) {
// 如果传过来的 accountType 为 0 则为雇员注册
if (accountType == 0) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    /**
* 跳转到雇主列表页
*
* @return
*/
@GetMapping("")
public String taskCategory(Model model) {
// 查询所有分类
List<Employee> employees = employeeService.getAll();

// 设置到域对象中,提供给页面展示
model.addAttribute("employees", employees);
return "admin/employee";
}
}
package com.yuu.recruit.controller;



/**
* 管理员雇主管理控制器
*
* @Classname AdminEmployerController
* @see com.yuu.recruit.controller
*/
@Controller
@RequestMapping("admin/employer")
public class AdminEmployerController {

@Resource
private EmployerService employerService;

/**
* 跳转到雇主列表页
*


项目链接:
https://javayms.github.io?id=531422302105200hc
https://javayms.pages.dev?id=531422302105200hc