Java项目:SSM高校教职工差旅报销管理系统

news2024/9/23 1:37:34

作者主页:源码空间站2022

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

文末获取源码

项目介绍

管理员角色包含以下功能:
管理员登录,修改管理员资料,用户管理,公告管理,报销类型管理,系别信息管理,报销审核管理等功能。

用户角色包含以下功能:

用户登录,修改个人资料,查看公告,报销类型查看,系别信息查看,报销审批查看等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 

5.数据库:MySql 5.7版本;

技术栈

1. 后端:Spring+SpringMVC+Mybatis

2. 前端:HTML+CSS+JavaScript+jsp

使用说明

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

2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;

3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

4. 运行项目,输入localhost:8080/ 登录

运行截图

相关代码

主控制器

package com.jubilantz.controller;

import com.jubilantz.entity.EasNotice;
import com.jubilantz.entity.EasUser;
import com.jubilantz.services.EasNoticeService;
import com.jubilantz.services.EasUserService;
import com.jubilantz.utils.PageUtil;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author JubilantZ
 * @Date: 2021/4/28 20:25
 */
@RequestMapping("/main")
@Controller
public class EasMainController {
    @Autowired
    private EasNoticeService easNoticeService;

    @Autowired
    private EasUserService easUserService;

    @RequestMapping("/homePage")
    public String homePage() throws Exception{
        return "system/home/homePage";
    }

//    @RequestMapping(value="/getNotice",method = RequestMethod.GET)
//    @ResponseBody
//    public Map<String,Object> getNotice(@RequestParam(defaultValue = "1") Integer page,
//                                        @RequestParam(defaultValue = "2") Integer limit,
//                                        EasNotice easNotice) throws Exception {
//        Map<String,Object> map = new HashMap<>();
//
        System.out.println("模糊查询的内容为:"+easNotice.getContent());
//
//        EasUser easUser = (EasUser) SecurityUtils.getSubject().getPrincipal();//获取EasUser对象
//
//        //判断用户有没有 角色 有就返回角色id 没有就返回1000
//
//        Integer roleId = easUserService.findRoleIdByUserId(easUser.getId());
//
//
//        String strRoleId =roleId +"";
        System.out.println("roleId:"+roleId);
        System.out.println("strRoleId:"+strRoleId);
//        PageUtil pageUtil = new  PageUtil(page,limit);
//
//        //没有角色
//        if(roleId == null || !(strRoleId.length() >0 || roleId == 2)){//全体可见的部分公告,没要求
//            //type = 1 全员可见 type = 2 教师可见  type = 3 草稿  管理员可见
//            int type = 1;
//            int count = easNoticeService.getCountByTypeAndEasNotice(type,easNotice);
//            pageUtil.setTotal(count);
//            pageUtil.setCount(limit);
//            int totalPage = pageUtil.getTotalPage();
            System.out.println("总页数为"+totalPage);
//
//            List<EasNotice> list = easNoticeService.getNoticeListByTypeAndEasNotice(type,easNotice,pageUtil);
//
//            map.put("totalPage",totalPage);
//            map.put("count",count);
//            map.put("data",list);
//            map.put("code",0);
//            map.put("msg","");
//        }else if(roleId == 3){//增加教师公告可见
//            int type = 2;
//            int count = easNoticeService.getCountByTypeAndEasNotice(type,easNotice);
//            List<EasNotice> list = easNoticeService.getNoticeListByTypeAndEasNotice(type,easNotice,pageUtil);
//            pageUtil.setTotal(count);
//            pageUtil.setCount(limit);
//            int totalPage = pageUtil.getTotalPage();
            System.out.println("总页数为"+totalPage);
//
//            map.put("totalPage",totalPage);
//            map.put("count",count);
//            map.put("data",list);
//            map.put("code",0);
//            map.put("msg","");
//        }else{//管理员可见全部
//            int type = 3;
//            int count = easNoticeService.getCountByTypeAndEasNotice(type,easNotice);
//            List<EasNotice> list = easNoticeService.getNoticeListByTypeAndEasNotice(type,easNotice,pageUtil);
//
//            pageUtil.setTotal(count);
//            pageUtil.setCount(limit);
//            int totalPage = pageUtil.getTotalPage();
//
//            map.put("totalPage",totalPage);
//
//            map.put("count",count);
//            map.put("data",list);
//            map.put("code",0);
//            map.put("msg","");
//        }
//
//        return map;
//    }

