担心毕设技术栈太简单被批?《志愿者招募管理系统》用Python+Django+Vue让导师刮目相看

55 阅读5分钟

一、个人简介

💖💖作者:计算机编程果茶熊

💙💙个人简介:曾长期从事计算机专业培训教学,担任过编程老师,同时本人也热爱上课教学,擅长Java、微信小程序、Python、Golang、安卓Android等多个IT方向。会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我!

💛💛想说的话:感谢大家的关注与支持!

💕💕文末获取源码联系计算机编程果茶熊

二、系统介绍

开发语言:Java+Python

数据库:MySQL

系统架构:B/S

后端框架:SpringBoot(Spring+SpringMVC+Mybatis)+Django

前端:Vue+HTML+CSS+JavaScript+jQuery

《志愿者招募管理系统》是一款基于B/S架构设计的综合性管理平台,采用前后端分离的开发模式,前端使用Vue+ElementUI+HTML技术栈构建友好直观的用户界面,后端支持Java版(Spring Boot+Spring+SpringMVC+Mybatis)和Python版(Django)两种实现方案,底层采用MySQL数据库进行数据存储和管理。系统功能模块完善,包括志愿者管理、招募者管理、招募信息管理、报名信息管理、活动类型管理、志愿者活动管理、活动报名管理以及系统管理八大核心模块,实现了从志愿者注册、招募发布、活动管理到报名审核的全流程数字化管理。该系统有效解决了传统志愿服务管理中信息分散、沟通效率低、资源匹配度不高等问题,为志愿组织提供了一站式的招募与管理解决方案,同时为志愿者提供了便捷的活动查询与报名渠道,大大提升了志愿服务的组织效率和参与体验,是高校、社区、公益组织等进行志愿者资源管理的理想信息化工具。

三、志愿者招募管理系统-视频解说

担心毕设技术栈太简单被批?《志愿者招募管理系统》用Python+Django+Vue让导师刮目相看

四、志愿者招募管理系统-功能展示

1.后台管理员首页

2.后台管理员审批活动报名

3.后台招募者页面

4.后台系统登录

5.前台展示主页

6.前台个人信息管理

7.前台活动详情

8.前台志愿者活动信息

9.前台提交报名

五、志愿者招募管理系统-代码展示

// 核心功能1: 志愿者活动管理 - 创建新活动并发布
@Service
public class ActivityServiceImpl implements ActivityService {
    
    @Autowired
    private ActivityMapper activityMapper;
    
    @Autowired
    private ActivityTypeMapper activityTypeMapper;
    
    @Autowired
    private RecruiterMapper recruiterMapper;
    
    @Override
    @Transactional
    public ResponseResult createActivity(ActivityDTO activityDTO) {
        // 验证活动类型是否存在
        ActivityType activityType = activityTypeMapper.selectById(activityDTO.getTypeId());
        if (activityType == null) {
            return ResponseResult.error("活动类型不存在");
        }
        
        // 验证招募者是否存在且有权限
        Recruiter recruiter = recruiterMapper.selectById(activityDTO.getRecruiterId());
        if (recruiter == null || !recruiter.getStatus().equals(RecruiterStatus.APPROVED)) {
            return ResponseResult.error("招募者不存在或未获批准");
        }
        
        // 检查活动时间有效性
        if (activityDTO.getStartTime().before(new Date()) || 
            activityDTO.getEndTime().before(activityDTO.getStartTime())) {
            return ResponseResult.error("活动时间设置无效");
        }
        
        // 检查招募人数限制
        if (activityDTO.getMaxParticipants() <= 0 || activityDTO.getMinParticipants() <= 0 ||
            activityDTO.getMaxParticipants() < activityDTO.getMinParticipants()) {
            return ResponseResult.error("参与人数设置无效");
        }
        
        // 构建活动实体并保存
        Activity activity = new Activity();
        BeanUtils.copyProperties(activityDTO, activity);
        activity.setStatus(ActivityStatus.PENDING);
        activity.setCreateTime(new Date());
        activity.setCurrentParticipants(0);
        
        // 生成唯一活动编码
        String activityCode = generateActivityCode(activityDTO.getTypeId());
        activity.setActivityCode(activityCode);
        
        // 保存活动信息
        activityMapper.insert(activity);
        
        // 记录活动日志
        logActivityCreation(activity, recruiter);
        
        return ResponseResult.success(activity.getId());
    }
    
