灾区物资救助系统|基于Springboot开发实现灾区物资救助系统

简介: 灾区物资救助系统|基于Springboot开发实现灾区物资救助系统

一,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

开发技术:Springboot+JSP

二,项目简介

本基目主要基于Java开发技术实现一个灾区物资救助管理系统,用户注册后登录系统后可以在线申请救助,由管理员进行审批,也可以对别人的求助进行帮助,同时可以查看相关的灾区新闻信息,管理个人信息等。平台管理员登录系统后可以审核相关的求助信息,救助信息等,同时管理相关资讯信息,账号信息,轮播图信息,查看相关的图形报表统计数据等。具体的功能如下面展示。

三,系统展示

用户登录

轮播图及新闻展示

个人中心管理

我要求助

我来帮助

我的相关申请

求助审核

账号管理

新闻资讯

轮播图管理

数据统计

四,核心代码展示

package com.liuyang.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.crypto.SecureUtil;
import com.liuyang.common.Result;
import com.liuyang.entity.Account;
import com.liuyang.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者:me
 * @since 2022-02-22
 */
@RestController
@RequestMapping("/system/account")
public class AccountController {
    @Autowired
    private AccountService accountService;
    /**
     * 编辑个人中心
     * @param account
     * @return
     */
    @PostMapping("/editAccount")
    public Result editAccount(Account account) {
        account.setAccountPassword(SecureUtil.md5(account.getAccountPassword()));
        accountService.saveOrUpdate(account);
        return Result.succ("更新成功...");
    }
}
package com.liuyang.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpSession;
@Controller
public class IndexController {
    // 首页
    @GetMapping("/index")
    public String index() {
        return "index";
    }
    // 注册页
    @GetMapping("/register")
    public String register() {
        return "register";
    }
    // 后台主页
    @GetMapping("/system/index")
    public String systemIndex() {
        return "system/index";
    }
    // 后台菜单
    @GetMapping("/system/menu")
    public String systemMenu() {
        return "system/menu";
    }
    // 我的首页
    @GetMapping("/system/welcome")
    public String systemWelcome() {
        return "system/welcome";
    }
    // 我要求助
    @GetMapping("/system/sendHelp")
    public String systemSendHelp() {
        return "system/send-help";
    }
    // 我来帮助
    @GetMapping("/system/receiveHelp")
    public String systemReceiveHelp() {
        return "system/receive-help";
    }
    // 个人中心
    @GetMapping("/system/userInfo")
    public String systemUserInfo() {
        return "system/user-info";
    }
    // 我的申请 - 求助申请
    @GetMapping("/system/userApply")
    public String systemUserApply() {
        return "system/user-apply";
    }
    // 我的申请 - 帮助申请
    @GetMapping("/system/userHelp")
    public String systemUserHelp() {
        return "system/user-help";
    }
    // 注销
    @GetMapping("/logout")
    public String logout(HttpSession session) {
        session.invalidate();
        return "index";
    }
    // 物资详情
    @GetMapping("/system/ReceiveDetailHelp")
    public String systemReceiveDetailHelp() {
        return "system/receive-detail-help";
    }
    // 求助审核
    @GetMapping("/system/checkApply")
    public String systemCheckApply() {
        return "system/check-apply";
    }
    // 账号管理
    @GetMapping("/system/accountManage")
    public String systemAccountManage() {
        return "system/account-manage";
    }
    // 新闻资讯
    @GetMapping("/system/newsManage")
    public String systemNewsManage() {
        return "system/news-manage";
    }
    // 数据统计
    @GetMapping("/system/statisticsManage")
    public String systemStatisticsManage() {
        return "system/statistics-manage";
    }
    // 轮播图
    @GetMapping("/system/carouselManage")
    public String systemCarouselManage() {
        return "system/carousel-manage";
    }
    // 日志
    @GetMapping("/system/logsManage")
    public String systemLogsManage() {
        return "system/logs-manage";
    }
}
package com.liuyang.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.liuyang.common.Result;
import com.liuyang.common.TableResult;
import com.liuyang.entity.Disasterimg;
import com.liuyang.entity.Materials;
import com.liuyang.entity.Materialsimg;
import com.liuyang.service.DisasterimgService;
import com.liuyang.service.MaterialsService;
import com.liuyang.service.MaterialsimgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者:me
 * @since 2022-02-23
 */
