文末获取源码
开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7/8.0
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
该系统的应用可以减少工作人员的劳动强度,提高工作效率与管理水平,具有很大的价值。它可以使疫苗接种管理系统上操作简单,成功率高,使网上疫苗接种管理系统的管理向一个更高层次前进。
本系统尝试使用springboot在网上架构一个动态的疫苗接种管理系统,以使每一用户在家就能通过系统来进行疫苗预约。
本系统主要包括管理员,用户和工作人员三个角色组成,主要包括以下功能:
(1)前台:首页、接种点、疫苗信息、疫苗资讯、个人中心、后台管理。
(2)管理员:首页、个人中心、用户管理、工作人员管理、接种点管理、疫苗信息管理、疫苗预约管理、接种登记管理、留观登记管理、系统管理。
(3)用户:首页、个人中心、疫苗预约管理、接种登记管理、留观登记管理。
(4)工作人员:首页、个人中心、疫苗信息管理、疫苗预约管理、接种登记管理、留观登记管理。
/**
* 接种登记
* 后端接口
* @author
* @email
* @date 2022-02-24 09:12:48
*/
@RestController
@RequestMapping("/jiezhongdengji")
public class JiezhongdengjiController {
@Autowired
private JiezhongdengjiService jiezhongdengjiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,JiezhongdengjiEntity jiezhongdengji,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
jiezhongdengji.setZhanghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("gongzuorenyuan")) {
jiezhongdengji.setRenyuanzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = jiezhongdengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiezhongdengji), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params,JiezhongdengjiEntity jiezhongdengji,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = jiezhongdengjiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiezhongdengji), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( JiezhongdengjiEntity jiezhongdengji){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( jiezhongdengji, "jiezhongdengji"));
return R.ok().put("data", jiezhongdengjiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JiezhongdengjiEntity jiezhongdengji){
EntityWrapper< JiezhongdengjiEntity> ew = new EntityWrapper< JiezhongdengjiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiezhongdengji, "jiezhongdengji"));
JiezhongdengjiView jiezhongdengjiView = jiezhongdengjiService.selectView(ew);
return R.ok("查询接种登记成功").put("data", jiezhongdengjiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JiezhongdengjiEntity jiezhongdengji = jiezhongdengjiService.selectById(id);
return R.ok().put("data", jiezhongdengji);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JiezhongdengjiEntity jiezhongdengji = jiezhongdengjiService.selectById(id);
return R.ok().put("data", jiezhongdengji);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiezhongdengjiEntity jiezhongdengji, HttpServletRequest request){
jiezhongdengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiezhongdengji);
jiezhongdengjiService.insert(jiezhongdengji);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiezhongdengjiEntity jiezhongdengji, HttpServletRequest request){
jiezhongdengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiezhongdengji);
jiezhongdengjiService.insert(jiezhongdengji);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiezhongdengjiEntity jiezhongdengji, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiezhongdengji);
jiezhongdengjiService.updateById(jiezhongdengji);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiezhongdengjiService.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"));
}
if(tableName.equals("gongzuorenyuan")) {
wrapper.eq("renyuanzhanghao", (String)request.getSession().getAttribute("username"));
}
int count = jiezhongdengjiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
/**
* 通用接口
*/
@RestController
public class CommonController{
@Autowired
private CommonService commonService;
/**
* 获取table表中的column列表(联动接口)
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/option/{tableName}/{columnName}")
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* 根据table中的column获取单条记录
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/follow/{tableName}/{columnName}")
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* 修改table表的sfsh状态
* @param table
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
* 获取需要提醒的记录数
* @param tableName
* @param columnName
* @param type 1:数字 2:日期
* @param map
* @return
*/
@IgnoreAuth
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("table", tableName);
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));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
* 单列求和
*/
@IgnoreAuth
@RequestMapping("/cal/{tableName}/{columnName}")
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
Map result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
* 分组统计
*/
@IgnoreAuth
@RequestMapping("/group/{tableName}/{columnName}")
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
List