About the author: Java, front-end, and Python have been developed for many years, and have worked as engineers, project managers, and architects.
Main contents: Java project development, Python project development, university data and AI project development, microcontroller project design, interview technology compilation, latest technology sharing
Collect, like and don’t get lost. It’s good to follow the author.
Get the source code at the end of the article
Project number: BS-XX-198
1. Introduction to the environment
Locale: Java: jdk1.8
Database: Mysql: mysql5.7
Application server: Tomcat: tomcat8.5.31
Development tools: IDEA or eclipse
Development technology: Springboot+JSP
2. Project Introduction
This basic project is mainly based on Java development technology to implement a disaster area material relief management system. After registering and logging into the system, users can apply for assistance online, which will be approved by the administrator. They can also help others ask for help, and at the same time, they can view relevant disaster area news information. , manage personal information, etc. After logging into the system, the platform administrator can review relevant help information, rescue information, etc., and at the same time manage relevant information, account information, carousel chart information, and view relevant graphical report statistics, etc. The specific functions are shown below.
3. System display
User login
Carousel pictures and news display
Personal center management
I want help
I'm here to help
My related applications
Help review
Account management
news
Carousel image management
Statistics
4. Core code display
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)? "审核通过": "审核不通过");
}
}
5. Display of related works
Practical projects based on Java development, Python development, PHP development, C# development and other related languages
Front-end practical projects developed based on Nodejs, Vue and other front-end technologies
Related works based on WeChat applet and Android APP application development
Development and application of embedded Internet of Things based on 51 microcontroller and other embedded devices
AI intelligent applications based on various algorithms
Various data management and recommendation systems based on big data