传统信息的管理大部分依赖于管理人员的手工登记与管理,然而,随着近些年信息技术的迅猛发展,让许多比较老套的信息管理模式进行了更新迭代,薪资信息因为其管理内容繁杂,管理数量繁多导致手工进行处理不能满足广大用户的需求,因此就应运而生出相应的企业员工薪酬关系系统。
本企业员工薪酬关系系统分为管理员还有用户两个权限,管理员可以管理用户的基本信息内容,可以管理公告信息以及公告的租赁信息,能够与用户进行相互交流等操作,用户可以查看薪资信息,可以查看公告以及查看管理员回复信息等操作。
该企业员工薪酬关系系统采用的是WEB应用程序开发中最受欢迎的B/S三层结构模式,使用占用空间小但功能齐全的MySQL数据库进行数据的存储操作,系统开发技术使用到了JSP技术。该企业员工薪酬关系系统能够解决许多传统手工操作的难题,比如数据查询耽误时间长,数据管理步骤繁琐等问题。总的来说,企业员工薪酬关系系统性能稳定,功能较全,投入运行使用性价比很高。
关键词:企业员工薪酬关系系统;MySQL数据库;SSM技术
java、tomcat、mysql、spring、springBoot、mybatis、query、vue
3.1 整体功能设计图
企业员工薪酬关系系统系统在进行系统中功能模块的划分时,采用层次图来进行表示。层次图具有树形结构,它能使用矩形框来描绘数据信息。顶层代表的数据结构很完整,顶层下面的矩形框表示的数据就是子集数据,当然处于最下面的矩形框就是不能再进行细分的数据元素了,使用层次方框图描述系统功能能让用户一目了然,能够明白系统的功能,以及对应功能板块下面的子功能都可以清楚领会。企业员工薪酬关系系统分为管理员和用户两部分操作角色,下面将对他们的功能进行阐述。
管理员可以管理用户的基本信息,可以管理等功能。管理员功能结构图如下:
3.2 功能具体细节设计
如图5.1显示的就是薪资列表页面,此页面提供给管理员的功能有:查看薪资、新增薪资、修改薪资、删除薪资等。
公告信息管理
管理员可以对公告信息进行管理,可以新增公告信息,修改公告信息,删除无效的公告信息。公告信息管理界面如图5.2所示。
公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。公告类型管理界面如图5.3所示。
数据库里面的数据表存放的就是各种数据记录,我们在进行系统增删改查操作时,其实也是在对应数据表里面进行的增删改查操作,一个好的数据库能够缩短信息处理时间,所以说数据库的设计工作不容小觑,数据库里面设置哪些表,表里面的字段设计以及字段类型和字段长度等信息都要考虑周到才行,比如时间这个字段,它的数据类型就不能是int型,不然在系统操作中就会弹出输入数据格式不符合要求的报错提示。下面简单介绍企业员工薪酬关系系统的一些数据表。
表4.1字典表
| 序号 | 列名 | 数据类型 | 说明 | 允许空 |
| 1 | Id | Int | id | 否 |
| 2 | dic_code | String | 字段 | 是 |
| 3 | dic_name | String | 字段名 | 是 |
| 4 | code_index | Integer | 编码 | 是 |
| 5 | index_name | String | 编码名字 | 是 |
| 6 | super_id | Integer | 父字段id | 是 |
| 7 | beizhu | String | 备注 | 是 |
| 8 | create_time | Date | 创建时间 | 是 |
表4.2公告表
| 序号 | 列名 | 数据类型 | 说明 | 允许空 |
| 1 | Id | Int | id | 否 |
| 2 | gonggao_name | String | 公告名称 | 是 |
| 3 | gonggao_types | Integer | 公告类型 | 是 |
| 4 | insert_time | Date | 公告发布时间 | 是 |
| 5 | gonggao_content | String | 公告详情 | 是 |
| 6 | create_time | Date | 创建时间 | 是 |
表4.3留言表
| 序号 | 列名 | 数据类型 | 说明 | 允许空 |
| 1 | Id | Int | id | 否 |
| 2 | yuangong_id | Integer | 员工 | 是 |
| 3 | liuyan_name | String | 留言标题 | 是 |
| 4 | liuyan_types | Integer | 公告类型 | 是 |
| 5 | liuyan_text | String | 留言内容 | 是 |
| 6 | insert_time | Date | 留言时间 | 是 |
| 7 | reply_text | String | 回复内容 | 是 |
| 8 | update_time | Date | 回复时间 | 是 |
| 9 | create_time | Date | 创建时间 | 是 |
表4.4薪资表
| 序号 | 列名 | 数据类型 | 说明 | 允许空 |
| 1 | Id | Int | id | 否 |
| 2 | yuangong_id | Integer | 员工 | 是 |
| 3 | xinzi_uuid_number | String | 薪资编号 | 是 |
| 4 | xinzi_name | String | 标题 | 是 |
| 5 | xinzi_month | String | 月份 | 是 |
| 6 | jiben_jine | BigDecimal | 基本工资 | 是 |
| 7 | jiangjin_jine | BigDecimal | 奖金 | 是 |
| 8 | jixiao_jine | BigDecimal | 绩效 | 是 |
| 9 | butie_jine | BigDecimal | 补贴 | 是 |
| 10 | yingfa_jine | BigDecimal | 应发 | 是 |
| 11 | daikou_shiyejin_jine | BigDecimal | 代扣失业金 | 是 |
| 12 | daikou_yanglaojin_jine | BigDecimal | 代扣养老保险金 | 是 |
| 13 | daikou_gongjijin_jine | BigDecimal | 代扣公积金 | 是 |
| 14 | daikou_gerensuodeshui_jine | BigDecimal | 代扣个人所得税 | 是 |
| 15 | shifa_jine | BigDecimal | 实发工资 | 是 |
| 16 | xinzi_content | String | 备注 | 是 |
| 17 | insert_time | Date | 记录时间 | 是 |
| 18 | create_time | Date | 创建时间 | 是 |
表4.5员工表
| 序号 | 列名 | 数据类型 | 说明 | 允许空 |
| 1 | Id | Int | id | 否 |
| 2 | yuangong_uuid_number | String | 员工工号 | 是 |
| 3 | yuangong_name | String | 员工姓名 | 是 |
| 4 | yuangong_phone | String | 员工手机号 | 是 |
| 5 | yuangong_id_number | String | 员工身份证号 | 是 |
| 6 | yuangong_photo | String | 员工头像 | 是 |
| 7 | bumen_types | Integer | 部门 | 是 |
| 8 | zhiwei_types | Integer | 职位 | 是 |
| 9 | shiyong_types | Integer | 是否启用 | 是 |
| 10 | yuangong_email | String | 电子邮箱 | 是 |
| 11 | create_time | Date | 创建时间 | 是 |
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 公告
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/gonggao")
public class GonggaoController {
private static final Logger logger = LoggerFactory.getLogger(GonggaoController.class);
@Autowired
private GonggaoService gonggaoService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired
private YuangongService yuangongService;
/**
* 后端列表
*/
@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("yuangongId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = gonggaoService.queryPage(params);
//字典表数据转换
List<GonggaoView> list =(List<GonggaoView>)page.getList();
for(GonggaoView 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);
GonggaoEntity gonggao = gonggaoService.selectById(id);
if(gonggao !=null){
//entity转view
GonggaoView view = new GonggaoView();
BeanUtils.copyProperties( gonggao , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GonggaoEntity gonggao, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,gonggao:{}",this.getClass().getName(),gonggao.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<GonggaoEntity> queryWrapper = new EntityWrapper<GonggaoEntity>()
.eq("gonggao_name", gonggao.getGonggaoName())
.eq("gonggao_types", gonggao.getGonggaoTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GonggaoEntity gonggaoEntity = gonggaoService.selectOne(queryWrapper);
if(gonggaoEntity==null){
gonggao.setInsertTime(new Date());
gonggao.setCreateTime(new Date());
gonggaoService.insert(gonggao);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody GonggaoEntity gonggao, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,gonggao:{}",this.getClass().getName(),gonggao.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<GonggaoEntity> queryWrapper = new EntityWrapper<GonggaoEntity>()
.notIn("id",gonggao.getId())
.andNew()
.eq("gonggao_name", gonggao.getGonggaoName())
.eq("gonggao_types", gonggao.getGonggaoTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GonggaoEntity gonggaoEntity = gonggaoService.selectOne(queryWrapper);
if(gonggaoEntity==null){
gonggaoService.updateById(gonggao);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
gonggaoService.deleteBatchIds(Arrays.asList(ids));
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");
try {
List<GonggaoEntity> gonggaoList = 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){
//循环
GonggaoEntity gonggaoEntity = new GonggaoEntity();
// gonggaoEntity.setGonggaoName(data.get(0)); //公告名称 要改的
// gonggaoEntity.setGonggaoTypes(Integer.valueOf(data.get(0))); //公告类型 要改的
// gonggaoEntity.setInsertTime(date);//时间
// gonggaoEntity.setGonggaoContent("");//详情和图片
// gonggaoEntity.setCreateTime(date);//时间
gonggaoList.add(gonggaoEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
gonggaoService.insertBatch(gonggaoList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- gamedaodao.com 版权所有 湘ICP备2022005869号-6
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务