You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DSWMS/说明文档/初始化数据库/DSWMS结构建立.sql

2428 lines
95 KiB
MySQL

2 years ago
ALTER TABLE [dbo].[code_goods] ADD [GOODSFEETYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
CREATE TABLE [dbo].[INFO_ACCBOOK] (
[ACCBOOKID] uniqueidentifier NOT NULL,
[ACCBOOKNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TAXNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGECODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_INFO_ACCBOOK] PRIMARY KEY CLUSTERED ([ACCBOOKID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[INFO_ACCBOOK] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[INFO_GOODS] (
[GID] uniqueidentifier NOT NULL,
[ACCBOOKID] uniqueidentifier NOT NULL,
[ORDERNO] numeric(10) NULL,
[MATERIALNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[HSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSMODEL] varchar(600) COLLATE Chinese_PRC_CI_AS NULL,
[COUNTRY] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REPORTUNIT] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNIT] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNIT2] nchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[PRICE] numeric(18,4) NULL,
[CURRENCYSTR] varchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[ZHIXINGBIAOZHI] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[JIANGUANQIXIAN] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[XIUGAIBIAOZHI] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[JIZHANGQINGDANNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[JIZHANGQINGDANORDER] numeric(10) NULL,
[REMARK] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_INFO_GOODS] PRIMARY KEY CLUSTERED ([GID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[INFO_GOODS] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS] (
[WMSID] uniqueidentifier NOT NULL,
[BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BILLTYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MATERIALNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSHSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(22,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[ISCLEAR] bit NULL,
[BSSTATUS] bit NULL,
[FEESTATUS] bit NULL,
[TIMEMARK] timestamp NULL,
[FEEENDDATE] datetime NULL,
[FEESTARTDATE] datetime NULL,
[INDATE] datetime NULL,
[KGS_SINGLE] numeric(18,3) NULL,
[CBM_SINGLE] numeric(18,3) NULL,
[STORAGEUNITCOUNT_SINGLE] numeric(22,6) NULL,
[RULEUNITCOUNT_SINGLE] numeric(18,3) NULL,
[OP] uniqueidentifier NULL,
[NETWEIGHT] decimal(18,3) NULL,
[CUSTOMNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ACCBOOKNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS] PRIMARY KEY CLUSTERED ([WMSID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS'
GO
CREATE TABLE [dbo].[OP_WMS_CHANGE] (
[WMSLOGID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[DOBSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DOGID] uniqueidentifier NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CHANGETYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(18,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[KGS2] numeric(18,3) NULL,
[CBM2] numeric(18,3) NULL,
[PKGS2] numeric(18,3) NULL,
[KINDPKGS2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PAYEDTAXES2] bit NULL,
[STORAGEUNIT2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT2] numeric(18,6) NULL,
[RULEUNIT2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT2] numeric(18,3) NULL,
[KGS3] numeric(18,3) NULL,
[CBM3] numeric(18,3) NULL,
[PKGS3] numeric(18,3) NULL,
[KINDPKGS3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PAYEDTAXES3] bit NULL,
[STORAGEUNIT3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT3] numeric(18,6) NULL,
[RULEUNIT3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT3] numeric(18,3) NULL,
[NETWEIGHT] decimal(18,3) NULL,
[NETWEIGHT2] decimal(18,3) NULL,
[NETWEIGHT3] decimal(18,3) NULL,
[DODATE] datetime NULL,
CONSTRAINT [PK_OP_WMS_CHANGE_LOG<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־] PRIMARY KEY CLUSTERED ([WMSLOGID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_CHANGE] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD>¼
<EFBFBD>޺<EFBFBD>׺<EFBFBD>ֶ<EFBFBD>Ϊ<EFBFBD>ֵ <EFBFBD><EFBFBD>׺2Ϊԭֵ <EFBFBD><EFBFBD>׺3Ϊ<EFBFBD><EFBFBD>ֵ',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_CHANGE'
GO
CREATE TABLE [dbo].[OP_WMS_CHECK] (
[WMSCHECKID] uniqueidentifier NOT NULL,
[BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STOREHOUSE] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[DODATE] datetime NULL,
[REMARK] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[BILLSTATUS] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_CHECK] PRIMARY KEY CLUSTERED ([WMSCHECKID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_CHECK] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_CHECK_DETAIL] (
[WMSCHECKDETAILID] uniqueidentifier NOT NULL,
[WMSCHECKID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[WMSPHYSICSID] uniqueidentifier NULL,
[PKGS] numeric(18,3) NULL,
[PKGS_CHANGE] numeric(18,3) NULL,
[REMARK] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK2] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyID] uniqueidentifier NULL,
[ModifyDate] datetime NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_CHECK_DETAIL] PRIMARY KEY CLUSTERED ([WMSCHECKDETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_CHECK_DETAIL] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_FEE] (
[FEEID] uniqueidentifier NOT NULL,
[PID] uniqueidentifier NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[FEETYPE] varchar(2) COLLATE Chinese_PRC_CI_AS NOT NULL,
[FEENAME] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[PRICE] numeric(18,2) NULL,
[QUANTITY] numeric(18,4) NULL,
[AMOUNT] numeric(18,2) NULL,
[CURRENCY] varchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[CreateDate] datetime NULL,
CONSTRAINT [PK_OP_WMS_FEE] PRIMARY KEY CLUSTERED ([FEEID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_FEE] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_FEECALENDAR] (
[FEECALENDERID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[WMSDUIID] uniqueidentifier NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[FEEDATE] datetime NULL,
[QUANTITY] numeric(18,2) NULL,
[FEETYPE] int NULL,
[PRICE] numeric(18,2) NULL,
[AMOUNT] numeric(18,2) NULL,
CONSTRAINT [PK_OP_WMS_FEECALENDAR] PRIMARY KEY CLUSTERED ([FEECALENDERID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_FEECALENDAR] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_FEECALENDAR'
GO
CREATE TABLE [dbo].[OP_WMS_FEEDUI_STORAGE] (
[WMSDUIID] uniqueidentifier NOT NULL,
[BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ACCDATE] datetime NULL,
[QUANTITY] numeric(18,2) NULL,
[AMOUNT] numeric(18,2) NULL,
[STARTDATE] datetime NULL,
[ENDDATE] datetime NULL,
[BILLSTATUS] varchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[FEESTATUS] bit NULL,
[BSSTATUS] bit NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[CreateDate] datetime NULL
)
GO
ALTER TABLE [dbo].[OP_WMS_FEEDUI_STORAGE] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD>˵<EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_FEEDUI_STORAGE'
GO
CREATE TABLE [dbo].[OP_WMS_FEEDUI_STORAGE_DETAIL] (
[WMSDUIDETAILID] uniqueidentifier NOT NULL,
[WMSDUIID] uniqueidentifier NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ACCDATE] datetime NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[QUANTITY] numeric(18,2) NULL,
[AMOUNT] numeric(18,2) NULL,
[STARTDATE] datetime NULL,
[ENDDATE] datetime NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[FEETYPE] tinyint NULL,
CONSTRAINT [PK_OP_WMS_FEEDUI_STORAGE_DETAI] PRIMARY KEY CLUSTERED ([WMSDUIDETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_FEEDUI_STORAGE_DETAIL] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>ϸ',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_FEEDUI_STORAGE_DETAIL'
GO
CREATE TABLE [dbo].[OP_WMS_FEERATE] (
[FEERATEID] uniqueidentifier NOT NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSFEETYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[INUSE] bit DEFAULT ('true') NULL,
CONSTRAINT [PK_OP_WMS_FEERATE] PRIMARY KEY CLUSTERED ([FEERATEID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_FEERATE] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD>ͻ<EFBFBD>-<2D>Ʒ<EFBFBD>Ʒ<EFBFBD><C6B7> <20><><EFBFBD>ʱ<EFBFBD>
',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_FEERATE'
GO
CREATE TABLE [dbo].[OP_WMS_FEERATE_DETAIL] (
[ID] uniqueidentifier NOT NULL,
[FEERATEID] uniqueidentifier NULL,
[FEEMAKETYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[FEENAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DEFAULTUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[FEEPRICE] numeric(18,3) NULL,
[FEETYPE] tinyint NULL,
[FEEGRADE] tinyint NULL,
[FEESCALE] int NULL,
[ADDPRICE] numeric(18,3) NULL,
CONSTRAINT [PK_OP_WMS_FEERATE_DETAIL] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_FEERATE_DETAIL] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD>Ϣ
',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_FEERATE_DETAIL'
GO
CREATE TABLE [dbo].[OP_WMS_IN_DO] (
[BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[WMSDOID] uniqueidentifier NOT NULL,
[WMS_PLAN_BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BILLTYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MATERIALNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSHSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PAYEDTAXES] bit NULL,
[BSSTATUS] bit NULL,
[CreateDate] datetime NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[FEESTATUS] bit NULL,
[BILLSTATUS] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[DODATE] datetime NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_IN_DO] PRIMARY KEY CLUSTERED ([WMSDOID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_IN_DO] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ο<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>߼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_IN_DO'
GO
CREATE TABLE [dbo].[OP_WMS_IN_DO_GOODS] (
[WMSDODETAILID] uniqueidentifier NOT NULL,
[WMSDOID] uniqueidentifier NULL,
[STOREHOUSE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(22,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(22,6) NULL,
[WMSPLANID] uniqueidentifier NULL,
[WMSPLANDETAILID] uniqueidentifier NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[OP] uniqueidentifier NULL,
[NETWEIGHT] decimal(18,3) NULL,
[REMARK2] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_IN_DO_GOODS] PRIMARY KEY CLUSTERED ([WMSDODETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_IN_DO_GOODS] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD>¼ʵ<EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_IN_DO_GOODS'
GO
CREATE TABLE [dbo].[OP_WMS_IN_PLAN] (
[WMSPLANID] uniqueidentifier NOT NULL,
[WMSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CONTRACTNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BILLTYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PLANTIME] date NULL,
[ACCDATE] date NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ACCBOOKNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[GOODSNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(18,3) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[REMARK] varchar(400) COLLATE Chinese_PRC_CI_AS NULL,
[BSSOURCE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[FEESTATUS] bit NULL,
[BSSTATUS] bit NULL,
[TIMEMARK] datetime DEFAULT (getdate()) NULL,
[ModifyDate] datetime NULL,
[ModifyID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ISEND] bit NULL,
[MASTERBSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[NETWEIGHT] decimal(18,3) NULL,
[CUSTOMNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ETA] datetime NULL,
[CTNNUM] tinyint NULL,
[JINJINGBEIANSHENBAORIQI] datetime NULL,
[JINGNEISHOUHUOREN] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[INSPECTION_NO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PLAN_GETTIME] datetime NULL,
[CUSTOMAMOUNT] numeric(18,2) NULL,
CONSTRAINT [PK_OP_WMS_IN_PLAN] PRIMARY KEY CLUSTERED ([WMSPLANID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_IN_PLAN] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_IN_PLAN_GOODS] (
[GID] uniqueidentifier NOT NULL,
[WMSPLANID] uniqueidentifier NULL,
[MATERIALNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSHSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(22,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[REMARK] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMSINSPECTION] bit NULL,
[STOREHOUSEINSPECTION] bit NULL,
[NETWEIGHT] decimal(18,3) DEFAULT ((0)) NULL,
[SEALNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSMODEL] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_IN_PLAN_GOODS] PRIMARY KEY NONCLUSTERED ([GID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY],
CONSTRAINT [AK_KEY_1_OP_WMS_I] UNIQUE NONCLUSTERED ([GID] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_IN_PLAN_GOODS] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD>λ/<2F>ִ<EFBFBD><D6B4>Ʒѵ<C6B7>λ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>շѱ<EFBFBD>׼<EFBFBD><EFBFBD>λ',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_IN_PLAN_GOODS',
'COLUMN', N'STORAGEUNIT'
GO
CREATE TABLE [dbo].[OP_WMS_LOGIC] (
[WMSLOGICID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[NAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[VALUE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_LOGIC] PRIMARY KEY CLUSTERED ([WMSLOGICID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_LOGIC] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD>߼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_LOGIC'
GO
CREATE TABLE [dbo].[OP_WMS_LOGIC_LOG] (
[WMSLOGIC_LOGID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[WMSLOGICID] uniqueidentifier NULL,
[CHANGETYPE] varchar(4) COLLATE Chinese_PRC_CI_AS NULL,
[NAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[VALUE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[NAME2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[VALUE2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[CreateDate] datetime NULL,
CONSTRAINT [PK_OP_WMS_LOGIC_LOG] PRIMARY KEY CLUSTERED ([WMSLOGIC_LOGID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_LOGIC_LOG] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD>߼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼ <20><>׺2Ϊԭֵ',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_LOGIC_LOG'
GO
CREATE TABLE [dbo].[OP_WMS_MOVE] (
[WMSDOID] uniqueidentifier NOT NULL,
[BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DODATE] datetime NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[WMSID] uniqueidentifier NULL,
[WMSPHYSICSID] uniqueidentifier NULL,
[WMSPHYSICSID_NEW] uniqueidentifier NULL,
[STOREHOUSE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STOREHOUSE_NEW] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE_NEW] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(18,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,6) NULL,
[BILLSTATUS] varchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[NETWEIGHT] decimal(18,3) NULL,
CONSTRAINT [PK_OP_WMS_MOVE] PRIMARY KEY CLUSTERED ([WMSDOID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_MOVE] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ֻ<EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>ϸֱ<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_MOVE'
GO
CREATE TABLE [dbo].[OP_WMS_OUT_DO] (
[WMSDOID] uniqueidentifier NOT NULL,
[WMSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DODATE] datetime NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(800) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[CreateDate] datetime NULL,
[ModifyDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ISEND] bit NULL,
[FEESTATUS] bit NULL,
[BSSTATUS] bit NULL,
[BSSOURCE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BILLSTATUS] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[MBLNO] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMNO_IMPORT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PICKUPNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TRUCKNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TRUCKMODEL] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[WMSPLANID] uniqueidentifier NULL,
[CUSTOMNO] varchar(300) COLLATE Chinese_PRC_CI_AS NULL,
[WEIGHING] numeric(18,6) NULL,
[GOODSNAME] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSFEETYPE] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_OUT_DO] PRIMARY KEY CLUSTERED ([WMSDOID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_OUT_DO] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_OUT_DO_GOODS] (
[WMSDODETAILID] uniqueidentifier NOT NULL,
[WMSDOID] uniqueidentifier NULL,
[WMSPLANDETAILID] uniqueidentifier NULL,
[MATERIALNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSHSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STOREHOUSE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(18,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[WMSID] uniqueidentifier NULL,
[WMSPHYSICSID] uniqueidentifier NULL,
[NETWEIGHT] decimal(18,3) NULL,
[CUSTOMNO] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_OUT_DO_GOODS] PRIMARY KEY CLUSTERED ([WMSDODETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_OUT_DO_GOODS] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_OUT_PLAN] (
[WMSPLANID] uniqueidentifier NULL,
[WMSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PLANTIME] date NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(400) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[FEESTATUS] bit NULL,
[BSSTATUS] bit NULL,
[TIMEMARK] datetime DEFAULT (getdate()) NULL,
[ModifyDate] datetime NULL,
[ModifyID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ISEND] bit NULL,
[CUSTOMNO] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSNAME] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSFEETYPE] varchar(200) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[OP_WMS_OUT_PLAN] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_OUT_PLAN_DETAIL] (
[WMSOUTDETAILID] uniqueidentifier NOT NULL,
[WMSPLANID] uniqueidentifier NULL,
[WMSID] uniqueidentifier NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MATERIALNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSHSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(18,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[WMSPHYSICSID] uniqueidentifier NULL,
[NETWEIGHT] decimal(18,3) NULL,
[CUSTOMNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_OUT_PLAN_DETAIL] PRIMARY KEY CLUSTERED ([WMSOUTDETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_OUT_PLAN_DETAIL] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_PHYSICS] (
[WMSPHYSICSID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[STOREHOUSE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) DEFAULT ((0)) NULL,
[CBM] numeric(18,3) DEFAULT ((0)) NULL,
[PKGS] numeric(18,3) DEFAULT ((0)) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(22,6) DEFAULT ((0)) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) DEFAULT ((0)) NULL,
[STARTDATE] datetime NULL,
[FEEENDDATE] datetime NULL,
[KGS_SINGLE] numeric(18,3) NULL,
[CBM_SINGLE] numeric(18,3) NULL,
[STORAGEUNITCOUNT_SINGLE] numeric(22,6) NULL,
[RULEUNITCOUNT_SINGLE] numeric(18,3) NULL,
[NETWEIGHT] decimal(18,3) NULL,
CONSTRAINT [PK_OP_WMS_PHYSICS] PRIMARY KEY CLUSTERED ([WMSPHYSICSID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_PHYSICS] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_PHYSICS'
GO
CREATE TABLE [dbo].[OP_WMS_PHYSICS_CHANGE] (
[WMSPHYSICS_LOGID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[WMSPHYSICSID] uniqueidentifier NULL,
[STOREHOUSE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DOBSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DOGID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CHANGETYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(22,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[KGS2] numeric(18,3) NULL,
[CBM2] numeric(18,3) NULL,
[PKGS2] numeric(18,3) NULL,
[KINDPKGS2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STOREHOUSE2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT2] numeric(22,6) NULL,
[RULEUNIT2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT2] numeric(18,3) NULL,
[KGS3] numeric(18,3) NULL,
[CBM3] numeric(18,3) NULL,
[PKGS3] numeric(18,3) NULL,
[KINDPKGS3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STOREHOUSE3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT3] numeric(22,6) NULL,
[RULEUNIT3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT3] numeric(18,3) NULL,
[DODATE] datetime NULL,
[NETWEIGHT] decimal(18,3) NULL,
[NETWEIGHT2] decimal(18,3) NULL,
[NETWEIGHT3] decimal(18,3) NULL,
CONSTRAINT [PK_OP_WMS_PHYSICS_CHANGE<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>] PRIMARY KEY CLUSTERED ([WMSPHYSICS_LOGID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_PHYSICS_CHANGE] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD>¼
һ<EFBFBD>θı<EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־
<EFBFBD>ֱ<EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>־
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_PHYSICS_CHANGE'
GO
CREATE TABLE [dbo].[OP_WMS_PHYSICS_DODETAIL] (
[DODETAILID] uniqueidentifier NOT NULL,
[WMSDOID] uniqueidentifier NOT NULL,
[WMSPHYSICSID] uniqueidentifier NOT NULL,
[WMSID] uniqueidentifier NULL,
[STOREHOUSE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(18,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[STARTDATE] datetime NULL,
[FEEENDDATE] datetime NULL,
[NETWEIGHT] decimal(18,3) NULL,
CONSTRAINT [PK_OP_WMS_PHYSICS_DODETAIL] PRIMARY KEY CLUSTERED ([WMSPHYSICSID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_PHYSICS_DODETAIL] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>¼ <20><><EFBFBD>ڼ<EFBFBD>¼<EFBFBD>ƿ⡢<C6BF><E2A1A2>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_PHYSICS_DODETAIL'
GO
CREATE TABLE [dbo].[OP_WMS_STOREHOUSE] (
[Id] int IDENTITY(1,1) NOT NULL,
[CORPNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(4) COLLATE Chinese_PRC_CI_AS NOT NULL,
[AREANAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[INUSE] int NULL,
[ISOWN] int NULL,
[REMARK] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[MAPHTML] varchar(max) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_STOREHOUSE_1] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_STOREHOUSE] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_STOREHOUSE_AREA] (
[Id] int IDENTITY(1,1) NOT NULL,
[Pid] int NOT NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[AREANAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITVOLUME] int NULL,
[ISLEAF] int NULL,
[INUSE] int NULL,
CONSTRAINT [PK_OP_WMS_STOREHOUSE_AREA_1] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_STOREHOUSE_AREA] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_STOREHOUSE_AREA_POSITION] (
[GID] uniqueidentifier NOT NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[ModifyDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ROWNUM] int NULL,
[COLUMNNUM] int NULL,
[REMARK] nchar(10) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_STOREHOUSE_AREA_POSITION] PRIMARY KEY CLUSTERED ([GID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_STOREHOUSE_AREA_POSITION] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_STOREHOUSE_GOODSTYPE] (
[Id] int IDENTITY(1,1) NOT NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[LINENUM] int NULL,
[GOODSCODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_STOREHOUSE_GOODSTYPE] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_STOREHOUSE_GOODSTYPE] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_STOREHOUSE_LETOUT] (
[GID] uniqueidentifier NOT NULL,
[AREACODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STOREHOUSECODE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREA] numeric(18,3) NULL,
[STARTDATE] datetime NULL,
[ENDDATE] datetime NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[PRICE] numeric(18,3) NULL,
[DAYPRICE] numeric(18,3) NULL,
[REPAYPRICE] numeric(18,4) DEFAULT ((0)) NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_STOREHOUSE_LETOUT] PRIMARY KEY CLUSTERED ([GID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_STOREHOUSE_LETOUT] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_STOREHOUSE_LETOUT'
GO
CREATE TABLE [dbo].[OP_WMS_TEMP] (
[ID] uniqueidentifier NOT NULL,
[MID] uniqueidentifier NULL,
[DEPART] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[NAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ZHI] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_TEMP] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_TEMP] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_TRANSFERGOODS] (
[WMSTRANSFERGOODSID] uniqueidentifier NOT NULL,
[BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OLDCUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TRANSFERDATE] datetime NULL,
[STOREHOUSEDAYS] tinyint NULL,
[STOREHOUSEENDDATE] datetime NULL,
[WMSINFEE_OLDCUST] bit NULL,
[WMSOUTFEE_OLDCUST] bit NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[BILLSTATUS] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[NEWCUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_TRANSFERGOODS] PRIMARY KEY CLUSTERED ([WMSTRANSFERGOODSID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_TRANSFERGOODS] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD>Ȩת<EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_TRANSFERGOODS'
GO
CREATE TABLE [dbo].[OP_WMS_TRANSFERGOODS_DETAIL] (
[WMSDODETAILID] uniqueidentifier NOT NULL,
[WMSTRANSFERGOODSID] uniqueidentifier NULL,
[REMARK] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[WMSID] uniqueidentifier NULL,
[ISALL] bit NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[STORAGEUNITCOUNT] numeric(22,6) NULL,
[RULEUNIT] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RULEUNITCOUNT] numeric(18,3) NULL,
[BSSTATUS] bit NULL,
[FEESTATUS] bit NULL,
[WMSID_NEW] uniqueidentifier NULL,
[NETWEIGHT] decimal(18,3) NULL,
CONSTRAINT [PK_OP_WMS_TRANSFERGOODS_DETAIL] PRIMARY KEY CLUSTERED ([WMSDODETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_TRANSFERGOODS_DETAIL] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>ϸ
<EFBFBD><EFBFBD>תʱ<EFBFBD>ճ<EFBFBD><EFBFBD>߼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ճ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>ϸ',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_TRANSFERGOODS_DETAIL'
GO
CREATE TABLE [dbo].[OP_WMS_TRUCK] (
[GID] uniqueidentifier NOT NULL,
[WMSPLANID] uniqueidentifier NULL,
[TRUCKTEAM] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TRUCKNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DRIVER] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MOBILE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[LICENSENUM] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[GOODSCOD] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KGS] numeric(18,3) NULL,
[CBM] numeric(18,3) NULL,
[PKGS] numeric(18,3) NULL,
[KINDPKGS] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CNTRNO1] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PKGS1] numeric(18,3) NULL,
[CNTRNO2] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PKGS2] numeric(18,3) NULL,
[CNTRNO3] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PKGS3] numeric(18,3) NULL,
[DRIVELICENSE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[WEIGHING] numeric(18,6) NULL,
CONSTRAINT [PK_OP_WMS_TRUCK] PRIMARY KEY CLUSTERED ([GID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_TRUCK] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_WEIGH] (
[WMSWEIGHID] uniqueidentifier NOT NULL,
[BSNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DODATE] datetime NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CUSTOMWEIGH] bit NULL,
CONSTRAINT [PK_OP_WMS_WEIGH] PRIMARY KEY CLUSTERED ([WMSWEIGHID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_WEIGH] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_WEIGH_DETAIL] (
[WMSWEIGHDETAILID] uniqueidentifier NOT NULL,
[WMSWEIGHID] uniqueidentifier NOT NULL,
[CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[PICPATH] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[FILEPATH] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyID] uniqueidentifier NULL,
[ModifyDate] datetime NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_WEIGH_DETAIL] PRIMARY KEY CLUSTERED ([WMSWEIGHDETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_WEIGH_DETAIL] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_WORKDETAIL] (
[WORKDETAILID] uniqueidentifier NOT NULL,
[WMSDOID] uniqueidentifier NULL,
[WORKER] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[WORKDATE] datetime NULL,
[WORKNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[WORKLOADCOUNT] numeric(18,3) NULL,
[SCALE] numeric(18,3) NULL,
[WORKLOAD] numeric(18,3) NULL,
[REMARK] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_IN_DO_WORKDETAIL] PRIMARY KEY CLUSTERED ([WORKDETAILID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_WORKDETAIL] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_WORKDETAIL'
GO
CREATE TABLE [dbo].[OP_WMS_WORKNAME] (
[WORKNAMEID] uniqueidentifier NOT NULL,
[WORKNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SCALE] decimal(18,3) NULL,
[REMARK] nchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[Creator] nchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] nchar(10) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
CONSTRAINT [PK_OP_WMS_WORKNAME] PRIMARY KEY CLUSTERED ([WORKNAMEID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_WORKNAME] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[OP_WMS_YARD] (
[YARDCODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS NOT NULL,
[YARD] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_OP_WMS_YARD] PRIMARY KEY CLUSTERED ([YARDCODE])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[OP_WMS_YARD] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_City] (
[CityId] int IDENTITY(1,1) NOT NULL,
[CityCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[CityName] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL,
[ProvinceCode] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Sys_City] PRIMARY KEY CLUSTERED ([CityId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_City] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_Dictionary] (
[Dic_ID] int IDENTITY(1,1) NOT NULL,
[Config] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL,
[DBServer] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[DbSql] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[DicName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL,
[DicNo] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL,
[Enable] tinyint NOT NULL,
[Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[OrderNo] int NULL,
[ParentId] int NOT NULL,
[Remark] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
[CompanyField] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Sys_Dictionary] PRIMARY KEY CLUSTERED ([Dic_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_Dictionary] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_DictionaryList] (
[DicList_ID] int IDENTITY(1,1) NOT NULL,
[CreateDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL,
[DicName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[DicValue] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Dic_ID] int NULL,
[Enable] tinyint NULL,
[Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[OrderNo] int NULL,
[Remark] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Sys_DictionaryList] PRIMARY KEY CLUSTERED ([DicList_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_DictionaryList] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_Log_Core] (
[Id] int IDENTITY(1,1) NOT NULL,
[BeginDate] datetime NULL,
[BrowserType] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[ElapsedTime] int NULL,
[EndDate] datetime NULL,
[ExceptionInfo] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,
[LogType] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RequestParameter] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,
[ResponseParameter] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,
[Role_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ServiceIP] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Success] int NULL,
[Url] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[UserIP] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[UserName] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[User_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Sys_Log_Core] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_Log_Core] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_Menu] (
[Menu_Id] int IDENTITY(1,1) NOT NULL,
[MenuName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[Auth] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[Icon] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Enable] tinyint NULL,
[OrderNo] int NULL,
[TableName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[ParentId] int NOT NULL,
[Url] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[Creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[Modifier] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Sys_Menu] PRIMARY KEY CLUSTERED ([Menu_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_Menu] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[SYS_PRINTINFO] (
[PRINTID] uniqueidentifier NOT NULL,
[MODNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PRINTNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[FILEPATH] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateID] uniqueidentifier NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[CRC] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_SYS_PRINTINFO] PRIMARY KEY CLUSTERED ([PRINTID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[SYS_PRINTINFO] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_Province] (
[ProvinceId] int IDENTITY(1,1) NOT NULL,
[ProvinceCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NOT NULL,
[ProvinceName] nvarchar(30) COLLATE Chinese_PRC_CI_AS NOT NULL,
[RegionCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Sys_Province] PRIMARY KEY CLUSTERED ([ProvinceId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_Province] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_Role] (
[Role_Id] int IDENTITY(1,1) NOT NULL,
[CreateDate] datetime NULL,
[Creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DeleteBy] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DeptName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Dept_Id] int NULL,
[Enable] tinyint NULL,
[Modifier] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[OrderNo] int NULL,
[ParentId] int NOT NULL,
[RoleName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[tempuserid] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
CONSTRAINT [PK_Sys_Role] PRIMARY KEY CLUSTERED ([Role_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_Role] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_Role_Core] (
[CreateDate] datetime NULL,
[Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DeleteBy] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DeptName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Dept_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Enable] tinyint NULL,
[Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[OrderNo] int NULL,
[ParentId] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RoleName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Role_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[LimitCompanyRange] bit DEFAULT ('true') NULL,
CONSTRAINT [PK_Sys_Role_Core] PRIMARY KEY CLUSTERED ([Role_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_Role_Core] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_RoleAuth_Core] (
[Auth_Id] int IDENTITY(1,1) NOT NULL,
[AuthValue] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NOT NULL,
[CreateDate] datetime NULL,
[Creator] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[Menu_Id] int NOT NULL,
[Modifier] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[Role_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[User_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Sys_RoleAuth_Core] PRIMARY KEY CLUSTERED ([Auth_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_RoleAuth_Core] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_RoleAuthData] (
[Auth_Id] int IDENTITY(1,1) NOT NULL,
[DataType_Id] int NULL,
[Role_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[User_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Node_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[LevelID] int NULL,
[AuthValue] varchar(4000) COLLATE Chinese_PRC_CI_AS NULL,
[Creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[Modifier] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
CONSTRAINT [PK_Sys_RoleAuthData] PRIMARY KEY CLUSTERED ([Auth_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_RoleAuthData] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[SYS_SECCOMPANY_BACK] (
[GID] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[CompanySecretKey] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[OperUser] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OperTime] datetime NULL
)
GO
ALTER TABLE [dbo].[SYS_SECCOMPANY_BACK] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_TableColumn] (
[ColumnId] int IDENTITY(1,1) NOT NULL,
[ApiInPut] int NULL,
[ApiIsNull] int NULL,
[ApiOutPut] int NULL,
[ColSize] int NULL,
[ColumnCNName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ColumnName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ColumnType] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,
[ColumnWidth] int NULL,
[Columnformat] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CreateID] uniqueidentifier NULL,
[Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[DropNo] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[EditColNo] int NULL,
[EditRowNo] int NULL,
[EditType] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Enable] int NULL,
[IsColumnData] int NULL,
[IsDisplay] int NULL,
[IsImage] int NULL,
[IsKey] int NULL,
[IsNull] int NULL,
[IsReadDataset] int NULL,
[Maxlength] int NULL,
[Modifier] ntext COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[ModifyID] uniqueidentifier NULL,
[OrderNo] int NULL,
[Script] ntext COLLATE Chinese_PRC_CI_AS NULL,
[SearchColNo] int NULL,
[SearchRowNo] int NULL,
[SearchType] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Sortable] int NULL,
[TableName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Table_Id] int NULL,
[IsParentField] bit NULL,
[ParentId] varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsNormal] bit NULL,
CONSTRAINT [PK_Sys_TableColumn] PRIMARY KEY CLUSTERED ([ColumnId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_TableColumn] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_TableInfo] (
[Table_Id] int IDENTITY(1,1) NOT NULL,
[CnName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ColumnCNName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[DBServer] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
[DataTableType] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[DetailCnName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[DetailName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[EditorType] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Enable] int NULL,
[ExpressField] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[FolderName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Namespace] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[OrderNo] int NULL,
[ParentId] int NULL,
[RichText] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[SortName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TableName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TableTrueName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[UploadField] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[UploadMaxCount] int NULL,
CONSTRAINT [PK_Sys_TableInfo] PRIMARY KEY CLUSTERED ([Table_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_TableInfo] SET (LOCK_ESCALATION = TABLE)
GO
CREATE TABLE [dbo].[Sys_User] (
[Address] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[AppType] int NULL,
[AuditDate] datetime NULL,
[AuditStatus] int NULL,
[Auditor] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[CreateDate] datetime NULL,
[CreateID] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[DeptName] nvarchar(150) COLLATE Chinese_PRC_CI_AS NULL,
[Dept_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Enable] tinyint NOT NULL,
[Gender] int NULL,
[HeadImageUrl] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[IsRegregisterPhone] int NOT NULL,
[LastLoginDate] datetime NULL,
[LastModifyPwdDate] datetime NULL,
[Mobile] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[ModifyDate] datetime NULL,
[ModifyID] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[OrderNo] int NULL,
[Role_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RoleName] nvarchar(150) COLLATE Chinese_PRC_CI_AS NOT NULL,
[PhoneNo] nvarchar(11) COLLATE Chinese_PRC_CI_AS NULL,
[Remark] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Tel] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[UserName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NOT NULL,
[UserPwd] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[UserTrueName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NOT NULL,
[Token] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[User_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
CONSTRAINT [PK_Sys_User] PRIMARY KEY CLUSTERED ([User_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[Sys_User] SET (LOCK_ESCALATION = TABLE)
GO
ALTER TABLE [dbo].[user] ADD [Token] varchar(500) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[user] ADD [Role_Id] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[user_baseinfo] ADD [QdPortUserName] varchar(100) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[user_baseinfo] ADD [QdPortPassword] varchar(100) COLLATE Chinese_PRC_CI_AS NULL
GO
------------
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.user_baseinfo
DROP CONSTRAINT DF_web_user_userbaseinfo_CREATETIME
GO
ALTER TABLE dbo.user_baseinfo
DROP CONSTRAINT DF__user_base__IMAGE__5185DF67
GO
ALTER TABLE dbo.user_baseinfo
DROP CONSTRAINT DF__user_base__SIGNA__1C5DEA11
GO
CREATE TABLE dbo.Tmp_user_baseinfo
(
GID uniqueidentifier NOT NULL,
USERID varchar(36) NOT NULL,
COMPANYNAME varchar(150) NULL,
DEPTNAME varchar(100) NULL,
OFFICEPHONE varchar(50) NULL,
HOMEPHONE varchar(50) NULL,
MOBILE varchar(50) NULL,
FAX varchar(50) NULL,
EMAIL1 varchar(50) NULL,
EMAIL2 varchar(50) NULL,
HOMEADDRESS varchar(150) NULL,
REMARK varchar(200) NULL,
CREATEUSER varchar(36) NULL,
CREATETIME datetime NULL,
MODIFIEDUSER varchar(36) NULL,
MODIFIEDTIME datetime NULL,
EMERGUSER varchar(100) NULL,
EMERGPHONE varchar(50) NULL,
EMERGEMAIL varchar(50) NULL,
POSTCODE varchar(50) NULL,
QQ varchar(50) NULL,
MSN varchar(100) NULL,
SIGNATURE image NULL,
FINANCESOFTCODE varchar(20) NULL,
IMAGEURL varchar(100) NULL,
SIGNATUREURL varchar(100) NULL,
mailsign varchar(1000) NULL,
CONTRACTDATE datetime NULL,
TRIALTIME varchar(50) NULL,
IDNUM varchar(50) NULL,
EDURECORD varchar(50) NULL,
ANNUALLEAVE varchar(50) NULL,
QdPortUserName varchar(100) NULL,
QdPortPassword varchar(100) NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE dbo.Tmp_user_baseinfo SET (LOCK_ESCALATION = TABLE)
GO
DECLARE @v sql_variant
SET @v = N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD>˾<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'Tmp_user_baseinfo', N'COLUMN', N'COMPANYNAME'
GO
DECLARE @v sql_variant
SET @v = N'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'Tmp_user_baseinfo', N'COLUMN', N'DEPTNAME'
GO
DECLARE @v sql_variant
SET @v = N'ǩ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'Tmp_user_baseinfo', N'COLUMN', N'SIGNATURE'
GO
ALTER TABLE dbo.Tmp_user_baseinfo ADD CONSTRAINT
DF_web_user_userbaseinfo_CREATETIME DEFAULT (getdate()) FOR CREATETIME
GO
ALTER TABLE dbo.Tmp_user_baseinfo ADD CONSTRAINT
DF__user_base__IMAGE__5185DF67 DEFAULT ('') FOR IMAGEURL
GO
ALTER TABLE dbo.Tmp_user_baseinfo ADD CONSTRAINT
DF__user_base__SIGNA__1C5DEA11 DEFAULT ('') FOR SIGNATUREURL
GO
IF EXISTS(SELECT * FROM dbo.user_baseinfo)
EXEC('INSERT INTO dbo.Tmp_user_baseinfo (GID, USERID, COMPANYNAME, DEPTNAME, OFFICEPHONE, HOMEPHONE, MOBILE, FAX, EMAIL1, EMAIL2, HOMEADDRESS, REMARK, CREATEUSER, CREATETIME, MODIFIEDUSER, MODIFIEDTIME, EMERGUSER, EMERGPHONE, EMERGEMAIL, POSTCODE, QQ, MSN, SIGNATURE, FINANCESOFTCODE, IMAGEURL, SIGNATUREURL, mailsign, CONTRACTDATE, TRIALTIME, IDNUM, EDURECORD, ANNUALLEAVE, QdPortUserName, QdPortPassword)
SELECT CONVERT(uniqueidentifier, GID), USERID, COMPANYNAME, DEPTNAME, OFFICEPHONE, HOMEPHONE, MOBILE, FAX, EMAIL1, EMAIL2, HOMEADDRESS, REMARK, CREATEUSER, CREATETIME, MODIFIEDUSER, MODIFIEDTIME, EMERGUSER, EMERGPHONE, EMERGEMAIL, POSTCODE, QQ, MSN, SIGNATURE, FINANCESOFTCODE, IMAGEURL, SIGNATUREURL, mailsign, CONTRACTDATE, TRIALTIME, IDNUM, EDURECORD, ANNUALLEAVE, QdPortUserName, QdPortPassword FROM dbo.user_baseinfo WITH (HOLDLOCK TABLOCKX)')
GO
DROP TABLE dbo.user_baseinfo
GO
EXECUTE sp_rename N'dbo.Tmp_user_baseinfo', N'user_baseinfo', 'OBJECT'
GO
ALTER TABLE dbo.user_baseinfo ADD CONSTRAINT
PK_Users_BasicInfo PRIMARY KEY CLUSTERED
(
GID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
COMMIT
CREATE TABLE [dbo].[WS_USER] (
[GID] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[NAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[COMPANY_NAME] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[MOBILE] varchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[CUST_NAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CUST_JSON] varchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[CREATE_TIME] datetime DEFAULT (getdate()) NOT NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[OPENID] varchar(128) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_WS_USER] PRIMARY KEY CLUSTERED ([GID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
GO
ALTER TABLE [dbo].[WS_USER] SET (LOCK_ESCALATION = TABLE)
GO
CREATE FUNCTION [dbo].[F_OUTDODETAIL_CNTRNO](@WMSDOID uniqueidentifier)
returns nvarchar(100)
as
begin
declare @S nvarchar(100)
select @S=isnull(@S,'')+CNTRNO+',' from(select distinct CNTRNO from OP_WMS_OUT_DO_GOODS where WMSDOID=@WMSDOID )t
if( LEN(@S)>0)
set @S=substring(@S,1,len(@S)-1)
return @S
end
GO
ALTER PROCEDURE [dbo].[sSysGetBillNo_new]
( @ps_BillType varchar(4),
@ps_OrgCode varchar(100)='',
@ps_EmpCode varchar(100)='',
@ps_Date varchar(10)='',
@ps_BillNo varchar(20) output,
@ps_RefBillNo varchar(20)=Null --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><EFBFBD><EFBFBD>ʱû<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>
)
--WITH ENCRYPTION
AS
declare
@vs_TmpBillNo varchar(20),
@vs_IsUpdate varchar(1),
@vi_ID numeric(27,0),
@vi_ID_A numeric(27,0),
@vi_ID_B numeric(27,0),
@vi_Times integer,
@vi_DelaySec integer,
@vs_HeadTbl varchar(100),
@vs_NowDate varchar(10),
@vs_IsPrefix varchar(100),
@vi_PrefixLen integer,
@vs_PrefixNo varchar(100),
@vs_IsDate varchar(100),
@vi_DateLen integer,
@vs_DateFmt varchar(100),
@vi_SerialLen integer,
@vs_YearNo varchar(100),
@vs_MonthNo varchar(100),
@vs_DayNo varchar(100),
@vs_IsOrgPrefix varchar(100),
@vs_IsEmpPrefix varchar(100),
@vi_ii int,
@vi_MaxSerial integer,
@vs_dateNo varchar(10),
@vi_BillNoLength int,
@vi_BillHeadLength int,
@vs_BanksHead varchar(10),
@BsNo int
Begin
/*=================<3D><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=================*/
Set @vs_IsUpdate='0'
Set @ps_BillNo=null
Set @vs_TmpBillNo=''
if @ps_Date='' begin
Set @vs_NowDate=convert(varchar(10),getdate(),120)
end else
Set @vs_NowDate=left(@ps_Date,10)
/*=================ȡ<>õ<EFBFBD><C3B5>ݺŽṹ=================*/
If not exists(select BillCode from tSysBillType where BillCode=@ps_BillType)
Begin
return(-1)
End
Select @vs_IsPrefix=IsPrefix,@vi_PrefixLen=PrefixLen,@vs_PrefixNo=PrefixNo,
@vs_IsDate=IsDate,@vs_DateFmt=DateFmt,@vi_SerialLen=SerialLen,
@vs_YearNo=IsNull(YearNo,''),@vs_MonthNo=IsNull(MonthNo,''),@vs_DayNo=IsNull(DayNo,''),
@vi_MaxSerial=MaxSerial,@vs_HeadTbl=IsNull(BillHeadTbl,''),
@vs_IsOrgPrefix=IsOrgPrefix,@vs_IsEmpPrefix=IsEmpPrefix
from tSysBillType
where BillCode=@ps_BillType
/*=================<3D><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>֯<EFBFBD><D6AF><EFBFBD>ɣ<EFBFBD>ww<77><77>=================*/
if @vs_IsOrgPrefix='1'
begin
set @vs_HeadTbl = @vs_HeadTbl + '_' + @ps_OrgCode;
end
if @vs_IsEmpPrefix='1'
begin
set @vs_HeadTbl = @vs_HeadTbl + '_' + @ps_EmpCode;
end
If @vi_MaxSerial=0 Set @vi_MaxSerial=1
/*=================<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=================*/
If @vs_IsDate='1' and
( (@vs_DateFmt in ('YYYYMMDD','YYMMDD') and @vs_NowDate<>@vs_YearNo+'-'+@vs_MonthNo+'-'+@vs_DayNo) or
(@vs_DateFmt in ('YYYYMM','YYMM') and Left(@vs_NowDate,7)<>@vs_YearNo+'-'+@vs_MonthNo) or
(@vs_DateFmt in ('YYYY','YY') and Left(@vs_NowDate,4)<>@vs_YearNo)
)
Begin --<EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>tSysBillType
Set @vs_IsUpdate='1'
Set @vs_YearNo=left(@vs_NowDate,4)
Set @vs_DayNo=right(@vs_NowDate,2)
Set @vs_MonthNo=substring(@vs_NowDate,6,2)
End
/*=================ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD>־=================*/
-- Select @vs_TmpBillNo=IsNull(DBID,'0000') from tComDataBase where isself='1'
/*=================<3D><><EFBFBD>÷ֹ<C3B7>˾ǰ׺=================*/
if @vs_IsOrgPrefix='1'
begin
select @vs_BanksHead=BANKSHEAD
from company
where CODENAME=@ps_OrgCode;
set @vs_TmpBillNo=@vs_TmpBillNo+UPPER(@vs_BanksHead)
end
/*=================ȡ<><C8A1>ǰ׺=================*/
if (@vs_IsPrefix='1' and @vi_PrefixLen>0 and @vs_PrefixNo<>'')
Set @vs_TmpBillNo=@vs_TmpBillNo+substring(@vs_PrefixNo,1,@vi_PrefixLen)
if @vs_IsEmpPrefix='1'
begin
select @vs_BanksHead=NOCODE
from [USER]
where CODENAME=@ps_EmpCode;
set @vs_TmpBillNo =@vs_TmpBillNo+UPPER(@vs_BanksHead);
end
/*=================ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=================*/
if @vs_IsDate='1'
begin
If @vs_DateFmt='YYYYMMDD'
Set @vs_TmpBillNo=@vs_TmpBillNo+@vs_YearNo+@vs_MonthNo+@vs_DayNo
Else If @vs_DateFmt='YYMMDD'
Set @vs_TmpBillNo=@vs_TmpBillNo+Right(@vs_YearNo,2)+@vs_MonthNo+@vs_DayNo
Else If @vs_DateFmt='YYYYMM'
Set @vs_TmpBillNo=@vs_TmpBillNo+@vs_YearNo+@vs_MonthNo
Else If @vs_DateFmt='YYMM'
Set @vs_TmpBillNo=@vs_TmpBillNo+Right(@vs_YearNo,2)+@vs_MonthNo
Else If @vs_DateFmt='YYYY'
Set @vs_TmpBillNo=@vs_TmpBillNo+@vs_YearNo
Else If @vs_DateFmt='YY'
Set @vs_TmpBillNo=@vs_TmpBillNo+right(@vs_YearNo,2)
End
delete FROM sys_no where ISUSE=0 and BSNO in (select custno from v_op_bill)
/*=================Ŀǰ<C4BF><C7B0><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD><EFBFBD><EFBFBD>Ϊ 20<32><30><EFBFBD><EFBFBD><EFBFBD>Ϸֹ<CFB7>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>20,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><E2B4A6>=================*/
set @vi_BillHeadLength=LEN(@vs_TmpBillNo)
set @vi_BillNoLength=20-@vi_BillHeadLength
if @vi_SerialLen > @vi_BillNoLength
set @vi_SerialLen=@vi_BillNoLength
if isnull((select top 1 BSNO from sys_no where ISUSE=0 and (substring (BSNO,1,@vi_BillHeadLength) =@vs_TmpBillNo) and (LEN(BSNO)=(@vi_SerialLen+@vi_BillHeadLength))),'1')='1'
begin
if (select count(ID) from sys_wtno where HEADSTR=@vs_TmpBillNo and NOTYPE=@ps_BillType)=0
begin
select @BsNo=1
insert sys_wtno ( HEADSTR, MAXNO,NOTYPE) values (@vs_TmpBillNo,1,@ps_BillType)
end
else
begin
select @BsNo =1+(select MAXNO from sys_wtno where HEADSTR=@vs_TmpBillNo and NOTYPE=@ps_BillType)
update sys_wtno set MAXNO=@BsNo where HEADSTR=@vs_TmpBillNo and NOTYPE=@ps_BillType
end
Set @vs_TmpBillNo=@vs_TmpBillNo+right('00000000000000000000'+Cast(@BsNo as varchar(100)),@vi_SerialLen)
Set @ps_BillNo=@vs_TmpBillNo
insert sys_no (BSNO, ISUSE) values (@ps_BillNo,1)
end
else
begin
select @vs_TmpBillNo=(select top 1 BSNO from sys_no where ISUSE=0 and (substring (BSNO,1,@vi_BillHeadLength) =@vs_TmpBillNo) and (LEN(BSNO)=(@vi_SerialLen+@vi_BillHeadLength)))
Set @ps_BillNo=@vs_TmpBillNo
update sys_no set ISUSE=1 where BSNO=@ps_BillNo
end
select @ps_BillNo as BillNo
End
GO
CREATE FUNCTION [dbo].[F_Str_logicword](@WMSID varchar(500) ,@logicname varchar(50))
returns nvarchar(100)
as
begin
declare @S nvarchar(100)
select @S=isnull(@S,'')+value+' ' from(select distinct value from OP_WMS_LOGIC where CHARINDEX(convert(varchar(36), WMSID),@WMSID)>=0 and name=@logicname )t
return isnull(@S,'')
end
GO
CREATE FUNCTION [dbo].[F_OUTPLANDETAIL_MBLNO](@WMSPLANID uniqueidentifier)
returns nvarchar(100)
as
begin
declare @S nvarchar(100)
select @S=isnull(@S,'')+MBLNO+' ' from(select distinct MBLNO from OP_WMS_OUT_PLAN_DETAIL where WMSPLANID=@WMSPLANID )t
return @S
end
GO
CREATE FUNCTION [dbo].[F_OUTPLANDETAIL_CNTRNO](@WMSPLANID uniqueidentifier)
returns nvarchar(100)
as
begin
declare @S nvarchar(100)
select @S=isnull(@S,'')+CNTRNO+' ' from(select distinct CNTRNO from OP_WMS_OUT_PLAN_DETAIL where WMSPLANID=@WMSPLANID )t
return @S
end
GO
CREATE VIEW [dbo].[user_conmpanydept] AS select a.SHOWNAME,c.NAME ,c.ENNAME,c.FULLNAME,c.ADDRESS,i.DEPTNAME from [user] a
left join user_company b on a.GID=b.USERID
left join company c on b.COMPANYID=c.GID
left join user_baseinfo i on i.userid=a.gid
GO
CREATE VIEW [dbo].[v_code_country] AS select countryid,country,substring(country,0,(charindex('(',country)) ) cncountry
from code_country
GO
alter table INFO_FILES add IMGPATH varchar(1000) null
alter table INFO_FILES add PWORKTYPE varchar(50) null
alter table INFO_FILES add CreateID uniqueidentifier null
alter table INFO_FILES add CreateDate datetime null
alter table INFO_FILES add Creator varchar(50) null
alter table INFO_FILES add ModifyID uniqueidentifier null
alter table INFO_FILES add ModifyDate datetime null
alter table INFO_FILES add Modifier varchar(50) null
alter table INFO_FILES add PBSNO varchar(500) null
alter table INFO_FILES add MBLNO varchar(50) null
alter table INFO_FILES add CNTRNO varchar(50) null
GO
CREATE VIEW [dbo].[VW_INFO_FILES] AS select GID,PID,[FILENAME],FILETYPE,IMGFILE,UPLOADEMPLY,UPLOADDATE,FILEPATH,IMGPATH,PWORKTYPE,CreateID
,CreateDate,Creator,ModifyID,ModifyDate,Modifier,PBSNO,MBLNO,CNTRNO
from INFO_FILES
union all
select WMSWEIGHDETAILID GID,D.WMSWEIGHID PID,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' [FILENAME],'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>' FILETYPE,null IMGFILE
,creator UPLOADEMPLY,CreateDate UPLOADDATE, FILEPATH,PICPATH IMGPATH,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>' PWORKTYPE,CreateID,CreateDate,Creator
, ModifyID, ModifyDate, Modifier,wh.MBLNO PBSNO,wh.MBLNO MBLNO,D.CNTRNO
from OP_WMS_WEIGH_DETAIL D
left join OP_WMS_WEIGH wh on wh.WMSWEIGHID=D.WMSWEIGHID
GO
CREATE VIEW [dbo].[VW_OP_REP_WMSINDO] AS select wc.WMSLOGID,id.DODATE,w.CORPID, w.CUSTOMERNAME,w.GOODSNAME,w.MBLNO,w.CUSTOMNO,w.CNTRNO,wc.PKGS,wc.KGS,wc.NETWEIGHT,wc.CBM,wc.PKGS3,wc.KGS3,wc.NETWEIGHT3,wc.CBM3,idg.STOREHOUSE ,idg.AREACODE,w.OP
,wc.CHANGETYPE,id.BSNO,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=w.GOODSNAME)GOODSFEETYPE
from OP_WMS_CHANGE wc
left join op_wms w on w.WMSID=wc.WMSID
left join op_wms_in_do id on id.WMSDOID=wc.DOBSNO
left join OP_WMS_in_DO_GOODS idg on idg.WMSDODETAILID=wc.DOGID
where wc.CHANGETYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
GO
CREATE VIEW [dbo].[VW_OP_REP_WMSOUTDO] AS select wc.WMSLOGID,od.DODATE,w.CORPID, w.CUSTOMERNAME,w.GOODSNAME,w.MBLNO,w.CUSTOMNO,w.CNTRNO,wc.PKGS,wc.KGS,wc.NETWEIGHT,wc.CBM,wc.PKGS3,wc.KGS3,wc.NETWEIGHT3,wc.CBM3,odg.STOREHOUSE ,odg.AREACODE,w.OP
,wc.CHANGETYPE,od.WMSNO,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=w.GOODSNAME)GOODSFEETYPE
from OP_WMS_CHANGE wc
left join op_wms w on w.WMSID=wc.WMSID
left join op_wms_OUT_do od on od.WMSDOID=wc.DOBSNO
left join OP_WMS_OUT_DO_GOODS odg on odg.WMSDODETAILID=wc.DOGID
where wc.CHANGETYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
GO
CREATE VIEW [dbo].[Vw_Op_Wms] AS select [WMSID]
,[BSNO]
,[BILLTYPE]
,[REMARK]
,[CORPID]
,[ModifyID]
,[Modifier]
,[ModifyDate]
,[CreateID]
,[Creator]
,[CreateDate]
,[CUSTOMERNAME]
,[MATERIALNO]
,[GOODSCODE]
,[GOODSNAME]
,[GOODSHSCODE]
,[MBLNO]
,[CNTRNO]
,[KGS]
,NETWEIGHT
,[CBM]
,[PKGS]
,[KINDPKGS]
,[STORAGEUNIT]
,[STORAGEUNITCOUNT]
,[RULEUNIT]
,[RULEUNITCOUNT]
,[ISCLEAR]
,[BSSTATUS]
,[FEESTATUS]
,[INDATE]
,[FEESTARTDATE]
,[FEEENDDATE]
,KGS_SINGLE,CBM_SINGLE,STORAGEUNITCOUNT_SINGLE,RULEUNITCOUNT_SINGLE,OP,CUSTOMNO,ACCBOOKNO
from OP_WMS
GO
CREATE view [dbo].[Vw_Op_Wms_Physics_Need]
as
select p.[WMSPHYSICSID]
,p.[WMSID]
,p.[STOREHOUSE]
,p.[AREACODE]
,p.KGS-isnull(d.KGS,0)-isnull(od.KGS,0) [KGS]
,p.NETWEIGHT-isnull(d.NETWEIGHT,0)-isnull(od.NETWEIGHT,0) [NETWEIGHT]
,p.CBM-isnull(d.CBM,0)-isnull(od.CBM,0) [CBM]
,p.PKGS-isnull(d.PKGS,0)-isnull(od.PKGS,0) [PKGS]
,p.[KINDPKGS]
,p.[STORAGEUNIT]
,p.STORAGEUNITCOUNT-isnull(d.STORAGEUNITCOUNT,0)-isnull(od.STORAGEUNITCOUNT,0)[STORAGEUNITCOUNT]
,p.[RULEUNIT]
,p.RULEUNITCOUNT-isnull(d.RULEUNITCOUNT,0)-isnull(od.RULEUNITCOUNT,0)[RULEUNITCOUNT]
,p.[STARTDATE]
,p.[FEEENDDATE]
,w.MBLNO,w.CNTRNO,w.MBLNO+'_'+w.CNTRNO MBLNOCNTRNO,w.GOODSNAME,w.INDATE,w.CUSTOMERNAME,w.OP
,convert(numeric(18,6) ,p.KGS/1000)TONS
from Op_Wms_Physics p
left join op_wms w on w.WMSID=p.WMSID
left join OP_WMS_PHYSICS_DODETAIL d on d.WMSPHYSICSID=p.WMSPHYSICSID
and (select billstatus from OP_WMS_Transfergoods where WMSTRANSFERGOODSID=d.WMSDOID )='1000'
left join OP_WMS_PHYSICS_DODETAIL od on od.WMSPHYSICSID=p.WMSPHYSICSID
and (select BSSTATUS from OP_WMS_OUT_DO where WMSDOID=d.WMSDOID )='false'
GO
CREATE VIEW [dbo].[VW_OP_WMS_AREAGOODS] AS select w.WMSID,w.BSNO, w.CORPID, p.MBLNO,w.CUSTOMNO,p.CNTRNO,p.CUSTOMERNAME,(select codename from info_client where shortname=p.CUSTOMERNAME)CUSTOMERCODE,p.KGS,p.PKGS,p.CBM,p.NETWEIGHT,p.STORAGEUNITCOUNT,p.RULEUNITCOUNT,p.STORAGEUNIT,p.RULEUNIT,p.GOODSNAME,h.AREANAME STOREHOUSENAME,a.AREANAME,w.INDATE
,p.AREACODE,p.STOREHOUSE,(select top 1 PKGS from OP_WMS_CHANGE where CHANGETYPE in('<EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>') and wmsid=p.WMSID) PKGS_FIRST,w.BILLTYPE,LOWER(w.ACCBOOKNO) ACCBOOKNO
,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=p.GOODSNAME)GOODSFEETYPE
from Vw_Op_Wms_Physics_Need p
left join op_wms w on w.WMSID=p.WMSID
left join OP_WMS_STOREHOUSE h on h.AREACODE=p.STOREHOUSE
left join OP_WMS_STOREHOUSE_AREA a on a.AREACODE= p.AREACODE
where p.PKGS>0
GO
CREATE VIEW [dbo].[VW_OP_WMS_CHECK] AS select c.*,(select sum(pkgs_change) from op_wms_check_detail where wmscheckid=c.wmscheckid) PKGS_CHANGE from OP_WMS_CHECK c
GO
CREATE VIEW [dbo].[VW_OP_WMS_CHECK_DETAIL] AS select D.*,w.CUSTOMERNAME,w.MBLNO,w.CNTRNO,w.GOODSNAME,p.AREACODE,p.STOREHOUSE from OP_WMS_CHECK_DETAIL D
left join op_wms w on w.wmsid=d.wmsid
left join OP_WMS_PHYSICS p on p.WMSPHYSICSID=d.WMSPHYSICSID
GO
CREATE VIEW [dbo].[VW_OP_WMS_FEECALENDAR] AS select fc.*,wms.MBLNO ,wms.CNTRNO,wms.MBLNO+'_'+wms.CNTRNO MBLNOCNTRNO,wms.GOODSNAME from OP_WMS_FEECALENDAR fc left join op_wms wms on wms.wmsid=fc.wmsid
GO
CREATE VIEW [dbo].[VW_OP_WMS_FEEDUI_STORAGE] AS select * from OP_WMS_FEEDUI_STORAGE
GO
CREATE VIEW [dbo].[VW_OP_WMS_FEERATE] AS SELECT dbo.OP_WMS_FEERATE_DETAIL.ID, dbo.OP_WMS_FEERATE_DETAIL.FEEMAKETYPE,
dbo.OP_WMS_FEERATE_DETAIL.FEENAME, dbo.OP_WMS_FEERATE_DETAIL.DEFAULTUNIT,
dbo.OP_WMS_FEERATE_DETAIL.FEEPRICE, dbo.OP_WMS_FEERATE_DETAIL.FEETYPE,
dbo.OP_WMS_FEERATE_DETAIL.FEEGRADE, dbo.OP_WMS_FEERATE_DETAIL.FEESCALE,
dbo.OP_WMS_FEERATE_DETAIL.ADDPRICE, dbo.OP_WMS_FEERATE.CORPID,
dbo.OP_WMS_FEERATE.CUSTOMERNAME, dbo.OP_WMS_FEERATE.GOODSFEETYPE,
dbo.OP_WMS_FEERATE.REMARK, dbo.OP_WMS_FEERATE.FEERATEID,OP_WMS_FEERATE.INUSE
FROM dbo.OP_WMS_FEERATE INNER JOIN
dbo.OP_WMS_FEERATE_DETAIL ON
dbo.OP_WMS_FEERATE.FEERATEID = dbo.OP_WMS_FEERATE_DETAIL.FEERATEID
GO
CREATE VIEW [dbo].[VW_OP_WMS_HOMESHOW_PLANSTATUS] AS select WMSPLANID, 'δ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>' itemname,CORPID,GOODSNAME, CUSTOMERNAME,MBLNO,(select count(1)from OP_WMS_IN_PLAN_GOODS where wmsplanid=inp.WMSPLANID) CNTRCOUNT from OP_WMS_IN_PLAN inp where WMSPLANID not in (select WMSPLANID from OP_WMS_IN_DO_GOODS)
union all
select WMSPLANID,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' itemname,CORPID,GOODSNAME, CUSTOMERNAME,MBLNO,(select count(1)from OP_WMS_IN_PLAN_GOODS where wmsplanid=inp.WMSPLANID) CNTRCOUNT from OP_WMS_IN_PLAN inp where WMSPLANID in (select WMSPLANID from OP_WMS_IN_DO_GOODS where WMSDOID in(select WMSDOID from OP_WMS_IN_DO where BILLSTATUS <>'1003'))
union all
select WMSPLANID,'δ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>' itemname,CORPID,(select top 1 goodsname from OP_WMS_OUT_PLAN_DETAIL where wmsplanid=oup.WMSPLANID) GOODSNAME, CUSTOMERNAME,dbo.F_OUTPLANDETAIL_MBLNO(WMSPLANID) MBLNO,(select count(1) from OP_WMS_OUT_PLAN_DETAIL where wmsplanid=oup.WMSPLANID) CNTRCOUNT from OP_WMS_OUT_PLAN oup where WMSPLANID not in (select WMSPLANID from OP_WMS_OUT_DO)
union all
select WMSPLANID,'<EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD><EFBFBD><EFBFBD>' itemname,CORPID,(select top 1 goodsname from OP_WMS_OUT_PLAN_DETAIL where wmsplanid=oup.WMSPLANID) GOODSNAME, CUSTOMERNAME,dbo.F_OUTPLANDETAIL_MBLNO(WMSPLANID) MBLNO,(select count(1) from OP_WMS_OUT_PLAN_DETAIL where wmsplanid=oup.WMSPLANID) CNTRCOUNT from OP_WMS_OUT_PLAN oup where WMSPLANID in (select WMSPLANID from OP_WMS_OUT_DO where BILLSTATUS<>'1012')
GO
CREATE VIEW [dbo].[Vw_Sys_User] AS select b.HOMEADDRESS Address,1 Apptype,u.MODIFIEDTIME AuditDate,1 AuditStatus,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա' Auditor
,u.ENROLLTIME CreateDate,u.CREATEUSER CreateID,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա' Createor
,vu.DeptName,vu.deptgid Dept_Id,b.EMAIL1 Email,case when u.ISDELETED ='true' then 0 else 1 end as Enable
,1 Gender,b.IMAGEURL HeadImageUrl,0 IsRegregisterPhone,null LastLoginDate,null LastModifyPwdDate
,b.Mobile,u.MODIFIEDUSER Modifier,u.MODIFIEDTIME ModifyDate
,u.Role_Id Role_Id
,r.RoleName RoleName ,b.OFFICEPHONE PhoneNo
,b.Remark ,b.HOMEPHONE Tel,u.CODENAME UserName,u.PASSWORD UserPwd,u.SHOWNAME UserTrueName,u.Token,Convert(uniqueidentifier, U.gid) User_Id
,vu.COMPANYID CompanyId,vu.companyname CompanyName,(select codename from company where gid=vu.COMPANYID) CompanyCodeName
from [user] u left join user_baseinfo b on b.USERID=u.GID
left join vw_user vu on vu.USERID=u.gid
left join Sys_Role_Core r on r.Role_Id=u.Role_Id
GO
CREATE VIEW [dbo].[VW_OP_WMS_IMPORT] AS select w.WMSID,CUSTOMERNAME,GOODSNAME, MBLNO,CNTRNO,CUSTOMNO,w.PKGS,w.KGS,w.CBM,w.NETWEIGHT,w.STORAGEUNIT,w.STORAGEUNITCOUNT,w.RULEUNIT,w.RULEUNITCOUNT,INDATE
,(select userTrueName from Vw_Sys_User where User_Id=OP) OPNAME
, case ACCBOOKNO when '' then '' else (select ACCBOOKNO from INFO_ACCBOOK where ACCBOOKID=w.ACCBOOKNO) end ACCBOOKNO
,(select AREANAME from OP_WMS_STOREHOUSE where AREACODE = p.STOREHOUSE) STORAGENAME
,(select AREANAME from OP_WMS_STOREHOUSE_AREA where AREACODE = p.AREACODE) AREANAME
from OP_WMS w
left join OP_WMS_PHYSICS p on w.WMSID=p.WMSID
where (w.KGS>0 or w.NETWEIGHT>0 or w.PKGS>0 or w.CBM>0)
GO
CREATE VIEW [dbo].[VW_OP_WMS_IN_DO] AS select D.*,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=GOODSNAME)GOODSFEETYPE,
isnull((select sum(KGS) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) KGS,
isnull((select sum(NETWEIGHT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) NETWEIGHT,
isnull((select sum(CBM) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) CBM,
isnull((select sum(PKGS) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) PKGS,
(select top 1 KINDPKGS from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) KINDPKGS,
(select top 1 STORAGEUNIT from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) STORAGEUNIT,
(select top 1 RULEUNIT from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) RULEUNIT,
isnull((select sum(STORAGEUNITCOUNT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) STORAGEUNITCOUNT,
isnull((select sum(RULEUNITCOUNT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) RULEUNITCOUNT
from OP_WMS_IN_DO D
GO
CREATE VIEW [dbo].[VW_OP_WMS_IN_DO_GOODS] AS SELECT WMSDODETAILID, WMSDOID, STOREHOUSE, AREACODE, KGS, CBM, PKGS, KINDPKGS, STORAGEUNIT,
STORAGEUNITCOUNT, RULEUNIT, RULEUNITCOUNT, WMSPLANID, WMSPLANDETAILID, MBLNO, CNTRNO, REMARK,
OP, NETWEIGHT, REMARK2,(select top 1 SEALNO from OP_WMS_IN_PLAN_GOODS where GID = WIG.WMSPLANDETAILID)SEALNO,
(SELECT ISNULL(CUSTOMSINSPECTION, 0) AS Expr1
FROM dbo.OP_WMS_IN_PLAN_GOODS
WHERE (GID = WIG.WMSPLANDETAILID)) AS CUSTOMSINSPECTION,
(SELECT ISNULL(STOREHOUSEINSPECTION, 0) AS Expr1
FROM dbo.OP_WMS_IN_PLAN_GOODS
WHERE (GID = WIG.WMSPLANDETAILID)) AS STOREHOUSEINSPECTION
FROM dbo.OP_WMS_IN_DO_GOODS AS WIG
GO
CREATE VIEW [dbo].[VW_OP_WMS_IN_PLAN] AS select [WMSPLANID]
,[WMSNO]
,[MBLNO]
,[CONTRACTNO]
,[BILLTYPE]
,[PLANTIME]
,[ACCDATE]
,[CUSTOMERNAME]
,[CORPID]
,[ACCBOOKNO]
,[KGS]
,[PKGS]
,[CBM]
,[GOODSNAME]
,[KINDPKGS]
,[STORAGEUNIT]
,[STORAGEUNITCOUNT]
,[RULEUNIT]
,[RULEUNITCOUNT]
,[REMARK]
,[BSSOURCE]
,[Creator]
,[CreateID]
,[CreateDate]
,[FEESTATUS]
,[BSSTATUS]
,[TIMEMARK]
,[ModifyDate]
,[ModifyID]
,[Modifier]
,[ISEND]
,[MASTERBSNO]
,[NETWEIGHT]
,[CUSTOMNO]
,[ETA]
,[CTNNUM]
,[JINJINGBEIANSHENBAORIQI]
,[JINGNEISHOUHUOREN]
,[INSPECTION_NO]
,[PLAN_GETTIME]
,[CUSTOMAMOUNT]
,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=GOODSNAME)GOODSFEETYPE
FROM [OP_WMS_IN_PLAN]
GO
CREATE VIEW [dbo].[VW_OP_WMS_MOVE] AS select m.*,w.MBLNO,w.CNTRNO,w.GOODSNAME from OP_WMS_MOVE m left join op_wms w on w.WMSID=m.WMSID
GO
CREATE VIEW [dbo].[Vw_Op_Wms_Need] AS select w.[WMSID],w.CUSTOMERNAME,w.CORPID
,w.MBLNO,w.CUSTOMNO,w.CNTRNO,w.GOODSNAME,w.INDATE,w.OP
,w.KGS-isnull(td.KGS,0)-isnull(opd.KGS,0) [KGS]
,w.NETWEIGHT-isnull(td.NETWEIGHT,0)-isnull(opd.NETWEIGHT,0) [NETWEIGHT]
,w.CBM-isnull(td.CBM,0)-isnull(opd.CBM,0) [CBM]
,w.PKGS-isnull(td.PKGS,0)-isnull(opd.PKGS,0) [PKGS]
,w.[KINDPKGS]
,w.[STORAGEUNIT]
,w.STORAGEUNITCOUNT-isnull(td.STORAGEUNITCOUNT,0)-isnull(opd.STORAGEUNITCOUNT,0)[STORAGEUNITCOUNT]
,w.[RULEUNIT]
,w.RULEUNITCOUNT-isnull(td.RULEUNITCOUNT,0)-isnull(opd.RULEUNITCOUNT,0)[RULEUNITCOUNT]
,w.[FEESTARTDATE]
,w.[FEEENDDATE]
,w.MBLNO+'_'+w.CNTRNO MBLNOCNTRNO
,w.KGS-isnull(td.KGS,0)-isnull(opd.KGS,0)+
w.NETWEIGHT-isnull(td.NETWEIGHT,0)-isnull(opd.NETWEIGHT,0)+
w.CBM-isnull(td.CBM,0)-isnull(opd.CBM,0)+
w.PKGS-isnull(td.PKGS,0)-isnull(opd.PKGS,0) ALLSTORAGECOUNT
from Op_Wms w
left join(select wmsid,sum(KGS) KGS,sum(NETWEIGHT) NETWEIGHT,sum(CBM) CBM,sum(PKGS) PKGS,sum(STORAGEUNITCOUNT) STORAGEUNITCOUNT,sum(RULEUNITCOUNT) RULEUNITCOUNT from OP_WMS_TRANSFERGOODS_DETAIL _td
where exists (select 1 from OP_WMS_Transfergoods where WMSTRANSFERGOODSID=_td.WMSTRANSFERGOODSID and BILLSTATUS='1000' )
group by wmsid) td on td.WMSID=w.wmsid
left join (select wmsid,sum(KGS) KGS,sum(NETWEIGHT) NETWEIGHT,sum(CBM) CBM,sum(PKGS) PKGS,sum(STORAGEUNITCOUNT) STORAGEUNITCOUNT,sum(RULEUNITCOUNT) RULEUNITCOUNT from OP_WMS_OUT_PLAN_DETAIL _opd
where not exists (select 1 from OP_WMS_OUT_DO_GOODS og left join OP_WMS_OUT_DO od on od.WMSDOID=og.WMSDOID where WMSPLANID=_opd.WMSPLANID and od.billstatus='1012' )
group by wmsid)opd on opd.WMSID=w.WMSID
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUT_DO] AS SELECT D.[WMSDOID]
,D.[WMSNO]
,D.[DODATE]
,D.[CUSTOMERNAME]
,D.[CORPID]
,D.[REMARK]
,D.[Creator]
,D.[CreateID]
,D.[CreateDate]
,D.[ModifyDate]
,D.[ModifyID]
,D.[Modifier]
,D.[ISEND]
,D.[FEESTATUS]
,D.[BSSTATUS]
,D.[BSSOURCE]
,D.[BILLSTATUS]
,D.[MBLNO]
,D.[CUSTOMNO_IMPORT]
,D.[PICKUPNAME]
,D.[TRUCKNO]
,D.[TRUCKMODEL]
,D.[WMSPLANID]
,D.[CUSTOMNO],dbo.F_OUTDODETAIL_CNTRNO(d.WMSDOID) CNTRNO
,GOODSNAME,GOODSFEETYPE
FROM [dbo].[OP_WMS_OUT_DO] D
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUT_DO_GOODS] AS SELECT dbo.OP_WMS_OUT_DO_GOODS.WMSDODETAILID, dbo.OP_WMS_OUT_DO_GOODS.WMSDOID,
dbo.OP_WMS_OUT_DO_GOODS.WMSPLANDETAILID, dbo.OP_WMS_OUT_DO_GOODS.MATERIALNO,
dbo.OP_WMS_OUT_DO_GOODS.GOODSCODE, dbo.OP_WMS_OUT_DO_GOODS.GOODSNAME,
dbo.OP_WMS_OUT_DO_GOODS.GOODSHSCODE, dbo.OP_WMS_OUT_DO_GOODS.MBLNO,
dbo.OP_WMS_OUT_DO_GOODS.CNTRNO, dbo.OP_WMS_OUT_DO_GOODS.STOREHOUSE,
dbo.OP_WMS_OUT_DO_GOODS.AREACODE, dbo.OP_WMS_OUT_DO_GOODS.KGS, dbo.OP_WMS_OUT_DO_GOODS.NETWEIGHT,
dbo.OP_WMS_OUT_DO_GOODS.CBM, dbo.OP_WMS_OUT_DO_GOODS.PKGS,
dbo.OP_WMS_OUT_DO_GOODS.KINDPKGS, dbo.OP_WMS_OUT_DO_GOODS.STORAGEUNIT,
dbo.OP_WMS_OUT_DO_GOODS.STORAGEUNITCOUNT, dbo.OP_WMS_OUT_DO_GOODS.RULEUNIT,
dbo.OP_WMS_OUT_DO_GOODS.RULEUNITCOUNT, dbo.OP_WMS_OUT_DO_GOODS.WMSID,
dbo.OP_WMS_OUT_DO.CUSTOMERNAME, dbo.OP_WMS_OUT_DO.WMSNO, dbo.OP_WMS_OUT_DO.ISEND,
dbo.OP_WMS_OUT_DO.FEESTATUS, dbo.OP_WMS_OUT_DO.BSSTATUS, dbo.OP_WMS_OUT_DO.BILLSTATUS,
dbo.OP_WMS_OUT_DO.CORPID, dbo.OP_WMS_OUT_DO.DODATE, dbo.OP_WMS_OUT_DO.BSSOURCE,
dbo.OP_WMS_OUT_DO.MBLNO AS Expr1, dbo.OP_WMS_OUT_DO.CUSTOMNO_IMPORT,
dbo.OP_WMS_OUT_DO.CUSTOMNO, dbo.OP_WMS_OUT_DO.PICKUPNAME, dbo.OP_WMS_OUT_DO.TRUCKNO,
dbo.OP_WMS_OUT_DO.TRUCKMODEL, dbo.OP_WMS_OUT_DO.WMSPLANID
FROM dbo.OP_WMS_OUT_DO INNER JOIN
dbo.OP_WMS_OUT_DO_GOODS ON dbo.OP_WMS_OUT_DO.WMSDOID = dbo.OP_WMS_OUT_DO_GOODS.WMSDOID
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUT_DO_TRUCK] AS SELECT dbo.OP_WMS_TRUCK.*, dbo.OP_WMS_OUT_PLAN.PLANTIME, dbo.OP_WMS_OUT_PLAN.CUSTOMERNAME,
dbo.OP_WMS_OUT_PLAN.ISEND, dbo.OP_WMS_OUT_PLAN.BSSTATUS, dbo.OP_WMS_OUT_PLAN.FEESTATUS
FROM dbo.OP_WMS_OUT_PLAN INNER JOIN
dbo.OP_WMS_TRUCK ON dbo.OP_WMS_OUT_PLAN.WMSPLANID = dbo.OP_WMS_TRUCK.WMSPLANID
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUT_PLAN] AS SELECT [WMSPLANID]
,[WMSNO]
,[PLANTIME]
,[CUSTOMERNAME]
,[CORPID]
,[REMARK]
,[Creator]
,[CreateID]
,[CreateDate]
,[FEESTATUS]
,[BSSTATUS]
,[TIMEMARK]
,[ModifyDate]
,[ModifyID]
,[Modifier]
,[ISEND]
,[CUSTOMNO]
,GOODSNAME,GOODSFEETYPE
,dbo.[F_OUTPLANDETAIL_MBLNO](WMSPLANID) MBLNO,dbo.[F_OUTPLANDETAIL_CNTRNO](WMSPLANID) CNTRNO
FROM [dbo].[OP_WMS_OUT_PLAN]
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUT_PLAN_DETAIL] AS select opd.*,p.AREACODE,p.STOREHOUSE from OP_WMS_OUT_PLAN_DETAIL opd left join OP_WMS_PHYSICS p on opd.WMSPHYSICSID=p.WMSPHYSICSID
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUT_PLAN_NEED] AS SELECT *,dbo.[F_OUTPLANDETAIL_MBLNO](WMSPLANID) MBLNO,dbo.[F_OUTPLANDETAIL_CNTRNO](WMSPLANID) CNTRNO
,dbo.[F_OUTPLANDETAIL_MBLNO](WMSPLANID)+dbo.[F_OUTPLANDETAIL_CNTRNO](WMSPLANID) MBLNOCNTRNO
FROM dbo.OP_WMS_OUT_PLAN where ISEND='false'
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUT_PLANDETAIL_PHYSICS] AS SELECT D.WMSOUTDETAILID, D.WMSPLANID,
D.WMSID, D.MBLNO,
D.CNTRNO, D.MATERIALNO,
D.GOODSCODE, D.GOODSNAME,
D.GOODSHSCODE, D.KGS, D.NETWEIGHT,
D.PKGS, D.CBM,
D.KINDPKGS, D.STORAGEUNIT,
D.STORAGEUNITCOUNT, D.RULEUNIT,
D.RULEUNITCOUNT, pc.STOREHOUSE,
pc.AREACODE, pc.PKGS AS PKGS1,pc.WMSPHYSICSID
FROM OP_WMS_OUT_PLAN_DETAIL D
left JOIN dbo.OP_WMS_PHYSICS pc ON
(D.WMSID = pc.WMSID and pc.PKGS>=0) or (D.WMSPHYSICSID=pc.WMSPHYSICSID)
GO
CREATE VIEW [dbo].[VW_OP_WMS_OUTPLANDETAIL] AS SELECT WMSID, MATERIALNO, GOODSCODE, GOODSNAME, GOODSHSCODE, MBLNO, CNTRNO, KGS,NETWEIGHT, CBM, PKGS,
STORAGEUNIT, STORAGEUNITCOUNT, RULEUNIT, RULEUNITCOUNT, CUSTOMERNAME, KINDPKGS
FROM dbo.OP_WMS
GO
CREATE VIEW [dbo].[Vw_Op_Wms_Physics] AS select p.*
,convert(numeric(18,6) ,p.KGS/1000)TONS
,(select areaname from OP_WMS_STOREHOUSE where AREACODE=p.STOREHOUSE)
+'_'+(select areaname from OP_WMS_STOREHOUSE_AREA where AREACODE=p.AREACODE) AREANAME
,w.CORPID,w.MBLNO,w.CNTRNO,w.CUSTOMNO,w.CUSTOMERNAME,w.GOODSNAME
from Op_Wms_Physics p left join op_wms w on w.WMSID=p.WMSID
GO
CREATE VIEW [dbo].[VW_OP_WMS_PHYSICS_DODETAIL] AS select D.*,W.CUSTOMERNAME,W.GOODSNAME,W.MBLNO,W.CNTRNO from OP_WMS_PHYSICS_DODETAIL D
left join OP_WMS W on W.WMSID=D.WMSID
GO
CREATE VIEW [dbo].[VW_OP_WMS_STOREHOUSE_AREA_POSITION] AS select p.*,a.AREANAME,h.AREANAME STOREHOUSENAME,h.AREACODE STOREHOUSE from OP_WMS_STOREHOUSE_AREA_POSITION P
left join OP_WMS_STOREHOUSE_AREA a on a.AREACODE = p.AREACODE
left join OP_WMS_STOREHOUSE h on h.id=a.pid
GO
CREATE VIEW [dbo].[VW_OP_WMS_TRANSFERGOODS] AS select *,(select name from company where GID=CORPID) COMPANYNAME
,(select sum(KGS) from OP_WMS_TRANSFERGOODS_DETAIL where WMSTRANSFERGOODSID=OP_WMS_TRANSFERGOODS.WMSTRANSFERGOODSID) KGS
,(select sum(CBM) from OP_WMS_TRANSFERGOODS_DETAIL where WMSTRANSFERGOODSID=OP_WMS_TRANSFERGOODS.WMSTRANSFERGOODSID) CBM
,(select sum(PKGS) from OP_WMS_TRANSFERGOODS_DETAIL where WMSTRANSFERGOODSID=OP_WMS_TRANSFERGOODS.WMSTRANSFERGOODSID) PKGS
from OP_WMS_TRANSFERGOODS
GO
CREATE VIEW [dbo].[VW_OP_WMS_TRANSFERGOODS_DETAIL] AS select d.*,w.GOODSNAME,w.MBLNO,w.CNTRNO,w.INDATE
from OP_WMS_TRANSFERGOODS_DETAIL d
left join op_wms w on w.WMSID=d.WMSID
GO
CREATE VIEW [dbo].[VW_OP_WMS_WEIGH] AS select * from OP_WMS_WEIGH
GO
CREATE VIEW [dbo].[VW_OP_WMS_WORKDETAIL] AS select * from OP_WMS_WORKDETAIL
GO
CREATE VIEW [dbo].[VW_OP_WMS_WORKHEAD] AS select WMSDOID,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>' WORKTYPE,BSNO,(select companyid from vw_user where userid=CreateID) corpid from OP_WMS_IN_DO
union all
select WMSDOID,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ' WORKTYPE,WMSNO,corpid from OP_WMS_OUT_DO
union all
select WMSDOID,'<EFBFBD>ƿ<EFBFBD>' WORKTYPE,BSNO,corpid from OP_WMS_MOVE
union all
select WMSWEIGHID WMSDOID,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' WORKTYPE,BSNO,corpid from OP_WMS_WEIGH
GO
ALTER table wms_stevedores add CORPID varchar(50) null
GO
CREATE VIEW [dbo].[VW_OP_WMS_WORKNAME] AS select userid as USERID,SHOWNAME as SHOWNAME,COMPANYID CORPID from vw_user
union all
select GID as 'key',Name as 'value',CORPID from wms_stevedores
GO
CREATE VIEW [dbo].[VW_OP_WMS_WORKTOTAL] AS select wd.*,wh.WORKTYPE,wh.BSNO,CORPID from OP_WMS_WORKDETAIL wd left join VW_OP_WMS_WORKHEAD wh
on wh.wmsdoid=wd.WMSDOID
GO
CREATE VIEW [dbo].[Vw_Sys_User_Authority_Range] AS select r.Gid,r.UserId User_Id,(select showname from vw_user where userid= r.USERID) UserName,r.AUTHORITYID Authorityid,i.NAME ModName,i.DESCRIPTION ModNameCn,r.VisibleRange,r.OperateRange from user_authority_range r left join user_authority_info i on r.AUTHORITYID=i.GID
GO
CREATE VIEW [dbo].[Vw_Sys_User_Authority_Range_Select] AS select GID,USERID User_Id,AUTHORITYID Authorityid,(select Name from user_authority_info where gid=AUTHORITYID) ModName,COMPANYID Companyid,'' Opid,VISIBLERANGE CanVisit,OPERATERANGE CanEdit from user_authority_range_company
union all
select GID,USERID User_Id,AUTHORITYID Authorityid,(select Name from user_authority_info where gid=AUTHORITYID) ModName,'' Companyid, Opid,VISIBLERANGE CanVisit,OPERATERANGE CanEdit from user_authority_range_Op
GO
ALTER VIEW [dbo].[VW_user] AS SELECT ub.USERID, u.CODENAME, u.SHOWNAME, uc.COMPANYID, c.NAME AS companyname, sd.GID AS deptgid, sd.DEPTNAME, sd.DEPTNO, ub.EMAIL1, ub.mailsign,
u.WeChatAccount,u.Role_Id
FROM dbo.user_baseinfo AS ub LEFT OUTER JOIN
dbo.user_company AS uc ON uc.USERID = ub.USERID LEFT OUTER JOIN
dbo.sys_dept AS sd ON sd.DEPTNAME = ub.DEPTNAME AND sd.LINKID = uc.COMPANYID LEFT OUTER JOIN
dbo.[user] AS u ON u.GID = ub.USERID LEFT OUTER JOIN
dbo.company AS c ON c.GID = uc.COMPANYID
WHERE (u.ISDISABLE = 0) AND (u.ISDELETED = 0)
GO
CREATE VIEW [dbo].[VW_WMS_IN_PLAN_GOODS_NEEDDO] AS SELECT * from (
select g.CBM,g.CNTRNO,g.SEALNO,g.CUSTOMSINSPECTION,g.GID,g.GOODSCODE,p.GOODSNAME,g.GOODSHSCODE,g.KGS,g.NETWEIGHT,g.PKGS,g.KINDPKGS,g.MATERIALNO
,g.REMARK,g.RULEUNIT,g.RULEUNITCOUNT,g.STORAGEUNIT,g.STORAGEUNITCOUNT,g.STOREHOUSEINSPECTION,g.WMSPLANID,p.CUSTOMNO,
--g.*
--,
p.mblno MBLNO ,p.mblno+'-'+g.CNTRNO MBLNOCNTRNO,isnull(p.ISEND,'false') ISEND,p.PLANTIME,p.CUSTOMERNAME,p.BSSTATUS planbsstatus
,p.ETA,p.CTNNUM,p.JINJINGBEIANSHENBAORIQI,p.JINGNEISHOUHUOREN,p.INSPECTION_NO,p.PLAN_GETTIME
,isnull((select sum(pkgs) from OP_WMS_IN_DO_GOODS where WMSPLANDETAILID=g.GID),0) DONEPKGS
,isnull((select sum(kgs) from OP_WMS_IN_DO_GOODS where WMSPLANDETAILID=g.GID),0) DONEKGS
from OP_WMS_IN_PLAN_GOODS g
left join OP_WMS_IN_PLAN p on p.WMSPLANID=g.WMSPLANID)t
where ISEND='false' and planbsstatus='true' and (PKGS<>DONEPKGS AND KGS<>DONEKGS)
GO
CREATE VIEW [dbo].[workname] AS select userid as 'key',showname as 'value' from vw_user
union all
select gid as 'key',code+name as 'value' from wms_stevedores
GO
ALTER TABLE dbo.Sys_Task_Execution ADD CONSTRAINT
PK_Sys_Task_Execution PRIMARY KEY CLUSTERED
(
ID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO