高校志愿者信息管理系统,其功能目标是实现将现有的高校志愿者信息管理系统模式向基于Internet的无纸张化志愿者信息管理模式的转变,所以它必须实现本身社团信息的管理,对参与志愿者社团活动的学生的管理。通过互联网联络协会成员的关键是要建立一个通畅的沟通平台,这样可以方便地实现会员与协会,会员与会员之间的沟通。

演示视频:

【java毕业设计】基于springboot志愿者管理平台

随着网络技术的飞速发展,现在很多国外的大学和社会其他部门都已经拥了百兆,甚至千兆的校内网络通信平台,通过计算机网络实现各种信息服务,并进行异地教育和培训。另一方面,现在的很多高校,为丰富学生的校园生活,培养学生的个性,促进特长学生的培养,学生会组织了很多社团。每个同学,根据参与自愿的原则,可以参加与自己兴趣相符的社团,但随着校园学生人数的增多,对社团及社团成员的管理,传统的方式显然不能胜任。[4]高校志愿者信息管理系统主要有两大部分:一是批准合法的志愿者申请加入社团,另一个是对具体志愿者信息管理系统本身的管理。其中很重要的一个环节就是具体社团管理,同时它也是本系统最难实现的环节。对于,一个具体的社团,学生可以自由的参加该社团组织的各种活动,如何对这类信息的管理是一个难点,另一方面,随着学生社团的增多,如何有效的对各个社团间信息的划分也是一个难点,这就需要对社团进行归类处理。显然,随着学生人数的不断增加及学生社团要求的不断提高,管理者的工作量将会越来越大,并且其工作将是一件十分烦琐和非常难以组织的事情,可以说传统的管理方式已经不能适应急剧扩大的学校规模需要。随着计算机应用的迅猛发展,网络应用不断扩大,如WWW服务、虚拟社区等等,且这些应用正逐步深入到千家万户。人们迫切要求利用这些技术来进行学生社团的组织和管理,以减轻管理者的工作负担及提高工作效率,与此同时也提高了校园的文化氛围,更加激发学生的学习兴趣。基于B/S模式的信息管理系统是现阶段研究开发的一个热点。它是建立在国际互联网上的应用系统,客户端的配置极为简单,使使用者不受地域的局限。一个完备的志愿者信息管理系统可以使学生在任一台接入校园网或Internet的计算机上,浏览志愿者社团信息,查看社团组织的各种活动,这将大大的激发学生的兴趣,使在校大学生能力、个性得以全面的培养。为了适应新形势的发展,本文进行了这一系统的初步设计工作,做了一个初步的探索,希望它能够在各类高校中发挥高效、便捷的作用,达到简化管理面向学生的目的。[4]2.2技术可行性分析目前,网络应用软件运行的模式主要有二类:Client/server模式,Browser/Web模式。前者的缺点是维护、升级较麻烦,后者是近几年伴随Internet迅速发展起来的一种技术,它与客户/服务器方式类似,客户端是一个标准的浏览器,服务器端是WebServer,而WebServer与数据库和应用服务器的紧密结合,使得这种模式的应用范围不断扩大,它已不仅仅用于网上查询,有很多部门的业务系统、企业的MIS系统纷纷采用这种模式,它的主要优点是便于扩充应用、升级维护简便。[5]Access功能强大,使用方便,是开发桌面数据库的最优秀的工具之一。Access本身具有强大的向导机制,能提供大量的数据库常用操作。如果能适当的加上少量代码,那么程序将是专业级的。这一切都靠VBA。

