ERP技术全接触:数据库、编程和前端技术

信息技术在ERP中的作用是巨大的。我们在此先给出ERP的技术清单,之后我们将基于该列表展开全面的讨论。

3646d8e0d66bebd7be7df398b31c1e00.jpg-wh_651x-s_159487334.jpg

数据库

  • PostgreSQL

  • MSSQL

  • ORACLE SQL

编程技术

  • .NET和ASP.NET

  • Java

  • Ruby

  • Python

  • PHP

前端技术

  • JavaScript

  • AngualJS

  • React

  • Vue.JS

ERP系统的简单结构

在开始讨论ERP各项技术之前,我们首先需要了解一下ERP系统的典型结构。在现实生活中,一般企业的资源规划方案(resource planning solutions)包括:多个相互连接的应用程序、数据库、模块、和API等。而任何一种应用程序,都可以被视为由数据库、后端服务器、和前端(或称为用户界面)所组成:

数据库 – 各种与资产相关的数据(如,仓库里各种产品的数量)被存储于此。

后端 - 根据用户的需求,在系统中执行各种操作的“引擎”。例如,向数据库发出请求,以罗列出特定仓库内的产品和商品,然后将其呈现给用户。

前端 - 是用户用来与后端通信的图形界面,它能产生请求,并显示所接收到的信息。

这是从软件架构的角度,对ERP组件的概括性解释。在本文中,我们将使用上述分类作为ERP系统技术的构建标准,以讨论它们作为一整套商业智能软件,在企业中所起到的作用和展现的价值。

ERP的类型

1.C/S型与桌面型ERP

C/S(客户端/服务器)型ERP技术工作在一些hub主机上,它既能连接本地,又可以连接到云服务器上。此类ERP技术将数据库托管在某一中央位置,并且将其报告服务通过用户的接口分发到所有其他的位置上。C/S型ERP技术能够帮助企业对各种资源进行实时监控和管理。

而桌面型ERP,则是将其前端和后端作为应用程序运行在用户的主机上。它的数据是通过企业内网(如,本地服务器)的数据库、或企业外网(如Azure之类的云端数据库)共享的。可见,桌面型ERP方便了身处各地的团队成员,能够实现快速的协作和便利的访问。

2.云端型/基于Web型ERP

云端型/基于Web型ERP的数据库与后端都运行在云端,通常情况下,可以是一款SaaS产品。由于其界面是通过Web浏览器呈现的,因此用户能够在任何设备上通过Web浏览器访问到。

您可以轻松地通过各种应用,访问到托管服务器上的磁盘存储空间、内存和CPU等资源。就基于Web的ERP技术而言,由于其前期成本较低,企业能够保持在较长的一段时间内不需要额外软/硬件安装,因此,用户能够立竿见影地从基于云端的ERP技术上获利。

3.混合型ERP

混合型ERP是结合了基于Web和基于桌面端的ERP方案。因此,它既可以作为桌面应用程序被启动,也可以通过浏览器被访问到。由于它们拥有统一的共享数据库,因此用户无论是通过浏览器,还是桌面应用,都能访问到相同的数据。另外,其相应的后端有运行在服务器上的Web应用和用户主机上的桌面应用两种。而个人用户不论是通过浏览器、还是使用桌面应用程序向数据库发出请求,这两种后端模式都能够以相同的方式向云端数据库转发请求。

在实际应用中,企业更趋向于使用混合型ERP,而非单纯的云端型/基于Web型ERP,来实现快速实施、缩短维护周期和独立于任何服务商。当然,混合型ERP的缺点在于:它的安装一般是构建在对于最新技术架构进行了一定投入的基础上。因此,它没有基于云端型的ERP那么成熟,且无法进行全面的测试。

购置或托管硬件基础设施

众所周知,一个功能强大且稳定的基础设施,对于企业系统的健康性和持久性是至关重要的。我们在谨慎地甄选ERP技术的同时,也要考虑到硬件基础设施对于系统整体性能的影响。

如今,云计算已经能够让各个企业和它们的员工,随时随地通过互联网登录自己的系统中。对于那些不愿单纯依靠云端服务的公司而言,他们可以采用混合的方式,即:在企业内部保留部分ERP功能的基础上,将其他操作服务放置到托管主机里。

下面我们将和您一起讨论内部服务器和云端服务器各自的优、缺点:

内部服务器

优点

它能够让您完全掌控自己的备份。

由于存储在内部,第三方实体原则上无法访问到贵司的关键数据。

就算失去了外网连接,您仍可保证自己运营能够持续下去。

就成本效益而言,它是中、小型企业可以接受的方案。

缺点

其基础设施和硬件都会牵扯到巨额的安装成本。

您需要配备有高手在内的专业IT团队。同时,它会占用您办公室(或称服务器机房)的一部分空间。

由于处于企业内部,它更容易发现任何的数据丢失。

在灾难事故发生时,您可能无法保证恢复时间(RTO)。

