随着留守儿童爱心管理的不断发展,留守儿童爱心网站在现实生活中的使用和普及,留守儿童爱心管理成为近年内出现的一个热门话题,并且能够成为大众广为认可和接受的行为和选择。设计留守儿童爱心网站的目的就是借助计算机让复杂的管理操作变简单,变高效。
留守儿童爱心网站采用了B/S结构,JAVA作为开发语言,数据库采用了B/S结构,Mysql数据库进行开发。该系统包括前台操作,后台由管理员和用户两个部分,一方面,为用户提供首页、宣传新闻、志愿活动、爱心捐赠、个人中心、后台管理等功能;另一方面,为管理员提供首页、个人中心、用户管理、宣传新闻管理、志愿活动管理、爱心捐赠管理、旧物捐赠管理、活动报名管理、系统管理等功能。
【关键词】留守儿童爱心;JAVA;B/S结构
基于springboot留守儿童爱心网站源码和论文327
演示视频:
基于springboot留守儿童爱心网站源码和论文
Abstract
With the continuous development of love management for left-behind children, the use and popularity of love websites for left-behind children in real life, love management for left-behind children has become a hot topic in recent years, and can become a widely recognized and accepted behavior and choice. The purpose of designing the left-behind children love website is to make the complex management operation simple and efficient with the help of computers.
Left-behind children love website adopts B/S structure, JAVA as development language, B/S structure for database and Mysql database for development. The system includes the front desk operation, the background by the administrator and the user two parts, on the one hand, to provide users with home page, publicity news, volunteer activities, love donation, personal center, background management and other functions; On the other hand, it provides administrators with home page, personal center, user management, publicity and news management, volunteer activity management, love donation management, old things donation management, activity registration management, system management and other functions.
【 Key words 】 Left-behind children love; JAVA; B/S structure
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.HuodongbaomingEntity;
import com.entity.view.HuodongbaomingView;
import com.service.HuodongbaomingService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 活动报名
* 后端接口
* @author
* @email
* @date 2022-04-18 12:00:47
*/
@RestController
@RequestMapping("/huodongbaoming")
public class HuodongbaomingController {
@Autowired
private HuodongbaomingService huodongbaomingService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,HuodongbaomingEntity huodongbaoming,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
huodongbaoming.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = huodongbaomingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, huodongbaoming), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params,HuodongbaomingEntity huodongbaoming,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = huodongbaomingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, huodongbaoming), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( HuodongbaomingEntity huodongbaoming){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( huodongbaoming, "huodongbaoming"));
return R.ok().put("data", huodongbaomingService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(HuodongbaomingEntity huodongbaoming){
EntityWrapper< HuodongbaomingEntity> ew = new EntityWrapper< HuodongbaomingEntity>();
ew.allEq(MPUtil.allEQMapPre( huodongbaoming, "huodongbaoming"));
HuodongbaomingView huodongbaomingView = huodongbaomingService.selectView(ew);
return R.ok("查询活动报名成功").put("data", huodongbaomingView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
HuodongbaomingEntity huodongbaoming = huodongbaomingService.selectById(id);
return R.ok().put("data", huodongbaoming);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
HuodongbaomingEntity huodongbaoming = huodongbaomingService.selectById(id);
return R.ok().put("data", huodongbaoming);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody HuodongbaomingEntity huodongbaoming, HttpServletRequest request){
huodongbaoming.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(huodongbaoming);
huodongbaomingService.insert(huodongbaoming);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody HuodongbaomingEntity huodongbaoming, HttpServletRequest request){
huodongbaoming.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(huodongbaoming);
huodongbaomingService.insert(huodongbaoming);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody HuodongbaomingEntity huodongbaoming, HttpServletRequest request){
//ValidatorUtils.validateEntity(huodongbaoming);
huodongbaomingService.updateById(huodongbaoming);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
huodongbaomingService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
wrapper.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
int count = huodongbaomingService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.JiuwujuanzengEntity;
import com.entity.view.JiuwujuanzengView;
import com.service.JiuwujuanzengService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 旧物捐赠
* 后端接口
* @author
* @email
* @date 2022-04-18 12:00:47
*/
@RestController
@RequestMapping("/jiuwujuanzeng")
public class JiuwujuanzengController {
@Autowired
private JiuwujuanzengService jiuwujuanzengService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,JiuwujuanzengEntity jiuwujuanzeng,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
jiuwujuanzeng.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = jiuwujuanzengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiuwujuanzeng), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params,JiuwujuanzengEntity jiuwujuanzeng,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = jiuwujuanzengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiuwujuanzeng), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( JiuwujuanzengEntity jiuwujuanzeng){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( jiuwujuanzeng, "jiuwujuanzeng"));
return R.ok().put("data", jiuwujuanzengService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JiuwujuanzengEntity jiuwujuanzeng){
EntityWrapper< JiuwujuanzengEntity> ew = new EntityWrapper< JiuwujuanzengEntity>();
ew.allEq(MPUtil.allEQMapPre( jiuwujuanzeng, "jiuwujuanzeng"));
JiuwujuanzengView jiuwujuanzengView = jiuwujuanzengService.selectView(ew);
return R.ok("查询旧物捐赠成功").put("data", jiuwujuanzengView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JiuwujuanzengEntity jiuwujuanzeng = jiuwujuanzengService.selectById(id);
return R.ok().put("data", jiuwujuanzeng);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JiuwujuanzengEntity jiuwujuanzeng = jiuwujuanzengService.selectById(id);
return R.ok().put("data", jiuwujuanzeng);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiuwujuanzengEntity jiuwujuanzeng, HttpServletRequest request){
jiuwujuanzeng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiuwujuanzeng);
jiuwujuanzengService.insert(jiuwujuanzeng);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiuwujuanzengEntity jiuwujuanzeng, HttpServletRequest request){
jiuwujuanzeng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiuwujuanzeng);
jiuwujuanzengService.insert(jiuwujuanzeng);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiuwujuanzengEntity jiuwujuanzeng, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiuwujuanzeng);
jiuwujuanzengService.updateById(jiuwujuanzeng);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiuwujuanzengService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
wrapper.eq("yonghuzhanghao", (String)request.getSession().getAttribute("username"));
}
int count = jiuwujuanzengService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.XuanchuanxinwenEntity;
import com.entity.view.XuanchuanxinwenView;
import com.service.XuanchuanxinwenService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
* 宣传新闻
* 后端接口
* @author
* @email
* @date 2022-04-18 12:00:46
*/
@RestController
@RequestMapping("/xuanchuanxinwen")
public class XuanchuanxinwenController {
@Autowired
private XuanchuanxinwenService xuanchuanxinwenService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,XuanchuanxinwenEntity xuanchuanxinwen,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = xuanchuanxinwenService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuanchuanxinwen), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params,XuanchuanxinwenEntity xuanchuanxinwen,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = xuanchuanxinwenService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xuanchuanxinwen), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XuanchuanxinwenEntity xuanchuanxinwen){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( xuanchuanxinwen, "xuanchuanxinwen"));
return R.ok().put("data", xuanchuanxinwenService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XuanchuanxinwenEntity xuanchuanxinwen){
EntityWrapper< XuanchuanxinwenEntity> ew = new EntityWrapper< XuanchuanxinwenEntity>();
ew.allEq(MPUtil.allEQMapPre( xuanchuanxinwen, "xuanchuanxinwen"));
XuanchuanxinwenView xuanchuanxinwenView = xuanchuanxinwenService.selectView(ew);
return R.ok("查询宣传新闻成功").put("data", xuanchuanxinwenView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XuanchuanxinwenEntity xuanchuanxinwen = xuanchuanxinwenService.selectById(id);
return R.ok().put("data", xuanchuanxinwen);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XuanchuanxinwenEntity xuanchuanxinwen = xuanchuanxinwenService.selectById(id);
return R.ok().put("data", xuanchuanxinwen);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XuanchuanxinwenEntity xuanchuanxinwen, HttpServletRequest request){
xuanchuanxinwen.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xuanchuanxinwen);
xuanchuanxinwenService.insert(xuanchuanxinwen);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XuanchuanxinwenEntity xuanchuanxinwen, HttpServletRequest request){
xuanchuanxinwen.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xuanchuanxinwen);
xuanchuanxinwenService.insert(xuanchuanxinwen);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody XuanchuanxinwenEntity xuanchuanxinwen, HttpServletRequest request){
//ValidatorUtils.validateEntity(xuanchuanxinwen);
xuanchuanxinwenService.updateById(xuanchuanxinwen);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
xuanchuanxinwenService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = xuanchuanxinwenService.selectCount(wrapper);
return R.ok().put("count", count);
}
}