package com.yjy.zdemo.controller;import com.yjy.zdemo._common.core.controller.BaseController;
import com.yjy.zdemo._common.core.page.TableDataInfo;
import com.yjy.zdemo._common.core.pojo.AjaxResult;
import com.yjy.zdemo._common.core.pojo.ZTree;
import com.yjy.zdemo._common.exceptions.BusinessException;
import com.yjy.zdemo._framework.config.Global;
import com.yjy.zdemo._framework.shiro.utils.ShiroUtils;
import com.yjy.zdemo.pojo.*;
import com.yjy.zdemo.service.*;
import com.yjy.zdemo.utils.ExcelUtils;
import com.yjy.zdemo.utils.Files.FileUploadUtils;
import com.yjy.zdemo.utils.PhoneSmsUtils;
import com.yjy.zdemo.utils.Security.PassSetUtils;
import com.yjy.zdemo.utils.StrUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.session.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;import java.io.IOException;
import java.util.List;/*** 组织信息管理 控制层* Create By YuJiaYe on 2022/12/18*/
@Controller
@RequestMapping("/dept")
public class DeptController extends BaseController {private static final Logger log = LoggerFactory.getLogger(DeptController.class);// 自定义路径private String prefix = "system/dept";// 自定义前台路径private String prefixFront = "system/webFrontEnd";//自动注入@Autowiredprivate DeptService deptService;@Autowiredprivate DeptCategoryService deptCategoryService;@Autowiredprivate UserService userService;@Autowiredprivate DeptServiceObjectService deptServiceObjectService;@Autowiredprivate DeptApplicationService deptApplicationService;/*** 根据当前访问角色获取组织信息* @return*/private Dept getDeptInfoByUserRole(){Dept dept = null;// 获取当前点击的角色Session session = ShiroUtils.getMySession();List<Role> roles = this.userService.findUserInfoById(ShiroUtils.getUserId()).getRoles();for (Role role : roles){if (role.getRoleKey().equals("manager")){// 组织管理者直接获取dept = (Dept) session.getAttribute("info");} else if (role.getRoleKey().equals("operators")){// 组织运营者需要查本组织信息Volunteer volunteer = (Volunteer) session.getAttribute("info");dept = deptService.findDeptById(volunteer.getDeptId());}}return dept;}/*** 组织管理的主页面(系统管理员界面)* @return*/@RequiresPermissions("sys:dept:view")@GetMapping("/deptList")public String dept(ModelMap mMap){List<DeptCategory> deptCategories = deptCategoryService.findDeptCgAll();mMap.put("deptCategory", deptCategories);return prefix + "/dept";}@RequiresPermissions("sys:dept:list")@PostMapping("/list")@ResponseBodypublic List<Dept> list(Dept dept){List<Dept> deptList = deptService.findDeptList(dept);return deptList;}/*** 组织列表及关系展示(志愿者前台)* @return*/@PostMapping("/frontList") // 列表展示@ResponseBodypublic TableDataInfo frontList(Dept dept){startPage();List<Dept> deptList = deptService.findDeptList(dept);return getDataTable(deptList);}@PostMapping("/frontTreeList") // 树型关系展示@ResponseBodypublic List<Dept> frontTreeList(Dept dept){List<Dept> deptList = deptService.findDeptList(dept);return deptList;}/*** 子组织管理的组页面(组织管理者)* @param mMap* @return*/
//    @RequiresPermissions("sys:dept:view")@GetMapping("/deptChildList")public String deptChild(ModelMap mMap){// 根据当前访问角色获取组织信息Dept deptParent = getDeptInfoByUserRole();List<DeptCategory> deptCategories = deptCategoryService.findDeptCgAll();mMap.put("deptCategory", deptCategories);mMap.put("dept", deptParent);return prefix + "/child/deptChild";}
//    @RequiresPermissions("sys:dept:list")@PostMapping("/childList")@ResponseBodypublic TableDataInfo childList(Dept dept){startPage();List<Dept> deptList = deptService.findDeptList(dept);return getDataTable(deptList);}/*** 组织信息页面* @param mMap* @return*/@RequiresPermissions("sys:dept:info")// 具备 “组织管理者” 或 “组织运营者” 的角色才能访问@RequiresRoles(value = {"manager","operators"},logical = Logical.OR)@GetMapping("/deptInfo")public String deptInfo(ModelMap mMap){// 根据当前访问角色获取组织信息Dept dept = getDeptInfoByUserRole();mMap.put("info", dept);List<DeptCategory> deptCategories = deptCategoryService.findDeptCgAll();mMap.put("deptCategory", deptCategories);List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectsByDeptId(dept.getDeptId());mMap.put("deptServiceObjects", deptServiceObjects);return prefix + "/info";}/*** 查看某个组织的信息* @param deptId 组织ID* @param mMap* @return*/@GetMapping("/view/{deptId}")public String deptView(@PathVariable("deptId") Integer deptId, ModelMap mMap){Dept dept = deptService.findDeptById(deptId);
//        if (StrUtils.isNotNull(dept) && deptId == 1){
//            dept.setParentName("无");
//        } if (StrUtils.isNull(dept.getParentId())){
//            dept.setParentName("暂无");
//        } if (StrUtils.isNull(dept.getDeptCategory())){
//            dept.setDeptCgname("暂无类别");
//        }List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectsByDeptId(dept.getDeptId());mMap.put("deptServiceObjects", deptServiceObjects);mMap.put("dept", dept);return prefix + "/view";}/*** 查看某个审核组织的信息(组织申请时查看)* @param deptId* @param mMap* @return*/@GetMapping("/baseView/{deptId}")public String deptBaseView(@PathVariable("deptId") Integer deptId, ModelMap mMap){Dept dept = deptService.findDeptById(deptId);
//        if (StrUtils.isNotNull(dept) && deptId == 1){
//            dept.setParentName("无");
//        } if (StrUtils.isNull(dept.getParentId())){
//            dept.setParentName("暂无");
//        } if (StrUtils.isNull(dept.getDeptCategory())){
//            dept.setDeptCgname("暂无类别");
//        }List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectsByDeptId(dept.getDeptId());mMap.put("deptServiceObjects", deptServiceObjects);mMap.put("dept", dept);return prefix + "/viewAudit";}/*** 跳转到修改LOGO页面* @param mMap* @return*/@GetMapping("/avatar")public String avatar(ModelMap mMap){Session session = ShiroUtils.getMySession();mMap.put("info", session.getAttribute("info"));return prefix + "/avatar";}/*** 保存LOGO* @param file LOGO路径* @return*/@PostMapping("/profile/updateAvatar")@ResponseBodypublic AjaxResult updateAvatar(@RequestParam("avatarFile") MultipartFile file){Session session = ShiroUtils.getMySession();Dept currentDept = (Dept) session.getAttribute("info");try {if (!file.isEmpty()){String avatar = FileUploadUtils.upload(Global.getAvatarPath(), file);currentDept.setAvatar(avatar);if (deptService.updateDept(currentDept) > 0){session.setAttribute("info",deptService.findDeptById(currentDept.getDeptId()));return success();}}return error();} catch (Exception e){log.error("修改LOGO失败!", e);return error(e.getMessage());}}/*** 组织添加页面跳转(管理员)* @param mMap* @return*/@GetMapping("/add/{parentId}")public String deptAdd(@PathVariable("parentId") Integer parentId, ModelMap mMap){List<DeptCategory> deptCategories = deptCategoryService.findDeptCgAll();List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectAll();Dept dept = deptService.findDeptById(parentId);mMap.put("deptCategory", deptCategories);mMap.put("deptServiceObjects", deptServiceObjects);mMap.put("dept", dept);return prefix + "/add";}/*** 组织添加页面跳转初始(管理员)* @param mMap* @return*/@GetMapping("/add")public String deptAdds(ModelMap mMap){List<DeptCategory> deptCategories = deptCategoryService.findDeptCgAll();List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectAll();Dept dept = deptService.findDeptById(1);mMap.put("deptCategory", deptCategories);mMap.put("deptServiceObjects", deptServiceObjects);mMap.put("dept", dept);return prefix + "/add";}/*** 组织添加(管理员)* @param dept 组织信息* @return*/@RequiresPermissions("sys:dept:add")@PostMapping("/addSave")@ResponseBodypublic AjaxResult deptAdd(@Validated Dept dept,@Validated DeptManager deptManager, @Validated User user,@RequestParam("userPassword") String userPassword){// 生成用户随机盐String salt = ShiroUtils.randomSalt();user.setSalt(salt);// 用户密码加密user.setUserPassword(PassSetUtils.passSet(userPassword,salt));System.out.println("获取:"+dept);System.out.println("获取:"+deptManager);System.out.println("获取:"+user);// 用户信息放入组织表dept.setUser(user);// 组织管理者信息放入组织表dept.setDeptManager(deptManager);// 系统管理员添加的组织默认申请状态为“1.已通过”dept.setApplicationStatus("1");// 组织新增标志为“0.增加”return toAjax(deptService.addDept(dept,"0"));}/*** 组织获取文件路径方法* @param dept 组织信息* @param idFile 组织管理者身份证文件图片* @param recFile 组织备案文件图片*/public void deptFilePathMethod(Dept dept, DeptManager deptManager, MultipartFile idFile, MultipartFile recFile) throws IOException {// 如果有上传身份证照片if (StrUtils.isNotNull(idFile) && !idFile.isEmpty()){// 注意存储路径(身份证路径)String deptMidphoto = FileUploadUtils.upload(Global.getIdCardAvatarPath(), idFile);deptManager.setDeptMidphoto(deptMidphoto);}// 如果有上传备案证书登记if (StrUtils.isNotNull(recFile) && !recFile.isEmpty()){// 注意存储路径(备案扫件路径)String deptRecordphoto = FileUploadUtils.upload(Global.getRecordPath(), recFile);dept.setDeptRecordphoto(deptRecordphoto);}}/*** 组织注册(游客)* @param mMap* @return*/@GetMapping("/deptReg")public String deptReg(ModelMap mMap){List<DeptCategory> deptCategories = deptCategoryService.findDeptCgAll();List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectAll();
//        Dept parentDept = deptService.findDeptById(1);mMap.put("deptCategory", deptCategories);mMap.put("deptServiceObjects", deptServiceObjects);
//        mMap.put("parentDept", parentDept);return prefix + "/toReg";}/*** 组织注册* @param dept 组织信息* @param deptManager 组织管理者信息* @param user 用户信息* @param idFile 组织管理者身份证文件图片* @param recFile 组织备案文件图片* @return*/@PostMapping("/regInfo")@ResponseBodypublic AjaxResult regDept(@Validated Dept dept,@Validated DeptManager deptManager,@Validated User user,@RequestParam(required = false, value = "deptMidphotoFile") MultipartFile idFile,@RequestParam(required = false, value = "deptRecordphotoFile") MultipartFile recFile){// 生成用户随机盐String salt = ShiroUtils.randomSalt();user.setSalt(salt);// 用户密码加密user.setUserPassword(PassSetUtils.passSet(user.getUserPassword(),salt));System.out.println("..获取:"+dept);System.out.println("..获取:"+deptManager);System.out.println("..获取:"+user);System.out.println("..获取:"+idFile);System.out.println("..获取:"+recFile);try {// 组织获取文件路径方法deptFilePathMethod(dept, deptManager, idFile, recFile);// 用户信息放入组织表dept.setUser(user);// 组织管理者信息放入组织表dept.setDeptManager(deptManager);// 组织默认申请状态为“0.待通过”dept.setApplicationStatus("0");// 获取组织父IDint parentId = dept.getParentId();// 组织新增标志为“0.注册”,返回的是注册成功以后的组织IDint result = deptService.addDept(dept,"1");if (result > 0){// 如果注册成功就生成一条申请组织归属记录DeptApplication deptApplication = new DeptApplication();deptApplication.setDeptId(result);// 组织deptApplication.setParentId(parentId);// 归属组织deptApplication.setRemark(dept.getDeptName() + "注册归属申请");System.out.println("获取申请: " + deptApplication);int deptAppResult = deptApplicationService.addDeptApplication(deptApplication);if (deptAppResult > 0){return success("组织 '"+dept.getDeptName()+"' 注册成功,等待归属组织审核");}return error("组织归属申请失败...");}} catch (Exception e){return error(e.getMessage());}return error("系统错误...");}/*** 组织修改页面跳转* @param deptId 组织ID* @param mMap* @return*/@GetMapping("/edit/{deptId}")public String deptEdit(@PathVariable("deptId") Integer deptId, ModelMap mMap){Dept dept = deptService.findDeptById(deptId);List<DeptCategory> deptCategories = deptCategoryService.findDeptCgAll();List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectsByDeptId(dept.getDeptId());if (StrUtils.isNotNull(dept) && deptId == 1){dept.setParentName("无");}mMap.put("dept", dept);mMap.put("deptCategory", deptCategories);mMap.put("deptServiceObjects", deptServiceObjects);return prefix + "/edit";}/*** 修改组织信息(管理员)* @param dept 组织信息* @return*/@RequiresPermissions("sys:dept:edit")@PostMapping("/edit")@ResponseBodypublic AjaxResult deptEdit(@Validated Dept dept){// 判断组织规范方法if ("1".equals(deptService.checkDeptNameUnique(dept))){return error("组织名称'" + dept.getDeptName() + "'已存在,修改失败");}if (StrUtils.isNotNull(dept.getParentId()) && dept.getParentId().equals(dept.getDeptId())){return error("上级部门不能是'" + dept.getDeptName() + "'(自己),修改失败");}return toAjax(deptService.updateDept(dept));}/*** 组织信息修改方法(组织管理者)* @param dept 组织信息* @return*/private AjaxResult deptUpdateMethod(Dept dept){Session session = ShiroUtils.getMySession();// 判断组织规范方法if ("1".equals(deptService.checkDeptNameUnique(dept))){return error("组织名称'" + dept.getDeptName() + "'已存在,修改失败");} if (StrUtils.isNotNull(dept.getParentId()) && dept.getParentId().equals(dept.getDeptId())){return error("上级部门不能是'" + dept.getDeptName() + "'(自己),修改失败");}if (deptService.updateDept(dept) > 0){//更新用户信息ShiroUtils.setUser(userService.findUserById(dept.getUser().getUserId()));//更新组织信息session.setAttribute("info",deptService.findDeptById(dept.getDeptId()));return success();}return error();}/*** 修改组织信息(组织管理者)* @param dept 组织信息* @return*/@RequiresPermissions("sys:dept:edit")@PostMapping("/editInfo")@ResponseBodypublic AjaxResult deptUpdate(@Validated Dept dept,@Validated DeptManager deptManager,@Validated User user,@RequestParam(required = false, value = "deptMidphotoFile") MultipartFile idFile,@RequestParam(required = false, value = "deptRecordphotoFile") MultipartFile recFile){System.out.println("..获取:"+dept);System.out.println("..获取:"+deptManager);System.out.println("..获取:"+user);System.out.println("..获取:"+idFile);System.out.println("..获取:"+recFile);
//        Session session = ShiroUtils.getMySession();try {// 组织获取文件路径方法deptFilePathMethod(dept, deptManager, idFile, recFile);User newUser = ShiroUtils.getUser();if (StrUtils.isNotNull(user)){newUser.setUserLogname(user.getUserLogname());newUser.setRemark(user.getRemark());}dept.setUser(newUser);dept.setDeptManager(deptManager);// 组织信息修改方法return deptUpdateMethod(dept);} catch (Exception e){return error(e.getMessage());}}/*** 组织状态修改页面(组织管理者)* 用于子组织的管理* @param deptId 组织ID* @return*/@GetMapping("/deptStatusChange/{deptId}")public String deptStatusEdit(@PathVariable("deptId") Integer deptId, ModelMap mMap){// 获取组织信息Dept deptInfo = deptService.findDeptById(deptId);deptInfo.getUser().setStatus((deptInfo.getUser().getStatus().equals("0")) ? "1" : "0");// 获取父组织信息Dept parentInfo = getDeptInfoByUserRole();mMap.put("dept", deptInfo);mMap.put("parent", parentInfo);return prefix + "/child/statusChanger";}/*** 组织状态修改(组织管理者)* 修改成功后还需要发送信息(邮箱)* @param dept 组织信息* @param statusRemark 原因* @return*/@RequiresPermissions("sys:dept:edit")@PostMapping("/deptStatusChange")@ResponseBodypublic AjaxResult editDeptStatus(@Validated Dept dept,@Validated DeptManager deptManager,@Validated User user,@RequestParam(required = false, value = "sendName") String sendName,@RequestParam(required = false, value = "statusRemark") String statusRemark){System.out.println("..获取:"+dept);System.out.println("..获取:"+deptManager);System.out.println("..获取:"+user);System.out.println("..获取:"+sendName);System.out.println("..获取:"+statusRemark);try {int result = userService.changeStatus(user);if (result > 0){// 发送手机短信提醒String statusTip;if(user.getStatus().equals("0")){// 启用志愿者statusTip = "已被启用";} else {// 停用志愿者statusTip = "已被停用";}String info = "您的组织因" + statusRemark + ",为此,您的'"+ dept.getDeptName() +"'组织账号'" + statusTip +"',如有疑问请联系组织管理者,谢谢。";// 手机号,发送人,接收人,发送内容String sendResult = sendSMS(deptManager.getDeptMphone(), sendName, deptManager.getName(), info);if (sendResult.equals("0")){return success("操作成功,将操作结果发送给组织管理者...");}return success("操作成功,但短信发送失败,请另行通知该组织管理者...");}} catch (Exception e) {return error(e.getMessage());}return error();}/*** 子组织移除页面跳转(组织管理者)* @param deptId 组织ID* @return*/@GetMapping("/deleteDeptParent/{deptId}")public String deleteDeptParent(@PathVariable("deptId") Integer deptId, ModelMap mMap){// 获取组织信息Dept deptInfo = deptService.findDeptById(deptId);// 获取父组织信息Dept parentInfo = getDeptInfoByUserRole();mMap.put("dept", deptInfo);mMap.put("parent", parentInfo);return prefix + "/child/deleteDeptChild";}/*** 移除子组织(组织管理者)* 移除成功后还需要发送信息(邮箱)* @param dept 组织信息* @param deleteRemark 原因* @return*/@RequiresPermissions("sys:dept:edit")@PostMapping("/deleteDeptParent")@ResponseBodypublic AjaxResult deptParentDelete(@Validated Dept dept,@Validated DeptManager deptManager,@Validated User user,@RequestParam(required = false, value = "sendName") String sendName,@RequestParam(required = false, value = "deleteRemark") String deleteRemark){System.out.println("..获取:"+dept);System.out.println("..获取:"+user);System.out.println("..获取:"+deptManager);System.out.println("..获取:"+sendName);System.out.println("..获取:"+deleteRemark);try {int result = 0;// 如果该组织处于“停用”状态,先将其恢复“正常”状态,再删除if (StrUtils.isNotNull(user.getStatus()) && !user.getStatus().equals("0")){user.setStatus("0");result = userService.changeStatus(user);if (result <= 0) {return error();}}if (deptService.findDeptCount(dept.getDeptId()) > 0){return AjaxResult.warn("该组织存在下级组织, 暂不能移除");} else {result = deptService.deleteDeptChild(dept.getDeptId());if (result > 0){// 发送手机短信提醒String info = "您的组织'"+ dept.getDeptName() +"'因" + deleteRemark + ",为此,您的组织已被踢除出'" + dept.getParentName() +"',如有疑问请联系组织管理者,谢谢。";// 手机号,发送人,接收人,发送内容String sendResult = sendSMS(deptManager.getDeptMphone(), sendName, deptManager.getName(), info);if (sendResult.equals("0")){return success("操作成功,将操作结果发送给组织管理者...");}return success("操作成功,但短信发送失败,请另行通知该组织管理者...");}}} catch (Exception e) {return error(e.getMessage());}return error();}//    /**
//     * 修改组织管理者身份证照片(组织管理者)
//     * @param idFile 组织管理者照片
//     * @param deptManager 组织管理者信息
//     * @param dept 组织信息
//     * @return
//     */
//    @RequiresPermissions("sys:dept:edit")
//    @PostMapping("/editManagerInfo")
//    @ResponseBody
//    public AjaxResult deptMPhotoUpdate(@RequestParam("deptMidphotoFile") MultipartFile idFile,
//                                        DeptManager deptManager, Dept dept){
//        try {
//            if (!idFile.isEmpty()){
//                // 注意路径
//                String deptMidphoto = FileUploadUtils.upload(Global.getIdCardAvatarPath(), idFile);
//                deptManager.setDeptMidphoto(deptMidphoto);
//                dept.setUser(ShiroUtils.getUser());
//                dept.setDeptManager(deptManager);
//                // 组织信息修改方法
//                return deptUpdateMethod(dept);
//            }
//        } catch (Exception e){
//            return error(e.getMessage());
//        }
//        return error();
//    }//    /**
//     * 修改组织备案照片(组织管理者)
//     * @param recFile 组织备案图片
//     * @param deptManager 组织管理者信息
//     * @param dept 组织信息
//     * @return
//     */
//    @RequiresPermissions("sys:dept:edit")
//    @PostMapping("/editRecordInfo")
//    @ResponseBody
//    public AjaxResult deptRecPhotoUpdate(@RequestParam("deptRecordphotoFile") MultipartFile recFile,
//                                       DeptManager deptManager, Dept dept){
//        try {
//            if (!recFile.isEmpty()){
//                // 注意路径
//                String deptRecordphoto = FileUploadUtils.upload(Global.getRecordPath(), recFile);
//                dept.setDeptRecordphoto(deptRecordphoto);
//                dept.setUser(ShiroUtils.getUser());
//                dept.setDeptManager(deptManager);
//                // 组织信息修改方法
//                return deptUpdateMethod(dept);
//            }
//        } catch (Exception e){
//            return error(e.getMessage());
//        }
//        return error();
//    }/*** 删除组织* @param deptId 组织ID* @return*/@RequiresPermissions("sys:dept:edit")@GetMapping("/delete/{deptId}")@ResponseBodypublic AjaxResult deleteDept(@PathVariable("deptId") Integer deptId){System.out.println("..获取ID: " + deptId);if (deptService.findDeptCount(deptId) > 0){return AjaxResult.warn("存在下级组织,不允许删除");} if (deptService.checkDeptExistVolunteer(deptId)){return AjaxResult.warn("组织存在志愿者,不允许删除");}return toAjax(deptService.deleteDeptById(deptId));}/*** 组织状态修改* @param user 组织用于信息* @return*/@PostMapping("/changeStatus")@ResponseBodypublic AjaxResult changStatus(User user){System.out.println("..获取:"+user);try {int result = userService.changeStatus(user);if (result > 0){return success();}return error();} catch (BusinessException e) {return error(e.getMessage());}}/*** 获取某个组织的信息(志愿者前台)* @param mMap* @return*/@GetMapping("/viewInfo")public String deptViewInfo(ModelMap mMap){Session session = ShiroUtils.getMySession();// 获取组织信息Volunteer volunteer = (Volunteer) session.getAttribute("info");Dept dept = deptService.findDeptById(volunteer.getDeptId());// 获取组织服务对象信息List<DeptServiceObject> deptServiceObjects = deptServiceObjectService.findDeptServiceObjectsByDeptId(dept.getDeptId());mMap.put("info", volunteer);mMap.put("roleGroup", session.getAttribute("role"));mMap.put("dept", dept);mMap.put("deptServiceObjects", deptServiceObjects);// 跳转至前台页面return prefixFront + "/dept/deptInfo";}/*** 获取某个组织的信息(志愿者前台)* 从组织列表里获取* @param deptId 组织ID* @param mMap* @return*/@GetMapping("/frontView/{deptId}")public String frontDeptViewInfo(@PathVariable("deptId") Integer deptId, ModelMap mMap){Dept dept = deptService.findDeptById(deptId);mMap.put("dept", dept);// 跳转至前台页面return prefixFront + "/dept/frontView";}/*** 选择组织树* @param deptId 组织ID* @param mMap* @return*/@GetMapping("/findDeptTree/{deptId}")public String findDeptTree(@PathVariable("deptId") Integer deptId, ModelMap mMap){mMap.put("dept", deptService.findDeptById(deptId));return prefix + "/tree";}/*** 加载组织列表树* @return*/@GetMapping("/treeData")@ResponseBodypublic List<ZTree> treeData(){List<ZTree> zTrees = deptService.findDeptTree(new Dept());return zTrees;}/*** 加载组织下拉选择框信息* @return*/@GetMapping("/findDeptByMessage")@ResponseBodypublic List<Dept> findDeptListByMessage(){List<Dept> depts = deptService.findDeptList(new Dept());return depts;}/*** 导出组织信息* @param dept 组织信息* @return*/@PostMapping("/export")@ResponseBodypublic AjaxResult export(Dept dept){System.out.println("导出条件: " + dept);List<Dept> list = deptService.findDeptList(dept);ExcelUtils<Dept> deptUtil = new ExcelUtils<Dept>(Dept.class);String exportName = "所有"; // 默认if (StrUtils.isNotNull(dept.getParentId())){Dept deptInfo = deptService.findDeptById(dept.getParentId());exportName = deptInfo.getDeptName() + "的下属";}return deptUtil.exportExcel(list, exportName + "组织信息");}/*** 校验组织名称* @param dept 组织信息* @return*/@PostMapping("/checkDeptNameUnique")@ResponseBodypublic String checkDeptNameUnique(Dept dept){return deptService.checkDeptNameUnique(dept);}/*** 校验用户账号唯一性* @param user 用户信息* @return*/@PostMapping("/checkLoginNameUnique")@ResponseBodypublic String checkLoginNameUnique(User user){return userService.checkLoginNameUnique(user);}/*** 校验组织电话* @param dept 组织信息* @return*/@PostMapping("/checkDeptPhoneUnique")@ResponseBodypublic String checkDeptPhoneUnique(Dept dept){return deptService.checkDeptPhoneUnique(dept);}/*** 校验组织邮箱* @param dept 组织信息* @return*/@PostMapping("/checkDeptEmailUnique")@ResponseBodypublic String checkDeptEmailUnique(Dept dept){return deptService.checkDeptEmailUnique(dept);}/*** 短信发送方法* @param telPhone 接收方手机号* @param sendName 接收人* @param receiveName 发送人* @param message 内容* @return*/private String sendSMS(String telPhone,String sendName, String receiveName,String message){return PhoneSmsUtils.smsPhone(telPhone, sendName, receiveName, message);}}

package com.yjy.zdemo.controller;import com.yjy.zdemo._common.core.controller.BaseController;
import com.yjy.zdemo._common.core.page.TableDataInfo;
import com.yjy.zdemo._common.core.pojo.AjaxResult;
import com.yjy.zdemo._common.core.text.Convert;
import com.yjy.zdemo._framework.shiro.utils.ShiroUtils;
import com.yjy.zdemo.pojo.Activity;
import com.yjy.zdemo.pojo.ActivityRegAudit;
import com.yjy.zdemo.pojo.ActivityType;
import com.yjy.zdemo.pojo.Volunteer;
import com.yjy.zdemo.service.*;
import com.yjy.zdemo.utils.PhoneSmsUtils;
import com.yjy.zdemo.utils.StrUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;import java.util.List;/*** 活动报名管理 控制层* Create By YuJiaYe on /2/16*/
@Controller
@RequestMapping("/activityReg")
public class ActivityRegAuditController extends BaseController {// 默认访问路径private String prefix = "system/activity/reg";// 自定义前台路径private String prefixFront = "system/webFrontEnd";// 自动注入@Autowiredprivate ActivityRegAuditService activityRegAuditService;@Autowiredprivate ActivityService activityService;@Autowiredprivate ActivityTypeService activityTypeService;@Autowiredprivate VolunteerService volunteerService;@Autowiredprivate ActivityRecordService activityRecordService;/*** 可以报名的活动页面跳转(组织管理者、组织运营者)* @param mMap* @return*/@GetMapping("/activityRegList")public String activityRegList(ModelMap mMap){// 活动类型List<ActivityType> activityTypes = activityTypeService.findActivityTypeAll();// 主要用于获取组织ID信息mMap.put("info", ShiroUtils.getMySession().getAttribute("info"));mMap.put("activityTypes", activityTypes);return prefix + "/regActivityAudit";}@PostMapping("/actRegList")@ResponseBodypublic TableDataInfo actRegList(Activity activity){// 根据自及组织ID查询startPage();List<Activity> activityList = activityService.findActivityList(activity);// 获取该活动相关报名人数以及录用人数方法for (Activity info : activityList){activityService.getCountForActivity(info);}return getDataTable(activityList);}/*** 添加活动报名申请审核表* @param activityRegAudit 申请审核信息* @return*/@PostMapping("/addActivityReg")@ResponseBodyprivate AjaxResult addActivityReg(@Validated ActivityRegAudit activityRegAudit,@RequestParam(required = false,value = "actDeptId") String actDeptId,@RequestParam(required = false,value = "volDeptId") String volDeptId,@RequestParam(required = false,value = "activitySignlimit") String activitySignlimit,@RequestParam(required = false,value = "volAge") String volAge,@RequestParam(required = false,value = "activityAgelimit") String activityAgelimit,@RequestParam(required = false,value = "volRegFlag") String volRegFlag,@RequestParam(required = false,value = "exeStatus") String exeStatus){System.out.println("活动状态: " + exeStatus);System.out.println("报名状态: " + volRegFlag);if (!exeStatus.equals("1")){return error("非常抱歉,该活动报名时间已过.");}if (volDeptId.equals("1") || StrUtils.isNull(volDeptId)){return error("非常抱歉,您还未有归属组织,暂不能参加活动哦.");} else {// 报名限制为只允许本组织志愿者报名if (activitySignlimit.equals("1") && !actDeptId.equals(volDeptId)){return error("非常抱歉,该活动仅限发布组织下的志愿者报名,感谢您的热心.");}}if (activityAgelimit.equals("1") && Integer.parseInt(volAge) < 16){return error("非常抱歉,该活动仅限16周岁及以上的志愿者报名,感谢您的热心.");}if (volRegFlag.equals("1")){return error("您已提交过该活动申请了,请耐心等待审核哦.");}if (volRegFlag.equals("2")){return error("您已成功报名该活动了,不能重复报名哦.");}// 如果判断都通过,则生成一则活动申请int result = activityRegAuditService.addActivityRegAudit(activityRegAudit);if (result > 0){return success("报名成功!请等待发布组织审核录用.");}return error("系统错误.");}/*** 志愿者查询自身的活动报名记录(志愿者前台)* @param activityRegAudit 活动报名信息* @return*/@PostMapping("/actReg/frontVolAuditList")@ResponseBodypublic TableDataInfo frontVolAuditList(ActivityRegAudit activityRegAudit){startPage();List<ActivityRegAudit> activityRegAudits = activityRegAuditService.findActivityRegAuditList(activityRegAudit);return getDataTable(activityRegAudits);}/*** 活动报名待审核页面跳转* @param activityId 活动ID* @param mMap* @return*/@GetMapping("/actReg/actVolUnAudit/{activityId}")public String actVolUnAudit(@PathVariable("activityId") Integer activityId, ModelMap mMap){Activity activity = activityService.findActivityById(activityId);// 获取该活动相关报名人数以及录用人数方法activityService.getCountForActivity(activity);mMap.put("activity", activity);return prefix + "/regActVol";}/*** 查询待审核的志愿者活动报名信息* @param activityRegAudit 活动报名信息* @return*/@PostMapping("/actReg/actVolUnAuditList")@ResponseBodypublic TableDataInfo actVolUnAuditList(ActivityRegAudit activityRegAudit){startPage();List<ActivityRegAudit> activityRegAudits = activityRegAuditService.findActivityRegAuditList(activityRegAudit);return getDataTable(activityRegAudits);}/*** 活动审核报名记录页面跳转* @param activityId 活动ID* @param mMap* @return*/@GetMapping("/actReg/actVolAudit/{activityId}")public String actVolAudit(@PathVariable("activityId") Integer activityId, ModelMap mMap){Activity activity = activityService.findActivityById(activityId);// 获取该活动相关报名人数以及录用人数方法activityService.getCountForActivity(activity);mMap.put("activity", activity);return prefix + "/regActVols";}/*** 查询已审核的志愿者活动报名信息* @param activityRegAudit 活动报名信息* @return*/@PostMapping("/actReg/actVolAuditList")@ResponseBodypublic TableDataInfo actVolAuditList(ActivityRegAudit activityRegAudit){startPage();List<ActivityRegAudit> activityRegAudits = activityRegAuditService.findAllAuditList(activityRegAudit);return getDataTable(activityRegAudits);}/*** 查看审核记录(组织管理者、组织运营者)* @param araId 报名申请审核表ID* @param mMap* @return*/@GetMapping("/actReg/view/{araId}")public String actVolRegAuditView(@PathVariable("araId") Integer araId, ModelMap mMap){// 获取报名审核信息ActivityRegAudit activityRegAudit = activityRegAuditService.findActivityRegAuditById(araId);// 获取报名志愿者信息Volunteer volunteer = volunteerService.findVolunteerById(activityRegAudit.getVolId());// 根据志愿者ID查询志愿者的正常参加的活动记录activityRecordService.findActivityRecordByVol(volunteer);mMap.put("ara", activityRegAudit);mMap.put("volunteer", volunteer);return prefix + "/regVolAuditView";}/*** 查看审核记录(志愿者前台)* @param araId 报名申请审核表ID* @param mMap* @return*/@GetMapping("/frontActReg/view/{araId}")public String frontActVolRegAuditView(@PathVariable("araId") Integer araId, ModelMap mMap){// 获取报名审核信息ActivityRegAudit activityRegAudit = activityRegAuditService.findActivityRegAuditById(araId);mMap.put("ara", activityRegAudit);return prefixFront + "/activity/frontRegAuditView";}/*** 志愿者活动报名审核页面跳转* @param araId 活动报名审核ID* @param mMap* @return*/@GetMapping("/actReg/edit/{araId}")public String actVolRegAuditEdit(@PathVariable("araId") Integer araId, ModelMap mMap){// 获取报名审核信息ActivityRegAudit activityRegAudit = activityRegAuditService.findActivityRegAuditById(araId);// 获取报名志愿者信息Volunteer volunteer = volunteerService.findVolunteerById(activityRegAudit.getVolId());// 根据志愿者ID查询志愿者的正常参加的活动记录activityRecordService.findActivityRecordByVol(volunteer);// 活动当前审核人信息mMap.put("info", ShiroUtils.getMySession().getAttribute("info"));mMap.put("ara", activityRegAudit);mMap.put("volunteer", volunteer);return prefix + "/regVolAudit";}/*** 志愿者活动报名审核* @param activityRegAudit 活动报名审核信息* @param activityName 活动名称* @param sendName 发送人名称* @param receiveName 接收人名称* @param volPhone 志愿者手机* @param volEmail 志愿者邮箱* @return*/
//    @RequiresPermissions("sys:activity:edit")@PostMapping("/actReg/edit")@ResponseBodypublic AjaxResult editActVolRegAudit(@Validated ActivityRegAudit activityRegAudit,@RequestParam(required = false, value = "activityName") String activityName,@RequestParam(required = false, value = "sendName") String sendName,@RequestParam(required = false, value = "receiveName") String receiveName,@RequestParam(required = false, value = "volPhone") String volPhone,@RequestParam(required = false, value = "volEmail") String volEmail){System.out.println("..获取:" + activityRegAudit);System.out.println("..获取:" + activityName);System.out.println("..获取:" + sendName);System.out.println("..获取:" + receiveName);System.out.println("..获取:" + volPhone);System.out.println("..获取:" + volEmail);// 修改信息int result = activityRegAuditService.updateActivityRegAudit(activityRegAudit);// 如果修改成功则发送短信if(result > 0){String appTip;// 审核通过if(activityRegAudit.getAuditFlag().equals("1")){appTip = "通过";} else {// 不通过appTip = "不通过";}String info = "您报名的' " + activityName + " '活动" + "的审核结果为:'" + appTip + "',请尽快登录寮步志愿者平台查看,谢谢。";// 手机号,发送人,接收人,发送内容String sendResult = sendSMS(volPhone, sendName, receiveName, info);if (sendResult.equals("0")){return success("审核成功,将审核信息发送给活动报名者...");}}return error("系统错误.");}/*** 批量修改活动报名审核操作* @param activityRegAudit 活动报名信息* @return*/@PostMapping("/actReg/editMore")@ResponseBodypublic AjaxResult editMoreActVolRegAudit(@Validated ActivityRegAudit activityRegAudit,@RequestParam(required = false, value = "ids") String ids,@RequestParam(required = false, value = "vIds") String vIds,@RequestParam(required = false, value = "vPhones") String vPhones,@RequestParam(required = false, value = "vNames") String vNames) throws Exception {// String[] 转型成 Integer[]// 获取审核ID数组Integer[] araIds = Convert.toIntArray(ids);// 获取志愿者ID数组(用于发送短信)Integer[] volIds = Convert.toIntArray(vIds);// 获取志愿者手机号数组(用于发送短信)String[] volPhones = Convert.toStrArray(vPhones);// 获取志愿者姓名数组(用于发送短信)String[] volNames = Convert.toStrArray(vNames);
//        System.out.println("获取: " + vIds);
//        System.out.println("获取: " + volIds);
//        System.out.println("获取: " + vPhones);
//        System.out.println("获取: " + vNames);// 放入报名审核信息activityRegAudit.setAraIds(araIds);activityRegAudit.setVolIds(volIds);// 获取当前审核人的userIdactivityRegAudit.setUserId(ShiroUtils.getUserId().intValue());// 判断审核结果补充相应的审核备注String auditFlag = activityRegAudit.getAuditFlag();// 审核通过if (auditFlag.equals("1")){activityRegAudit.setRemark("审核通过");} else {activityRegAudit.setRemark("审核不通过");}int result = activityRegAuditService.volRegAuditByIds(activityRegAudit);if (result > 0){return success("审核成功");}return error("系统错误.");}/*** 志愿者活动报名及记录相关信息表(志愿者前台)* @param mMap* @return*/@RequestMapping("/volAudRecList")public String volAudRecList(ModelMap mMap){mMap.put("info", ShiroUtils.getMySession().getAttribute("info"));mMap.put("roleGroup", ShiroUtils.getMySession().getAttribute("role"));// 活动类型集合List<ActivityType> activityTypes = activityTypeService.findActivityTypeAll();mMap.put("activityTypes", activityTypes);return prefixFront + "/activity/volAudRecList";}/*** 短信发送方法* @param telPhone 接收方手机号* @param sendName 接收人* @param receiveName 发送人* @param message 内容* @return*/private String sendSMS(String telPhone,String sendName, String receiveName,String message){return PhoneSmsUtils.smsPhone(telPhone, sendName, receiveName, message);}}

基于springboot志愿者管理平台相关推荐