    @RequestMapping(value="/getNotice",method = RequestMethod.GET)
    @ResponseBody
    public Map<String,Object> getNotice(@RequestParam(defaultValue = "1") Integer page,
                                        @RequestParam(defaultValue = "2") Integer limit,
                                        EasNotice easNotice) throws Exception {
        Map<String,Object> map = new HashMap<>();
//        System.out.println("模糊查询的内容为:"+easNotice.getContent());
        EasUser easUser = (EasUser) SecurityUtils.getSubject().getPrincipal();//获取EasUser对象
        //判断用户有没有 角色 有就返回角色id 没有就返回1000

        List<Integer> rolelist = easUserService.findRoleIdByUserId2(easUser.getId());


        PageUtil pageUtil = new  PageUtil(page,limit);
        if(rolelist.size() >= 2){
            int type = 3;
            int count = easNoticeService.getCountByTypeAndEasNotice(type,easNotice);
            List<EasNotice> list = easNoticeService.getNoticeListByTypeAndEasNotice(type,easNotice,pageUtil);

            pageUtil.setTotal(count);
            pageUtil.setCount(limit);
            int totalPage = pageUtil.getTotalPage();

            map.put("totalPage",totalPage);

            map.put("count",count);
            map.put("data",list);
            map.put("code",0);
            map.put("msg","");
        }else {
            if(rolelist.size() == 0 || rolelist.get(0) == 2){
                //type = 1 全员可见 type = 2 教师可见  type = 3 草稿  管理员可见
                int type = 1;
                int count = easNoticeService.getCountByTypeAndEasNotice(type,easNotice);
                pageUtil.setTotal(count);
                pageUtil.setCount(limit);
                int totalPage = pageUtil.getTotalPage();
//            System.out.println("总页数为"+totalPage);

                List<EasNotice> list = easNoticeService.getNoticeListByTypeAndEasNotice(type,easNotice,pageUtil);

                map.put("totalPage",totalPage);
                map.put("count",count);
                map.put("data",list);
                map.put("code",0);
                map.put("msg","");
            }else if(rolelist.get(0) == 3) {
                int type = 2;
                int count = easNoticeService.getCountByTypeAndEasNotice(type,easNotice);
                List<EasNotice> list = easNoticeService.getNoticeListByTypeAndEasNotice(type,easNotice,pageUtil);
                pageUtil.setTotal(count);
                pageUtil.setCount(limit);
                int totalPage = pageUtil.getTotalPage();
//            System.out.println("总页数为"+totalPage);

                map.put("totalPage",totalPage);
                map.put("count",count);
                map.put("data",list);
                map.put("code",0);
                map.put("msg","");
            }else{
                int type = 3;
                int count = easNoticeService.getCountByTypeAndEasNotice(type,easNotice);
                List<EasNotice> list = easNoticeService.getNoticeListByTypeAndEasNotice(type,easNotice,pageUtil);

                pageUtil.setTotal(count);
                pageUtil.setCount(limit);
                int totalPage = pageUtil.getTotalPage();

                map.put("totalPage",totalPage);

                map.put("count",count);
                map.put("data",list);
                map.put("code",0);
                map.put("msg","");
            }
        }

        return map;
    }


    //点击查看具体通知
    @RequestMapping(value="/lookNotice")
    public ModelAndView look(Integer id){
        ModelAndView modelAndView = new ModelAndView();
//        System.out.println("我是通知id:"+id);

        List<EasNotice> list = easNoticeService.getNoticeById(id);
        modelAndView.addObject("noticeList",list);
        modelAndView.setViewName("system/notice/homeNotice");

        return modelAndView;
    }


}

 如果也想学习本系统,下面领取。关注并回复:148ssm

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

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

