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/DB/SQL_banben/01 向标准库插入仓储所需的表结构.sql

2516 lines
110 KiB
MySQL

2 years ago
ALTER TABLE [dbo].[code_goods] ADD [GOODSFEETYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[code_goods] ADD [STORAGEUNIT_TYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
ALTER TABLE [dbo].[wms_stevedores] ADD [CORPID] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
update code_goods set STORAGEUNIT_TYPE='ë<EFBFBD><EFBFBD>' where GOODNAME like '%<25><>%'
GO
update code_goods set STORAGEUNIT_TYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where GOODNAME like '%<25><>%'
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,
[GOODSOWNER] 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,
[GOODSOWNER] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AREACODE] 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_CUST_DETAIL] (
[WMSDUIDETAILID] uniqueidentifier NOT NULL,
[WMSDUIID] uniqueidentifier NULL,
[WMSID] uniqueidentifier NULL,
[CUSTOMERNAME] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ACCDATE] datetime NULL,
[MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[QUANTITY_DAY] numeric(18,3) NULL,
[QUANTITY] numeric(18,3) NULL,
[AMOUNT] numeric(18,2) NULL,
[STARTDATE] datetime NULL,
[ENDDATE] datetime NULL,
[PRICE] numeric(18,3) NULL,
[DAYS] numeric(8) NULL,
[REMARK] varchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[FEETYPE] tinyint NULL,
CONSTRAINT [PK_OP_WMS_FEEDUI_CUST_DETAIL] 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_CUST_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>ϸ',
'SCHEMA', N'dbo',
'TABLE', N'OP_WMS_FEEDUI_CUST_DETAIL'
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,
[GOODSOWNER] 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,
[GOODSOWNER] varchar(50) COLLATE Chinese_PRC_CI_AS 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,
[CTNALL] varchar(4) 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,
[GOODSOWNER] varchar(50) 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,
[GOODSOWNER] varchar(50) 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 ([DODETAILID])
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,
[OLD_GOODSOWNER] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[NEW_GOODSOWNER] 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,
[WEIGHDATE] datetime NULL,
[CUSTOMWEIGHDATE] datetime NULL,
[DELIVERDATE] datetime NULL,
[BAOJIANHAO] 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_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
ALTER TABLE [dbo].[sys_log] ALTER COLUMN [LOGCONTENT] varchar(MAX) COLLATE Chinese_PRC_CI_AS NULL
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_PRINTINFO_DETAIL] (
[GID] uniqueidentifier NOT NULL,
[PRINTID] uniqueidentifier NULL,
[SQLORDER] int NULL,
[SQLSTR] varchar(max) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_SYS_PRINTINFO_DETAIL] 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].[SYS_PRINTINFO_DETAIL] 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
ALTER TABLE [dbo].[Sys_Task_Execution] ADD CONSTRAINT [PK_Sys_Task_Execution] 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
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
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
CREATE FUNCTION [dbo].[F_WMSINCOUNTRY](@ASSOCIATEDNO varchar(50))
returns nvarchar(100)
as
begin
declare @S nvarchar(100)
select @S=isnull(@S,'')+country+',' from(select distinct isnull(country,'') country from code_country where countryid in(select countryid from wms_in where ASSOCIATEDNO= @ASSOCIATEDNO ))t where country<>''
if(LEN(@S)>0) begin
select @S =substring(@S,1,len(@S)-1)
end
return @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
ALTER TABLE [info_files] DROP CONSTRAINT PK_info_files
GO
ALTER TABLE [dbo].[info_files] ALTER COLUMN [GID] uniqueidentifier NOT NULL
GO
alter table [info_files] add constraint PK_info_files primary key(GID)
ALTER TABLE [dbo].[info_files] ALTER COLUMN [PID] uniqueidentifier NOT NULL
GO
ALTER TABLE [dbo].[info_files] ALTER COLUMN [FILEPATH] varchar(500) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[info_files] ADD [IMGPATH] varchar(500) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[info_files] ADD [PWORKTYPE] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[info_files] ADD [CreateID] uniqueidentifier NULL
GO
ALTER TABLE [dbo].[info_files] ADD [CreateDate] datetime NULL
GO
ALTER TABLE [dbo].[info_files] ADD [Creator] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[info_files] ADD [ModifyID] uniqueidentifier NULL
GO
ALTER TABLE [dbo].[info_files] ADD [ModifyDate] datetime NULL
GO
ALTER TABLE [dbo].[info_files] ADD [Modifier] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[info_files] ADD [PBSNO] varchar(500) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[info_files] ADD [MBLNO] varchar(50) COLLATE Chinese_PRC_CI_AS NULL
GO
ALTER TABLE [dbo].[info_files] ADD [CNTRNO] varchar(50) COLLATE Chinese_PRC_CI_AS 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_FEEQuery] AS select f.GID, b.OPLBNAME,isnull(b.CORPID,'') CORPID, b.CUSTNO,b.MBLNO, f.CUSTOMERNAME,f.FEENAME,f.FEETYPE,f.AMOUNT,f.FEESTATUS from ch_fee F left join v_op_bs b on b.BSNO=f.BSNO
GO
CREATE VIEW [dbo].[VW_OP_REP_NOFEEWMS] AS select CUSTOMERNAME,ACCDATE,MBLNO,CNTRNO,STARTDATE,ENDDATE,WMSID,WMSDUIDETAILID,WMSDUIID,'' REMARK from OP_WMS_FEEDUI_CUST_DETAIL FD
GO
CREATE VIEW [dbo].[VW_OP_REP_QIANFEITONGJI_1] AS SELECT *,dbo.F_FeeStatusStr(DRFEESTATUS) DRFEESTATUSREF,dbo.F_FeeStatusStr(CRFEESTATUS) CRFEESTATUSREF ,case OPDATE when '' then 0 else case when BALTTLDR<>0 OR BALTTLCR<>0 then DATEDIFF([day],CASE WHEN STLDATE IS NULL THEN OPDATE ELSE STLDATE END,GETDATE()) else (DATEDIFF([day],CASE WHEN STLDATE IS NULL THEN OPDATE ELSE STLDATE END,SETTLETIME)) end end AS NODAY FROM (SELECT B.BSNO,B.OPTYPE, B.OPLBNAME, B.BSTYPE,B.CUSTOMERNAME, B.CUSTNO, B.MBLNO, B.HBLNO,B.VESSEL, B.VOYNO, B.INPUTBY, B.CREATETIME, B.BSSTATUS, B.SALE, B.OP,
B.DOC,B.YARD,B.BLISSUESTATUS,B.BLTYPE,case B.ETD when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), B.ETD,23) end as ETD,B.STLNAME,case B.OPDATE when '1900-01-01 00:00:00.000'
then '' else CONVERT(varchar(100), B.OPDATE,23) end as OPDATE,B.ENTERP,B.DELIVERYDATE,case B.CUSTOMDATE when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), B.CUSTOMDATE,23) end
as CUSTOMDATE,B.CUSTSERVICE, B.PORTLOAD, B.PORTDISCHARGE,B.DESTINATION, B.CUSTOMNO, B.ACCDATE,B.CARRIER, B.BSSOURCE, B.LANE,
B.FORWARDER,B.NETWEIGHT,B.KGS,B.TEU,B.CNTRTOTAL,B.CORPID,B.CNTR1,B.CNTR2,B.CNTR3,B.CNTR4,B.CNTR5,B.CNTR6,B.CNTR7,B.CNTR8,B.CNTR9,B.CNTR10,B.OTCNTR,B.TRADETYPE,B.GOODSNAME,B.FEESTATUS,B.PKGS,B.CBM,B.ORDERNO,B.SALECORPID,(select
[NAME] from [company] where GID=B.SALECORPID) as SALECORP,(CASE B.FEESTATUS WHEN 1 THEN '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' else 'δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' end) as FEESTATUSREF ,F.CUSTOMERNAME AS CUSTNAME ,C.[DESCRIPTION] AS CUSTFULLNAME
,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN
ISNULL(AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS STLRMBDR,isnull(SUM(CASE
FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLRMBCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN
ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS BALRMBDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS
BALRMBCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS ORDERRMBDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS ORDERRMBCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLUSDDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLUSDCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS BALUSDDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS BALUSDCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS ORDERUSDDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS ORDERUSDCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT,0) END) END)ELSE 0 END),0) AS OTDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT,0) END) END)ELSE 0 END),0) AS OTCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(SETTLEMENT,0) END) END)ELSE 0 END),0) AS STLOTDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(SETTLEMENT,0) END) END)ELSE 0 END),0) AS STLOTCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT-SETTLEMENT,0) END) END) ELSE 0 END),0) AS BALOTDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE
ISNULL(AMOUNT-SETTLEMENT,0) END) END) ELSE 0 END),0) AS BALOTCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE
ISNULL(ORDERAMOUNT,0) END) END)ELSE 0 END),0) AS ORDEROTDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(ORDERAMOUNT,0)
END) END)ELSE 0 END),0) AS ORDEROTCR,isnull(SUM(CASE CURRENCY WHEN 'RMB' THEN ISNULL(INVOICE,0) ELSE 0 END),0) AS INVRMB,isnull(SUM(CASE CURRENCY WHEN 'USD' THEN ISNULL(INVOICE,0) ELSE 0
END),0) AS INVUSD,isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(AMOUNT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS TTLDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN
cast(round(ISNULL(AMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS TTLCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(SETTLEMENT,0) * ISNULL(EXCHANGERATE,0),2) as
numeric(20,2)) ELSE 0 END),0) AS STLTTLDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(SETTLEMENT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS
STLTTLCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(AMOUNT-SETTLEMENT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS BALTTLDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN
cast(round(ISNULL(AMOUNT-SETTLEMENT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS BALTTLCR,isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(ORDERAMOUNT,0) *
ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLDR,isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(ORDERAMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0
END),0) AS ORDERTTLCR,case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then (case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, GETDATE()) end) else
(case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, S.SETTLETIME) end) end AS ACTUALDAY,S.SETTLETIME,CASE WHEN B.STLDATE IS NULL THEN B.OPDATE ELSE B.STLDATE END STLDATE
,isnull((select top 1 case ACCTYPE WHEN '<EFBFBD>½<EFBFBD>' then accmonth*30 + accdays WHEN '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =B.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY , (CASE WHEN (SUM(G.TTLDR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLDR)) * 100, 10, 2))) END) AS PROFITRATE,'' INVOICENO,dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS,dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS
FROM CH_FEE F INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO)
LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO)
LEFT JOIN info_client C ON (C.SHORTNAME=F.CUSTOMERNAME)
LEFT JOIN V_MAX_SETTLEMENTTIME S ON (S.CUSTOMERNAME=F.CUSTOMERNAME AND S.BSNO=B.BSNO)
Where 1=1
GROUP BY B.BSNO,B.OPTYPE,B.OPLBNAME, B.BSTYPE,B.CUSTOMERNAME, B.CUSTNO, B.MBLNO, B.HBLNO,B.VESSEL, B.VOYNO, B.INPUTBY
, B.CREATETIME, B.BSSTATUS, B.SALE, B.OP, B.DOC,B.YARD,B.BLISSUESTATUS,B.BLTYPE, B.ETD ,B.OPDATE,B.ENTERP,B.DELIVERYDATE ,B.CUSTOMDATE
,B.CUSTSERVICE, B.PORTLOAD, B.PORTDISCHARGE,B.DESTINATION, B.CUSTOMNO, B.ACCDATE,B.CARRIER, B.BSSOURCE, B.LANE, B.FORWARDER,B.NETWEIGHT
,B.KGS,B.TEU,B.CNTRTOTAL,B.CORPID ,B.CNTR1,B.CNTR2,B.CNTR3,B.CNTR4,B.CNTR5,B.CNTR6,B.CNTR7,B.CNTR8,B.CNTR9,B.CNTR10,B.OTCNTR,B.TRADETYPE
,B.GOODSNAME,B.FEESTATUS,B.PKGS,B.CBM,B.ORDERNO,B.SALECORPID,B.STLDATE,F.CUSTOMERNAME,C.[DESCRIPTION] ,B.STLNAME, S.SETTLETIME) AS T
--order by CUSTNAME,OPDATE,MBLNO
GO
CREATE VIEW [dbo].[VW_OP_REP_TRANSFERGOODSDETAIL] AS select c.*,t.BSNO,t.TRANSFERDATE,t.STOREHOUSEDAYS,t.STOREHOUSEENDDATE,t.WMSINFEE_OLDCUST,t.WMSOUTFEE_OLDCUST,t.OLDCUSTOMERNAME,t.NEWCUSTOMERNAME
,t.OLD_GOODSOWNER,t.NEW_GOODSOWNER,w.MBLNO,w.CNTRNO,w.GOODSNAME,w.CORPID
from OP_WMS_CHANGE c
left join OP_WMS_TRANSFERGOODS t on t.WMSTRANSFERGOODSID=c.dobsno
left join OP_WMS w on w.WMSID = c.WMSID
where CHANGETYPE in('<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
GO
CREATE VIEW [dbo].[VW_OP_REP_WEIGH] AS select w.BSNO,w.MBLNO,w.CUSTOMERNAME,w.CORPID,D.* from OP_WMS_WEIGH_DETAIL D left join OP_WMS_WEIGH W on d.WMSWEIGHID=w.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,w.GOODSOWNER
,inplan.INSPECTION_NO,inplan.CONTRACTNO,inplan.JINGNEISHOUHUOREN
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
left join OP_WMS_IN_PLAN inplan on inplan.WMSPLANID=idg.WMSPLANID
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,w.GOODSOWNER
,od.TRUCKNO
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,GOODSOWNER
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,w.GOODSOWNER
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.WMSCHECKID,c.BSNO,c.STOREHOUSE,c.DODATE,c.REMARK,c.CORPID
,c.Creator,c.CreateDate,c.CreateID,c.Modifier,c.ModifyDate,c.ModifyID,c.BILLSTATUS,c.CUSTOMERNAME,c.GOODSOWNER,c.AREACODE
,(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_FeeBase] 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]
,isnull([FEEENDDATE],'3000-12-12') [FEEENDDATE]
,[MBLNO]+[CNTRNO] MBLNOCNTRNO
,KGS_SINGLE,CBM_SINGLE,STORAGEUNITCOUNT_SINGLE,RULEUNITCOUNT_SINGLE,OP,CUSTOMNO,ACCBOOKNO,GOODSOWNER
from OP_WMS
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_FEEDUI_STORAGE_CUST] 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,w.GOODSOWNER,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 top 1 CTNALL from OP_WMS_IN_PLAN_GOODS where GID = WIG.WMSPLANDETAILID)CTNALL,
(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
,GOODSOWNER
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
,w.GOODSOWNER
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
,GOODSOWNER
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
,isnull((select sum(KGS) from OP_WMS_TRANSFERGOODS_DETAIL where WMSTRANSFERGOODSID=OP_WMS_TRANSFERGOODS.WMSTRANSFERGOODSID),0) KGS
,isnull((select sum(CBM) from OP_WMS_TRANSFERGOODS_DETAIL where WMSTRANSFERGOODSID=OP_WMS_TRANSFERGOODS.WMSTRANSFERGOODSID),0) CBM
,isnull((select sum(PKGS) from OP_WMS_TRANSFERGOODS_DETAIL where WMSTRANSFERGOODSID=OP_WMS_TRANSFERGOODS.WMSTRANSFERGOODSID),0) 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
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_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
,p.GOODSOWNER,g.CTNALL
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
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM01','<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'RKPL','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_IN_PLAN','0','7D83C9B6-05B0-4BA7-A4D4-E64C4304B070',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM02','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'RK','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_IN_DO','0','AD960660-2861-44AD-9FE7-4C2287069BDF',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM03','<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'CKPL','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_OUT_PLAN','0','54FCB386-EFA3-4BF5-9E95-C3A39CC1E729',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM04','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'CK','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_OUT_DO','0','FDB5A71E-91DB-41C2-B72B-66E5E13B9648',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM05','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'GB','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_GB','0','44553084-EEC3-4D36-8555-1109E6EE26EF',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM06','<EFBFBD>ƿ<EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'YK','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_YK','0','CE7EEF24-E114-4302-B890-B6C6F37E4F49',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM07','<EFBFBD>̵<EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'PD','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_PD','0','C0D5DD8E-B9AE-4D15-B9E2-58A0DE483158',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM08','<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'FL','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_FEERATE','0','4AFEF44E-DC33-470F-86B6-A2B67FAA2957',NULL)
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM09','<EFBFBD>½<EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'MF','1','YYYYMMDD',6,'2020','01','01',57,'OP_WMS_FEEDUI_STORAGE','0','7A55DAF5-0D0D-4F09-85C3-ACC47A76E57F',NULL)
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( '7D83C9B6-05B0-4BA7-A4D4-E64C4304B070' , '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM01' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( 'AD960660-2861-44AD-9FE7-4C2287069BDF' , '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM02' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( '54FCB386-EFA3-4BF5-9E95-C3A39CC1E729' , '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM03' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( 'FDB5A71E-91DB-41C2-B72B-66E5E13B9648' , '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM04' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( '44553084-EEC3-4D36-8555-1109E6EE26EF' , '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM05' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( 'CE7EEF24-E114-4302-B890-B6C6F37E4F49' , '<EFBFBD>ƿ<EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM06' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( 'C0D5DD8E-B9AE-4D15-B9E2-58A0DE483158' , '<EFBFBD>̵<EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM07' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( '4AFEF44E-DC33-470F-86B6-A2B67FAA2957' , '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM08' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( '7A55DAF5-0D0D-4F09-85C3-ACC47A76E57F' , '<EFBFBD>½<EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM09' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
--select newid()
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM10','<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'WMS','1','YYYYMMDD',4,'2020','01','01',57,'OP_WMS','0','C0778808-BFE9-4C39-9501-54A86950C212',NULL)
--delete from sys_billno_set where gid= 'C0778808-BFE9-4C39-9501-54A86950C212'
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( 'C0778808-BFE9-4C39-9501-54A86950C212' , '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM10' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
--select newid()
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM11','<EFBFBD><EFBFBD>Ȩת<EFBFBD><EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'WT','1','YYYYMMDD',4,'2020','01','01',57,'OP_WMS','0','8FBE0A35-BA8E-45AD-B0C4-3595CDB6B361',NULL)
--delete from sys_billno_set where gid= 'C0778808-BFE9-4C39-9501-54A86950C212'
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( '8FBE0A35-BA8E-45AD-B0C4-3595CDB6B361' , '<EFBFBD><EFBFBD>Ȩת<EFBFBD><EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM11' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
insert into tSysBillType(BillCode,BillName,BillGrp,IsRule,NoLength,IsPrefix,PrefixLen,PrefixNo,IsDate,DateFmt,SerialLen,YearNo,MonthNo,DayNo,MaxSerial,BillHeadTbl,IsOrgPrefix,GID,IsEmpPrefix)values('WM12','<EFBFBD>ƿ<EFBFBD>','<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','1',18,'1',4,'WMV','1','YYYYMMDD',4,'2020','01','01',57,'OP_WMS_MOVE','0','716451F8-88B8-4152-BC4E-5F3E2F6A6688',NULL)
--delete from sys_billno_set where gid= 'C0778808-BFE9-4C39-9501-54A86950C212'
insert sys_billno_set(GID,OPLBNAME,RULEBLNO,RULEDATETYPE,BILLTYPE,COMPANYID,CREATEUSER,CREATETIME,ISEDIT,ISAUTO,CUSTOMHEAD) values( '716451F8-88B8-4152-BC4E-5F3E2F6A6688' , '<EFBFBD>ƿ<EFBFBD>' , 'ί<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>' , 'ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' , 'WM12' , 'Comcab2d43f60454327af30a131fc1d3abd' , NULL , NULL , '1' , NULL , NULL )
/****** Object: StoredProcedure [dbo].[sSysGetBillNo_new] Script Date: 2020/9/16 14:12:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
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
ALTER TABLE [user_baseinfo] DROP CONSTRAINT PK_Users_BasicInfo
GO
ALTER TABLE [dbo].[user_baseinfo] ALTER COLUMN [GID] uniqueidentifier NOT NULL
GO
alter table [user_baseinfo] add constraint PK_Users_BasicInfo primary key(GID)
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