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

相关内容

热门资讯

前端-session、jwt 目录:   (1)session (2&#x...
linux入门---制作进度条 了解缓冲区 我们首先来看看下面的操作: 我们首先创建了一个文件并在这个文件里面添加了...
关于测试,我发现了哪些新大陆 关于测试 平常也只是听说过一些关于测试的术语,但并没有使用过测试工具。偶然看到编程老师...
前缀和与对数器与二分法 1. 前缀和 假设有一个数组,我们想大量频繁的去访问L到R这个区间的和,...
nodejs:本地安装nvm实... 一、背景-使用不同版本node的原因 vue3+ts、nuxt3版本,node...
JAVA集合知识整理 Java集合知识整理 HashMap相关 HashMap的底层数据结构:jdk1.8之...
无刷直流电机介绍及单片机控制实... 无刷直流电机介绍及单片机控制实例前言基本概念优势与劣势使用寿命基本结构使用单片机控制实例电子调速器&...
fwdiary(2) dp2 1.传纸条  AcWing 275. 传纸条 - AcWing 走两条路,走一条最大的...
常用的DOS命令 常用的DOS命令 DOS(Disk Operating System,磁...
<C++> 类和对象(下) 1.const成员函数将const修饰的“成员函数”称之为const成员函数,cons...