文末获取源码
开发语言:Java
开发工具:IDEA /Eclipse
数据库:MYSQL5.7/8.0
使用框架:springboot+vue
JDK版本:jdk1.8
目录
本校园志愿者管理系统以springboot作为框架,b/s模式以及MySql作为后台运行的数据库,同时使用Tomcat用为系统的服务器。本系统主要包括首页、个人中心、志愿者管理、活动类型管理、活动信息管理、活动报名管理、活动通知管理、活动心得管理、交流反馈、系统管理等功能,通过这些功能的实现基本能够满足日常校园志愿者管理的操作。
根据校园志愿者管理系统的功能需求,进行系统设计。
前台功能:用户进入系统可以实现首页、活动信息、活动心得、公告信息、交流反馈、个人中心、后台管理等功能进行操作;
后台由管理员和志愿者,主要功能包括首页、个人中心、志愿者管理、活动类型管理、活动信息管理、活动报名管理、活动通知管理、活动心得管理、交流反馈、系统管理等功能;
系统对这些功能进行整合,产生的功能结构图如下:

数据库的E-R图反映了实体、实体的属性和实体之间的联系。下面是各个实体以及实体的属性。
活动信息实体属性图如下所示:

活动心得实体属性图如下所示:
活动报名实体属性图如下所示:
校园志愿者管理系统,用户进入到系统首页,可以查看首页、活动信息、活动心得、公告信息、交流反馈、个人中心、后台管理等内容进行操作,如图

志愿者注册;在志愿者注册页面中输入用户名、密码、确认密码、姓名、年龄、邮箱、手机等内容完成注册操作;如图
活动信息;在活动信息页面中可以查看活动名称、活动类型、活动时间、人数、活动场地、活动介绍、图片等内容;并进行报名操作;如图

活动心得;在活动心得页面中可以查看活动名称、图片、活动类型、发布时间、心得分享等内容,并进行评论或收藏操作;如图
个人中心;在个人中心页面中输入用户名、密码、姓名、性别、上传图片、年龄、邮箱、手机等内容进行更新信息,并根据需要对我的收藏进行详细的操作管理,如图

管理员登录,通过填写注册时输入的用户名、密码、选择角色等信息进行登录操作,如图

管理员登录进入校园志愿者管理系统可以查看首页、个人中心、志愿者管理、活动类型管理、活动信息管理、活动报名管理、活动通知管理、活动心得管理、交流反馈、系统管理等功能进行详细操作,如图

志愿者管理;在志愿者管理页面中可以查看索引、用户名、姓名、性别、头像、年龄、邮箱、手机等内容,并进行详情,修改和删除等操作;如图
活动类型管理;在活动类型管理页面中可以查看索引、活动类型等内容,并进行修改、删除等操作;如图

活动信息管理;在活动信息管理页面中可以查看索引、活动名称、活动类型、图片、活动时间、人数、活动场地等内容,并进行详情、修改或删除等操作;如图

活动报名管理;在活动报名管理页面中可以查看索引、活动名称、活动类型、人数、报名说明、报名时间、用户名、姓名、手机、审核回复、审核状态、审核等内容,并进行详情、修改、通知和删除等操作;如图

活动通知管理;在活动通知管理页面中可以查看索引、标题、用户名、姓名、手机、通知时间等内容,并进行详情、修改和删除等操作;如图

活动心得管理;在活动心得管理页面中可以查看索引、活动名称、活动类型、图片、发布时间等内容,并进行详情、修改、查看评论和删除等操作;如图

交流反馈;在交流反馈页面中可以查看索引、用户名、留言内容、留言图片、回复内容、回复图片等内容,并进行详情、修改和删除等操作;如图

志愿者登录进入校园志愿者管理系统可以查看首页、个人中心、活动报名管理、活动通知管理、活动心得管理、我的收藏管理、交流反馈等功能进行详细操作,如图

个人中心;在个人中心页面通过填写用户名、性别、头像、年龄、手机、姓名、邮箱等内容进行个人信息修改;如图

活动报名管理;在活动报名管理页面中可以查看索引、活动名称、活动类型、人数、报名说明、报名时间、用户名、姓名、手机、审核回复、审核状态等内容,并进行详情、或删除等操作;如图

