文章目录
- 社团管理系统
- 一、项目演示
- 二、项目介绍
- 三、系统运行界面图
- 四、系统部分功能截图
- 五、部分代码展示
- 六、底部获取源码
社团管理系统
一、项目演示
社团管理系统
二、项目介绍
基于SpringBoot2+Vue的前后端分离的社团管理系统
前后端分离
前端开发 : Vue2 + ElementUl
后端开发 : SpringBoot2 + MyBatisPlus
数据库 :MySQL
用户角色:系统管理员、社团团长、学生
系统管理员:管理系统所有模块所有用户的,系统默认设置一个
社团团长:社团的负责人管理社团相关工作
学生用户: 学生可以申请账户,申请加入社团,看到社团相关信息
1、系统管理员:系统首页+系统用户管理+社团类型管理+社团信息管理+社团成员管理+社团活动管理+通知信息管理+入团申请记录+费用申请记录 9个模块
2、社团团长:系统首页+社团信息浏览+社团成员管理+入团申请记录+社团活动浏览+通知信息管理+费用申请记录 7个模块
3、普通用户: 系统首页+社团信息浏览+入团申请记录+社团活动浏览+费用申请记录 5个模块
三、系统运行界面图
四、系统部分功能截图
五、部分代码展示
package self.cases.teams.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import self.cases.teams.entity.Users;
import self.cases.teams.handle.CacheHandle;
import self.cases.teams.service.UsersService;
import self.cases.teams.utils.DateUtils;
import self.cases.teams.utils.IDUtils;
import self.cases.teams.msg.R;
import self.cases.teams.msg.PageData;
import self.cases.teams.entity.ActiveLogs;
import self.cases.teams.service.ActiveLogsService;
import java.util.List;
import java.util.Map;
/**
* 系统请求响应控制器
* 报名记录
*/
@Controller
@RequestMapping("/activeLogs")
public class ActiveLogsController extends BaseController {
protected static final Logger Log = LoggerFactory.getLogger(ActiveLogsController.class);
@Autowired
private CacheHandle cacheHandle;
@Autowired
private UsersService usersService;
@Autowired
private ActiveLogsService activeLogsService;
@RequestMapping("")
public String index() {
return "pages/ActiveLogs";
}
@GetMapping("/info")
@ResponseBody
public R getInfo(String id) {
Log.info("查找指定报名记录,ID:{}", id);
ActiveLogs activeLogs = activeLogsService.getOne(id);
return R.successData(activeLogs);
}
@GetMapping("/list")
@ResponseBody
public R getList(String activeId) {
Log.info("获取指定活动的报名记录,活动ID:{}", activeId);
List<Map<String, Object>> list = activeLogsService.getListByActiveId(activeId);
return R.successData(list);
}
@PostMapping("/add")
@ResponseBody
public R addInfo(String token, ActiveLogs activeLogs) {
Users user = usersService.getOne(cacheHandle.getUserInfoCache(token));
if(activeLogsService.isActive(activeLogs.getActiveId(), user.getId())){
activeLogs.setId(IDUtils.makeIDByCurrent());
activeLogs.setUserId(user.getId());
activeLogs.setCreateTime(DateUtils.getNowDate());
Log.info("添加报名记录,传入参数:{}", activeLogs);
activeLogsService.add(activeLogs);
return R.success();
}else{
return R.warn("该活动您已参与,请勿重复报名");
}
}
@PostMapping("/upd")
@ResponseBody
public R updInfo(ActiveLogs activeLogs) {
Log.info("修改报名记录,传入参数:{}", activeLogs);
activeLogsService.update(activeLogs);
return R.success();
}
@PostMapping("/del")
@ResponseBody
public R delInfo(String id) {
Log.info("删除报名记录, ID:{}", id);
ActiveLogs activeLogs = activeLogsService.getOne(id);
activeLogsService.delete(activeLogs);
return R.success();
}
}
package self.cases.teams.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import self.cases.teams.entity.Users;
import self.cases.teams.handle.CacheHandle;
import self.cases.teams.service.UsersService;
import self.cases.teams.utils.IDUtils;
import self.cases.teams.msg.R;
import self.cases.teams.msg.PageData;
import self.cases.teams.entity.Activities;
import self.cases.teams.service.ActivitiesService;
/**
* 系统请求响应控制器
* 活动信息
*/
@Controller
@RequestMapping("/activities")
public class ActivitiesController extends BaseController {
protected static final Logger Log = LoggerFactory.getLogger(ActivitiesController.class);
@Autowired
private CacheHandle cacheHandle;
@Autowired
private UsersService usersService;
@Autowired
private ActivitiesService activitiesService;
@RequestMapping("")
public String index() {
return "pages/Activities";
}
@GetMapping("/info")
@ResponseBody
public R getInfo(String id) {
Log.info("查找指定活动信息,ID:{}", id);
Activities activities = activitiesService.getOne(id);
return R.successData(activities);
}
@GetMapping("/page")
@ResponseBody
public R getPageInfos(Long pageIndex, Long pageSize,
String token, String teamName, String activeName) {
Users user = usersService.getOne(cacheHandle.getUserInfoCache(token));
if (user.getType() == 0) {
Log.info("分页查找活动信息,当前页码:{},"
+ "每页数据量:{}, 模糊查询,社团名称:{},活动名称:{}", pageIndex,
pageSize, teamName, activeName);
PageData page = activitiesService.getPageAll(pageIndex, pageSize, teamName, activeName);
return R.successData(page);
} else {
Log.info("分页查找活动信息,当前页码:{},"
+ "每页数据量:{}, 模糊查询,社团名称:{},活动名称:{}", pageIndex,
pageSize, teamName, activeName);
PageData page = activitiesService.getPageByUserId(pageIndex, pageSize, user.getId(), teamName, activeName);
return R.successData(page);
}
}
@PostMapping("/add")
@ResponseBody
public R addInfo(Activities activities) {
activities.setId(IDUtils.makeIDByCurrent());
Log.info("添加活动信息,传入参数:{}", activities);
activitiesService.add(activities);
return R.success();
}
@PostMapping("/upd")
@ResponseBody
public R updInfo(Activities activities) {
Log.info("修改活动信息,传入参数:{}", activities);
activitiesService.update(activities);
return R.success();
}
@PostMapping("/del")
@ResponseBody
public R delInfo(String id) {
Log.info("删除活动信息, ID:{}", id);
Activities activities = activitiesService.getOne(id);
activitiesService.delete(activities);
return R.success();
}
}
package self.cases.teams.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import self.cases.teams.entity.Users;
import self.cases.teams.handle.CacheHandle;
import self.cases.teams.service.UsersService;
import self.cases.teams.utils.DateUtils;
import self.cases.teams.utils.IDUtils;
import self.cases.teams.msg.R;
import self.cases.teams.msg.PageData;
import self.cases.teams.entity.ApplyLogs;
import self.cases.teams.service.ApplyLogsService;
/**
* 系统请求响应控制器
* 申请记录
*/
@Controller
@RequestMapping("/applyLogs")
public class ApplyLogsController extends BaseController {
protected static final Logger Log = LoggerFactory.getLogger(ApplyLogsController.class);
@Autowired
private CacheHandle cacheHandle;
@Autowired
private UsersService usersService;
@Autowired
private ApplyLogsService applyLogsService;
@RequestMapping("")
public String index() {
return "pages/ApplyLogs";
}
@GetMapping("/info")
@ResponseBody
public R getInfo(String id) {
Log.info("查找指定申请记录,ID:{}", id);
ApplyLogs applyLogs = applyLogsService.getOne(id);
return R.successData(applyLogs);
}
@GetMapping("/page")
@ResponseBody
public R getPageInfos(Long pageIndex, Long pageSize,
String token, String teamName, String userName) {
Users user = usersService.getOne(cacheHandle.getUserInfoCache(token));
if (user.getType() == 0) {
Log.info("分页查看全部申请记录,当前页码:{},"
+ "每页数据量:{}, 模糊查询,团队名称:{},用户姓名:{}", pageIndex,
pageSize, teamName, userName);
PageData page = applyLogsService.getPageInfo(pageIndex, pageSize, null, teamName, userName);
return R.successData(page);
} else if (user.getType() == 1) {
Log.info("团队管理员查看申请记录,当前页码:{},"
+ "每页数据量:{}, 模糊查询,团队名称:{},用户姓名:{}", pageIndex,
pageSize, teamName, userName);
PageData page = applyLogsService.getManPageInfo(pageIndex, pageSize, user.getId(), teamName, userName);
return R.successData(page);
} else {
Log.info("分页用户相关申请记录,当前页码:{},"
+ "每页数据量:{}, 模糊查询,团队名称:{},用户姓名:{}", pageIndex,
pageSize, teamName, userName);
PageData page = applyLogsService.getPageInfo(pageIndex, pageSize, user.getId(), teamName, null);
return R.successData(page);
}
}
@PostMapping("/add")
@ResponseBody
public R addInfo(String token, ApplyLogs applyLogs) {
Users user = usersService.getOne(cacheHandle.getUserInfoCache(token));
if(applyLogsService.isApply(user.getId(), applyLogs.getTeamId())){
applyLogs.setId(IDUtils.makeIDByCurrent());
applyLogs.setUserId(user.getId());
applyLogs.setCreateTime(DateUtils.getNowDate());
Log.info("添加申请记录,传入参数:{}", applyLogs);
applyLogsService.add(applyLogs);
return R.success();
}else{
return R.warn("申请提交或者已是社团成员,无法重复申请");
}
}
@PostMapping("/upd")
@ResponseBody
public R updInfo(ApplyLogs applyLogs) {
Log.info("修改申请记录,传入参数:{}", applyLogs);
applyLogsService.update(applyLogs);
return R.success();
}
@PostMapping("/del")
@ResponseBody
public R delInfo(String id) {
Log.info("删除申请记录, ID:{}", id);
ApplyLogs applyLogs = applyLogsService.getOne(id);
applyLogsService.delete(applyLogs);
return R.success();
}
}