@RestController
@RequestMapping("/system/materials")
public class MaterialsController {
    @Autowired
    private MaterialsService materialsService;
    @Autowired
    private MaterialsimgService materialsimgService;
    @Autowired
    private DisasterimgService disasterimgService;
    /**
     * 我要求助, 添加需要申请的物资信息
     * @param map
     * @return
     */
    @PostMapping("/addMaterials")
    public Result addMaterials(@RequestBody Map map) {
        if(map.size() == 0) {
            return Result.fail("申请失败");
        }
        Snowflake snowflake = new Snowflake(2,3);
        Materials materials = new Materials();
        String id = snowflake.nextIdStr();
        String applicationTime = DateUtil.format(new Date(), "yyyy-MM-dd");
        materials.setId(id);
        materials.setApplicationTime(applicationTime);
        materials.setStatus("3"); // 处于待帮助状态
        BeanUtil.fillBeanWithMap(map, materials, false);
        materialsService.saveOrUpdate(materials); // 添加物资
        String imgIds = map.get("imgIds").toString();
        List<String> imgIdsList = StrUtil.split(imgIds, ',');
        for(String imgId : imgIdsList) {
//            Materialsimg materialsimg = new Materialsimg();
//            materialsimg.setId(imgId);
//            materialsimg.setMaterialsId(id);
//            materialsimgService.saveOrUpdate(materialsimg);
            Disasterimg disasterimg = new Disasterimg();
            disasterimg.setId(imgId);
            disasterimg.setMaterialsId(id);
            disasterimgService.saveOrUpdate(disasterimg);
        }
        return Result.succ("申请成功");
    }
    /**
     * 我来帮助, 状态3, 3表示处于待接收帮助
     * @return
     */
    @GetMapping("/queryMaterials")
    public TableResult queryMaterials(String applicantId) {
        List<Materials> materialsList = materialsService.list(new QueryWrapper<Materials>().eq("status", "3").ne("applicantId", applicantId));
        TableResult tableResult = new TableResult(0, "ok",materialsList.size(),materialsList);
        return tableResult;
    }
    /**
     * 我的申请 - 求助申请
     * @param applicantId
     * @return
     */
    @GetMapping("/queryMaterialsByApplicantId")
    public TableResult queryMaterialsByApplicantId(String applicantId) {
        List<Materials> list = materialsService.list(new QueryWrapper<Materials>().eq("applicantId", applicantId));
        TableResult tableResult = new TableResult(0,"ok",list.size(),list);
        return tableResult;
    }
    /**
     * 我的申请 - 帮助申请
     * @param helperId
     * @return
     */
    @GetMapping("/queryMaterialsByHelperId")
    public TableResult queryMaterialsByHelperId(String helperId) {
        List<Materials> list = materialsService.list(new QueryWrapper<Materials>().eq("helperId", helperId));
        TableResult tableResult = new TableResult(0,"ok",list.size(),list);
        return tableResult;
    }
    /**
     * 物资详情
     * @param id
     * @return
     */
    @GetMapping("/queryMaterialsById")
    public Result queryMaterialsById(String id) {
        Materials materials = materialsService.queryMaterialsById(id);
        return Result.succ(materials);
    }
    /**
     * 我来帮助, 接受需要帮助物资, 状态置为 0, 表示从状态3变为0, 当前状态处于待审核状态
     * @param id
     * @return
     */
    @PostMapping("/editReceiveMaterialsById")
    public Result editReceiveMaterialsById(String id, String helperId, String helpType, String imgIds) {
        Materials materials = new Materials();
        materials.setId(id);
        materials.setStatus("0");
        materials.setHelperId(helperId);
        materials.setHelpType(helpType);
        List<String> imgIdsList = StrUtil.split(imgIds, ',');
        for(String imgId : imgIdsList) {
            Materialsimg materialsimg = new Materialsimg();
            materialsimg.setId(imgId);
            materialsimg.setMaterialsId(id);
            materialsimgService.saveOrUpdate(materialsimg);
        }
        materialsService.saveOrUpdate(materials);
        return Result.succ("申请帮助成功...");
    }
    /**
     * 求助审核, 对物资状态0, 进行查询
     * @return
     */
    @GetMapping("/queryMaterialsCheckApply")
    public TableResult queryMaterialsCheckApply() {
        List<Materials> list = materialsService.list(new QueryWrapper<Materials>().eq("status", "0"));
        TableResult tableResult = new TableResult(0, "ok",list.size(),list);
        return tableResult;
    }
    @PostMapping("/editMaterialsCheckApply")
    public Result editMaterialsCheckApply(String id, String status, String checkIdea) {
        Materials materials = new Materials();
        materials.setId(id);
        materials.setStatus(status);
        materials.setCheckIdea(checkIdea);
        materialsService.saveOrUpdate(materials);
        return Result.succ("1".equals(status)? "审核通过": "审核不通过");
    }
}