  1. 基于php志愿者服务平台管理系统获取(php毕业设计)

    基于php志愿者服务平台管理系统 志愿者服务平台管理系统是基于php编程语言和mysql数据库设计,系统分为志愿者和管理员两个角色,其中志愿者可以注册和登陆平台,查看志愿活动,报名参加志愿活动,对志愿 ...

  2. Springboot毕设项目基于springboot大学生兼职平台3tf70(java+VUE+Mybatis+Maven+Mysql)

    Springboot毕设项目基于springboot大学生兼职平台3tf70(java+VUE+Mybatis+Maven+Mysql) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + ...

  3. 基于JAVA游泳馆管理平台计算机毕业设计源码+系统+数据库+lw文档+部署

    基于JAVA游泳馆管理平台计算机毕业设计源码+系统+数据库+lw文档+部署 基于JAVA游泳馆管理平台计算机毕业设计源码+系统+数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语言: ...

  4. (附源码)springboot酒店管理平台 毕业设计 201010

    springboot酒店管理平台 摘 要 信息化社会内需要与之针对性的信息获取途径,但是途径的扩展基本上为人们所努力的方向,由于站在的角度存在偏差,人们经常能够获得不同类型信息,这也是技术最为难以攻克 ...

  5. Jeecg-Boot 一款基于SpringBoot 快速开发平台

