Springboot+vue项目疫情社区防控系统

开发语言:Java

开发工具:IDEA /Eclipse

数据库:MYSQL5.7

应用服务:Tomcat7/Tomcat8

使用框架:springboot+vue

JDK版本:jdk1.8

本疫情防控系统是结合当前新冠疫情期间的具体需求而开发的,本系统使用Java语言,springboot框架和MySQL数据库来进行开发,通过本系统可以对新冠疫情期间居家防护的人提供更多的资讯,从而在一定程度上防止了疫情的蔓延。

疫情防控系统分为前台和后台两部分,其中前台部分主要是给用户使用的,主要功能包括,用户的注册登录,查看疫情公告,在线交流,志愿者报名,体温上报管理,行踪上报管理,健康码上传管理,异常上报管理等功能,后台管理员功能主要包括个人中心,用户管理,体温上报管理,轨迹上报管理,健康码上传管理,收费类型管理,收费信息管理,收费信息,志愿者报名管理,报名信息管理,异常上报管理,系统论坛,系统管理等功能,通过这些功能可以更好的对疫情进行防控。

系统首页

本系统是一个让用户疫情期间居家防护的系统,首页设计的时候我们加入了banner和图片轮播,并对最新的一些信息进行了推荐,方便用户更加直观方便的了解到想要的信息 ,疫情防控系统首页部分如图

管理员登录模块的实现

 疫情防控系统中的管理员通过登录后可以系统的所有信息进行管理,在管理登录界面我们是通过用户名+密码的方式进行验证的,当用户输入登录信息并点击[登录]按钮之后系统将这些信息提交给login.jsp并到管理员信息表中查询信息是否存在,如果输入的用户名+密码正确即可成功的登录到系统中,否则系统给出提示要求重新登录。疫情防控系统管理员登陆界面如图 


部分核心代码: 

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.BaomingxinxiEntity;
import com.entity.view.BaomingxinxiView;
 
import com.service.BaomingxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
 
 
/**
 * 报名信息
 * 后端接口
 * @author 
 * @email 
 * @date 2021-04-07 16:26:16
 */
@RestController
@RequestMapping("/baomingxinxi")
public class BaomingxinxiController {
    @Autowired
    private BaomingxinxiService baomingxinxiService;
    
 
 
    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,BaomingxinxiEntity baomingxinxi,
		HttpServletRequest request){
		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yonghu")) {
			baomingxinxi.setZhanghao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<BaomingxinxiEntity> ew = new EntityWrapper<BaomingxinxiEntity>();
		PageUtils page = baomingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, baomingxinxi), params), params));
 
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,BaomingxinxiEntity baomingxinxi, HttpServletRequest request){
        EntityWrapper<BaomingxinxiEntity> ew = new EntityWrapper<BaomingxinxiEntity>();
		PageUtils page = baomingxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, baomingxinxi), params), params));
        return R.ok().put("data", page);
    }
 
	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( BaomingxinxiEntity baomingxinxi){
       	EntityWrapper<BaomingxinxiEntity> ew = new EntityWrapper<BaomingxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( baomingxinxi, "baomingxinxi")); 
        return R.ok().put("data", baomingxinxiService.selectListView(ew));
    }
 
	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(BaomingxinxiEntity baomingxinxi){
        EntityWrapper< BaomingxinxiEntity> ew = new EntityWrapper< BaomingxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( baomingxinxi, "baomingxinxi")); 
		BaomingxinxiView baomingxinxiView =  baomingxinxiService.selectView(ew);
		return R.ok("查询报名信息成功").put("data", baomingxinxiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        BaomingxinxiEntity baomingxinxi = baomingxinxiService.selectById(id);
        return R.ok().put("data", baomingxinxi);
    }
 
    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        BaomingxinxiEntity baomingxinxi = baomingxinxiService.selectById(id);
        return R.ok().put("data", baomingxinxi);
    }
    
 
 
 
    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody BaomingxinxiEntity baomingxinxi, HttpServletRequest request){
    	baomingxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(baomingxinxi);
        baomingxinxiService.insert(baomingxinxi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody BaomingxinxiEntity baomingxinxi, HttpServletRequest request){
    	baomingxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(baomingxinxi);
        baomingxinxiService.insert(baomingxinxi);
        return R.ok();
    }
 
    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody BaomingxinxiEntity baomingxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(baomingxinxi);
        baomingxinxiService.updateById(baomingxinxi);//全部更新
        return R.ok();
    }
    
 
    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        baomingxinxiService.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<String, Object> 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<BaomingxinxiEntity> wrapper = new EntityWrapper<BaomingxinxiEntity>();
		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("zhanghao", (String)request.getSession().getAttribute("username"));
		}
 
		int count = baomingxinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
 
 
}
 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值