基于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
使用说明
-
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
-
使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
public class RoleController {
@Autowired
private RoleService roleService;
@Autowired
private PermissionService permissionService;
@RequestMapping("/list")
@RequiresPermissions("role:list")
public String roleList() {
return "role/list";
@ResponseBody
@RequestMapping("/getRoles")
criteria.andRolenameEqualTo(name);
if (roleService.selectByExample(roleExample).size() != 0) {
return false;
return true;
@RequestMapping("/edit")
@RequiresPermissions("role:update")
public String edit(Model m, Long roleId) {
m.addAttribute("role", roleService.selectByPrimaryKey(roleId));
return "role/edit";
@ResponseBody
@RequestMapping("/update")
private final GoodService goodService;
private final OrderService orderService;
private final ReviewService reviewService;
private final UserService userService;
private final CollectService collectService;
@Autowired
public UserController(GoodService goodService, OrderService orderService,
ReviewService reviewService, UserService userService,
CollectService collectService) {
this.goodService = goodService;
this.orderService = orderService;
private final GoodService goodService;
private final OrderService orderService;
private final ReviewService reviewService;
private final UserService userService;
private final CollectService collectService;
@Autowired
public UserController(GoodService goodService, OrderService orderService,
ReviewService reviewService, UserService userService,
CollectService collectService) {
this.goodService = goodService;
this.orderService = orderService;
this.reviewService = reviewService;
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) {
HashMap<String, String> map = new HashMap<>();
if (roleIds.length == 1) {
int res = roleService.deleteByPrimaryKey(roleIds[0]);
if (res == 1) {
List<Reply> replies = reviewService.gerReplyByToUserId(user.getId());
List<Order> sellGoods = orderService.getOrderBySellerId(user.getId());
model.addAttribute("collects", collects);
model.addAttribute("goods", goods);
model.addAttribute("orders", orders);
model.addAttribute("reviews", reviews);
model.addAttribute("replies", replies);
model.addAttribute("sellGoods", sellGoods);
return "user/userProfile";
@RequestMapping(value = "/review", method = RequestMethod.GET)
public String getReviewInfo(@RequestParam(required = false) Integer goodId,
model.addAttribute("sellGoods", sellGoods);
return "user/userProfile";
@RequestMapping(value = "/review", method = RequestMethod.GET)
public String getReviewInfo(@RequestParam(required = false) Integer goodId,
@RequestParam(required = false) Integer reviewId) {
System.out.println("reviewId" + reviewId);
if (reviewId != null) {
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)
if (roleService.selectByExample(roleExample).size() != 0) {
return false;
return true;
@RequestMapping("/edit")
@RequiresPermissions("role:update")
public String edit(Model m, Long roleId) {
m.addAttribute("role", roleService.selectByPrimaryKey(roleId));
return "role/edit";
@ResponseBody
@RequestMapping("/update")
@RequiresPermissions("role:update")
public Boolean update(Role role) {
List<Good> goods = goodService.getGoodByUserId(user.getId());
List<Order> orders = orderService.getOrderByCustomerId(user.getId());
List<Review> reviews = reviewService.gerReviewByToUserId(user.getId());
List<Reply> replies = reviewService.gerReplyByToUserId(user.getId());
List<Order> sellGoods = orderService.getOrderBySellerId(user.getId());
model.addAttribute("collects", collects);
model.addAttribute("goods", goods);
model.addAttribute("orders", orders);
model.addAttribute("reviews", reviews);
model.addAttribute("replies", replies);
model.addAttribute("sellGoods", sellGoods);
return "user/userProfile";
@RequestMapping(value = "/review", method = RequestMethod.GET)
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;
// if (!mdsPass .equals(admin.getPassword())){
// message = "用户密码错误!";
// }
if (!password .equals(admin.getPassword())){
message = "用户密码错误!";
} else if (admin.getRoleId() != 101){
message = "用户没有权限访问!";
} else {
session.setAttribute("admin",admin);
return "redirect:/admin/adminPage";
} else {
message = "用户不存在!";
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")
@RequiresPermissions("role:update")
public String edit(Model m, Long roleId) {
m.addAttribute("role", roleService.selectByPrimaryKey(roleId));
return "role/edit";
@ResponseBody
@RequestMapping("/add")
@RequiresPermissions("role:insert")
public String addRole() {
return "role/add";
@ResponseBody
@RequestMapping("/getTree")
public List<Permission> getTree(){
ArrayList<Permission> permissions = (ArrayList<Permission>) permissionService.selectByExample(new PermissionExample());
return permissions;
@ResponseBody
@RequestMapping("/insert")
@RequiresPermissions("role:insert")
public Boolean insert(Role role){
@Controller
@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;
for(Long roleId : roleIds) {
success += roleService.deleteByPrimaryKey(roleId);
map.put("status", "true");
map.put("info", "成功删除选中 " + total + " 个角色中的 " + success + " 个角色");
return map;
@RequestMapping("/add")
@RequiresPermissions("role:insert")
public String addRole() {
return "role/add";
@ResponseBody
String photoUrl = userService.getUserById(user.getId())
.getPhotoUrl();
user.setPhotoUrl(photoUrl);
insertSuccess = userService.updateUser(user);
if (insertSuccess) {
session.removeAttribute("user");
session.setAttribute("user", user);
return "redirect:/user/userProfile";
} else {
status = "修改失败!";
model.addAttribute("user", user);
model.addAttribute("status", status);
insertSuccess = userService.updateUser(user);
if (insertSuccess) {
session.removeAttribute("user");
session.setAttribute("user", user);
return "redirect:/user/userProfile";
} else {
status = "修改失败!";
model.addAttribute("user", user);
model.addAttribute("status", status);
return "user/userEdit";
System.out.println(user.getMobile());
System.out.println(status);
model.addAttribute("user", user);
model.addAttribute("status", status);