    // 生成唯一活动编码
    private String generateActivityCode(Long typeId) {
        String prefix = "ACT" + typeId;
        String dateStr = new SimpleDateFormat("yyyyMMdd").format(new Date());
        String randomStr = UUID.randomUUID().toString().substring(0, 4);
        return prefix + dateStr + randomStr;
    }
}

// 核心功能2: 报名信息管理 - 志愿者报名活动并处理
@Service
public class ApplicationServiceImpl implements ApplicationService {

    @Autowired
    private ApplicationMapper applicationMapper;
    
    @Autowired
    private ActivityMapper activityMapper;
    
    @Autowired
    private VolunteerMapper volunteerMapper;
    
    @Autowired
    private MessageService messageService;
    
    @Override
    @Transactional
    public ResponseResult applyForActivity(ApplicationDTO applicationDTO) {
        // 验证活动是否存在且状态正确
        Activity activity = activityMapper.selectById(applicationDTO.getActivityId());
        if (activity == null) {
            return ResponseResult.error("活动不存在");
        }
        
        if (!activity.getStatus().equals(ActivityStatus.RECRUITING)) {
            return ResponseResult.error("活动不在招募阶段");
        }
        
        // 检查活动是否已满
        if (activity.getCurrentParticipants() >= activity.getMaxParticipants()) {
            return ResponseResult.error("活动报名人数已满");
        }
        
        // 验证志愿者信息
        Volunteer volunteer = volunteerMapper.selectById(applicationDTO.getVolunteerId());
        if (volunteer == null || !volunteer.getStatus().equals(VolunteerStatus.ACTIVE)) {
            return ResponseResult.error("志愿者不存在或状态异常");
        }
        
        // 检查是否重复报名
        Application existingApplication = applicationMapper.findByVolunteerAndActivity(
            applicationDTO.getVolunteerId(), applicationDTO.getActivityId());
        if (existingApplication != null) {
            return ResponseResult.error("您已报名此活动");
        }
        
        // 检查志愿者是否满足活动要求
        if (!checkVolunteerQualification(volunteer, activity)) {
            return ResponseResult.error("不满足活动报名条件");
        }
        
        // 创建报名记录
        Application application = new Application();
        BeanUtils.copyProperties(applicationDTO, application);
        application.setStatus(ApplicationStatus.PENDING);
        application.setApplyTime(new Date());
        application.setScore(null);  // 初始评分为空
        
        // 保存报名信息
        applicationMapper.insert(application);
        
        // 发送报名通知
        messageService.sendApplicationNotification(application, volunteer, activity);
        
        return ResponseResult.success(application.getId());
    }
    
    // 检查志愿者是否满足活动要求
    private boolean checkVolunteerQualification(Volunteer volunteer, Activity activity) {
        // 检查年龄要求
        if (activity.getMinAge() != null && calculateAge(volunteer.getBirthday()) < activity.getMinAge()) {
            return false;
        }
        if (activity.getMaxAge() != null && calculateAge(volunteer.getBirthday()) > activity.getMaxAge()) {
            return false;
        }
        
        // 检查技能要求
        if (StringUtils.isNotBlank(activity.getRequiredSkills())) {
            String[] requiredSkills = activity.getRequiredSkills().split(",");
            String volunteerSkills = volunteer.getSkills();
            if (StringUtils.isBlank(volunteerSkills)) {
                return false;
            }
            
            for (String skill : requiredSkills) {
                if (!volunteerSkills.contains(skill.trim())) {
                    return false;
                }
            }
        }
        
        return true;
    }
}

// 核心功能3: 志愿者管理 - 志愿者信息审核与评分
@Service
public class VolunteerServiceImpl implements VolunteerService {

    @Autowired
    private VolunteerMapper volunteerMapper;
    
    @Autowired
    private ApplicationMapper applicationMapper;
    
    @Autowired
    private CreditService creditService;
    
    @Autowired
    private FileService fileService;
    