云端服务器

优点

对于那些有着大量存储空间需求的小公司来说,更具吸引力。

您可以随时按需扩充现有的解决方案。例如,您可以随时购买更多的存储空间。

云端服务器能够为您提供更好的安全性。

您可以通过一键点击,来实现数据备份。您甚至可以轻松地通过智能手机、平板电脑、或一体机来完成。

您能够以更短的时间间隔(如,每15分钟)备份自己的数据。因此,针对一些特殊的紧急情况,它能够实现最小化的数据丢失率(RPO)。

缺点

一旦数据产生丢失,其恢复成本可能会超过数据本身的价值。

由于可能涉及到高昂的成本、和有限的可用存储空间等因素,用户对其数据的恢复能力可能会受到一定的限度。

为了避免数据丢失,而对大量的数据采用全量恢复时,您需要付出一定的时间和昂贵的成本。

重度依赖于互联网。一旦访问方、或被访问方失去了网络连接,用户则会在一段时间内无法访问到自己的数据。

ERP技术

1.数据库系统和数据库管理系统(DBMS)

在各类开发人员的心中,一般都有一张根据自己的经验所总结出的,能够较好地支持ERP技术的数据库列表。而DBMS则能够根据用户的查询请求,在其对应的数据库上检索数据。下面我们来看看不同的数据库及其管理系统。

PostgreSQL

PostgreSQL是一款功能强大的数据库。凭借着它所提供的server management studio和 server profiler等工具,您能够得心应手地开展各种数据排障工作。可以说,它是目前最先进的开源式数据库技术之一。因此,如果您的开发团队已经决定为ERP项目选择开源技术,那么PostgreSQL就是最好的选择。

在开源属性的背后,它拥有广泛的知识共享机制和庞大的生态支持社区,因此它在使用中很容易与其他系统相集成。此外,PostgreSQL包含了多样性的索引技术、具有全文检索的能力、以及弹性的搜索功能,这些对于ERP系统的用户来说都是非常必要的。

MSSQL

微软的SQL(即MSSQL)是当前普遍流行的ERP数据库之一。它的主要功能包括:根据应用程序的请求,存储并检索数据。MSSQL可以帮助您优化服务器的性能,进而确保系统的可用性和可恢复性。简易的安装、增强的性能、以及更好的安全特性都使之成为了开发者的心仪之选。

Oracle SQL

Oracle SQL的主要目标是:能够以敏捷的速度按需提生成、保存、和获取数据。作为一种新颖且复杂的ERP技术,这种关系型数据库提高了系统的整体生产效率。该SQL具有一定的自治和自愈能力,因此更适合于数据库系统的排障。

如今,无论是用到了关系型数据服务的云端,还是非关系数据库服务都有用到Oracle SQL。另外,Oracle SQL能够通过自动化备份,消除了各项手动任务,从而使用户也能轻松地访问到各类数据。

2.后端编程技术

能够提供ERP技术的后端编程语言真是不胜枚举。下面我们仅列出最为常用的五种。最终如何进行选择,还是取决于您系统的长期目标。

.NET

.NET和ASP.NET是开发者公认的ERP热门编程语言。这些框架能够为用户带来更少的代码、和增强的代码质量,进而缩短了开发周期、并降低了重用的额外成本。

.NET允许用户通过网络与合作伙伴轻松地实现应用整合,其中包括:价值链管理、产品应用、记账管理和服务应用等方面。由于使用了标准的互联网协议来进行通信,因此.NET基本上适用于各大主流的Web服务。另外,它提供了一整套丰富的Web与桌面开发工具,如WPF(Windows Presentation Foundation)和WinForms,它们能够在较短的时间内创建各种精良的应用接口。

Java

与.NET类似,Java可以被同时运用在桌面型和Web型的ERP系统中。不过,相应的桌面版前端应用需要被构建在SWING之上。而对于Web型ERP而言,由于它们可连接到相同的Java后端,因此各种Web开发框架,为不同的浏览器和平台提供了一致性的用户体验。

此外,对于那些同时需要具有云端和桌面计算能力的系统而言,Java是一种最佳的选择。一旦您在自己的ERP中使用了Java,您就可以将此类代码复用到其他任何业务之中。Java代码不但容易被编写,而且具有出色的网络支持能力。

另外,Java的优点还包括:具有良好的移动与桌面端UI、能恰当地确保数据的安全性、以及用户可以从任何非信任的网站处下载各种资源,而不会造成数据的损坏。可见,Java的各种灵活性奠定了其高效、实用、动态和独立的语言架构。

Ruby

Ruby入选我们的ERP技术清单的原因有二:首先,由于其具备自托管(self-hosting)的功能,因此具有模块和类的扩展能力。其次,它的数据库运行迅速,非常适合于CRM(客户关系管理)等各种应用。如果您准备搭建一个基于Web而非桌面版本的ERP,并配有移动应用的话,Ruby就很适合于后端的实现。当然,由于Ruby的程序员比较难以寻觅(在就业市场上比较珍稀),而且只能靠社区提供支持,因此Ruby的代码维护稍显困难。