活动通知管理;在活动通知管理页面中可以查看索引、标题、用户名、姓名、手机、通知时间等内容,并进行详情等操作;如图

活动心得管理;在活动心得管理页面中可以查看索引、活动名称、活动类型、图片、发布时间等内容,并进行详情,修改,查看评论或删除等操作;如图

- /**
- * 活动心得评论表
- * 后端接口
- * @author
- * @email
- * @date 2022-05-06 08:33:49
- */
- @RestController
- @RequestMapping("/discusshuodongxinde")
- public class DiscusshuodongxindeController {
- @Autowired
- private DiscusshuodongxindeService discusshuodongxindeService;
-
-
-
-
-
- /**
- * 后端列表
- */
- @RequestMapping("/page")
- public R page(@RequestParam Map<String, Object> params,DiscusshuodongxindeEntity discusshuodongxinde,
- HttpServletRequest request){
- EntityWrapper<DiscusshuodongxindeEntity> ew = new EntityWrapper<DiscusshuodongxindeEntity>();
- PageUtils page = discusshuodongxindeService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusshuodongxinde), params), params));
-
- return R.ok().put("data", page);
- }
-
- /**
- * 前端列表
- */
- @IgnoreAuth
- @RequestMapping("/list")
- public R list(@RequestParam Map<String, Object> params,DiscusshuodongxindeEntity discusshuodongxinde,
- HttpServletRequest request){
- EntityWrapper<DiscusshuodongxindeEntity> ew = new EntityWrapper<DiscusshuodongxindeEntity>();
- PageUtils page = discusshuodongxindeService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusshuodongxinde), params), params));
- return R.ok().put("data", page);
- }
-
- /**
- * 列表
- */
- @RequestMapping("/lists")
- public R list( DiscusshuodongxindeEntity discusshuodongxinde){
- EntityWrapper<DiscusshuodongxindeEntity> ew = new EntityWrapper<DiscusshuodongxindeEntity>();
- ew.allEq(MPUtil.allEQMapPre( discusshuodongxinde, "discusshuodongxinde"));
- return R.ok().put("data", discusshuodongxindeService.selectListView(ew));
- }
-
- /**
- * 查询
- */
- @RequestMapping("/query")
- public R query(DiscusshuodongxindeEntity discusshuodongxinde){
- EntityWrapper< DiscusshuodongxindeEntity> ew = new EntityWrapper< DiscusshuodongxindeEntity>();
- ew.allEq(MPUtil.allEQMapPre( discusshuodongxinde, "discusshuodongxinde"));
- DiscusshuodongxindeView discusshuodongxindeView = discusshuodongxindeService.selectView(ew);
- return R.ok("查询活动心得评论表成功").put("data", discusshuodongxindeView);
- }
-
- /**
- * 后端详情
- */
- @RequestMapping("/info/{id}")
- public R info(@PathVariable("id") Long id){
- DiscusshuodongxindeEntity discusshuodongxinde = discusshuodongxindeService.selectById(id);
- return R.ok().put("data", discusshuodongxinde);
- }
-
- /**
- * 前端详情
- */
- @IgnoreAuth
- @RequestMapping("/detail/{id}")
- public R detail(@PathVariable("id") Long id){
- DiscusshuodongxindeEntity discusshuodongxinde = discusshuodongxindeService.selectById(id);
- return R.ok().put("data", discusshuodongxinde);
- }
-
-
-
-
- /**
- * 后端保存
- */
- @RequestMapping("/save")
- public R save(@RequestBody DiscusshuodongxindeEntity discusshuodongxinde, HttpServletRequest request){
- discusshuodongxinde.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
- //ValidatorUtils.validateEntity(discusshuodongxinde);
- discusshuodongxindeService.insert(discusshuodongxinde);
- return R.ok();
- }
-
- /**
- * 前端保存
- */
- @RequestMapping("/add")
- public R add(@RequestBody DiscusshuodongxindeEntity discusshuodongxinde, HttpServletRequest request){
- discusshuodongxinde.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
- //ValidatorUtils.validateEntity(discusshuodongxinde);
- discusshuodongxindeService.insert(discusshuodongxinde);
- return R.ok();
- }
-
- /**
- * 修改
- */
- @RequestMapping("/update")
- @Transactional
- public R update(@RequestBody DiscusshuodongxindeEntity discusshuodongxinde, HttpServletRequest request){
- //ValidatorUtils.validateEntity(discusshuodongxinde);
- discusshuodongxindeService.updateById(discusshuodongxinde);//全部更新
- return R.ok();
- }
-
-
- /**
- * 删除
- */
- @RequestMapping("/delete")
- public R delete(@RequestBody Long[] ids){
- discusshuodongxindeService.deleteBatchIds(Arrays.asList(ids));
- return R.ok();
- }
-
- /**
- * 提醒接口
- */
- @RequestMapping("/remind/{columnName}/{type}")
- public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
- @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
- map.put("column", columnName);
- map.put("type", type);
-
- if(type.equals("2")) {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- Calendar c = Calendar.getInstance();
- Date remindStartDate = null;
- Date remindEndDate = null;
- if(map.get("remindstart")!=null) {
- Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
- c.setTime(new Date());
- c.add(Calendar.DAY_OF_MONTH,remindStart);
- remindStartDate = c.getTime();
- map.put("remindstart", sdf.format(remindStartDate));
- }
- if(map.get("remindend")!=null) {
- Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
- c.setTime(new Date());
- c.add(Calendar.DAY_OF_MONTH,remindEnd);
- remindEndDate = c.getTime();
- map.put("remindend", sdf.format(remindEndDate));
- }
- }
-
- Wrapper<DiscusshuodongxindeEntity> wrapper = new EntityWrapper<DiscusshuodongxindeEntity>();
- if(map.get("remindstart")!=null) {
- wrapper.ge(columnName, map.get("remindstart"));
- }
- if(map.get("remindend")!=null) {
- wrapper.le(columnName, map.get("remindend"));
- }
-
-
- int count = discusshuodongxindeService.selectCount(wrapper);
- return R.ok().put("count", count);
- }
-
-
-
-
-
-
-
-
- }
- /**
- * 上传文件映射表
- */
- @RestController
- @RequestMapping("file")
- @SuppressWarnings({"unchecked","rawtypes"})
- public class FileController{
- @Autowired
- private ConfigService configService;
- /**
- * 上传文件
- */
- @RequestMapping("/upload")
- public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
- if (file.isEmpty()) {
- throw new EIException("上传文件不能为空");
- }
- String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
- File path = new File(ResourceUtils.getURL("classpath:static").getPath());
- if(!path.exists()) {
- path = new File("");
- }
- File upload = new File(path.getAbsolutePath(),"/upload/");
- if(!upload.exists()) {
- upload.mkdirs();
- }
- String fileName = new Date().getTime()+"."+fileExt;
- File dest = new File(upload.getAbsolutePath()+"/"+fileName);
- file.transferTo(dest);
- /**
- * 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开
- * 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径,
- * 并且项目路径不能存在中文、空格等特殊字符
- */
- // FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/
- if(StringUtils.isNotBlank(type) && type.equals("1")) {
- ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
- if(configEntity==null) {
- configEntity = new ConfigEntity();
- configEntity.setName("faceFile");
- configEntity.setValue(fileName);
- } else {
- configEntity.setValue(fileName);
- }
- configService.insertOrUpdate(configEntity);
- }
- return R.ok().put("file", fileName);
- }
-
- /**
- * 下载文件
- */
- @IgnoreAuth
- @RequestMapping("/download")
- public ResponseEntity<byte[]> download(@RequestParam String fileName) {
- try {
- File path = new File(ResourceUtils.getURL("classpath:static").getPath());
- if(!path.exists()) {
- path = new File("");
- }
- File upload = new File(path.getAbsolutePath(),"/upload/");
- if(!upload.exists()) {
- upload.mkdirs();
- }
- File file = new File(upload.getAbsolutePath()+"/"+fileName);
- if(file.exists()){
- /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
- getResponse().sendError(403);
- }*/
- HttpHeaders headers = new HttpHeaders();
- headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
- headers.setContentDispositionFormData("attachment", fileName);
- return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
- }
-
- }