基于javaweb的SSM校园门户平台系统(java+ssm+jsp+bootstrap+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

040023352402

050023352402

060023352402

070023352402

080023352402

090023352402

基于javaweb的SSM校园门户平台系统(java+ssm+jsp+bootstrap+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+jQuery+bootstrap

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ssm_xymh_sys/ 登录  注:Tomcat中配置项目路径必须为ssm_xymh_sys,否则会有异常

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
	//分页查询
Pager<WebCount> pagers = webCountService.findByEntity(webCount);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", webCount);
return jsonObject.toString();
}


/**
* 分页查询 返回list json(通过Map)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByMap.json", method = RequestMethod.GET)
@ResponseBody
public String findByMapMap(WebCount webCount, Model model, HttpServletRequest request, HttpServletResponse response) {
//通过map查询
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(webCount.getCountAll())){
params.put("countAll", webCount.getCountAll());
}
//分页查询
Pager<WebCount> pagers = webCountService.findByMap(params);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", webCount);
return jsonObject.toString();
}


/**
* ajax 添加
* @param
* @return
*/
@RequestMapping(value = "/exAdd.json", method = RequestMethod.POST)
@ResponseBody
public String exAddJson(WebCount webCount, Model model, HttpServletRequest request, HttpServletResponse response) {
webCountService.insert(webCount);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("message", "添加成功");
return jsonObject.toString();
}
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

/**
* @ClassName:
* @Description:
*/


@Controller
@RequestMapping("/xkzy")
public class XkzyController extends BaseController {

/**
* 依赖注入 start dao/service/===
*/
@Autowired
private XkzyService xkzyService;

// --------------------------------------- 华丽分割线 ------------------------------

/**
* 分页查询 返回list对象(通过对象)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.do")
public String findByObj(Xkzy xkzy, Model model, HttpServletRequest request, HttpServletResponse response) {
//分页查询
Pager<Xkzy> pagers = xkzyService.findByEntity(xkzy);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", xkzy);
return "xkzy/xkzy";
}

@RequestMapping(value = "/findByObj2.do")
public String findByObj2(Xkzy xkzy, Model model, HttpServletRequest request, HttpServletResponse response) {
//分页查询
Pager<Xkzy> pagers = xkzyService.findByEntity(xkzy);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", xkzy);
return "xkzy/xkzy2";
}
@RequestMapping(value = "/detail.do")
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
	jsonObject.put("message", "修改成功");
return jsonObject.toString();
}

/**
* ajax 删除
* @return
*/
@RequestMapping(value = "/delete.json", produces = "text/html;charset=UTF-8", method = RequestMethod.GET)
@ResponseBody
public String exDeleteJson(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
//真正删除
noticeService.deleteById(id);
//通过参数删除
//Map<String,Object> params = new HashMap<String,Object>();
//params.put("id", id);
//noticeService.deleteBySqId("deleteBySql", params);
//状态删除
//Notice load = noticeService.load(id);
//load.setIsDelete(1);
//noticeService.update(load);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("message", "删除成功");
return jsonObject.toString();
}
/**
* 单文件上传
* @param file
* @param request
* @param model
* @return
*/
@RequestMapping(value = "/saveFile")
public String saveFile(@RequestParam(value = "file", required = false) MultipartFile file, HttpServletRequest request, Model model) {

System.out.println("开始");
String path = request.getSession().getServletContext().getRealPath("/upload");
String fileName = file.getOriginalFilename();
System.out.println(path);
File targetFile = new File(path, fileName);
if(!targetFile.exists()){
targetFile.mkdirs();
}
//保存
try {
file.transferTo(targetFile);
} catch (Exception e) {
e.printStackTrace();
}
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
51
52
	Pager<Gz> pagers = gzService.findByMap(params);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", gz);
return "gz/gz";
}


/**
* 跳至添加页面
* @return
*/
@RequestMapping(value = "/add.do")
public String add(Model model, HttpServletRequest request, HttpServletResponse response) {
List<GzDto> dtos = new ArrayList<GzDto>();
GzDto d1 = new GzDto();
d1.setNum(1);
d1.setName("新闻快讯");
dtos.add(d1);
GzDto d2 = new GzDto();
d2.setNum(2);
d2.setName("通知公告");
dtos.add(d2);
GzDto d3 = new GzDto();
d3.setNum(3);
d3.setName("求职招聘");
dtos.add(d3);
GzDto d4 = new GzDto();
d4.setNum(4);
d4.setName("校园风采");
dtos.add(d4);

Integer id = Integer.valueOf(request.getSession().getAttribute("userId").toString());
Map<String, Object> map = MapUtils.getMap();
map.put("userId", id);
List<Gz> list = gzService.list(map);
List<Integer> types = new ArrayList<>();
List<GzDto> listNew = new ArrayList<>();

if(!isEmpty(list)){
for(Gz g: list){
types.add(g.getType());
}
}
for(GzDto dt :dtos){
if(types.contains(dt.getNum())){
dt.setIsCheck(1);
}else{
dt.setIsCheck(0);
}
listNew.add(dt);
}
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
51
52
53
	//params.put("id", id);
//roleActionService.deleteBySqId("deleteBySql", params);
//状态删除
//RoleAction load = roleActionService.load(id);
//load.setIsDelete(1);
//roleActionService.update(load);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("message", "删除成功");
return jsonObject.toString();
}
/**
* 单文件上传
* @param file
* @param request
* @param model
* @return
*/
@RequestMapping(value = "/saveFile")
public String saveFile(@RequestParam(value = "file", required = false) MultipartFile file, HttpServletRequest request, Model model) {

System.out.println("开始");
String path = request.getSession().getServletContext().getRealPath("/upload");
String fileName = file.getOriginalFilename();
System.out.println(path);
File targetFile = new File(path, fileName);
if(!targetFile.exists()){
targetFile.mkdirs();
}
//保存
try {
file.transferTo(targetFile);
} catch (Exception e) {
e.printStackTrace();
}

return "";
}


/**
* springMvc多文件上传
* @param files
* @param id
* @return
*/
@RequestMapping(value = "/saveFiles")
public String saveFiles(@RequestParam("file") CommonsMultipartFile[] files,Integer id,HttpServletRequest request){
for(int i = 0;i<files.length;i++){
System.out.println("fileName---------->" + files[i].getOriginalFilename());
if(!files[i].isEmpty()){
int pre = (int) System.currentTimeMillis();
try {
//拿到输出流,同时重命名上传的文件


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