五,相关作品展示

基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目

基于Nodejs、Vue等前端技术开发的前端实战项目

基于微信小程序和安卓APP应用开发的相关作品

基于51单片机等嵌入式物联网开发应用

基于各类算法实现的AI智能应用

基于大数据实现的各类数据管理和推荐系统


相关文章
|
4月前
|
监控 安全 JavaScript
2025基于springboot的校车预定全流程管理系统
针对传统校车管理效率低、信息不透明等问题,本研究设计并实现了一套校车预定全流程管理系统。系统采用Spring Boot、Java、Vue和MySQL等技术,实现校车信息管理、在线预定、实时监控等功能,提升学校管理效率,保障学生出行安全,推动教育信息化发展。
|
4月前
|
JavaScript Java 关系型数据库
基于springboot的高校运动会系统
本系统基于Spring Boot、Vue与MySQL,实现高校运动会报名、赛程安排及成绩管理的全流程信息化,提升组织效率,杜绝信息错漏与冒名顶替,推动体育赛事智能化发展。
|
4月前
|
JavaScript 安全 Java
基于springboot的大学生兼职系统
本课题针对大学生兼职信息不对称、权益难保障等问题,研究基于Spring Boot、Vue、MySQL等技术的兼职系统,旨在构建安全、高效、功能完善的平台,提升大学生就业竞争力与兼职质量。
|
4月前
|
JavaScript Java 关系型数据库
基于springboot的美食城服务管理系统
本系统基于Spring Boot、Java、Vue和MySQL技术,构建集消费者服务、商家管理与后台监管于一体的美食城综合管理平台,提升运营效率与用户体验。
|
4月前
|
JavaScript Java 关系型数据库
基于springboot的项目管理系统
本文探讨项目管理系统在现代企业中的应用与实现,分析其研究背景、意义及现状,阐述基于SSM、Java、MySQL和Vue等技术构建系统的关键方法,展现其在提升管理效率、协同水平与风险管控方面的价值。
|
4月前
|
搜索推荐 JavaScript Java
基于springboot的儿童家长教育能力提升学习系统
本系统聚焦儿童家长教育能力提升,针对家庭教育中理念混乱、时间不足、个性化服务缺失等问题,构建科学、系统、个性化的在线学习平台。融合Spring Boot、Vue等先进技术,整合优质教育资源,提供高效便捷的学习路径,助力家长掌握科学育儿方法,促进儿童全面健康发展,推动家庭和谐与社会进步。
|
4月前
|
JavaScript Java 关系型数据库
基于springboot的古树名木保护管理系统
本研究针对古树保护面临的严峻挑战,构建基于Java、Vue、MySQL与Spring Boot技术的信息化管理系统,实现古树资源的动态监测、数据管理与科学保护,推动生态、文化与经济可持续发展。
|
5月前
|
存储 JavaScript Java
基于springboot的大学公文收发管理系统
本文介绍公文收发系统的研究背景与意义,分析其在数字化阅读趋势下的必要性。系统采用Vue、Java、Spring Boot与MySQL技术,实现高效、便捷的公文管理与在线阅读,提升用户体验与信息处理效率。
|
4月前
|
人工智能 Java 关系型数据库
基于springboot的画品交流系统
本项目构建基于Java+Vue+SpringBoot+MySQL的画品交流系统,旨在解决传统艺术交易信息不透明、流通受限等问题,融合区块链与AI技术,实现画品展示、交易、鉴赏与社交一体化,推动艺术数字化转型与文化传播。