文末获取源码

开发语言:Java

开发工具:IDEA /Eclipse

数据库:MYSQL5.7

使用框架:springboot+vue

JDK版本:jdk1.8

我通过对新冠病毒的到来萌生了开发一套关于校园疫情防控系统,本系统采用了Java技术,将所有业务模块采用以浏览器交互的模式,选择MySQL数据库,springboot作为系统的后台框架,开发工具选择My eclipse来进行系统的设计。基本实现了校园疫情防控系统应有的主要功能模块,本系统有管理员、学生。管理员:首页、个人中心、核酸检测管理、体温状态管理、学生管理、学生状态管理、休假申请管理、出入登记管理、疫情知识管理、论坛管理、系统管理。学生权限;首页、个人中心、学生状态管理、休假申请管理、出入登记管理;前台首页:首页、出入登记、疫情知识、论坛信息、疫情公告、个人中心、后台管理、客服等操作。

对系统进行测试,是为了改善了程序逻辑和代码。同时确保系统中所有的程序都能正常运行,所有的功能都能操作,并且该系统有很好的操作体验,实现了对于校园疫情防控系统和护工管理、学校学生管理、政府部门双赢。

系统流程分析

系统登录流程图,如图所示:

添加信息流程

添加信息流程图,如图所示:

删除信息流程

删除信息流程图,如图所示:

系统体系结构

校园疫情防控系统的结构图

 登录系统结构图,如图

 校园疫情防控系统结构图,如图

系统详细设计

学生前后台功能模块

学生注册/登陆,通过填写学号、密码、学生姓名、性别、头像、专业、班级、住址省份、市级、县级、手机、邮箱等信息,输入完成后选择注册即可进入校园疫情防控系统,通过学号密码登陆如图

学生前台首页浏览,通过内容列表可以获取网站首页、出入登记、疫情知识、论坛信息、疫情公告、个人中心、后台管理、客服等信息操作内容,如图

 

 出入登记

 疫情知识

 论坛信息,通过论坛信息内容列表可以查看、发布帖子等操作

 疫情公告

个人中心,通过内容列表可以获取学号、密码、学生姓名、性别、头像、专业、班级、住址省份、市级、县级、手机、邮箱等信息可进行增、删、改或查看等操作,如图

 客服

 管理员功能模块

校园疫情防控系统,在管理员登录系统的首页可以通过填写账号/密码、选择角色进行登录操作等信息,如图

管理员首页,管理员进入校园疫情防控系统查看个人中心、核酸检测管理、体温状态管理、学生管理、学生状态管理、休假申请管理、出入登记管理、疫情知识管理、论坛管理、系统管理操作,如图

 

 核酸检测管理,通过核酸检测管理内容列表可以获取核酸检测、核酸状态等信息可进行详情、修改、删除或查看操作,如图

学生管理,通过学生管理内容列表获取景区学号、密码、学生姓名、性别、头像、专业、班级、住址省份、市级、县级、手机、邮箱等信息可进行详情、修改、删除或查看操作。如图

休假申请管理,通过休假申请管理内容列表可以获取申请编号、申请标题、休假天数、行程城市、途径城市、申请日期等信息可进行详情、修改、删除或查看操作,如图 

 出入登记管理,通过出入登记管理内容列表可以获取登记标题、登陆类型、登记时间、备注、学号、学生姓名、性别、头像、实时体温、手机、班级、专业、审核回复、审核状态、审核等信息可进行详情、修改、删除或查看等操作,如图

 疫情知识,通过疫情知识内容列表可以获取标题名称、分类、图片、视频、发布日期等信息可进行详情、修改、删除或查看等操作,如图

系统管理,管理员通过系统管理页面查看疫情公告/客服管理/轮播图等进行上传图片进行添加、删除、修改以及查看并对整个系统进行维护等操作,如图

 

学生功能模块 

个人信息,学生对个人信息进行填写学号、密码、学生姓名、性别、头像、专业、班级、住址省份、市级、县级、手机、邮箱并进行添加以及查看个人信息等操作。效果如下图所示

学生状态管理,在学生状态管理页面可以通过填写学号、密码、学生姓名、性别、头像、手机、身体状态、核酸检测等内容并进行添加以及查看效果如下图所示

 

