Springboot+vue project epidemic community prevention and control system

Get the source code at the end of the article

Development language: Java

Development tools: IDEA/Eclipse

Database: MYSQL5.7

Application service:Tomcat7/Tomcat8

Use framework: springboot+vue

JDK version: jdk1.8

This epidemic prevention and control system is developed in combination with the specific needs of the current new crown epidemic. This system uses Java language, springboot framework and MySQL database for development. Through this system, more information can be provided for people who are protecting their homes during the new crown epidemic. , thus preventing the spread of the epidemic to a certain extent.

The epidemic prevention and control system is divided into two parts: the front desk and the backend. The front desk part is mainly used by users. The main functions include: user registration and login, viewing epidemic announcements, online communication, volunteer registration, temperature reporting management, whereabouts reporting management, Health code upload management, abnormal report management and other functions, background administrator functions mainly include personal center, user management, body temperature report management, track report management, health code upload management, charge type management, charge information management, charge information, volunteer registration Management, registration information management, abnormal reporting management, system forum, system management and other functions, through these functions can better prevent and control the epidemic.

system structure

The epidemic prevention and control system is divided into two parts: the front desk and the backend. The front desk part is mainly used by users. The main functions include: user registration and login, viewing epidemic announcements, online communication, volunteer registration, temperature reporting management, whereabouts reporting management, Health code upload management, abnormal report management and other functions, background administrator functions mainly include personal center, user management, body temperature report management, track report management, health code upload management, charge type management, charge information management, charge information, volunteer registration Management, registration information management, abnormal reporting management, system forum, system management and other functions, through these functions can better prevent and control the epidemic. The specific functions are shown in the following figure

Front desk part design of epidemic prevention and control system

System Home

This system is a system for users to protect their homes during the epidemic. When designing the homepage, we added banners and picture carousels, and recommended the latest information, so that users can understand the desired information more intuitively and conveniently. The home page of the prevention and control system is shown in the figure

 

 

After clicking the picture of the epidemic announcement in the previous part, the user can see the detailed information of the epidemic announcement, and can learn its specific content in the detailed information of the epidemic announcement. The detailed  interface of the epidemic announcement is shown in the figure.

 

online forum

Users in this system can see the latest forum communication information in this system by clicking the forum communication information in the navigation menu. In the forum communication list, we display the summary content of the forum communication in the form of a list, so that the forum communication looks more is colorful, the forum list interface is as shown in the figure 

After clicking the title of the forum communication in the previous part, the user can see the detailed information of the forum communication. In the detailed information of the forum communication, the user can learn its specific content, and can reply to comments. The forum details interface is as shown in the figure. 

 

The design of the background part of the epidemic prevention and control system

Implementation of administrator login module

 The administrator in the epidemic prevention and control system can manage all the information of the system after logging in. In the management login interface, we use the user name + password for verification. When the user enters the login information and clicks the [Login] button, the system will Submit this information to login.jsp and check whether the information exists in the administrator information table. If the entered user name + password is correct, you can successfully log in to the system, otherwise the system will prompt you to log in again. The login interface of the epidemic prevention and control system administrator is shown in the figure 

 

 

 

 

 

user 

 

 

 Part of the core code:

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);
	}
	


}

 

Guess you like

Origin blog.csdn.net/m0_49113107/article/details/123747996