🍊作者:计算机编程-吉哥
🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
🍊心愿:点赞 👍 收藏 ?评论 📝
🍅 文末获取源码联系👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》
目录
springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8
14张?
idea、navicat
管理员、用户、部门主管
?
?
?
?
?
?
?
?
CREATE TABLE `bumen` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`bumen_uuid_number` varchar(200) DEFAULT NULL COMMENT '部门编号',
`bumen_name` varchar(200) DEFAULT NULL COMMENT '部门名称 Search111 ',
`bumen_address` varchar(200) DEFAULT NULL COMMENT '部门位置',
`bumen_content` longtext COMMENT '部门备注 ',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 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=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';
CREATE TABLE `dictionary` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`dic_code` varchar(200) DEFAULT NULL COMMENT '字段',
`dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',
`code_index` int(11) DEFAULT NULL COMMENT '编码',
`index_name` varchar(200) DEFAULT NULL COMMENT '编码名字 Search111 ',
`super_id` int(11) DEFAULT NULL COMMENT '父字段id',
`beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COMMENT='字典';
CREATE TABLE `gonggao` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`gonggao_name` varchar(200) DEFAULT NULL COMMENT '公告名称 Search111 ',
`gonggao_photo` varchar(200) DEFAULT NULL COMMENT '公告图片 ',
`gonggao_types` int(11) NOT NULL COMMENT '公告类型 Search111 ',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '发布时间',
`gonggao_content` longtext COMMENT '公告详情 ',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 nameShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='公告资讯';
CREATE TABLE `jingli` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(200) DEFAULT NULL COMMENT '账户',
`password` varchar(200) DEFAULT NULL COMMENT '密码',
`jingli_uuid_number` varchar(200) DEFAULT NULL COMMENT '部门经理编号 Search111 ',
`jingli_name` varchar(200) DEFAULT NULL COMMENT '部门经理姓名 Search111 ',
`jingli_phone` varchar(200) DEFAULT NULL COMMENT '部门经理手机号',
`jingli_id_number` varchar(200) DEFAULT NULL COMMENT '部门经理身份证号',
`jingli_photo` varchar(200) DEFAULT NULL COMMENT '部门经理头像',
`sex_types` int(11) DEFAULT NULL COMMENT '性别',
`jingli_email` varchar(200) DEFAULT NULL COMMENT '部门经理邮箱',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='部门经理';
CREATE TABLE `qingjia` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`jingli_id` int(11) DEFAULT NULL COMMENT '部门主管',
`qingjia_text` longtext COMMENT '请假缘由',
`qingjia_types` int(11) DEFAULT NULL COMMENT '请假类型 Search111',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '申请时间',
`qingjia_time` timestamp NULL DEFAULT NULL COMMENT '请假时间',
`qingjia_number` int(200) DEFAULT NULL COMMENT '请假天数',
`qingjia_yesno_types` int(11) DEFAULT NULL COMMENT '申请状态 Search111 ',
`qingjia_yesno_text` longtext COMMENT '处理意见',
`qingjia_shenhe_time` timestamp NULL DEFAULT NULL COMMENT '审核时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='员工请假';
CREATE TABLE `renwu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`jingli_id` int(11) DEFAULT NULL COMMENT '部门主管',
`renwu_name` varchar(200) DEFAULT NULL COMMENT '任务名称 Search111 ',
`renwu_uuid_number` varchar(200) DEFAULT NULL COMMENT '任务编号',
`renwu_photo` varchar(200) DEFAULT NULL COMMENT '任务照片',
`renwu_types` int(11) DEFAULT NULL COMMENT '任务类型 Search111',
`renwu_file` varchar(200) DEFAULT NULL COMMENT '文件',
`renwu_content` longtext COMMENT '任务介绍 ',
`renwu_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 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=4 DEFAULT CHARSET=utf8 COMMENT='token表';
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 `xinxi` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`xinxi_name` varchar(200) DEFAULT NULL COMMENT '基本信息名称 Search111 ',
`xinxi_uuid_number` varchar(200) DEFAULT NULL COMMENT '基本信息编号',
`xinxi_yuanxiao` varchar(200) DEFAULT NULL COMMENT '毕业院校',
`xinxi_zhuanye` varchar(200) DEFAULT NULL COMMENT '专业',
`xinxi_xuewei` varchar(200) DEFAULT NULL COMMENT '最终学位',
`xinxi_address` varchar(200) DEFAULT NULL COMMENT '家庭住址',
`xinxi_chepai` varchar(200) DEFAULT NULL COMMENT '车牌号',
`xinxi_didian` varchar(200) DEFAULT NULL COMMENT '办公地点',
`xinxi_types` int(11) DEFAULT NULL COMMENT '健康状况 ',
`xinxi_time` date DEFAULT NULL COMMENT '入职时间',
`xinxi_content` longtext COMMENT '基本信息介绍 ',
`xinxi_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='基本信息';
CREATE TABLE `yonghu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(200) DEFAULT NULL COMMENT '账户',
`password` varchar(200) DEFAULT NULL COMMENT '密码',
`yonghu_uuid_number` varchar(200) DEFAULT NULL COMMENT '用户编号 Search111 ',
`yonghu_name` varchar(200) DEFAULT NULL COMMENT '用户姓名 Search111 ',
`yonghu_phone` varchar(200) DEFAULT NULL COMMENT '用户手机号',
`yonghu_id_number` varchar(200) DEFAULT NULL COMMENT '用户身份证号',
`yonghu_photo` varchar(200) DEFAULT NULL COMMENT '用户头像',
`sex_types` int(11) DEFAULT NULL COMMENT '性别',
`yonghu_email` varchar(200) DEFAULT NULL COMMENT '用户邮箱',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用户';
package com.controller;
/**
* 任务分配
* 后端接口
* @author 计算机编程-吉哥
* @email
*/
@RestController
@Controller
@RequestMapping("/fenpei")
public class FenpeiController {
private static final Logger logger = LoggerFactory.getLogger(FenpeiController.class);
private static final String TABLE_NAME = "fenpei";
@Autowired
private FenpeiService fenpeiService;
@Autowired
private TokenService tokenService;
@Autowired
private BumenService bumenService;//部门
@Autowired
private DictionaryService dictionaryService;//字典
@Autowired
private GonggaoService gonggaoService;//公告资讯
@Autowired
private JingliService jingliService;//部门经理
@Autowired
private QingjiaService qingjiaService;//员工请假
@Autowired
private RenwuService renwuService;//任务
@Autowired
private XinxiService xinxiService;//基本信息
@Autowired
private XinziService xinziService;//薪资
@Autowired
private YonghuService yonghuService;//用户
@Autowired
private ZiliaoService ziliaoService;//资料
@Autowired
private UsersService usersService;//管理员
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("部门经理".equals(role))
params.put("jingliId",request.getSession().getAttribute("userId"));
params.put("fenpeiDeleteStart",1);params.put("fenpeiDeleteEnd",1);
CommonUtil.checkMap(params);
PageUtils page = fenpeiService.queryPage(params);
//字典表数据转换
List<FenpeiView> list =(List<FenpeiView>)page.getList();
for(FenpeiView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
FenpeiEntity fenpei = fenpeiService.selectById(id);
if(fenpei !=null){
//entity转view
FenpeiView view = new FenpeiView();
BeanUtils.copyProperties( fenpei , view );//把实体数据重构到view中
//级联表 任务
//级联表
RenwuEntity renwu = renwuService.selectById(fenpei.getRenwuId());
if(renwu != null){
BeanUtils.copyProperties( renwu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setRenwuId(renwu.getId());
}
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(fenpei.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody FenpeiEntity fenpei, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,fenpei:{}",this.getClass().getName(),fenpei.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
fenpei.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<FenpeiEntity> queryWrapper = new EntityWrapper<FenpeiEntity>()
.eq("renwu_id", fenpei.getRenwuId())
.eq("yonghu_id", fenpei.getYonghuId())
.eq("fenpei_types", fenpei.getFenpeiTypes())
.eq("fenpei_delete", 1)
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
FenpeiEntity fenpeiEntity = fenpeiService.selectOne(queryWrapper);
if(fenpeiEntity==null){
fenpei.setFenpeiDelete(1);
fenpei.setInsertTime(new Date());
fenpei.setCreateTime(new Date());
fenpeiService.insert(fenpei);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody FenpeiEntity fenpei, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,fenpei:{}",this.getClass().getName(),fenpei.toString());
FenpeiEntity oldFenpeiEntity = fenpeiService.selectById(fenpei.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// fenpei.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
if("".equals(fenpei.getFenpeiContent()) || "null".equals(fenpei.getFenpeiContent())){
fenpei.setFenpeiContent(null);
}
fenpeiService.updateById(fenpei);//根据id更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<FenpeiEntity> oldFenpeiList =fenpeiService.selectBatchIds(Arrays.asList(ids));//要删除的数据
ArrayList<FenpeiEntity> list = new ArrayList<>();
for(Integer id:ids){
FenpeiEntity fenpeiEntity = new FenpeiEntity();
fenpeiEntity.setId(id);
fenpeiEntity.setFenpeiDelete(2);
list.add(fenpeiEntity);
}
if(list != null && list.size() >0){
fenpeiService.updateBatchById(list);
}
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
try {
List<FenpeiEntity> fenpeiList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
FenpeiEntity fenpeiEntity = new FenpeiEntity();
fenpeiList.add(fenpeiEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
fenpeiService.insertBatch(fenpeiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = fenpeiService.queryPage(params);
//字典表数据转换
List<FenpeiView> list =(List<FenpeiView>)page.getList();
for(FenpeiView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Integer id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
FenpeiEntity fenpei = fenpeiService.selectById(id);
if(fenpei !=null){
//entity转view
FenpeiView view = new FenpeiView();
BeanUtils.copyProperties( fenpei , view );//把实体数据重构到view中
//级联表
RenwuEntity renwu = renwuService.selectById(fenpei.getRenwuId());
if(renwu != null){
BeanUtils.copyProperties( renwu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setRenwuId(renwu.getId());
}
//级联表
YonghuEntity yonghu = yonghuService.selectById(fenpei.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody FenpeiEntity fenpei, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,fenpei:{}",this.getClass().getName(),fenpei.toString());
Wrapper<FenpeiEntity> queryWrapper = new EntityWrapper<FenpeiEntity>()
.eq("renwu_id", fenpei.getRenwuId())
.eq("yonghu_id", fenpei.getYonghuId())
.eq("fenpei_types", fenpei.getFenpeiTypes())
.eq("fenpei_delete", fenpei.getFenpeiDelete())
// .notIn("fenpei_types", new Integer[]{102})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
FenpeiEntity fenpeiEntity = fenpeiService.selectOne(queryWrapper);
if(fenpeiEntity==null){
fenpei.setFenpeiDelete(1);
fenpei.setInsertTime(new Date());
fenpei.setCreateTime(new Date());
fenpeiService.insert(fenpei);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
package com.service;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.FenpeiEntity;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import java.util.List;
/**
* 任务分配 服务类
*/
public interface FenpeiService extends IService<FenpeiEntity> {
/**
* @param params 查询参数
* @return 带分页的查询出来的数据
*/
PageUtils queryPage(Map<String, Object> params);
}
package com.service.impl;
/**
* 任务分配 服务实现类
*/
@Service("fenpeiService")
@Transactional
public class FenpeiServiceImpl extends ServiceImpl<FenpeiDao, FenpeiEntity> implements FenpeiService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
Page<FenpeiView> page =new Query<FenpeiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}
package com.dao;
import com.entity.FenpeiEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.FenpeiView;
/**
* 任务分配 Dao 接口
*
* @author
*/
public interface FenpeiDao extends BaseMapper<FenpeiEntity> {
List<FenpeiView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}
?
你可能还有感兴趣的项目👇🏻👇🏻👇🏻
更多项目推荐:计算机毕业设计项目
如果大家有任何疑虑,请在下方咨询或评论