作者:计算机编程-吉哥
简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
心愿:点赞 收藏 ⭐评论
文末获取源码联系精彩专栏推荐订阅 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》
springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8
13张
idea、navicat
管理员、用户
1、用户信息管理
CREATE TABLE `cheliangxinxi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`cheliangmingcheng` varchar(200) NOT NULL COMMENT '车辆名称',
`chepaihao` varchar(200) NOT NULL COMMENT '车牌号',
`cheliangleixing` varchar(200) DEFAULT NULL COMMENT '车辆类型',
`cheliangyanse` varchar(200) DEFAULT NULL COMMENT '车辆颜色',
`tingfangweizhi` varchar(200) DEFAULT NULL COMMENT '停放位置',
`cheliangxiangqing` longtext COMMENT '车辆详情',
`shiyongzhuangkuang` varchar(200) DEFAULT NULL COMMENT '使用状况',
`thumbsupnum` int(11) DEFAULT '0' COMMENT '赞',
`crazilynum` int(11) DEFAULT '0' COMMENT '踩',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 COMMENT='车辆信息';
CREATE TABLE `config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) NOT NULL COMMENT '配置参数名称',
`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='配置文件';
CREATE TABLE `gonggaoxinxi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`biaoti` varchar(200) NOT NULL COMMENT '标题',
`leixing` varchar(200) NOT NULL COMMENT '类型',
`fabushijian` datetime DEFAULT NULL COMMENT '发布时间',
`gonggaoneirong` longtext COMMENT '公告内容',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='公告信息';
CREATE TABLE `gongzuorizhi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`biaoti` varchar(200) NOT NULL COMMENT '标题',
`dengjishijian` datetime DEFAULT NULL COMMENT '登记时间',
`gongzuoneirong` longtext COMMENT '工作内容',
`yonghuming` varchar(200) DEFAULT NULL COMMENT '用户名',
`xingming` varchar(200) DEFAULT NULL COMMENT '姓名',
`bumen` varchar(200) DEFAULT NULL COMMENT '部门',
`zhiwei` varchar(200) DEFAULT NULL COMMENT '职位',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8 COMMENT='工作日志';
CREATE TABLE `kehuguanxi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`kehuxingming` varchar(200) NOT NULL COMMENT '客户姓名',
`xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
`nianling` varchar(200) DEFAULT NULL COMMENT '年龄',
`shengri` date DEFAULT NULL COMMENT '生日',
`gongsimingcheng` varchar(200) NOT NULL COMMENT '公司名称',
`lianxidianhua` varchar(200) DEFAULT NULL COMMENT '联系电话',
`youxiang` varchar(200) DEFAULT NULL COMMENT '邮箱',
`hezuoneirong` longtext COMMENT '合作内容',
`yonghuming` varchar(200) DEFAULT NULL COMMENT '用户名',
`xingming` varchar(200) DEFAULT NULL COMMENT '姓名',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='客户关系';
CREATE TABLE `richenganpai` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`bianhao` varchar(200) DEFAULT NULL COMMENT '编号',
`mingcheng` varchar(200) NOT NULL COMMENT '名称',
`leixing` varchar(200) DEFAULT NULL COMMENT '类型',
`riqi` date DEFAULT NULL COMMENT '日期',
`shijian` varchar(200) DEFAULT NULL COMMENT '时间',
`richengneirong` longtext COMMENT '日程内容',
`yonghuming` varchar(200) DEFAULT NULL COMMENT '用户名',
`xingming` varchar(200) DEFAULT NULL COMMENT '姓名',
`bumen` varchar(200) DEFAULT NULL COMMENT '部门',
`zhiwei` varchar(200) DEFAULT NULL COMMENT '职位',
PRIMARY KEY (`id`),
UNIQUE KEY `bianhao` (`bianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8 COMMENT='日程安排';
CREATE TABLE `shangbankaoqin` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`bianhao` varchar(200) DEFAULT NULL COMMENT '编号',
`mingcheng` varchar(200) NOT NULL COMMENT '名称',
`riqi` date DEFAULT NULL COMMENT '日期',
`yonghuming` varchar(200) NOT NULL COMMENT '用户名',
`xingming` varchar(200) DEFAULT NULL COMMENT '姓名',
`bumen` varchar(200) DEFAULT NULL COMMENT '部门',
`zhiwei` varchar(200) DEFAULT NULL COMMENT '职位',
`zaotuicishu` varchar(200) NOT NULL COMMENT '早退次数',
`chidaocishu` varchar(200) NOT NULL COMMENT '迟到次数',
`qingjiacishu` varchar(200) NOT NULL COMMENT '请假次数',
`kuanggongcishu` varchar(200) NOT NULL COMMENT '旷工次数',
`userid` bigint(20) DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`id`),
UNIQUE KEY `bianhao` (`bianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8 COMMENT='上班考勤';
CREATE TABLE `token` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`userid` bigint(20) NOT NULL COMMENT '用户id',
`username` varchar(100) NOT NULL COMMENT '用户名',
`tablename` varchar(100) DEFAULT NULL COMMENT '表名',
`role` varchar(100) DEFAULT NULL COMMENT '角色',
`token` varchar(200) NOT NULL COMMENT '密码',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
`expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='token表';
CREATE TABLE `tongxunlu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`xingming` varchar(200) NOT NULL COMMENT '姓名',
`nianling` varchar(200) DEFAULT NULL COMMENT '年龄',
`xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
`touxiang` varchar(200) DEFAULT NULL COMMENT '头像',
`bumen` varchar(200) DEFAULT NULL COMMENT '部门',
`shoujihao` varchar(200) DEFAULT NULL COMMENT '手机号',
`dizhi` varchar(200) DEFAULT NULL COMMENT '地址',
`youxiang` varchar(200) DEFAULT NULL COMMENT '邮箱',
`beizhu` longtext COMMENT '备注',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8 COMMENT='通讯录';
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(100) NOT NULL COMMENT '用户名',
`password` varchar(100) NOT NULL COMMENT '密码',
`role` varchar(100) DEFAULT '管理员' COMMENT '角色',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户表';
CREATE TABLE `wenjianxinxi` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`biaoti` varchar(200) NOT NULL COMMENT '标题',
`fujian` varchar(200) DEFAULT NULL COMMENT '附件',
`wenjianneirong` longtext COMMENT '文件内容',
`fabushijian` datetime DEFAULT NULL COMMENT '发布时间',
`yonghuming` varchar(200) DEFAULT NULL COMMENT '用户名',
`xingming` varchar(200) DEFAULT NULL COMMENT '姓名',
`bumen` varchar(200) DEFAULT NULL COMMENT '部门',
`zhiwei` varchar(200) DEFAULT NULL COMMENT '职位',
`sfsh` varchar(200) DEFAULT '否' COMMENT '是否审核',
`shhf` longtext COMMENT '审核回复',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8 COMMENT='文件信息';
CREATE TABLE `yonghu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`yonghuming` varchar(200) NOT NULL COMMENT '用户名',
`mima` varchar(200) NOT NULL COMMENT '密码',
`xingming` varchar(200) DEFAULT NULL COMMENT '姓名',
`xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
`touxiang` varchar(200) DEFAULT NULL COMMENT '头像',
`bumen` varchar(200) DEFAULT NULL COMMENT '部门',
`zhiwei` varchar(200) DEFAULT NULL COMMENT '职位',
`youxiang` varchar(200) DEFAULT NULL COMMENT '邮箱',
`shouji` varchar(200) DEFAULT NULL COMMENT '手机',
PRIMARY KEY (`id`),
UNIQUE KEY `yonghuming` (`yonghuming`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='用户';
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.GongzixinxiEntity;
import com.entity.view.GongzixinxiView;
import com.service.GongzixinxiService;
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 计算机编程-吉哥
*/
@RestController
@RequestMapping("/gongzixinxi")
public class GongzixinxiController {
@Autowired
private GongzixinxiService gongzixinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,GongzixinxiEntity gongzixinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
gongzixinxi.setYonghuming((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = gongzixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongzixinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map params,GongzixinxiEntity gongzixinxi,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = gongzixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, gongzixinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( GongzixinxiEntity gongzixinxi){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( gongzixinxi, "gongzixinxi"));
return R.ok().put("data", gongzixinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(GongzixinxiEntity gongzixinxi){
EntityWrapper< GongzixinxiEntity> ew = new EntityWrapper< GongzixinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( gongzixinxi, "gongzixinxi"));
GongzixinxiView gongzixinxiView = gongzixinxiService.selectView(ew);
return R.ok("查询工资信息成功").put("data", gongzixinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
GongzixinxiEntity gongzixinxi = gongzixinxiService.selectById(id);
return R.ok().put("data", gongzixinxi);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
GongzixinxiEntity gongzixinxi = gongzixinxiService.selectById(id);
return R.ok().put("data", gongzixinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GongzixinxiEntity gongzixinxi, HttpServletRequest request){
gongzixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(gongzixinxi);
gongzixinxiService.insert(gongzixinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody GongzixinxiEntity gongzixinxi, HttpServletRequest request){
gongzixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(gongzixinxi);
gongzixinxiService.insert(gongzixinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody GongzixinxiEntity gongzixinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(gongzixinxi);
gongzixinxiService.updateById(gongzixinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
gongzixinxiService.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("yonghuming", (String)request.getSession().getAttribute("username"));
}
int count = gongzixinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
更多项目推荐:计算机毕业设计项目
如果大家有任何疑虑,请在下方咨询或评论