摘要
随着Internet的发展,人们的日常生活已经离不开网络。未来人们的生活与工作将变得越来越数字化,网络化和电子化。网上管理,它将是直接管理智能新冠疫苗接种助手的最新形式。本论文是以构建智能新冠疫苗接种助手管理系统为目标,使用 java技术制作,由管理员和用户两大部分组成。着重论述了系统设计分析,系统主要包括首页、个人中心、用户管理、疫苗信息管理、接种预约管理、接种提醒管理、预约分配管理等功能,以及后台数据库管理。从系统设计到详细实现都根据了系统的建设思想和mysql数据库的设计方法。
该系统的应用可以减少工作人员的劳动强度,提高工作效率与管理水平,具有很大的价值。它可以使智能新冠疫苗接种助手管理上操作简单,成功率高,使网上智能新冠疫苗接种助手的管理向一个更高层次前进。
本系统尝试使用ssm在网上架构一个动态的智能新冠疫苗接种助手管理系统,以使每一用户在家就能通过系统来进行智能新冠疫苗接种助手管理。
关键词:智能新冠疫苗接种助手; java技术;mysql数据库
ssm智能新冠疫苗接种助手源码和论文答辩PPT719
演示视频:
ssm智能新冠疫苗接种助手源码和论文答辩PPT
Abstract
With the development of Internet, People's Daily life has been inseparable from the Network. In the future, people's life and work will become more and more digital, network and electronic. Managed online, it will be the latest form of a directly managed smart COVID-19 vaccination assistant. This paper aims at building an intelligent assistant management system for COVID-19 vaccination. It is made by Using Java technology and consists of administrators and users. The system mainly includes home page, personal center, user management, vaccine information management, vaccination appointment management, vaccination reminder management, appointment allocation management and other functions, as well as background database management. From the system design to the detailed implementation are based on the system construction ideas and mysql database design method.
The application of the system can reduce the labor intensity of the staff, improve the work efficiency and management level, has great value. It can make the management of intelligent COVID-19 vaccination assistant easy to operate and have a high success rate, and advance the management of online intelligent COVID-19 vaccination assistant to a higher level.
This system attempts to use SSM to construct a dynamic intelligent COVID-19 vaccination assistant management system on the Internet, so that each user can manage the intelligent COVID-19 vaccination assistant through the system at home.
Key words: intelligent assistant for COVID-19 vaccination; Java technology; The mysql database
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 java.io.IOException;
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.YuyuefenpeiEntity;
import com.entity.view.YuyuefenpeiView;
import com.service.YuyuefenpeiService;
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 2022-03-25 23:35:50
*/
@RestController
@RequestMapping("/yuyuefenpei")
public class YuyuefenpeiController {
@Autowired
private YuyuefenpeiService yuyuefenpeiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,YuyuefenpeiEntity yuyuefenpei,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
yuyuefenpei.setZhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = yuyuefenpeiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuyuefenpei), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map params,YuyuefenpeiEntity yuyuefenpei,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
yuyuefenpei.setZhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = yuyuefenpeiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuyuefenpei), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( YuyuefenpeiEntity yuyuefenpei){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( yuyuefenpei, "yuyuefenpei"));
return R.ok().put("data", yuyuefenpeiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(YuyuefenpeiEntity yuyuefenpei){
EntityWrapper< YuyuefenpeiEntity> ew = new EntityWrapper< YuyuefenpeiEntity>();
ew.allEq(MPUtil.allEQMapPre( yuyuefenpei, "yuyuefenpei"));
YuyuefenpeiView yuyuefenpeiView = yuyuefenpeiService.selectView(ew);
return R.ok("查询预约分配成功").put("data", yuyuefenpeiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
YuyuefenpeiEntity yuyuefenpei = yuyuefenpeiService.selectById(id);
return R.ok().put("data", yuyuefenpei);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YuyuefenpeiEntity yuyuefenpei = yuyuefenpeiService.selectById(id);
return R.ok().put("data", yuyuefenpei);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YuyuefenpeiEntity yuyuefenpei, HttpServletRequest request){
yuyuefenpei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yuyuefenpei);
yuyuefenpeiService.insert(yuyuefenpei);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody YuyuefenpeiEntity yuyuefenpei, HttpServletRequest request){
yuyuefenpei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yuyuefenpei);
yuyuefenpei.setUserid((Long)request.getSession().getAttribute("userId"));
yuyuefenpeiService.insert(yuyuefenpei);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody YuyuefenpeiEntity yuyuefenpei, HttpServletRequest request){
//ValidatorUtils.validateEntity(yuyuefenpei);
yuyuefenpeiService.updateById(yuyuefenpei);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
yuyuefenpeiService.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("zhanghao", (String)request.getSession().getAttribute("username"));
}
int count = yuyuefenpeiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* (按值统计)
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}")
public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
Map params = new HashMap();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
EntityWrapper ew = new EntityWrapper();
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
ew.eq("zhanghao", (String)request.getSession().getAttribute("username"));
}
List
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为:123456");
}
/**
* 列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,UserEntity user){
EntityWrapper ew = new EntityWrapper();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* 保存
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
UserEntity u = userService.selectOne(new EntityWrapper().eq("username", user.getUsername()));
if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
return R.error("用户名已存在。");
}
userService.updateById(user);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}