基于javaweb+mysql的ssm社团管理系统(java+ssm+jsp+jquery+mysql)

基于javaweb+mysql的ssm社团管理系统(java+ssm+jsp+jquery+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

基于javaweb+mysql的SSM社团管理系统(java+ssm+jsp+jquery+mysql)

项目介绍

本社团管理系统是根据大学社团管理的实际应用而开发的,采用JSP技术,JAVA编程语言,基于SSM框架,使用MySQL数据库,充分保证系统的安全性和稳定性,使得社团管理工作系统化、规范化、高效化。

该系统主要分为前台和后台两大功能模块,共包含两个角色:用户、管理员。 具体的系统功能如下: 1.前台功能 前台首页、新闻公告、规章制度、社团活动、活动报名、互动交流、用户注册、用户登陆、用户中心、修改密码、个人信息、我的社团活动、物资申请、退出登陆等功能。 2.后台功能 后台系统登陆、社团用户管理、管理员管理、网站公告管理、社团活动管理、申请类型管理、用户申请管理、活动报名管理、留言交流管理等功能。

环境需要

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.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7/8.0等版本均可;

技术栈

后台框架:Spring、SpringMVC、MyBatis UI界面:JSP、jQuery 数据库:MySQL

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

  2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

+ randomString.getRandomString(10);

String contentType = photo.getContentType();

String imageName = contentType.substring(contentType

.indexOf("/") + 1);

String name = fileName + "." + imageName;

photo.transferTo(new File(pathRoot + name));

String photoUrl = filePath + "/" + name;

user.setPhotoUrl(photoUrl);

} else {

String photoUrl = userService.getUserById(user.getId())


.getId()) {

System.out.println(userService.getUserByMobile(user.getMobile())

.getId() + " " + user.getId());

status = "此手机号码已使用!";

} else if (userService.getUserByEmail(user.getEmail()).getId() != user

.getId()) {

status = "此邮箱已使用!";

} else {

if (!photo.isEmpty()) {

RandomString randomString = new RandomString();

FileCheck fileCheck = new FileCheck();

String filePath = "/statics/image/photos/" + user.getId();


RoleExample roleExample = new RoleExample();

/**

* StringUtils.isNotBlank 可以判断 ""/" "/null 为 false

*/

if (StringUtils.isNotBlank(keyWord)) {

//角色条件

RoleExample.Criteria criteriaUserName = roleExample.createCriteria();

criteriaUserName.andRolenameLike("%" + keyWord + "%");

List<Role> roles = roleService.selectByExample(roleExample);

//获得分页对象

PageInfo<Role> pageInfo = new PageInfo<>(roles);

return pageInfo;

@ResponseBody


System.out.println("reviewId" + reviewId);

if (reviewService.updateReviewStatus(1, reviewId) == 1) {

return "redirect:/goods/goodInfo?goodId=" + goodId;

return "redirect:/user/userProfile";

@RequestMapping(value = "/reply", method = RequestMethod.GET)

public String getReplyInfo(

@RequestParam(required = false) Integer reviewId,

@RequestParam(required = false) Integer replyId) {

if (replyId != null) {

if (reviewService.updateReplyStatus(1, replyId) == 1) {

Integer goodId = reviewService.getGoodIdByReviewId(reviewId);

return "redirect:/goods/goodInfo?goodId=" + goodId;

if (success){

List<User> userList = userService.getAllUser();

return ResponseEntity.ok(userList);

return ResponseEntity.ok(success);

@RequestMapping(value = "/user/delete/{userId}", method = RequestMethod.GET)

public ResponseEntity deleteUser(@PathVariable Integer userId){

Boolean success = userService.deleteUser(userId);

if (success){

List<User> userList = userService.getAllUser();

return ResponseEntity.ok(userList);


if (!photo.isEmpty()) {

RandomString randomString = new RandomString();

FileCheck fileCheck = new FileCheck();

String filePath = "/statics/image/photos/" + user.getId();

String pathRoot = fileCheck.checkGoodFolderExist(filePath);

String fileName = user.getId()

+ randomString.getRandomString(10);

String contentType = photo.getContentType();

String imageName = contentType.substring(contentType

.indexOf("/") + 1);

String name = fileName + "." + imageName;

photo.transferTo(new File(pathRoot + name));

String photoUrl = filePath + "/" + name;


model.addAttribute("reviews", reviews);

model.addAttribute("replies", replies);

return "user/userEdit";

@RequestMapping(value = "/userEdit", method = RequestMethod.POST)

public String postUserEdit(ModelMap model, @Valid User user,

HttpSession session,

@RequestParam(value = "photo", required = false) MultipartFile photo)

throws IOException {

String status;

Boolean insertSuccess;

User sessionUser = (User) session.getAttribute("user");

user.setId(sessionUser.getId());


session.removeAttribute("admin");

//        adminLogout = "false";

return "redirect:/";

@RequestMapping(value = "/adminPage", method = RequestMethod.GET)

public String getAdminPage(ModelMap model,

HttpSession session){

User admin = (User) session.getAttribute("admin");

if (admin == null){

return "redirect:/admin/adminLogin";

List<Good> goodList = goodService.getAllGoodList();

for (Good good : goodList) {


return "redirect:/";

User user = userService.getUserById(userId);

List<Order> sellGoods = orderService.getOrderBySellerId(user.getId());

List<Review> reviews = reviewService.gerReviewByToUserId(user.getId());

List<Reply> replies = reviewService.gerReplyByToUserId(user.getId());

model.addAttribute("user", user);

model.addAttribute("sellGoods", sellGoods);

model.addAttribute("reviews", reviews);

model.addAttribute("replies", replies);

return "user/userEdit";

@RequestMapping(value = "/userEdit", method = RequestMethod.POST)

public String postUserEdit(ModelMap model, @Valid User user,

HttpSession session,


@RequestMapping(value = "admin")

public class AdminController {

private final UserService userService;

private final GoodService goodService;

private final TypeService typeService;

private final OrderService orderService;

@Autowired

public AdminController(UserService userService, GoodService goodService, TypeService typeService, OrderService orderService) {

this.userService = userService;

this.goodService = goodService;


@RequiresPermissions("role:list")

public Boolean checkRole(String name, String curName) {

if (curName != null && name.equals(curName)) {

return true;

RoleExample roleExample = new RoleExample();

RoleExample.Criteria criteria = roleExample.createCriteria();

criteria.andRolenameEqualTo(name);

if (roleService.selectByExample(roleExample).size() != 0) {

return false;

return true;

@RequestMapping("/edit")


@RequestParam(required = false) Integer reviewId,

@RequestParam(required = false) Integer replyId) {

if (replyId != null) {

if (reviewService.updateReplyStatus(1, replyId) == 1) {

Integer goodId = reviewService.getGoodIdByReviewId(reviewId);

return "redirect:/goods/goodInfo?goodId=" + goodId;

return "redirect:/user/userProfile";

@RequestMapping(value = "/userEdit", method = RequestMethod.GET)

public String getUserEdit(ModelMap model,

@RequestParam(value = "userId", required = false) Integer userId,

HttpSession session) {


@RequestMapping(value = "/user/update/status/{statusId}&{userId}", method = RequestMethod.GET)

public ResponseEntity updateUserStatus(@PathVariable Integer statusId,

@PathVariable Integer userId){

Boolean success = userService.updateUserStatus(statusId, userId);

if (success){

List<User> userList = userService.getAllUser();

return ResponseEntity.ok(userList);

return ResponseEntity.ok(success);

@RequestMapping(value = "/user/delete/{userId}", method = RequestMethod.GET)

public ResponseEntity deleteUser(@PathVariable Integer userId){

Boolean success = userService.deleteUser(userId);

if (success){

List<User> userList = userService.getAllUser();


Boolean success = userService.updatePassword(md5Pass, code,

password.getUserId());

if (success) {

return ResponseEntity.ok(true);

} else {

return ResponseEntity.ok("密码修改失败!");

} else {

return ResponseEntity.ok("原密码输入不正确!");

后台管理员管理控制层:

@Controller

@RequestMapping(value = "admin")
model.addAttribute("status", status);

return "user/userEdit";

@RequestMapping(value = "/password/edit", method = RequestMethod.POST)

public ResponseEntity editPassword(@RequestBody Password password) {

User user = userService.getUserById(password.getUserId());

String oldPass = DigestUtils

.md5DigestAsHex((password.getOldPassword() + user.getCode())

.getBytes());

if (oldPass.equals(user.getPassword())) {

RandomString randomString = new RandomString();

String code = (randomString.getRandomString(5));

String md5Pass = DigestUtils.md5DigestAsHex((password

.getNewPassword() + code).getBytes());


String fileName = user.getId()

+ randomString.getRandomString(10);

String contentType = photo.getContentType();

String imageName = contentType.substring(contentType

.indexOf("/") + 1);

String name = fileName + "." + imageName;

photo.transferTo(new File(pathRoot + name));

String photoUrl = filePath + "/" + name;

user.setPhotoUrl(photoUrl);

} else {

String photoUrl = userService.getUserById(user.getId())

.getPhotoUrl();


public Boolean checkRole(String name, String curName) {

if (curName != null && name.equals(curName)) {

return true;

RoleExample roleExample = new RoleExample();

RoleExample.Criteria criteria = roleExample.createCriteria();

criteria.andRolenameEqualTo(name);

if (roleService.selectByExample(roleExample).size() != 0) {

return false;

return true;

@RequestMapping("/edit")


RoleExample.Criteria criteriaUserName = roleExample.createCriteria();

criteriaUserName.andRolenameLike("%" + keyWord + "%");

List<Role> roles = roleService.selectByExample(roleExample);

//获得分页对象

PageInfo<Role> pageInfo = new PageInfo<>(roles);

return pageInfo;

@ResponseBody

@RequestMapping("/delete")

@RequiresPermissions("role:delete")

public Map<String, String> delete(Long[] roleIds) {

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Java 大学社团管理系统社团管理系统 很早之前学习时的第一个项目,sql文件丢失了,手动写了几个,如需要达到理想的界面展示,需要手动添加一些数据。 更新,部分代码由于不是本人所写,没有上传,导致部分功能不能使用。所有代码仅供参考。项目目前不能友好的跑起来,见谅。 背景 是为了迎合学校“百团大战”(一种每年都有的社团迎新活动),为社团迎新开发的管理系统。方便学生浏览申请参加各种社团,同时方便管理者对各社团发送通知,下发文件等管理。 运行环境 JDK1.7编写 Eclipse( Neon.3 Release (4.6.3)) windows下 Tomcat v8.5 Mysql 5.5 使用技术 Java servlet & jsp Mysql 数据库 c3p0连接池 封装Page类 用以数据库分页 JavaScript & jQuery 使用bootstrap搭建前端展示界面 实现的功能 前端展示 普通用户登录、注册。保证用户名唯一性,不可重复。 登录前可以查看各种分类的社团的概要,简介等信息,还有最近各社团将要举行的各种活动的时间地点,活动标题等活动公告。 登录后可以查看、修改个人信息、密码等。 管理员登录后台后,后台登录URL [http://localhost/shetuan/admin_login.jsp] 用户管理,添加用户(根据账号修改普通用户的密码或权限),更新当前账号密码、查看用户列表(可以查看用户详细信息及加入或创建的社团信息,可对用户的个人信息进行修改、删除)。 社团管理,添加社团,查看社团列表(可以查看某一个社团的具体信息,进行编辑或删除),查看社团活动信息(可以查看社团活动详情,进行编辑或删除)。 审核管理,创建社团审批,创办活动审批。 社联新闻,添加社联新闻,更新社联新闻。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值