基于javaweb的SSM校园社团门户网站管理系统(前台、后台)(java+jsp+ssm+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

分为前台和后台

前台校园门户网站信息查看:学生

后台内容管理:管理员、教师、社团(角色不同,权限菜单不同)

030123182502

前台

510123172502

520123172502

530123172502

550123172502

后台

010123182502

020123182502

560123172502

570123172502

580123172502

590123172502

000123182502

技术框架

JavaBean MVC JSP SSM(Spring SpringMVC MyBatis) MySQL jQuery JavaScript CSS…

基于javaweb的SSM校园社团门户网站管理系统(前台、后台)(java+jsp+ssm+mysql)

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

@Controller
@RequestMapping("/schoolInfo")
public class SchoolInfoController extends BaseController {

/**
* 依赖注入 start dao/service/===
*/
@Autowired
private SchoolInfoService schoolInfoService;
@Autowired
private GzService gzService;
// --------------------------------------- 华丽分割线 ------------------------------

/**
* 分页查询 返回list对象(通过对象)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByObj.do")
public String findByObj(SchoolInfo schoolInfo, Model model, HttpServletRequest request, HttpServletResponse response) {
Object attribute = request.getSession().getAttribute("isManage");
if(isEmpty(attribute)){
Integer id2 = Integer.valueOf(request.getSession().getAttribute("userId").toString());
schoolInfo.setAddUserId(id2);
}
//分页查询
Pager<SchoolInfo> pagers = schoolInfoService.findByEntity(schoolInfo);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", schoolInfo);
return "schoolInfo/schoolInfo";
}


/**
* 分页查询 返回list对象(通过Map)
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/findByMap.do")
public String findByMap(SchoolInfo schoolInfo, Model model, HttpServletRequest request, HttpServletResponse response) {
//通过map查询
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(schoolInfo.getContent())){
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
	//通过map查询
Map<String,Object> params = new HashMap<String,Object>();
if(!isEmpty(userRole.getUserId())){
params.put("userId", userRole.getUserId());
}
if(!isEmpty(userRole.getRoleId())){
params.put("roleId", userRole.getRoleId());
}
//分页查询
Pager<UserRole> pagers = userRoleService.findByMap(params);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", userRole);
return jsonObject.toString();
}


/**
* ajax 添加
* @param
* @return
*/
@RequestMapping(value = "/exAdd.json", method = RequestMethod.POST)
@ResponseBody
public String exAddJson(UserRole userRole, Model model, HttpServletRequest request, HttpServletResponse response) {
userRoleService.insert(userRole);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("message", "添加成功");
return jsonObject.toString();
}


/**
* ajax 修改
* @param
* @return
*/
@RequestMapping(value = "/exUpdate.json",method = RequestMethod.POST)
@ResponseBody
public String exUpdateJson(UserRole userRole, Model model, HttpServletRequest request, HttpServletResponse response) {
userRoleService.update(userRole);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("message", "修改成功");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.demo.controller;


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


@Controller
@RequestMapping("/userNotice")
public class UserNoticeController extends BaseController {

/**
* 依赖注入 start dao/service/===
*/
@Autowired
private UserNoticeService userNoticeService;

// --------------------------------------- 华丽分割线 ------------------------------
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
*/
@RequestMapping(value = "/findByObj.json", method = RequestMethod.GET)
@ResponseBody
public String findByObjByEntity(UserRole userRole, Model model, HttpServletRequest request, HttpServletResponse response) {
//分页查询
Pager<UserRole> pagers = userRoleService.findByEntity(userRole);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", userRole);
return jsonObject.toString();
}


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


/**
* ajax 添加
* @param
* @return
*/
@RequestMapping(value = "/exAdd.json", method = RequestMethod.POST)
@ResponseBody
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
public String findByObjByEntity(SchoolInfo schoolInfo, Model model, HttpServletRequest request, HttpServletResponse response) {
//分页查询
Pager<SchoolInfo> pagers = schoolInfoService.findByEntity(schoolInfo);
JSONObject jsonObject = JsonUtil2.getJsonObject();
jsonObject.put("pagers", pagers);
jsonObject.put("obj", schoolInfo);
return jsonObject.toString();
}


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


/**
* ajax 添加
* @param
* @return
*/
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
}


/**
* 跳至修改页面
* @return
*/
@RequestMapping(value = "/update.do")
public String update(Integer id,Model model) {
Gz obj = gzService.load(id);
model.addAttribute("obj",obj);
return "gz/update";
}

/**
* 添加修改
* @return
*/
@RequestMapping(value = "/exUpdate.do")
public String exUpdate(Gz gz, Model model, HttpServletRequest request, HttpServletResponse response) {
gzService.update(gz);
return "redirect:/gz/findByObj.do";
}

/**
* 删除通过主键
* @return
*/
@RequestMapping(value = "/delete.do")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
//真正删除
gzService.deleteById(id);
//通过参数删除
//Map<String,Object> params = new HashMap<String,Object>();
//params.put("id", id);
//gzService.deleteBySqId("deleteBySql", params);
//状态删除
//Gz load = gzService.load(id);
//load.setIsDelete(1);
//gzService.update(load);
return "redirect:/gz/findByObj.do";
}


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