基本页面比较多,所以就不贴出来了,具体的页面可以自行浏览。

点我进入OA系统浏览界面(未做响应式布局,需电脑端打开)

账号密码:

部门:bumen------bumen

办公室:bangongshi------bangongshi

副厂长1:fuchang1------fuchang1

厂长:changzhang------changzhang

超级管理员:admin-------admin(目前只有添加账号功能)

需求:  

周一的时候做了将近五个小时,实现了几个部门间的简单流转功能,后来发现自己的数据库表结构不能满足要求,于是又重新构建了一下自己的数据库表结构。

  下面是数据库的表结构:

  document表:

  

  menu表:

  user表:

user表还不够完善,目前公文只能实现一条线的流转,即   部门---办公室---副厂长1---厂长---办公室---部门 ,如果不同的部门归属不同的副厂长管理,那么就不能实现所要求的功能,所以在后期准备新加一个“belong”列,来表示部门被哪个副厂长管理。

基本思路:

1、功能页加载:

  用户登陆后,cookie存储用户的用户名信息,同时loginservlet将用户的信息存到request域并转发到后台的主页中,后台的主页异步通过用户的权限来获取菜单。代码:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css"
href="${pageContext.request.contextPath }/css/bootstrap.min.css" />
<script src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<title>Insert title here</title> <script type="text/javascript">
$(function() {
var power = $("#power").val();
var content = "";
$
.post(
"${pageContext.request.contextPath}/getMenuByUserPower",
{
"power" : power
},
function(data) {
var userMenu = data;
for (var i = 0; i < userMenu.length; i++) {
content += "<li role='presentation'>"
+ "<a href='${pageContext.request.contextPath }/"+userMenu[i].url+"' target='right''>"
+ userMenu[i].name + "</a></li>";
}
$("#showDiv").html(content);
}, "json");
});
</script>
<style>
a {
text-decoration: none;
}
</style>
</head>
<body> <div
style="width: 100%; height: 120px; border: 1px solid red; float: left;">
<body style="background-color: whitesmoke">
<table border="0px" cellspacing="0px" cellpadding="0px"
width="1500px" height="90px">
<td width="1000px" align="left"><font size="5" color="gray">欢迎使用OA系统</font></td>
<td width="500px" align="right">
<span style="color: gray; font-size: 20px" > 欢迎您! &nbsp;&nbsp;${user.username }
&nbsp;&nbsp;&nbsp;&nbsp;
</span> <a href="${pageContext.request.contextPath}/logoff"><font
color="gray" size="4">退出登录</font></a>
</td>
</table>
</div> <div
style="height: 600px; width: 200px; border: 1px solid blue; float: left;">
<input type="text" value="${user.power }" id="power" hidden="">
<ul class="nav nav-pills nav-stacked" style="text-align: center;"
id="showDiv">
</ul>
</div> <div
style="height: 600px; width: 1310px; border: 1px solid gray; float: left;"> <iframe src="${pageContext.request.contextPath }/houtai/welcome.jsp"
name="right" width="100%" height="100%"> </iframe>
</div> </body>
</html>

2、公文间的流转

基本思路就是使用公文中的“current”属性,当前人是谁,那么公文便流转到了哪个部门了,然后部门查询公文的时候便通过“current”属性来查找公文。查找公文时通过存在cookie中的username来查询。具体代码比较多,在这里我分为了web层、service层、dao层,这里只贴出web层中的servlet代码:

