目录
1、项目介绍
2、项目技术
3、运行环境
4、项目介绍
5、项目代码
5、运行截图
6、源码获取
1、项目介绍
角色:管理员、用户
管理员:管理员登录系统后,可以对首页、个人中心、用户管理、捐赠记录管理、论坛管理、留言管理、心愿管理等功能进行相应的操作管理
用户:用户进入系统可以查看首页、个人中心、旧物捐赠管理、活动报名管理等内容,进行详细的操作、系统首页的主要功能展示了首页、捐赠衣服、论坛交流、爱心许愿、个人主页等信息
2、项目技术
后端: SpringBoot+Mybaits
前端: Vue +ElementUl +Layui +HTML+CSS+JS
3、运行环境
开发语言: Java
项目架构: B/S架构
开发工具: IDEA,Eclipse,Myeclipse都可以。推荐IDEA
JDK版本: 1.8
数据库: MySQL5.7或8.0版本以上
项目管理: Maven
4、项目介绍
在很多发达国家中,爱心捐赠系统的进展明显要快于我国很多,在管理方面也建设了很多不同的管理平台,这些管理平台能够为管理员管理提供数据信息。这些爱心捐赠系统原则上的设计能够结合网络软硬件构建出信息系统。
相比较于国外而言,我国网上用户资助和求助信息化发展是较为缓慢的,最初只是将网上用户资助和求助信息作为一个概念进行研究。随着信息技术的不断发展,目前我国在网上用户资助和求助管理方面已经有了进步。
以爱心捐赠系统的应用为基础,可以将软件开发机构分为几个层次:
第一个层次中的国外软件开发机构能够提供较为成熟的爱心捐赠系统,这些爱心捐赠系统的主要目标为市场上的高端用户,软件能够满足高端用户对其平台的要求。
第二个层次是我国的一些软件机构在研究爱心捐赠系统的时候往往引入了国外软件的设计模式,之后结合国内市场的具体需要进行设计软件。设计出的软件一般能够符合大多数用户的认可。
第三个层次为定制的爱心捐赠系统。一般是结合于用户的实际需求,定制有特殊功能的爱心捐赠系统,从而满足用户的不同要求。
5、项目代码
package com.lc.controller;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.lc.entity.Donation;
import com.lc.entity.User;
import com.lc.service.DonationService;
import com.lc.utils.UserContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.stream.Collectors;
/**
 * 捐赠信息控制层
 */