休假申请管理,在休假申请管理页面可以通过填写申请编号、申请标题、休假天数、行程城市、途径城市、申请日期等内容并进行添加以及查看效果如下图所示

 

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.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.YiqingzhishiEntity;
import com.entity.view.YiqingzhishiView;

import com.service.YiqingzhishiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 疫情知识
 * 后端接口
 * @author 
 * @email 
 * @date 2021-01-10 10:02:51
 */
@RestController
@RequestMapping("/yiqingzhishi")
public class YiqingzhishiController {
    @Autowired
    private YiqingzhishiService yiqingzhishiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,YiqingzhishiEntity yiqingzhishi, HttpServletRequest request){
        EntityWrapper<YiqingzhishiEntity> ew = new EntityWrapper<YiqingzhishiEntity>();
		PageUtils page = yiqingzhishiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yiqingzhishi), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,YiqingzhishiEntity yiqingzhishi, HttpServletRequest request){
        EntityWrapper<YiqingzhishiEntity> ew = new EntityWrapper<YiqingzhishiEntity>();
		PageUtils page = yiqingzhishiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yiqingzhishi), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( YiqingzhishiEntity yiqingzhishi){
       	EntityWrapper<YiqingzhishiEntity> ew = new EntityWrapper<YiqingzhishiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( yiqingzhishi, "yiqingzhishi")); 
        return R.ok().put("data", yiqingzhishiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(YiqingzhishiEntity yiqingzhishi){
        EntityWrapper< YiqingzhishiEntity> ew = new EntityWrapper< YiqingzhishiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( yiqingzhishi, "yiqingzhishi")); 
		YiqingzhishiView yiqingzhishiView =  yiqingzhishiService.selectView(ew);
		return R.ok("查询疫情知识成功").put("data", yiqingzhishiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        YiqingzhishiEntity yiqingzhishi = yiqingzhishiService.selectById(id);
		yiqingzhishi.setClicknum(yiqingzhishi.getClicknum()+1);
		yiqingzhishi.setClicktime(new Date());
		yiqingzhishiService.updateById(yiqingzhishi);
        return R.ok().put("data", yiqingzhishi);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        YiqingzhishiEntity yiqingzhishi = yiqingzhishiService.selectById(id);
		yiqingzhishi.setClicknum(yiqingzhishi.getClicknum()+1);
		yiqingzhishi.setClicktime(new Date());
		yiqingzhishiService.updateById(yiqingzhishi);
        return R.ok().put("data", yiqingzhishi);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody YiqingzhishiEntity yiqingzhishi, HttpServletRequest request){
    	yiqingzhishi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yiqingzhishi);
        yiqingzhishiService.insert(yiqingzhishi);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody YiqingzhishiEntity yiqingzhishi, HttpServletRequest request){
    	yiqingzhishi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yiqingzhishi);
        yiqingzhishiService.insert(yiqingzhishi);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody YiqingzhishiEntity yiqingzhishi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(yiqingzhishi);
        yiqingzhishiService.updateById(yiqingzhishi);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        yiqingzhishiService.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<YiqingzhishiEntity> wrapper = new EntityWrapper<YiqingzhishiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = yiqingzhishiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	/**
     * 前端智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,YiqingzhishiEntity yiqingzhishi, HttpServletRequest request,String pre){
        EntityWrapper<YiqingzhishiEntity> ew = new EntityWrapper<YiqingzhishiEntity>();
        Map<String, Object> newMap = new HashMap<String, Object>();
        Map<String, Object> param = new HashMap<String, Object>();
		Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry<String, Object> entry = it.next();
			String key = entry.getKey();
			String newKey = entry.getKey();
			if (pre.endsWith(".")) {
				newMap.put(pre + newKey, entry.getValue());
			} else if (StringUtils.isEmpty(pre)) {
				newMap.put(newKey, entry.getValue());
			} else {
				newMap.put(pre + "." + newKey, entry.getValue());
			}
		}
		params.put("sort", "clicknum");
        params.put("order", "desc");
		PageUtils page = yiqingzhishiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yiqingzhishi), params), params));
        return R.ok().put("data", page);
    }


}

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