Python

其实在多数情况下,我们都希望ERP不论是在主体架构上、还是其核心脚本上,都能够通过开放的技术、和简单的语言来实现。以目标为导向的Python不但易读,而且易用,因此程序员们很容易去实现它。Python能够提供复杂的数据、允许定期check-in和自动垃圾收集器。可见,它能够被用来在大规模的应用中创建字节码、并在ERP模型中采用高度抽象。

PHP

单从ERP的技术角度而言,PHP与上述各种语言略有不同。如今,许多企业的应用仍是由PHP所编写,同时它也还是内容管理系统(content management systems)最常用的语言之一。虽然PHP可谓是第一项服务器端技术,但由于它在后期缺乏改进,因此PHP的普及程度不及.NET,Java和Ruby。我们并不建议任何新的、和一些特殊的ERP系统采用PHP技术。

3. ERP前端技术

近年来,随着大量的ERP前端技术的涌现,各种精良的、且具备快速响应能力的接口也层出不穷。它们主要集中在桌面版本和基于Web版本这两个领域。当然,它们也是各有利弊,我们下面来具体讨论一下。

JavaScript

我们之所以首先提到JavaScript,是因为它与HTML5、以及CSS共同构建了现代Web应用程序、和单页面应用的三大支柱。

在大多数情况下,如果您要构建一个基于云的ERP系统,以供员工通过Web浏览器或移动应用使用的话,JavaScript会是您的理想选择。如果您想让访问更为便利,则可以在服务器端采用Node.js技术。它可以通过在用户的浏览器之外运行JavaScript代码,从而将繁重负载转移到云端完成。

AngularJS

如果您有Java和C#之类的后端,需要响应那些工作在不同设备上、和不同浏览器的Web应用时,AngularJS框架就很适合您。它能够帮助程序员们加速开发进程。当查询请求被发过来后,那些被预定义的数据信息能够轻松地被检索到。另外,用户还能够根据自己的需求,通过各种动态应用程序来获取他们所需的信息。

React

React提供了丰富的功能,很适合于那些以结果为导向的企业用来进行ERP的开发。一旦您使用它开发了网站代码,那么您也可以将其轻松地运用到某个移动应用之中,从而减少了开发所涉及到的总体成本。

Vue.JS

这种渐进式的框架被企业广泛地用来开发用户界面。您可以用它来创建桌面版本的ERP,和各种功能强大的单页面应用。而对于那些现有的项目而言,您同样可以轻松地添加相应的Vue.JS代码。同时,它在代码上的灵活性,也广受各类开发人员的欢迎。

结论

数据库、开发语言、和框架的多样性使得ERP技术更具灵活性。当然,为了保证应用的流畅运行和各个节点之间的顺畅连接,我们需要事先选择好适当的开发工具。

在一些特殊情况下,我们必须在应用程序开发的准备阶段,事先明确各种具体需求,例如:将使用到的平台、用户的数量、数据库的类型、系统的可扩展性、和安全性等方面。只有通过全方位的调查研究和深思熟虑,我们才能保证企业ERP项目的成功实施。

PS:更多内容请关注360linker官方公众号,让你快速精炼涨知识涨技术!