@RestController
@RequestMapping("/donation")
public class DonationController {
    @Autowired
    DonationService donationService;
    /**
     * 捐赠信息数据表格接口
     */
    @RequestMapping(value="/getTableData", produces="application/json; charset=utf-8")
    public String getTableData(@RequestBody Donation donation) {
        Map<String, Object> map = donationService.selectPage(donation);
        return JSON.toJSONString(map);
    }
    /**
     * 后台捐赠信息保存
     */
    @RequestMapping("/saveDonation")
    public String saveDonation(@RequestBody Donation donation) {
        return donationService.save(donation);
    }
    /**
     * 前台捐赠信息保存
     */
    @RequestMapping("/insertDonationList")
    public String insertDonationList(@RequestBody List<Donation> list) {
        return donationService.insertDonationList(list);
    }
    /**
     * 捐赠信息删除(物理删除)
     */
    @RequestMapping("/deleteDonation")
    public String deleteDonation(String id) {
        return donationService.deletePhysical(id);
    }
    /**
     * 我的捐赠记录数据获取
     */
    @RequestMapping("/selfDonation")
    public List<Map<String, Object>> selfDonation(){
        User currentUser = UserContext.getCurrentUser();
        List<Map<String, Object>> listMap = donationService.countSelfDonation(currentUser.getId());
        return listMap;
    }
    /**
     * 后台修改捐赠记录状态
     */
    @RequestMapping("/updateVerify")
    public String updateVerify(String id, Integer verify){
        return donationService.updateVerifyById(id, verify);
    }
    /**
     * 前台页面第一个饼状图数据接口
     */
    @RequestMapping("/echartsDataOne")
    public List<Map<String, String>> echartsDataOne(){
        List<Donation> allList = donationService.selectAllList();
        Map<String, List<Donation>> allMap = allList.stream().peek(o -> {
            if(o.getKind() == 0){
                o.setKindName("上衣");
            }else if(o.getKind() == 1){
                o.setKindName("裤子");
            }else if(o.getKind() == 2){
                o.setKindName("袜子");
            }else if(o.getKind() == 3){
                o.setKindName("手套");
            }else if(o.getKind() == 4){
                o.setKindName("帽子");
            }else if(o.getKind() == 5){
                o.setKindName("其他");
            }
        }).collect(Collectors.groupingBy(Donation::getKindName));
        List<Map<String, String>> listMap = new ArrayList<>();
        for(Map.Entry<String, List<Donation>> map : allMap.entrySet()){
            Double sum = map.getValue().stream().mapToDouble(Donation::getNumber).sum();
            Map<String, String> itemMap = new HashMap<String, String>();
            itemMap.put("value", String.valueOf(sum));
            itemMap.put("name", map.getKey());
            listMap.add(itemMap);
        }
        return listMap;
    }
    /**
     * 前台页面第二个柱状图数据接口
     */
    @RequestMapping("/echartsDataTwo")
    public Map<String, List<String>> echartsDataTwo(){
        Map<String, List<String>> resultMap = new HashMap<>();
        //获取最近七天的时间段(往前找3天+往后找三天+今天一天)
        List<String> dateList = new ArrayList<>();
        String today= DateUtil.today();
        Date date = DateUtil.parse(today);
        for(int i=0; i<7; i++){
            String d = DateUtil.format(DateUtil.offset(date, DateField.DAY_OF_MONTH, -6 + i), "yyyy-MM-dd");
            dateList.add(d);
        }
        //根据日期获取数据
        List<String> dataList = new ArrayList<>();
        List<Donation> allList = donationService.selectAllList();
        for(String currentDate : dateList){
            List<Donation> list = allList.stream().filter(o -> currentDate.equals(o.getCreateDate().split(" ")[0])).collect(Collectors.toList());
            if(list.isEmpty()){
                dataList.add(String.valueOf(0));
            }else{
                dataList.add(String.valueOf(list.stream().mapToDouble(Donation::getNumber).sum()));
            }
        }
        resultMap.put("dateList", dateList);
        resultMap.put("dataList", dataList);
        return resultMap;
    }
    /**
     * 前台页面第三个折现图数据接口
     */
    @RequestMapping("/echartsDataThree")
    public Map<String, List<String>> echartsDataThree(){
        Map<String, List<String>> resultMap = new HashMap<>();
        //获取最近七天的时间段(往前找6天+今天一天)
        List<String> dateList = new ArrayList<>();
        String today= DateUtil.today();
        Date date = DateUtil.parse(today);
        for(int i=0; i<7; i++){
            String d = DateUtil.format(DateUtil.offset(date, DateField.DAY_OF_MONTH, -6 + i), "yyyy-MM-dd");
            dateList.add(d);
        }
        //根据日期获取数据
        List<Donation> allList = donationService.selectAllList();
        List<String> agreeList = new ArrayList<>();
        List<String> refuseList = new ArrayList<>();
        List<String> waitList = new ArrayList<>();
        for(String currentDate : dateList){
            List<Donation> list = allList.stream().filter(o -> currentDate.equals(o.getCreateDate().split(" ")[0])).collect(Collectors.toList());
            agreeList.add(String.valueOf(list.stream().filter(o -> o.getVerify() == 1).count()));
            refuseList.add(String.valueOf(list.stream().filter(o -> o.getVerify() == 2).count()));
            waitList.add(String.valueOf(list.stream().filter(o -> o.getVerify() == 0).count()));
        }
        resultMap.put("dateList", dateList);
        resultMap.put("agreeList", agreeList);
        resultMap.put("refuseList", refuseList);
        resultMap.put("waitList", waitList);
        return resultMap;
    }
}
5、运行截图
管理员:

 
 
 
 
 
 

用户:
 
 
 
 
 
 
 
 
 
 
 
 
 
6、源码获取
点击下方微信公众号即可获取



