相关文章

Python webdriver.Chrome()的使用

1.前提 Python与Chrome路径下均安装chromedriver.exe。 2.chromedriver.exe版本选择及下载 下载地址为&#xff1a;http://npm.taobao.org/mirrors/chromedriver/ Chrome版本查看&#xff1a;浏览器右上角三个点->帮助->关于Google Chrome 找到对应的版本&#xff0c;主…

大数据面试之YARN常见题目

大数据面试之YARN常见题目 1 YARN工作机制 1.1 图解 上面有单词少个r&#xff0c;就不改了&#xff0c;大家知道就行。 1.2 文字描述 文字版描述&#xff1a; 1、MapReduce程序提交到Client所在节点&#xff0c;在MR程序的主函数当中有job.waitForCompletion()将任务进行提…

Linux网络-五种IO模型

Linux网络-高级IO零、前言一、什么是IO二、五种IO模型1、阻塞IO2、非阻塞IO3、信号驱动IO4、IO多路转接5、异步IO三、高级IO重要概念1、同步通信 vs 异步通信2、阻塞 vs 非阻塞3、其他高级IO零、前言 本章主要就Linux网络讲解非常重要的一个话题-高级IO 一、什么是IO IO是输入i…

20221211英语学习

今日新词&#xff1a; helplessly adv.无助地&#xff1b;无能为力地 physicist n.物理学家, 物理学研究者 capable adj.有能力的&#xff0c;有才能的&#xff1b;能胜任的&#xff1b;可以…的&#xff1b;容许…的 spokeswoman n.女发言人 production n.产量&#xff1…

卡尔曼滤波应用

卡尔曼滤波器的过程 卡尔曼滤波器的过程分为&#xff1a; 状态方程&#xff1a; xkAxk−1Buk−1ωk−1zkHxkνk这样就得到了状态方程和观测方程的表达式其中xk是状态向量&#xff0c;A是转移矩阵&#xff0c;B是输入转换为状态的矩阵&#xff0c;uk是系统输入&#xff0c;ωk是…

【波段自适应梯度和细节校正:统一遥感融合】

A Unified Pansharpening Model Based on Band-Adaptive Gradient and Detail Correction &#xff08;基于波段自适应梯度和细节校正的统一全色锐化模型&#xff09; 利用全色锐化技术将全色&#xff08;PAN&#xff09;图像与多光谱&#xff08;MS&#xff09;图像融合&…

谈谈Java应用发布时CPU抖动的优化

研究背景 通常情况下应用发布或重启时都存在cpu抖动飙高&#xff0c;甚至打满的现象&#xff0c;这是由于应用启动时&#xff0c;JVM重新进行类加载与对象的初始化&#xff0c;CPU在整个过程中需要进行比平时更多的编译工作。同样&#xff0c;闲鱼的消息系统在重新发布时经常有…

fsQCA+NCA方法的软件操作及注意事项、论文实证分析部分的写作范式

目录前言1 软件操作步骤2 fsQCA方法的详细操作步骤2.1 软件下载2.2 数据的准备2.3 校准点的确定2.4 变量的校准步骤及闪退问题2.5 fsQCA的数据必要性检验&#xff08;开始一次最后一次&#xff09;2.6 频数、一致性水平、PRI一致性水平的确定2.6.1 频数的确定2.6.2 一致性水平、…

【中级ECharts技术】前端框架ECharts的dataset 管理数据对数据可视化的高级dataset 管理

