Java项目:54 springboot工资信息管理系统453

作者主页:源码空间codegym

简介:Java领域优质创作者、Java项目、学习资料、技术互助

文中获取源码

项目介绍

本系统的使用角色可以被分为用户和管理员,

用户具有注册、查看信息、留言信息等功能,

管理员具有修改用户信息,发布津贴等功能

环境要求

1.运行环境:最好是java jdk1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.tomcat环境:Tomcat7.x,8.X,9.x版本均可

4.硬件环境:windows7/8/10 4G内存以上;或者Mac OS;

5.是否Maven项目:是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven.项目

6.数据库:MySql5.7/8.0等版本均可;

技术栈

运行环境:jdk8 + tomcat9 + mysql5.7 + windows10

服务端技术:Spring Boot+ Mybatis +VUE

使用说明

1.使用Navicati或者其它工具,在mysql中创建对应sq文件名称的数据库,并导入项目的sql文件;

2.使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;

3.将项目中config-propertiesi配置文件中的数据库配置改为自己的配置,然后运行;

运行指导

idea导入源码空间站顶目教程说明(Vindows版)-ssm篇:

http://mtw.so/5MHvZq

源码地址:http://codegym.top

运行截图

文档截图

image-20240315234234444

项目截图

微信截图_20240315233843

微信截图_20240315233854

微信截图_20240315233901

微信截图_20240315233916

微信截图_20240315233921

微信截图_20240315233928

微信截图_20240315233934

微信截图_20240315234003

微信截图_20240315234009

微信截图_20240315234013

微信截图_20240315234020

微信截图_20240315233800

微信截图_20240315233836