package com.oa2.web;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.oa2.domain.Document;
import com.oa2.service.DocumentService; /**
* Servlet implementation class GetDocumentByCurrentServlet
*/
@WebServlet("/getDocumentByCurrent")
public class GetDocumentByCurrentServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=utf-8");
String url = request.getParameter("url");
Cookie[] cookies = request.getCookies();
String username = null;
for (Cookie cookie : cookies) {
if(cookie.getName().equals("user")) {
username = cookie.getValue();
break;
}
}
DocumentService service = new DocumentService();
List<Document> documentList = null;
try {
documentList = service.getDocumentByCurrent(username);
} catch (SQLException e) {
e.printStackTrace();
}
request.setAttribute("documentList", documentList);
if(url.equals("gongwenxiugai")||url.equals("gongwenliuzhuan")||url.equals("gongwenfasong")) {
request.getRequestDispatcher("/bangongshi/"+url+".jsp").forward(request, response);
}else if(url.equals("gongwenshenhe")) {
request.getRequestDispatcher("/fuchang/"+url+".jsp").forward(request, response);
}else if(url.equals("gongwenshenqian")) {
request.getRequestDispatcher("/changzhang/"+url+".jsp").forward(request, response);
}
} /**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
} }

这里不同的用户登陆都是使用同一个servlet来实现获取公文的,所以针对不同的跳转来源,跳转到不同的页面。

3、公文是否可签收

公文是否可签收,需要使用表中的两个属性“opinion_fu”和“opinion_manager”,分别是副厂长和厂长的意见,如果两者都同意,那么部门的公文才算是通过了上司的审批,才可以签收,查询的条件是 : opinion_fu='同意' and opinion_manager='同意' and current='bumen' and state='未签收'

这里就不贴代码了。

OA公文流转系统(未完成)的更多相关文章

  1. “公文流转系统 v1.0”

    1.项目需求: 河北金力集团是我省机械加工的龙头企业,主要从事矿山机械制造及各种机械零部件加工.企业有3个厂区,主厂区位于省高新技术开发区,3个分厂分别在保定.邢台和唐山.为增加企业的核心竞争力和加强 ...

  2. YbSoftwareFactory 代码生成插件【二十三】:集成强大的公文流转系统

    今天有空更新博客才发现快一年没有写博客了,不得不感叹时间过得真快.过去的一年确实也挺忙的,在此祝各位博友们新的一年工作顺利.权限模型在过去一年进行了不少的升级,主要集成了公文流转系统.多家手机短信接口 ...

  3. Java web 公文流转系统 完成结果

    河北金力集团公文流转系统 1.项目需求: 河北金力集团是我省机械加工的龙头企业,主要从事矿山机械制造及各种机械零部件加工.企业有3个厂区,主厂区位于省高新技术开发区,3个分厂分别在保定.邢台和唐山.为 ...

  4. 公文流转系统v0.1

    河北金力集团公文流转系统 1.项目需求: 河北金力集团是我省机械加工的龙头企业,主要从事矿山机械制造及各种机械零部件加工.企业有3个厂区,主厂区位于省高新技术开发区,3个分厂分别在保定.邢台和唐山.为 ...

  5. javaweb 公文流转系统制作

    该系统主要的要求就是实现公文的流转审核,用户有多重类型,在不同用户登录的时候要进入不同的页面,并能执行他们的权限. 用户分四种,普通部门(可以草拟公文并提交),办公室(接受普通部门的公文并编辑,最后提 ...

  6. 2019.12.9java公文流转系统

    自己来写这个系统真是没有什么思路.就弄了个登陆界面,在数据库建了个表,其它的代码一直有错误,登陆不进去.

  7. 课程分享 企业普及版贝斯OA与工作流系统

    企业普及版贝斯OA与工作流系统 基于J2EE+JBPM3.x/JBPM4.3+Flex流程设计器+Jquery+授权认证企业普及版贝斯OA与工作流系统 假设对这个课程有兴趣的.能够和我联系.QQ205 ...

  8. 通达OA在centos系统中快速部署文档(web和数据库)

    通达OA2008从windows环境移植到linux中(centos5.5及以上版本) 如果安装好了,还是无法访问,则需要清空浏览器缓存即可 1.安装lamp环境,这里用的是xampp集成安装包xam ...

  9. OA及权限系统

    一直想找一款适合自己的权限管理后台,始终都没找到合适的,决定自己写一个 开发环境:vs2012 ,sql2008 语言:C# 前端:ligurui,jquery ORM框架:EF6.0 先来晒下我的数 ...

随机推荐

  1. vim编辑器的常用命令

    按ESC键跳到命令模式,然后::w - 保存文件,不退出 vim.:w file -将修改另外保存到 file 中,不退出 vim.:w! -强制保存,不退出 vim .:wq -保存文件,退出 vi ...

  2. [python学习手册-笔记]002.python核心数据类型

    python核心数据类型 ❝ 本系列文章是我个人学习<python学习手册(第五版)>的学习笔记,其中大部分内容为该书的总结和个人理解,小部分内容为相关知识点的扩展. 非商业用途转载请注明 ...

  3. nginx&http 第二章 ngx 事件event处理 数据结构

    ngx_event.c :这个文件主要放置Nginx事件event模块的核心代码. 包含:进程事件分发器(ngx_process_events_and_timers).事件模块的模块和配置.模块初始化 ...

  4. cetos6.5 gcc4.8 安装

    1.准备源 #安装仓库 wget http://people.centos.org/tru/devtools-2/devtools-2.repo mv devtools-2.repo /etc/yum ...

  5. Makefile 指定源文件目录 make

    top=$(CURDIR) SRC_DIR=$(top)/src BUILD_DIR=$(SRC_DIR) src=$(wildcard $(SRC_DIR)/*.c) obj=$(patsubst ...

  6. one-wallhaven 一个壁纸程序

    one-wallhaven 一款基于 Electron 壁纸客户端 . gitee:https://gitee.com/ml13/wallhaven-electron github:https://g ...

  7. Idea eclipse 快捷键版

    查找/搜索 打开搜索界面     Ctrl+H 查找类文件             Ctrl+Shift+T 最近访问上一个文件      Ctrl+Alt+ ← 最近访问下一个文件        C ...

  8. C++ const的自我理解

    C++学习笔记–const const 是 constant 的缩写,本意是不变的,不易改变的意思.在 C++ 中是用来修饰内置类型变量,自定义对象,成员函数,返回值,函数参数. C++ const ...

  9. 源码分析:CountDownLatch 之倒计时门栓

    简介 CountDownLatch 是JDK1.5 开始提供的一种同步辅助工具,它允许一个或多个线程一直等待,直到其他线程执行的操作完成为止.在初始化的时候给定 CountDownLatch 一个计数 ...

  10. 卷积神经网络图像纹理合成 Texture Synthesis Using Convolutional Neural Networks

    代码实现 概述 这是关于Texture Synthesis Using Convolutional Neural Networks论文的tensorflow2.0代码实现,使用keras预训练的VGG ...