dataset 管理数据 提供一份数据。 声明一个 X 轴,类目轴(category)。默认情况下,类目轴对应到声明多个 bar 系列,默认情况下,每个系列会自动对应到 dataset 的每一列。 option = {legend: {},tooltip: {},dataset:

Mac 中 MongoDB 使用

根据 homebrew-brew 官方的解释得知&#xff0c;MongoDB 不再是开源的了&#xff0c;并且已经从 Homebrew中移除 #43770 正是由于 MongoDB 的商业化不太理想&#xff0c;所以它选择了闭源。所以&#xff0c;在它闭源之前的那些 brew 安装方法都会报错了。网上很多的文章都是基…

[附源码]JAVA毕业设计雅博书城在线系统(系统+LW)

[附源码]JAVA毕业设计雅博书城在线系统&#xff08;系统LW&#xff09; 项目运行 环境项配置&#xff1a; Jdk1.8 Tomcat8.5 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术…

你想要的图片效果(动态实现)

一、前言 没有使用任何框架API&#xff0c;代码或逻辑在html或小程序都适用。主要实现图片随机位置、随机大小、不重叠&#xff0c;在页面上排布&#xff1b;还有扩展功能选定固定图片位置槽数、固定大小、不重叠&#xff0c;在页面上通过添加&#xff0c;图片随机排布。 二、…

我的创作纪念日(4周年)

机缘 回想当初&#xff0c;博主2017年底从北京中石油&#xff08;沙河总部&#xff09;辞职&#xff0c;一心想回到自己的家乡成都工作、不想在北京待了&#xff0c;在总部赵总的推荐下来到四川中石油工作&#xff08;刚好这边有人离职&#xff0c;所谓一个萝卜一个坑&#xf…

C语言入门(二)——常量,变量和表达式

继续Hello World 常量 变量 赋值 表达式 字符类型与字符编码 继续Hello World 前一个章节已经对Hello World程序做各种改动程序做各种改动看编译运行结果&#xff0c;其中有些改动会导致编译出错&#xff0c;有些改动会影响程序的输出&#xff0c;有些改动则没有任何影响…

C++:类的内存布局

文章目录1、虚的含义2、单基继承2.1、单继承2.2、单虚继承2.3、单虚继承 虚函数2.4、测试代码3、多基继承3.1、多继承 虚函数3.2、虚拟多继承 虚函数3.3、测试代码4、菱形继承4.1、菱形继承4.2、菱形虚拟继承4.3、测试代码5、效率分析建议先了解 C 继承与多态的相关知识&…

12.10 二叉搜索树与内部类

目录 一.二叉搜索树 1 概念 2 操作-查找 3.插入 4.删除(难点) 1.cur.leftnull 2.cue.rightnull 3.最复杂的情况 cur.left!null&&cur.right!null 6 性能分析 7 和 java 类集的关系 二.内部类 1.本地内部类 2.实例内部类 1.不可以定义静态 因为静态表示属于…

踩坑记录1——RK3588编译OpenCV

这两天有在板卡上跑代码的需求&#xff0c;拿到了一块RK3588CPU的板子&#xff0c;型号是HINLINK的HK88. 以后记录一下调试这个板子的问题&#xff0c;便于以后查看 0. 基本信息 板卡系统&#xff1a;ArmBian&#xff0c;基于Ubuntu20.04 OpenCV版本&#xff1a;3.4.5 采用方法…

Java项目:SSM公司人力资源管理系统

作者主页&#xff1a;源码空间站2022 简介&#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 项目介绍 本项目为后台管理系统,分为管理员与普通员工两种角色&#xff1b; 管理员角色包含以下功能&#xff1a; 管理员登录,员工账号管理,部门管理,员工…

陆拾肆- 时序数据的特征化

一、前期大数据状况 进行客户域大数据运营时&#xff0c;一般是在当前状态计算客户的行为特征。 如会建立特征为 近7天是否有登录昨天是否有登录近7天销售情况点击主页后是否有点击下层页面哪个页面点击购买总浏览电子产品的次数占访问次数占比不进行商品浏览&#xff0c;只进…

Codeforces Round #772 (Div. 2) D. Infinite Set

翻译&#xff1a; 给定一个数组&#x1d44e;&#xff0c;该数组由&#x1d45b;个不同的正整数组成。 让我们考虑一个无限整数集&#x1d446;&#xff0c;它包含至少满足以下条件之一的所有整数&#x1d465;: 对于某些1≤&#x1d456;≤&#x1d45b;&#xff0c;&#…