基于javaweb的SSM校园帮跑腿代办管理平台(java+ssm+jsp+layui+echarts+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

250023352402

260023352402

270023352402

280023352402

290023352402

300023352402

基于javaweb的SSM校园帮跑腿代办管理平台(java+ssm+jsp+layui+echarts+mysql)

项目介绍

本项目包含管理员与学生两种角色;

管理员角色包含以下功能:

管理员登录,院校管理,任务管理,用户维护,用户余额充值,添加管理员等功能。

学生用户角色包含以下功能:

学生注册,学生角色登录,发布新任务,个人信息查看,资料修改,密码修改等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  5.数据库:MySql 5.7版本; 6.是否Maven项目:否;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:JSP+CSS+JavaScript+LayUI+jquery+echarts

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.xml配置文件中的数据库配置改为自己的配置; 4. 运行项目,浏览器中输入localhost:8080/campusHelp 登录

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
	try {
aid = Integer.parseInt(aidstr);
} catch (Exception e) {
model.addAttribute("msg", "出现错误");
return "adminInfo";
}
if (aid == 0) {
model.addAttribute("msg", "出现错误");
return "adminInfo";
}
/*
* Admin admin = adminService.getByUid(stuid);
* model.addAttribute("theuser", user);
*/
return "adminInfo";
}

@RequestMapping("addadmin.do")
public String addadmin(String account, HttpServletRequest request, Model model) {

// 检查账号重复
int countnum = adminService.getAccountCount(account);
if (countnum > 0) {
model.addAttribute("msg", account + " 该账号已经被使用");
return "adminAddAdmin";
}

Admin admin = new Admin(0, account, "123456", account, new Date(), 0);

int result = adminService.setAdmin(admin);

if (result <= 0) {
model.addAttribute("msg", "注册失败");
return "adminAddAdmin";
}

model.addAttribute("msg", "注册成功,可以登录。默认密码:123456");

return "adminAddAdmin";
}

@RequestMapping("gettasks.do")
public String gettasks(String words, @RequestParam(required = true, defaultValue = "-1") String schoolidstr,
Model model) {
model.addAttribute("words", words);
model.addAttribute("schoolidstr", schoolidstr);
int schoolid = -1;
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
48
49
50

model.addAttribute("list", list);

return "adminSchool";
}

// 读取一个院校信息
@RequestMapping("getschool.do")
public String getschool(String schoolidstr, Model model) {
if (schoolidstr == null) {
model.addAttribute("msg", "出现错误");
return "adminSchoolSetting";
} else {
if (schoolidstr.length() == 0) {
model.addAttribute("msg", "出现错误");
return "adminSchoolSetting";
}
}
int schoolid = 0;
try {
schoolid = Integer.parseInt(schoolidstr);
if (schoolid == 0) {
model.addAttribute("msg", "出现错误");
return "adminSchoolSetting";
}
} catch (Exception e) {
model.addAttribute("msg", "出现错误");
return getschools(model);
}

School theSchool = schoolService.getSchoolByID(schoolid);

if (theSchool != null) {
model.addAttribute("theSchool", theSchool);
} else {
model.addAttribute("msg", "读取失败");
}
return "adminSchoolSetting";
}

// 更新院校
@RequestMapping("updateschool.do")
public String updateschool(School school, Model model) {

int r = 0;

r = schoolService.updateSchool(school);

if (r > 0) {
model.addAttribute("msg", "修改成功-刷新页面重新加载显示");
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
	if (result <= 0) {
model.addAttribute("msg", "注册失败");
return "adminAddAdmin";
}

model.addAttribute("msg", "注册成功,可以登录。默认密码:123456");

return "adminAddAdmin";
}

@RequestMapping("gettasks.do")
public String gettasks(String words, @RequestParam(required = true, defaultValue = "-1") String schoolidstr,
Model model) {
model.addAttribute("words", words);
model.addAttribute("schoolidstr", schoolidstr);
int schoolid = -1;
if (!schoolidstr.equals("-1")) {
try {
schoolid = Integer.parseInt(schoolidstr);
} catch (Exception e) {
System.err.println("err");
}
}
if (words != null) {
words = "%" + words + "%";
} else {
words = "%%";
}
List<Task> list = taskService.getTaskByKeys(words, schoolid);
model.addAttribute("list", list);
return "adminTask";
}

// to1.管理员点击关闭删除取消
@RequestMapping("taskclose.do")
public String taskclose(String tidstr, String words,
@RequestParam(required = true, defaultValue = "-1") String schoolidstr, HttpServletRequest request,
Model model) {
int tid = 0;
try {
tid = Integer.parseInt(tidstr);
} catch (Exception e) {
model.addAttribute("msg", "出现错误");
return gettasks(words, schoolidstr, 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
48
		return findtask("","", "-1", 1, model,"","");
}
List<Task> list = taskService.getUserTask(uid);
int pagesize = getPageSize(list, size);
list = getList(list, page, size);
if(page<=0) {
page = 1;
}
if(page>=pagesize) {
page = pagesize;
}
model.addAttribute("pagesize", pagesize);
model.addAttribute("nowpage", page);
model.addAttribute("list", list);
return "userPtask";
}


static List<Task> getList(List<Task> list,int page,int size){
int end = 0;
int pages = list.size()/size + 1;
if(page>pages) {
page = pages - 1;
}
if(page < 1) {
page = 1;
}
if(page*size>list.size()) {
end = list.size();
}else {
end = page*size;
}

return list.subList((page-1)*size, end);
}

static int getPageSize(List<Task> list,int size) {
if(list.size() % size == 0) {
return list.size()/size;
}else {
return list.size()/size + 1;
}

}

@RequestMapping("tongji.do")
public String tongji( 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
		if (words!=null&&!"".equals(words)) {
words="%"+words+"%";
}
if (louhao!=null) {
louhao="%"+louhao+"%";
}
if (ed!=null&&!"".equals(ed)) {
ed=""+ed+"";
}
if (bd!=null&&!"".equals(bd)) {
bd=""+bd+"";
}

//这段代码表示,程序开始分页了,page默认值是1,每页记录数(pageSize)默认是3,意思是从第1页开始,每页显示3条记录
//每页记录数可以自定义
PageHelper.startPage(page, 6);
List<Task> list = taskService.getTaskByKeysLouhaoNoState(words,louhao, schoolid,bd,ed);
PageInfo<Task>pageInfo = new PageInfo<Task>(list); //将集合封装到PageInfo
//绑定数据,返回给页面
model.addAttribute("p", pageInfo);


return "index";
}

}
package com.ssm.controller;




/**
* ***********用户基本**************
* 用户登录 *
* 用户注册*
*
* 用户信息更新*
* 用户密码更新*
*
*
*/


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