    Jeecg-Boot 一款基于SpringBoot 快速开发平台 Jeecg-Boot 是一款基于SpringBoot+代码生成器的快速开发平台!采用前后端分离架构:SpringBoot,Mybati ...

  6. 毕业设计-基于SpringBoot员工管理OA系统

    环境:开发工具:idea,数据库:MySQL5.7 jdk1.8 架构:SpringBoot,前端HTML 主要功能 管理员:员工管理.部门管理.职位管理.薪资管理.考勤管理.请假管理.奖惩管理.文件 ...

  7. 基于springboot信用分析管理系统设计与实现。

    项目描述 临近学期结束,还是毕业设计,你还在做java程序网络编程,期末作业,老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等.这里根据疫情当下,你 ...

  8. JeecgBoot 2.0.2 版本发布,基于SpringBoot快速开发平台

    项目介绍 Jeecg-Boot 是一款基于SpringBoot+代码生成器的快速开发平台!采用前后端分离架构:SpringBoot,Ant-Design-Vue,Mybatis,Shiro,JWT.强 ...

  9. 毕业季基于springboot的管理系统设计与实现怎么做如何选题

    毕业设计的选题,尤为重要,选好题目就不能修改了,要最终保证能在规定的时间里完成. 因为题目的选择是与设计的实现密不可分的,如果你所选择的题目你最终无法实现,这无疑会给你带来更大的困扰. 那么,怎么才能 ...

最新文章