代码


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("/jintie")
public class JintieController {private static final Logger logger = LoggerFactory.getLogger(JintieController.class);private static final String TABLE_NAME = "jintie";@Autowiredprivate JintieService jintieService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//字典表@Autowiredprivate GonggaoService gonggaoService;//公告@Autowiredprivate JixiaoService jixiaoService;//绩效@Autowiredprivate XinziService xinziService;//套账@Autowiredprivate YuangongService yuangongService;//用户@Autowiredprivate YuangongKaoqinService yuangongKaoqinService;//员工考勤@Autowiredprivate YuangongKaoqinListService yuangongKaoqinListService;//员工考勤详情@Autowiredprivate 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("yuangongId",request.getSession().getAttribute("userId"));CommonUtil.checkMap(params);PageUtils page = jintieService.queryPage(params);//字典表数据转换List<JintieView> list =(List<JintieView>)page.getList();for(JintieView 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);JintieEntity jintie = jintieService.selectById(id);if(jintie !=null){//entity转viewJintieView view = new JintieView();BeanUtils.copyProperties( jintie , view );//把实体数据重构到view中//级联表 用户//级联表YuangongEntity yuangong = yuangongService.selectById(jintie.getYuangongId());if(yuangong != null){BeanUtils.copyProperties( yuangong , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yuangongId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表view.setYuangongId(yuangong.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody JintieEntity jintie, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,jintie:{}",this.getClass().getName(),jintie.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");else if("用户".equals(role))jintie.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));Wrapper<JintieEntity> queryWrapper = new EntityWrapper<JintieEntity>().eq("yuangong_id", jintie.getYuangongId()).eq("jintie_name", jintie.getJintieName()).eq("jintie_types", jintie.getJintieTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());JintieEntity jintieEntity = jintieService.selectOne(queryWrapper);if(jintieEntity==null){jintie.setInsertTime(new Date());jintie.setCreateTime(new Date());jintieService.insert(jintie);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody JintieEntity jintie, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug("update方法:,,Controller:{},,jintie:{}",this.getClass().getName(),jintie.toString());JintieEntity oldJintieEntity = jintieService.selectById(jintie.getId());//查询原先数据String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            jintie.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));if("".equals(jintie.getJintieFile()) || "null".equals(jintie.getJintieFile())){jintie.setJintieFile(null);}if("".equals(jintie.getJintieContent()) || "null".equals(jintie.getJintieContent())){jintie.setJintieContent(null);}jintieService.updateById(jintie);//根据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<JintieEntity> oldJintieList =jintieService.selectBatchIds(Arrays.asList(ids));//要删除的数据jintieService.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 yuangongId = 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<JintieEntity> jintieList = 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){//循环JintieEntity jintieEntity = new JintieEntity();
//                            jintieEntity.setYuangongId(Integer.valueOf(data.get(0)));   //员工 要改的
//                            jintieEntity.setJintieUuidNumber(data.get(0));                    //津贴编号 要改的
//                            jintieEntity.setJintieName(data.get(0));                    //津贴标题 要改的
//                            jintieEntity.setJintieFile(data.get(0));                    //附件 要改的
//                            jintieEntity.setJintieTypes(Integer.valueOf(data.get(0)));   //津贴类型 要改的
//                            jintieEntity.setJintieJine(data.get(0));                    //津贴金额 要改的
//                            jintieEntity.setJintieContent("");//详情和图片
//                            jintieEntity.setInsertTime(date);//时间
//                            jintieEntity.setCreateTime(date);//时间jintieList.add(jintieEntity);//把要查询是否重复的字段放入map中//津贴编号if(seachFields.containsKey("jintieUuidNumber")){List<String> jintieUuidNumber = seachFields.get("jintieUuidNumber");jintieUuidNumber.add(data.get(0));//要改的}else{List<String> jintieUuidNumber = new ArrayList<>();jintieUuidNumber.add(data.get(0));//要改的seachFields.put("jintieUuidNumber",jintieUuidNumber);}}//查询是否重复//津贴编号List<JintieEntity> jintieEntities_jintieUuidNumber = jintieService.selectList(new EntityWrapper<JintieEntity>().in("jintie_uuid_number", seachFields.get("jintieUuidNumber")));if(jintieEntities_jintieUuidNumber.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(JintieEntity s:jintieEntities_jintieUuidNumber){repeatFields.add(s.getJintieUuidNumber());}return R.error(511,"数据库的该表中的 [津贴编号] 字段已经存在 存在数据为:"+repeatFields.toString());}jintieService.insertBatch(jintieList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/2868624.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

湖南麒麟SSH服务漏洞

针对湖南麒麟操作系统进行漏洞检测时&#xff0c;会报SSH漏洞风险提醒&#xff0c;具体如下&#xff1a; 针对这些漏洞&#xff0c;可以关闭SSH服务&#xff08;前提是应用已经部署完毕不再需要通过SSH远程访问传输文件的情况下&#xff0c;此时可以通过VNC远程登录方法&#x…

操作系统——cpu、内存、缓存介绍

一、内存是什么 内存就是系统资源的代名词&#xff0c;它是其他硬件设备与 CPU 沟通的桥梁&#xff0c; 计算机中的所有程序都在内存中运行。其作用是暂时存放CPU的运算数据&#xff0c;以及与硬盘交换的数据。也是相当于CPU与硬盘沟通的桥梁。只要计算机在运行&#xff0c;CP…

腾讯云2核4G服务器可以多少人同时访问?2核4G5M并发数计算

腾讯云轻量2核4G5M带宽服务器支持多少人在线访问&#xff1f;5M带宽下载速度峰值可达640KB/秒&#xff0c;阿腾云以搭建网站为例&#xff0c;假设优化后平均大小为60KB&#xff0c;则5M带宽可支撑10个用户同时在1秒内打开网站&#xff0c;并发数为10&#xff0c;经阿腾云测试&a…

电脑实现微信多开

电脑实现微信多开 现在很多人都有两个微信号&#xff0c;将工作与生活分开。工作上的伙伴用一个微信&#xff0c;生活中的朋友用一个微信。但是电脑只能打开一个微信&#xff0c;接下来简单三步教大家如何在电脑实现微信多开。 一、复制微信位置 右击单击微信&#xff0c;选…

Ubuntu 14.04:PaddleOCR基于PaddleHub Serving的服务部署(失败)

目录 一、为什么使用一键服务部署 二、安装 paddlehub 1.8 2.1 安装前的环境准备 2.2 安装paddlehub 1.8 2.2.1 安装paddlehub 2.2.2 检测安装是否成功 2.2.3 检查本地与远端PaddleHub-Server的连接状态 2.2.4 测试使用 2.3 其他 2.3.1 如何卸载、pip常用命令、常见…

Microsoft SQL Server2019占用大量磁盘空间的解决办法(占了我C盘120G的空间!!!)附SQL数据库定时清理代理作业

一、问题 安装Microsoft SQL Server2019后我的C盘在几天后少了100G&#xff0c;如图所示&#xff1a; 解决后&#xff1a; 出现这种情况&#xff0c;我在各种清理C盘后&#xff0c;空间还是没有太大变化 &#xff0c;且几乎每天都要少2个G&#xff0c;后来终于找见原因了&…

XCTF:level0[WriteUP]

PWN入门题目&#xff1a;XCTF攻防世界的level0 使用file、checksec命令查看文件详细信息 这是一个64bit的ELF文件&#xff08;后面编写EXP需要用到&#xff09; 从checksec中展示的信息看&#xff0c;该二进制文件只开启了NX&#xff08;数据执行保护&#xff09; 这样的话就…

【UE5】持枪状态站立移动的动画混合空间

项目资源文末百度网盘自取 创建角色在持枪状态站立移动的动画混合空间 在BlendSpace文件夹中单击右键选择动画(Animation)中的混合空间(Blend Space) 选择SK_Female_Skeleton 命名为BS_RifleStand 打开 水平轴表示角色的方向&#xff0c;命名为Direction&#xff0c;方…

想兼职赚钱?盘点6个靠谱兼职,赚钱更轻松!

1&#xff0c;微头条搬砖 微头条搬砖是一个门槛不高的赚钱方式&#xff0c;而且不需要你有多么好的原创能力&#xff0c;去收集一些热门文章的素材进行文章伪原创&#xff0c;十分钟就能搞定&#xff0c;只要你的文章有爆点&#xff0c;足够吸人眼球&#xff0c;就能够获取不低…

打造Python飞机大战游戏 - 从环境搭建到代码实现

一、环境搭建 要开发Python游戏&#xff0c;我们需要安装一些必要的库和工具。其中最常用的是pygame库&#xff0c;它提供了丰富的游戏开发功能。 目录 一、环境搭建 首先&#xff0c;确保你的计算机上已经安装了Python。然后&#xff0c;通过pip安装pygame库&#xff1a; 二…

蓝桥杯练习系统(算法训练)ALGO-969 N车

资源限制 内存限制&#xff1a;256.0MB C/C时间限制&#xff1a;1.0s Java时间限制&#xff1a;3.0s Python时间限制&#xff1a;5.0s 问题描述 给定NN的棋盘&#xff0c;问有多少种放置N个车使他们不互相攻击的方案。 输入格式 一行一个整数&#xff0c;N。 输出格式…

图像处理ASIC设计方法 笔记11 像素误差与字长优化

P108 P105 定点误差分析与字长优化 1 像素误差是什么原因导致的? 在本书所说的算法中,像素误差是由几次定点运算累加导致的: 首先由行(列)号与定点正弦/正切值计算出该行(列)的小数平移量,然后将这些小数平移量截取一定字长用来计算插值核,再将这些插值核也截取一…

修改NLog配置文件参数的方法

目录 一、背景 二、NLog配置文件 三、C#代码 四、验证结果 ​ 五、总结 一、背景 最近项目中要用到NLog记录日志&#xff0c;有一个要求是可以灵活地修改日志文件的存放位置&#xff0c;琢磨了一小会&#xff0c;发现可以使用XML文件的形式修改文件的参数&#xff0c;现将…

向量相似性度量的常用方法

向量相似性度量的常用方法 0. 引言1. 欧氏距离(Euclidean distance)2. 余弦相似度(Cosine similarity)3. 汉明距离(Hamming distance)4. 点积相似度 (Dot Product Similarity)5. 曼哈顿距离 (Manhattan Distance) 0. 引言 今天花时间学习学习向量相似性度量的常用方法&#xf…

Linux 安装Nginx (Nginx-1.25.4)

一、下载Nginx安装包 1.服务器联网的情况下&#xff0c;使用wget命令把Nginx安装包下载到/usr/local/目录中&#xff0c;如果没有wget命令&#xff0c;需要先安装&#xff1a;yum install -y wget cd /usr/local wget -c https://nginx.org/download/nginx-1.25.4.tar.gz ng…

CrossOver 24 Mac 中文破解版 CrossOver 2024激活码 crossover虚拟机 mac上运行windows 软件

CrossOver在Mac上本机运行。这意味着您不必运行Windows的副本。这意味着您不会为同时运行的两个操作系统支付RAM和CPU代价。这意味着没有陷入困境&#xff0c;波涛汹涌的表现。如果您需要原生速度&#xff0c;该软件是更好的选择。 安装后&#xff0c;像安装任何Mac应用程序一…

2024.3.17 机器学习周报

引言 Abstract 文献阅读 1、题目 R-TRANSFORMER: RECURRENT NEURAL NETWORK ENHANCED TRANSFORMER 2、引言 递归神经网络长期以来一直是序列建模的主要选择。然而&#xff0c;它严重遭受两个问题&#xff1a;在捕获非常长期的依赖性和无法并行化的顺序计算过程中无能为力…

2024 Python3.10 系统入门+进阶(一):Python编程基础

目录 一、编程语言是什么二、编译型语言和解释型语言的区别2.1 编译型语言2.2 解释型语言 三、Python是什么四、Python有哪些优点和缺点&#xff1f;4.1 Python的优点4.2 Python 的缺点 五、学Python能干什么&#xff0c;Python的应用领域有哪些&#xff1f;六、怎样学习Python…

HSCCTF-2024-Crypto 复现

文章目录 EZ_MATHSTAR_CHASING_DIARYRSATESTYOUQU 复现参考来源&#xff1a; lazzzaro佬写的题解 EZ_MATH 题目描述&#xff1a; from Crypto.Util.number import *flag HSCCTF{*****************************************} x bytes_to_long(flag.encode()) y getPrime(2…

监视和内存观察

监视和内存观察 5.监视和内存观察5.1 监视5.2 内存 5.监视和内存观察 在调试的过程中我们&#xff0c;如果要观察代码执行过程中&#xff0c;上下文环境中的变量的值&#xff0c;有哪些方法呢&#xff1f; 这些观察的前提条件一定是开始调试后观察&#xff0c;比如&#xff1…