Java项目:SSM高校教职工差旅报销管理系统
创始人
2024-04-21 05:04:13
0

作者主页:源码空间站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 {@Autowiredprivate EasNoticeService easNoticeService;@Autowiredprivate EasUserService easUserService;@RequestMapping("/homePage")public String homePage() throws Exception{return "system/home/homePage";}//    @RequestMapping(value="/getNotice",method = RequestMethod.GET)
//    @ResponseBody
//    public Map getNotice(@RequestParam(defaultValue = "1") Integer page,
//                                        @RequestParam(defaultValue = "2") Integer limit,
//                                        EasNotice easNotice) throws Exception {
//        Map 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 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 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 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)@ResponseBodypublic Map getNotice(@RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "2") Integer limit,EasNotice easNotice) throws Exception {Map map = new HashMap<>();
//        System.out.println("模糊查询的内容为:"+easNotice.getContent());EasUser easUser = (EasUser) SecurityUtils.getSubject().getPrincipal();//获取EasUser对象//判断用户有没有 角色 有就返回角色id 没有就返回1000List 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 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 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 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 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 list = easNoticeService.getNoticeById(id);modelAndView.addObject("noticeList",list);modelAndView.setViewName("system/notice/homeNotice");return modelAndView;}}

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

相关内容

热门资讯

银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...
【NI Multisim 14...   目录 序言 一、工具栏 🍊1.“标准”工具栏 🍊 2.视图工具...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...
Android|无法访问或保存... 这个问题可能是由于权限设置不正确导致的。您需要在应用程序清单文件中添加以下代码来请求适当的权限:此外...
AWSECS:访问外部网络时出... 如果您在AWS ECS中部署了应用程序,并且该应用程序需要访问外部网络,但是无法正常访问,可能是因为...
北信源内网安全管理卸载 北信源内网安全管理是一款网络安全管理软件,主要用于保护内网安全。在日常使用过程中,卸载该软件是一种常...
AWSElasticBeans... 在Dockerfile中手动配置nginx反向代理。例如,在Dockerfile中添加以下代码:FR...
AsusVivobook无法开... 首先,我们可以尝试重置BIOS(Basic Input/Output System)来解决这个问题。...
ASM贪吃蛇游戏-解决错误的问... 要解决ASM贪吃蛇游戏中的错误问题,你可以按照以下步骤进行:首先,确定错误的具体表现和问题所在。在贪...
​ToDesk 远程工具安装及... 目录 前言 ToDesk 优势 ToDesk 下载安装 ToDesk 功能展示 文件传输 设备链接 ...