    @Override
    @Transactional
    public ResponseResult reviewVolunteer(Long volunteerId, ReviewDTO reviewDTO) {
        // 获取志愿者信息
        Volunteer volunteer = volunteerMapper.selectById(volunteerId);
        if (volunteer == null) {
            return ResponseResult.error("志愿者不存在");
        }
        
        // 检查当前状态是否可审核
        if (!volunteer.getStatus().equals(VolunteerStatus.PENDING)) {
            return ResponseResult.error("该志愿者状态不可审核");
        }
        
        // 验证审核人权限
        if (!checkReviewerPermission(reviewDTO.getReviewerId())) {
            return ResponseResult.error("无审核权限");
        }
        
        // 更新志愿者状态
        volunteer.setStatus(reviewDTO.isApproved() ? VolunteerStatus.ACTIVE : VolunteerStatus.REJECTED);
        volunteer.setReviewTime(new Date());
        volunteer.setReviewerId(reviewDTO.getReviewerId());
        volunteer.setReviewComments(reviewDTO.getComments());
        
        // 如果有证件照审核
        if (volunteer.getIdCardPhoto() != null) {
            boolean idCardValid = verifyIdCardPhoto(volunteer.getIdCardPhoto(), volunteer.getIdCard());
            if (!idCardValid && reviewDTO.isApproved()) {
                return ResponseResult.error("证件照验证失败");
            }
            volunteer.setIdCardVerified(reviewDTO.isApproved());
        }
        
        // 初始化志愿者信用分
        if (reviewDTO.isApproved()) {
            CreditRecord initialCredit = new CreditRecord();
            initialCredit.setVolunteerId(volunteerId);
            initialCredit.setScore(100); // 初始信用分
            initialCredit.setType(CreditType.INITIAL);
            initialCredit.setDescription("初始信用分");
            initialCredit.setCreateTime(new Date());
            creditService.addCreditRecord(initialCredit);
            
            // 更新志愿者信用分
            volunteer.setCreditScore(100);
        }
        
        // 保存志愿者信息
        volunteerMapper.updateById(volunteer);
        
        // 发送审核结果通知
        sendReviewNotification(volunteer, reviewDTO.isApproved(), reviewDTO.getComments());
        
        // 记录审核日志
        logVolunteerReview(volunteer, reviewDTO);
        
        return ResponseResult.success();
    }
    
    @Override
    public ResponseResult calculateVolunteerPerformance(Long volunteerId) {
        // 获取志愿者信息
        Volunteer volunteer = volunteerMapper.selectById(volunteerId);
        if (volunteer == null) {
            return ResponseResult.error("志愿者不存在");
        }
        
        // 获取志愿者参与的所有活动
        List<Application> applications = applicationMapper.findCompletedByVolunteerId(volunteerId);
        if (applications.isEmpty()) {
            return ResponseResult.success(new PerformanceVO(volunteerId, 0, 0, 0.0, "无活动记录"));
        }
        
        // 计算服务时长
        int totalHours = 0;
        int completedActivities = 0;
        double averageScore = 0.0;
        
        for (Application app : applications) {
            if (app.getStatus().equals(ApplicationStatus.COMPLETED)) {
                completedActivities++;
                totalHours += app.getServiceHours() != null ? app.getServiceHours() : 0;
                if (app.getScore() != null) {
                    averageScore += app.getScore();
                }
            }
        }
        
        // 计算平均评分
        if (completedActivities > 0) {
            averageScore = averageScore / completedActivities;
        }
        
        // 更新志愿者统计数据
        volunteer.setTotalServiceHours(totalHours);
        volunteer.setCompletedActivities(completedActivities);
        volunteer.setAverageScore(averageScore);
        volunteerMapper.updateById(volunteer);
        
        // 根据表现更新信用分
        updateCreditByPerformance(volunteerId, totalHours, averageScore);
        
        // 构建并返回志愿者表现数据
        PerformanceVO performanceVO = new PerformanceVO(
            volunteerId, totalHours, completedActivities, averageScore,
            generatePerformanceEvaluation(totalHours, averageScore)
        );
        
        return ResponseResult.success(performanceVO);
    }
    
    // 根据表现更新信用分
    private void updateCreditByPerformance(Long volunteerId, int totalHours, double averageScore) {
        int creditAdjustment = 0;
        
        // 根据服务时长调整信用分
        if (totalHours > 100) {
            creditAdjustment += 10;
        } else if (totalHours > 50) {
            creditAdjustment += 5;
        } else if (totalHours > 20) {
            creditAdjustment += 2;
        }
        
        // 根据评分调整信用分
        if (averageScore >= 4.5) {
            creditAdjustment += 5;
        } else if (averageScore >= 4.0) {
            creditAdjustment += 3;
        } else if (averageScore < 3.0) {
            creditAdjustment -= 5;
        }
        
        // 如果有信用分调整,记录并更新
        if (creditAdjustment != 0) {
            creditService.adjustCredit(volunteerId, creditAdjustment, 
                "基于服务时长(" + totalHours + "小时)和平均评分(" + averageScore + ")的定期评估");
        }
    }
}

六、志愿者招募管理系统-文档展示

七、END

💕💕文末获取源码联系计算机编程果茶熊