--------语法 --建立视图 --if exists(select * from sysobjects where name='视图名') -- drop view 视图名 --go --create view 视图名 --as --select 字段名 from 表名 [条件] --go --主外健约束语句没有执行 use T90ERP go --***********人力资源 --部门表:Depet if exists(select * from sysobjects where name='Depet') drop table Depet go create table Depet ( dept_id Int primary key identity(1,1) not null, --部门编号 主键,自增 dept_name Varchar(20) not null --部门名称 ) ----约束 --alter table Depet add constraint UQ_dept_name unique (dept_name) go --职位表:Post if exists(select * from sysobjects where name='Post') drop table Post go create table Post ( Post_id Int primary key identity(1,1) not null, --职位编号 主键 自增 Post_name Varchar(50) not null, --职位名称 唯一 Post_money Money not null, --职位工资 Dept_id int not null --部门编号 外 Int 级联删除 ) ----约束 --alter table post add constraint UQ_post_name unique (post_name) alter table post add constraint FK_post_deptId foreign key(post_deptId) references depet(dept_id) go --员工信息表:Employee if exists(select * from sysobjects where name='Employee') drop table Employee go create table Employee ( Emp_id Int primary key identity(1,1) not null, --员工信息编号 主键,自增 Emp_number Varchar(50) not null, --员工工号 唯一 Emp_postId Int not null, --职位编号 外键 级联删除 Emp_hire Datetime not null, --录用时间 Emp_state Bit not null, --状态 默认1 (1在职/0离职) ) ----约束 --alter table Employee add constraint UQ_emp_number unique (emp_number) alter table Employee add constraint FK_emp_postId foreign key (emp_postId) references post(post_id) --alter table Employee add constraint DF_emp_state default(1) for emp_state go --简历表:Resume if exists(select * from sysobjects where name='Resume') drop table Resume go create table Resume ( Res_id Int primary key identity(1,1) not null, --职员信息ID 主键 非空自增 Int Emp_id Int not null, --职员ID 外键 Res_name Varchar(50) not null, --真实姓名 Res_englishname Varchar(50) null, --英文名 空 Res_idcard Varchar(19) not null, --身份证号 唯一索引 只有18位数字或18位数字加X Res_sex bit not null, --性别 默认1 男 只有男和女两种 Res_bornDate datetime not null, --出生年月 Res_nativeplace varchar(50) not null, --籍贯 Res_nation Varchar(50) not null, --民族 默认汉族 Res_health text null, --健康状况 空 默认健康 Res_diploma Varchar(50) not null, --学历 Res_address Varchar(50) null, --联系地址 空,默认地址不详 Res_Tel Varchar(50) not null, --电话 只能是11为数字 Res_photo image null --照片 空 ) ----约束 alter table Resume add constraint FK_res_empid foreign key (res_empid) references Employee(emp_id) --alter table Resume add constraint UQ_res_idcard unique (res_idcard) --alter table Resume add constraint CK_res_idcard check (res_idcard like '[1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9] --[1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9]' or res_idcard like '[1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9] --[1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9][1-9]X') --alter table Resume add constraint DF_res_sex default (1) for res_sex --alter table Resume add constraint CK_res_sex check(res_sex=1 or res_sex=0) --alter table Resume add constraint DF_res_nation default ('汉族') for res_nation --alter table Resume add constraint DF_res_health default ('健康') for res_health --alter table Resume add constraint DF_res_health defatult(1) for res_health --alter table Resume add constraint DF_res_address default ('地址不详') for res_address --alter table Resume add constraint CK_res_tel check(len(res_tel)=11) go --考勤类型表:CheckType if exists(select * from sysobjects where name='CheckType') drop table CheckType create table CheckType ( Checkt_id int primary key identity(1,1) not null, --考勤类型 主键 自增 Int Checkt_name varchar(50) not null --考勤名称(干什么) Varchar(50) ) go --考勤表:Check if exists(select * from sysobjects where name='CheckInfo') drop table CheckInfo create table CheckInfo ( Check_id int primary key identity(1,1) not null, --考勤id 主键 自增 Int Emp_id int not null, --员工id 外键 Int Check_hire datetime not null, --考勤开始时间 开始时间必须 Datetime Check_end datetime not null, --考勤结束时间 要在结束时间之前 Datatime Checkt_id int not null, --考勤类型 外键 Int Check_gtime int not null, --工休天数 Int check_time int not null --扣薪天数 Int ) ----约束 alter table CheckInfo add constraint FK_check_empId foreign key (check_empId) references Employee(emp_id) alter table CheckInfo add constraint FK_check_checktId foreign key (check_empId) references checkt(checkt_id) --alter table CheckInfo add constraint CK_check_hire check(check_hirecheck_hire) go --培训管理:Train if exists(select * from sysobjects where name='Train') drop table Train create table Train ( Train_id int primary key identity(1,1) not null, --培训编号 主键 自增 Int Train_time datetime not null, --培训日期 Datetime Train_address varchar(200) not null, --地址 Varchar(200) Train_content text not null, --内容 text Emp_id int not null, --职员编号 Int Train_teacher varchar(20) not null --讲师 Varchar(20) ) go --奖罚记录类型:PrizeAmerceType if exists(select * from sysobjects where name='PrizeAmerceType') drop table PrizeAmerceType create table PrizeAmerceType ( Prizet_id int primary key identity(1,1) not null, --奖罚记录类型id 主键 自增 Int Prizet_name varchar(50) not null, --奖罚记录名称 Varchar(50) Prizet_money money not null --奖罚金额 Money ) go --奖罚记录表:PrizeAmerceRecord if exists(select * from sysobjects where name='PrizeAmerceRecord') drop table PrizeAmerceRecord create table PrizeAmerceRecord ( Prize_id int primary key identity(1,1) not null, --奖罚记录id 主键 自增 Int Emp_id int not null, --员工id 外键 Int Prize_time datetime not null, --时间 Datetime Prizet_id int not null, --引用奖罚类型id 外键 Int Prize_desc text null, --描述 空,默认没有描述 text ) ----约束 --alter table PrizeAmerceRecord add constraint FK_prize_empid foreign key(prize_empId) references Employee(emp_id) --alter table PrizeAmerceRecord add constraint FK_prize_prizetid foreign key(prize_prizetId) references PrizeAmerceType(prizet_id) alter table PrizeAmerceRecord add constraint DF_prize_desc default('没有描述') for prize_desc go --档案:Record if exists(select * from sysobjects where name='Record') drop table Record create table Record ( Re_id int primary key identity(1,1) not null, --档案id 主键 自增 Int Re_code varchar(50) not null, --档案代码 日期+随即数生成 Varchar(50) Emp_id int not null, --员工id 外键 Int Prize_id int not null --奖罚记录id 外键 Int ) ----约束 --alter table Record add constraint FK_re_empId foreign key (re_empId) references Employee(emp_id) go --薪资表:SalaryInfo if exists(select * from sysobjects where name='SalaryInfo') drop table SalaryInfo create table SalaryInfo ( Sal_id int primary key identity(1,1) not null, --薪水表ID 主键 自增 Int Emp_id int not null, --职员ID 外键 Int Sal_bonus money not null, --奖金 Money Sal_deduct numeric(18,2) not null, --扣除 Numerica(18,2) Sal_tax money not null, --扣税 Money 默认为0 Sal_sum money not null, --总薪水 Money Sal_date smalldatetime not null --发放日期 smalldatetime ) ----约束 --alter table SalaryInfo add constraint FK_sal_empid foreign key (sal_empId) references Employee(emp_id) go --***********采购管理 --供应商级别:LevelInfo if exists(select * from sysobjects where name='LevelInfo') drop table LevelInfo create table LevelInfo ( Level_id int primary key identity(1,1) not null, --级别编号 主 自增 Int Level_name varchar(10) not null --级别名称 Varchar(10) ) go --供应商:Victualer if exists(select * from sysobjects where name='Victualer') drop table Victualer create table Victualer ( Victu_id int primary key identity(1,1) not null, --供应商编号 主 自增 Int Victu_name varchar(100) not null, --名称 Varchar(100) Level_id int not null, --级别编号 外,LevelInfo表 Int Victu_people varchar(20) not null, --联系人 Varchar(20) Victu_telephone varchar(11) not null, --联系电话 Varvhar(11),必须是11位 Victu_email varchar(50) null, --邮件 空,必须符合邮件格式 Varchar(50) Victu_address text not null, --联系地址 Text 默认地址不详 Victu_remark text null --备注 空,默认没有备注 Text ) ----约束 --alter table Victualer add constraint FK_Victu_levelId foreign key(Victu_levelId) references LevelInfo(Level_id) alter table Victualer add constraint CK_Victu_telephone check(len(victu_telephone)=11) alter table Victualer add constraint CK_Victu_email check(victu_email like '%@%.%') alter table Victualer add constraint DF_Victu_remark default ('没有描述') for victu_remark alter table Victualer add constraint DF_Victu_address default ('地址不详') for victu_address go --商品类别:Sort if exists(select * from sysobjects where name='Sort') drop table Sort create table Sort ( Sort_id int primary key identity(1,1) not null, --类别编号 主 自增 Int Sort_name varchar(50) not null --类别名称 Varchar(50) ) go --商品规格表:Spec if exists(select * from sysobjects where name='Spec') drop table Spec create table Spec ( Spec_id int primary key identity(1,1) not null, --规格编号 主 自增 Int Spec_name varchar(50) not null --规格名称 Varchar(50) ) go --商品表:Product if exists(select * from sysobjects where name='Product') drop table Product create table Product ( Pro_id int primary key identity(1,1) not null, --商品编号 主 自增 Int Pro_code varchar(20) not null, --商品代码 按日期+随机数生成,唯一 Varchar(20) Pro_name varchar(50) not null, --商品名称 Varchar(50) Sort_id int not null, --类别编号 外,Sort表 Int Spec_id int not null, --规格编号 外,Spec表 Int Pro_count int not null, --数量 Int Pro_inPrice money not null, --进货价 Money Pro_outPrice money not null, --销售价 Money Victu_id int not null, --供应商编号 外,Victualer表 Int 级联删除 Pro_remark text null --备注 空,默认没有备注 Text ) ----约束 go --询价单:AskPrice if exists(select * from sysobjects where name='AskPrice') drop table AskPrice create table AskPrice ( Ask_id int primary key identity(1,1) not null, --询价单编号 主 自增 Int Victu_id int not null, --供应商编号 外,Victualer表 Int Pro_id int not null, --商品编号 外,Product表 Int ask_price money not null, --报价 Money Ask_time datetime not null --添加时间 Datetime ) ----约束 go --采购单: BuyBill if exists(select * from sysobjects where name='BuyBill') drop table BuyBill create table BuyBill ( Buybill_id int primary key identity(1,1) not null, --采购单编号 主 自增 Int Buybill_num varchar(20) not null, --采购单据号 按日期+随机数生成,唯一 varchar(20) Emp_id int not null, --采购员编号 外,职员表 Int Buybill_time datetime not null, --采购时间 采购时间必须在交货时间之前 Datetime Buybill_delitime datetime not null, --交货时间 Datetime Buybill_remark text not null, --合同备注 Text Buybill_Isexam bit not null --库管是否审批 bit ) ----约束 go --采购明细表: BuyList if exists(select * from sysobjects where name='BuyList') drop table BuyList create table BuyList ( Buylist_id int primary key identity(1,1) not null, --采购明细编号 主 自增 Int Buybill_id int not null, --采购单编号 外,Buybill表 Int Pro_id int not null, --商品编号 外,Prduct表 Int Buylist_Count int not null, --采购数量 Int Buylist_price money not null, --采购价 Money Victu_id int not null, --供应商编号 外,Vitcualer表 Int Dsub_id int not null --采购单商品仓库编号 外,DepotSubarea表 Int ) ----约束 go --采购付款单:PayBill if exists(select * from sysobjects where name='PayBill') drop table PayBill create table PayBill ( Pay_id int primary key identity(1,1) not null, --付款单编号 主 自增 Int Buybill_id int not null, --采购单编号 外,Buybill表 Int Pay_oncoming money not null, --此次付款 如果应付款分为几次付 Money Pay_deal money not null, --应付款 则应付款应该要保持一致 Money Emp_id int not null, --财务部审批人编号 外,职员表 Int Pay_Isexam bit not null, --财务部是否审批 bit Pay_remark text null --备注 空,默认没有备注 text ) ----约束 go --采购退货单:MoveBill if exists(select * from sysobjects where name='MoveBill') drop table MoveBill create table MoveBill ( Move_id int primary key identity(1,1) not null, --退货单编号 主 自增 Int Buybill_id int not null, --采购单编号 外,Buybill表 Int Move_time datetime not null, --退单日期 退单日期必须是在采购日期之后 Datetime Dsub_id int not null, --库管审批人编号 外, Int Move_Isexam bit not null, --库管是否审批 Bit Move_remark text null --备注 空,默认没有备注 Text ) ----约束 go --***********仓库管理 --库区表:DepotSubarea if exists(select * from sysobjects where name='DepotSubarea') drop table DepotSubarea create table DepotSubarea ( Dsub_id int primary key identity(1,1) not null, --库区id 主键 自增 Int Dsub_name varchar(10) not null,--库区名称 Varchar(10) Dsub_type varchar(10) not null--仓库类别 Varchar(10) ) go --移动类型表:Transfer if exists(select * from sysobjects where name='Transfer') drop table Transfer create table Transfer ( Tran_id int primary key identity(1,1) not null, --移动类型id 主键 自增 Int Tran_name varchar(20) not null --移动类型名称 Varchar(20) ) go --入库明细表:PutInfo if exists(select * from sysobjects where name='PutInfo') drop table PutInfo create table PutInfo ( Put_id Int primary key identity(1,1) not null, --入库明细id 主键 自增 Put_code Varchar(20) not null, --入库单代码 日期+随即数生成 Buybill_id Int not null, --采购单编号 外键 Put_time Datetime not null, --入库时间 Put_people varchar(20) not null, --入库人 Dsub_id Int not null, --库区 外键 级联删除 Tran_id Int not null --移动类型 外键 ) ----约束 go --库存表:Stock if exists(select * from sysobjects where name='Stock') drop table Stock create table Stock ( Stock_id Int primary key identity(1,1) not null, --库存编号 主键 自增 Dsub_id Int not null,            --库区id 外键 Pro_id Int not null,              --商品id 外键 Stock_number Int not null             --商品数量 ) ----约束 go --出库明细表:OutInfo if exists(select * from sysobjects where name='OutInfo') drop table OutInfo create table OutInfo ( Out_id Int primary key identity(1,1) not null, --出库明细id 主键 自增 Out_code Varchar(20) not null, --出库单据号 唯一 Out_time Datetime not null, --出库时间 Out_llr Varchar(20) not null, --领料人 Out_flr Varchar(20) not null, --发料人 Out_tranId Int not null, --移动类型 Out_dsubId Int not null --库区 ) ----约束 go --补仓管理:RepairDepot if exists(select * from sysobjects where name='RepairDepot') drop table RepairDepot create table RepairDepot ( Repa_id Int primary key identity(1,1) not null, --补仓id 主键 自增 Pro_id Int not null, --商品id 外键 Repa_number Int not null, --补仓数量 Repa_dsubId Int not null, --库区表 外键 Repa_remark text null --备注 空,默认没有备注 ) ----约束 go --***********销售管理 --客户级别表(CustLevel) if exists(select * from sysobjects where name='CustLevel') drop table CustLevel create table CustLevel ( Cl_id Int primary key identity(1,1) not null,   --编号 主,自增 Cl_name Varchar(10) not null,           --级别名称 Cl_discount float not null            --折扣 ) --约束 go --客户信息表(customer) if exists(select * from sysobjects where name='customer') drop table customer create table customer ( C_id int primary key identity(1,1) not null,   --编号 主,自动增长 C_number Varchar(10) not null,          --客户代号 C_name Varchar(20) not null,            --客户名称 C_linkman Varchar(20) not null,        --联系人 C_phone Varchar(11) not null,          --联系电话 C_address Text null,              --公司地址 空,默认地址不详 Cl_id Int not null,              --级别编号 外 C_remark text null,               --备注信息 默认没有备注 空 ) --约束 go --订单表(orders) if exists(select * from sysobjects where name='orders') drop table orders create table orders ( O_id int primary key identity(1,1) not null,  --编号 主,自增 O_number Varchar(20) not null,         --订单代码 日期+随即数生成 O_timestart datetime not null,        --下单日期 下单时间必须在交货时间之前 O_timestop Datetime not null,         --交货日期 O_money Money not null,             --下单金额 C_id Int not null,             --客户编号 外 级联删除 Emp_id int not null              --员工编号 外 ) --约束 go --订单明细表(OrderDetails) if exists(select * from sysobjects where name='OrderDetails') drop table OrderDetails create table OrderDetails ( Od_id Int primary key identity(1,1) not null,   --编号 主,自增 O_id int not null,                --订单编号 外 Pro_id int not null,                --商品编号 外 Od_price Money not null,               --单件金额 Od_accounts Int not null               --单件数量 ) --约束 go --销售单表(Sells) if exists(select * from sysobjects where name='Sells') drop table Sells create table Sells ( Sell_id int primary key identity(1,1) not null,    --编号 主,自增 O_id int not null,                 --订单编号 外 Sell_timestart datetime not null,           --销售日期 下单时间必须在交货时间之前 Sell_timestop Datetime not null,            --交货日期 Sell_money Money not null,              --销售金额 C_id Int not null,              --客户编号 外 Emp_id int not null,               --员工编号 外 Sell_remark text null                   --备注 空 ) --约束 go --销售单明细表(SellDetails) if exists(select * from sysobjects where name='SellDetails') drop table SellDetails create table SellDetails ( Selld_id int primary key identity(1,1) not null,   --编号 主,自增 O_id int not null,               --订单编号 Pro_id int not null,              --商品编号 Selld_price Money not null,             --单件金额 Selld_accounts Int not null              --单件数量 ) --约束 go --***********财务管理 --财务科目表:FinaSub if exists(select * from sysobjects where name='FinaSub') drop table FinaSub create table FinaSub ( Fina_id Int primary key identity(1,1) not null, --科目编号 主,自增 Fina_name Varchar(50) not null, --科目名称 Fina_accounts Varchar(50) not null, --银行账号 随机数生成 Fina_people Varchar(50) not null, --联系人 Fina_telephone Varchar(11) not null, --联系电话 Fina_mode Varchar(10) not null, --是借或贷 Fina_play Varchar(10) not null, --借贷方式(现金、发票) Fian_money money not null --金额 ) go --发票信息表:Invoice if exists(select * from sysobjects where name='Invoice') drop table Invoice create table Invoice ( Invo_id Int primary key identity(1,1) not null, --发票编号 主,自增 Invo_code Varchar(50) not null, --发票单据号 日期+随机数生成,唯一 Invo_type Varchar(10) not null, --发票类型 Invo_money money not null, --金额 Invo_use Varchar(50) not null, --发票用途 Invo_datetime Datetime not null, --发票日期 Emp_id int not null --财务员编号 外,职员表 ) ----约束 go --固定资产表:FixedAssets if exists(select * from sysobjects where name='FixedAssets') drop table FixedAssets create table FixedAssets ( Fix_id Int primary key identity(1,1) not null, --资产编号 主,自增 Fix_name Varchar(100) not null, --资产名称 Fix_money Money not null, --可汇兑金额 Fix_datetime Datetime not null, --添加时间 Fix_remark Text null, --备注 空,默认没有备注 ) ----约束 go --财务员统计视图 --***********权限管理 --用户表:UserInfo if exists(select * from sysobjects where name='UserInfo') drop table UserInfo create table UserInfo ( u_id int primary key identity(1,1) not null, --用户编号,主,自增 u_name varchar(20) not null, --用户名,即登录名 u_pass varchar(10) not null, --登录密码 u_time datetime not null --登录时间 ) --insert into UserInfo values('admin','admin','2008-08-05') --insert into UserInfo values('yqh','yqh','2008-08-05') --insert into UserInfo values('gogo','gogo','2008-08-05') --insert into UserInfo values('wangwang','wangwang','2008-08-05') select * from UserInfo go --角色表:RolesInfo if exists(select * from sysobjects where name='RolesInfo') drop table RolesInfo create table RolesInfo ( r_id int primary key identity(1,1) not null, --角色编号,主,自增 r_name varchar(20) not null, --角色名称,即职位名称,唯一 r_desc text null --角色描述,空,默认没有描述 ) alter table RolesInfo add constraint UQ_r_name unique (r_name) alter table RolesInfo add constraint DF_r_desc default ('没有描述') for r_desc --insert into RolesInfo values('系统管理员','可以有任何操作') --insert into RolesInfo values('总经理','最高管理者') --insert into RolesInfo values('部门经理','管理者') --insert into RolesInfo values('普通员工',default) select * from RolesInfo go --用户和角色中间表(因为是、一对多的关系):UserRolesCenter if exists(select * from sysobjects where name='UserRolesCenter') drop table UserRolesCenter create table UserRolesCenter ( c_id int primary key identity(1,1) not null, --中间表编号,主,自增 u_id int not null, --外,用户编号,修改和删除规则都是层叠 r_id int not null --外,角色编号,修改和删除规则都是层叠 ) alter table UserRolesCenter add constraint FK_u_id foreign key (u_id) references UserInfo(u_id) alter table UserRolesCenter add constraint FK_r_id foreign key (r_id) references RolesInfo(r_id) --insert into UserRolesCenter values(1,1) --insert into UserRolesCenter values(1,2) --insert into UserRolesCenter values(2,2) --insert into UserRolesCenter values(3,3) --insert into UserRolesCenter values(4,4) select * from UserRolesCenter --delete from UserRolesCenter where c_id=5 --查询视图 select * from UserRolesView --查询角色1中已有的用户,利用视图 select * from UserRolesView where r_id=1 --查询角色1中没有的用户,利用子查询,用户表中的所有用户减去角色中已有的用户 Select * from UserInfo where u_id not in (select u_id from UserRolesView where r_id=1) go --菜单表:MenuInfo if exists(select * from sysobjects where name='MenuInfo') drop table MenuInfo create table MenuInfo ( M_id Int primary key identity(1,1) not null,--菜单编号 主,自增 M_name Varchar(50) not null,--菜单名称 M_url Varchar(50) null,--菜单链接 空 M_parentId int not null,--父菜单编号 ) --约束 --insert into MenuInfo values('系统权限管理','',0) --insert into MenuInfo values('人力资源管理','',0) --insert into MenuInfo values('采购管理','',0) --insert into MenuInfo values('仓库管理','',0) --insert into MenuInfo values('销售管理','',0) --insert into MenuInfo values('财务管理','',0) select * from MenuInfo go --4.角色和菜单中间表即权限表:PowerInfo if exists(select * from sysobjects where name='PowerInfo') drop table PowerInfo create table PowerInfo ( P_id Int primary key identity(1,1) not null,--权限编号 主 R_id Int not null,--角色编号 外 ,修改和删除规则都是层叠 M_id int not null,--菜单编号 外 ,修改和删除规则都是层叠 ) --约束 alter table PowerInfo add constraint FK_pr_id foreign key (r_id) references RolesInfo(r_id) alter table PowerInfo add constraint FK_m_id foreign key (m_id) references MenuInfo(m_id) --insert into PowerInfo values(1,1) --insert into PowerInfo values(1,2) --insert into PowerInfo values(2,2) --insert into PowerInfo values(3,3) --insert into PowerInfo values(4,4) select * from PowerInfo --查询视图 select * from RolesMenuView --查询角色1中已有的功能,利用视图 select * from RolesMenuView where r_id=1 --查询角色1中没有的功能,利用子查询,菜单表中的所有功能减去角色中已有的功能 Select * from MenuInfo where m_id not in (select m_id from RolesMenuView where r_id=1) go
引用中提到,ERP系统的开发技术需要考虑已有的资源情况和产品开发计划和目标,同时要兼顾长远发展。基于Web的开发技术被认为是大势所趋,特别是对于初涉ERP开发领域的开发人员和厂商而言。另外,开发平台和产品平台的建构也是ERP厂商获得成功的必由之路,一个兼具自主性和开放性的技术平台能够带来持续的发展动力和长期回报。 引用中提到,中小型ERP产品的开发平台更加广泛,除了Java和.Net,还包括Delphi、PowerBuilder、VB等传统的C/S开发技术。根据自身开发队伍的能力选择开发平台是一个关键因素。同时,注重系统结构设计,加强系统的灵活性,采用三层结构设计等方法可以打造适用于中小企业的ERP产品。 引用中指出,中型ERP产品的功能特性与大型ERP产品并没有太大差别,但成熟程度、细节处理和用户体验是妨碍中型ERP产品成为巨头的因素。二次开发能力被认为是ERP产品的重要标竿,近年来国内产品在这方面取得了长足进步。一些老牌厂商和面向中小企业的ERP厂商都具备了强大的技术创新能力,并提供足够的用户定制能力。 综上所述,ERP系统的开发技术包括基于Web的开发技术、传统的C/S开发技术,如Java、.Net、Delphi、PowerBuilder、VB等。选择开发技术应根据已有资源情况和开发计划和目标,并注重系统结构设计和灵活性。此外,二次开发能力和用户定制能力也是评价一个ERP系统的重要因素。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值