日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > windows >内容正文

windows

OA 办公系统 模块设计

發(fā)布時(shí)間:2023/12/20 windows 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 OA 办公系统 模块设计 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

--連接主數(shù)據(jù)庫(kù) use Master go --如果數(shù)據(jù)庫(kù)simpleoa 存在,則先刪除simpleoa。 if exists (select * from sysdatabases where name='simpleoa') drop database simpleoa go--創(chuàng)建simpleoa數(shù)據(jù)庫(kù) create database simpleoa go-- use simpleoa go--創(chuàng)建用戶表 create table [dbo].[User] ([UserID] int Identity(1,1) not null,--用戶ID[UserLoginName] nvarchar(20) not null, --用戶登錄名[UserName] nvarchar(20) not null, --用戶姓名[UserPassword] nvarchar(20) not null, --用戶密碼[UserRegister] nvarchar(20) default getdate(), --用戶注冊(cè)時(shí)間[UserUp] bit default 'true', --是否需要上交[UserInfo] nvarchar(200) not null --備注 -- ) alter table [dbo].[User] add constraint pk_user primary key(UserID); go--創(chuàng)建部門表 create table [dbo].[Department] ([DepartmentID] [int] identity(1,1) not null, --部門ID[DepartmentNum] [nvarchar](20) not null, --部門編號(hào)[DepartmentName] [nvarchar](20) not null, --部門名稱[UserID] [int] not null, --部門負(fù)責(zé)人ID[DepartmentInfo] [nvarchar](200) not null --部門備注 ) alter table [dbo].[Department] add constraint pk_department primary key(DepartmentID); go --添加外鍵約束 --alter table Department add constraint dep_ref_use foreign key(UserID) references [dbo].[User](UserID) --go--創(chuàng)建消息表 create table [dbo].[Message] ([MessageID] [int] identity(1,1) not null, --消息ID[MessageSender] [int] not null, --外鍵[MessageSubject] [nvarchar](50) default getdate(), --消息主題[MessageBody] [nvarchar](500) not null, --消息內(nèi)容[MessageDataTime] [datetime] default getdate(), --發(fā)送消息時(shí)間[MessageAttachment] [bit] default 'false' --是否含有附件 ) alter table [dbo].[Message] add constraint pk_MessageID primary key (MessageID); go --消息接收人表: create table [dbo].[Recipient] ([RecipientID] [int] identity(1,1) not null, --接收人ID[MessageID] [int] not null, --外鍵[RecipientRead] [bit] not null, --是否讀過(guò)[RecipientDel] [bit] not null, --是否刪除(顯示在已刪除消息欄)[RecipientReadTime] [nvarchar](20) default '尚未閱讀', --客戶要求能看到接收人是否已經(jīng)看過(guò)。[RecipientDelTime] [nvarchar](20) default '尚未刪除', --儲(chǔ)存刪除消息時(shí)間[RecipientAllDel] [nvarchar](20) default '尚未徹底刪除'--不再顯示在已刪除消息欄 ) alter table [dbo].[Recipient] add constraint pk_recipient primary key(RecipientID); go --附件表 create table [dbo].[Attachment] (AttachmentID [int] identity(1,1), --附件IDAttachmentName [nvarchar](50) not null, --附件名稱AttachmentFilePath [nvarchar](100) not null, --附件存放類型AttachmentType [nvarchar](20) not null, --附件文件類型AttachmentDateTime [datetime] not null, --附件上傳時(shí)間AttachmentSource [nvarchar](20) not null, --附件來(lái)源:消息、文章、上交?AttachmentSourceID [int] not null, --附件來(lái)源ID ) alter table [dbo].[Attachment] add constraint pk_Attachment primary key(AttachmentID) go--每月上傳時(shí)間表 create table [dbo].[Time] (TimeID [int] identity(1,1), --表時(shí)間IDTimeName [nvarchar](20) not null, --時(shí)間變量名TimeContent [datetime] default getdate() --時(shí)間變量值 ) alter table [dbo].[Time] add constraint pk_timeid primary key(TimeID) go 代碼 --連接主數(shù)據(jù)庫(kù)
use Master
go

--如果數(shù)據(jù)庫(kù)simpleoa 存在,則先刪除simpleoa。
if exists (select * from sysdatabases where name='simpleoa')
drop database simpleoa
go

--創(chuàng)建simpleoa數(shù)據(jù)庫(kù)
create database simpleoa
go

--
use simpleoa
go

--創(chuàng)建用戶表
create table [dbo].[User]
(
[UserID] int Identity(1,1) not null,--用戶ID
[UserLoginName] nvarchar(20) not null, --用戶登錄名
[UserName] nvarchar(20) not null, --用戶姓名
[UserPassword] nvarchar(20) not null, --用戶密碼
[UserRegister] nvarchar(20) default getdate(), --用戶注冊(cè)時(shí)間
[UserUp] bit default 'true', --是否需要上交
[UserInfo] nvarchar(200) not null --備注 --
)
alter table [dbo].[User] add constraint pk_user primary key(UserID);
go