  1. @所有技术社区,年度”社区之星“开选,快来盘点各家技术大佬
  2. 大哥你怕是没听过:头上没毛,代码不牢!
  3. ImageView宽度填满屏幕,高度自适应
  4. 机器学习入门资源不完全汇总
  5. ABAP memory中的Export和Import
  6. 【深度学习】人人都能看得懂的卷积神经网络——入门篇
  7. 微信支付宝 支付单文件操作
  8. C# 中的 ref 已经被放开,或许你已经不认识了
  9. 移动端开发——javascript
  10. react(88)--ant design控制inputNumber设置正整数
  11. MySQL操作权限整理
  12. Java中List的排序
  13. FreeModbus源码获取
  14. Android中软键盘弹出时关于布局的问题
  15. 所有受限制的应用程序包_您需要了解的有关Mac的Apple新款M1芯片的所有信息
  16. 蒙特卡洛粒子滤波定位算法_基于粒子滤波的TBD算法仿真—MATLAB仿真
  17. 蓝桥杯2011--2--歌赛新规则
  18. 我的世界服务器光影文件夹,我的世界光影怎么开?中国版介绍
  19. Ubuntu | ubuntu下安装edge
  20. Android:layout_weight详解

热门文章

  1. 使用NI PXI和LabVIEW实时模块有效简化硬件在环仿真系统
  2. esp32桌面天气代码
  3. 堡垒机-来自百度百科---感觉介绍不太对
  4. 深圳大学——大数据计算(一些选择题)
  5. matlab武汉加油,[00]数字图像处理-matlab速成
  6. 蓄电池分级分段维护方案
  7. 三相电动机用单相电源
  8. 如何利用悟空CRM实现售后服务派工单管理
  9. 基于Java Web的汽车公司的车辆管理系统
  10. 海康录像机RTSP回放流的格式