--創(chuàng)建部門表
create table [dbo].[Department]
(
[DepartmentID] [int] identity(1,1) not null, --部門ID
[DepartmentNum] [nvarchar](20) not null, --部門編號(hào)
[DepartmentName] [nvarchar](20) not null, --部門名稱
[UserID] [int] not null, --部門負(fù)責(zé)人ID
[DepartmentInfo] [nvarchar](200) not null --部門備注
)
alter table [dbo].[Department] add constraint pk_department primary key(DepartmentID);
go
--添加外鍵約束
--
alter table Department add constraint dep_ref_use foreign key(UserID) references [dbo].[User](UserID)
--
go

--創(chuàng)建消息表
create table [dbo].[Message]
(
[MessageID] [int] identity(1,1) not null, --消息ID
[MessageSender] [int] not null, --外鍵
[MessageSubject] [nvarchar](50) default getdate(), --消息主題
[MessageBody] [nvarchar](500) not null, --消息內(nèi)容
[MessageDataTime] [datetime] default getdate(), --發(fā)送消息時(shí)間
[MessageAttachment] [bit] default 'false' --是否含有附件
)
alter table [dbo].[Message] add constraint pk_MessageID primary key (MessageID);
go
--消息接收人表:
create table [dbo].[Recipient]
(
[RecipientID] [int] identity(1,1) not null, --接收人ID
[MessageID] [int] not null, --外鍵
[RecipientRead] [bit] not null, --是否讀過(guò)
[RecipientDel] [bit] not null, --是否刪除(顯示在已刪除消息欄)
[RecipientReadTime] [nvarchar](20) default '尚未閱讀', --客戶要求能看到接收人是否已經(jīng)看過(guò)。
[RecipientDelTime] [nvarchar](20) default '尚未刪除', --儲(chǔ)存刪除消息時(shí)間
[RecipientAllDel] [nvarchar](20) default '尚未徹底刪除'--不再顯示在已刪除消息欄
)
alter table [dbo].[Recipient] add constraint pk_recipient primary key(RecipientID);
go
--附件表
create table [dbo].[Attachment]
(
AttachmentID
[int] identity(1,1), --附件ID
AttachmentName [nvarchar](50) not null, --附件名稱
AttachmentFilePath [nvarchar](100) not null, --附件存放類型
AttachmentType [nvarchar](20) not null, --附件文件類型
AttachmentDateTime [datetime] not null, --附件上傳時(shí)間
AttachmentSource [nvarchar](20) not null, --附件來(lái)源:消息、文章、上交?
AttachmentSourceID [int] not null, --附件來(lái)源ID
)
alter table [dbo].[Attachment] add constraint pk_Attachment primary key(AttachmentID)
go

--每月上傳時(shí)間表
create table [dbo].[Time]
(
TimeID
[int] identity(1,1), --表時(shí)間ID
TimeName [nvarchar](20) not null, --時(shí)間變量名
TimeContent [datetime] default getdate() --時(shí)間變量值
)
alter table [dbo].[Time] add constraint pk_timeid primary key(TimeID)
go

?

最近偶然接到這樣一個(gè)小項(xiàng)目,所以認(rèn)真做一下。

1,消息模塊設(shè)計(jì):

?

???? 方案一:A給B,C,D發(fā)送信息,則在消息表中生成3條信息,接收人分別是B,C,D,并有Bool表示是否查看過(guò)。

???? 方案二:A給B,C,D發(fā)送信息,在表A中生成一條信息?,表B中保存消息ID,和接收人分別是B,C,D的3條信息。(優(yōu)點(diǎn),當(dāng)消息字?jǐn)?shù)多時(shí),能有效節(jié)省數(shù)據(jù)庫(kù)空間)

???? 關(guān)于消息附件:設(shè)計(jì)表FuJianBiao ,每個(gè)附件記錄引用消息表ID,可實(shí)現(xiàn)一條消息附帶多條附件。

?

2,用戶及權(quán)限模塊設(shè)計(jì):

????

?

用戶角色表關(guān)聯(lián)用戶表和角色表,角色功能表關(guān)聯(lián)角色表和功能表,都是多對(duì)多關(guān)系。每個(gè)用戶有多個(gè)角色,每個(gè)角色也有多個(gè)用戶;每個(gè)角色有多個(gè)功能,每個(gè)功能可以對(duì)應(yīng)多個(gè)角色,由于該項(xiàng)目對(duì)權(quán)限要求明確而且很簡(jiǎn)單,所以不必這樣設(shè)計(jì)用戶權(quán)限系統(tǒng)。簡(jiǎn)單合適就好。

?

3,部門管理模塊(管理員)設(shè)計(jì)

設(shè)計(jì)部門表

?

4,文檔上傳管理模塊:

?

?

5,服務(wù)器文件管理模塊:

?

?

?

轉(zhuǎn)載于:https://www.cnblogs.com/netact/archive/2010/12/08/1900568.html

總結(jié)

以上是生活随笔為你收集整理的OA 办公系统 模块设计的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。