Design commercial sales system with Rational Rose 2003

xiaoxiao2021-03-06  37

This analysis design is modeling several major businesses in a commercial sales system.

Our design object is a commercial sales system in shopping malls. With business units, warehouses, several counter groups and cashiers, etc. The payment point of finance is responsible for the collection of retail products.

1. Existing system description

The existing department of the mall is as follows:

Home Appliance Manager, household appliance large cabinet, household appliance small cabinet;

Hardware Communication Manager Department, Small Hardware Cabinet, Electrical Material Cabinet;

Watch glasses manager, watchdock, glasses cabinet;

Department of Cultural Supplies, one cabinet, cultural supplies, two cabinets;

Sporting Goods Manager Department, Sports Equipment Cabinet, Sports Clothing Cabinet

Clothing supplies manager, women's clothing cabinet, children's clothing cabinet, men's clothing cabinet;

Large commodity warehouse, clothing supplies warehouse, fine commodity warehouse, general commodity warehouse.

The business center is currently handled by hand, and the specific business is described below:

The business department ordering goods from the relevant manufacturers and wholesalers; when ordering goods, the business unit fills in the goods inventory notice by the business department, and the warehouse is notified to carry out the library; the warehouse centers will be in the goods Introduction to the library; no matter how the acceptance situation, you must fill in the acceptance form, notify the business unit and finance;

When the counter is required to sell the inventory of the goods, it is also notified of the product transfer order by the business department's order, and the warehouse is notified, and the warehouse is shipped by the dial; the counter shall be purchased by the adjustment order; when the goods are retained, the salesperson is filled in Pay the payment list to the customer, the customer will pay the payment order to the cashier, pay the payer, pay the payment, and then cover the payment, the customer pays the payment after the paid Remove the goods at the counter;

For the wholesale business, the customer has directly negotiated directly to the business department. The business personnel of the business unit will open the bills according to the results of the business, and the customer will pay the payment order to the financial department, and after paying the payment. Continue with the collection section; after the customer pays the payment directly to the warehouse pick-up; the warehouse is shipped by the sales order, and the pick-up of the sales form is detained.

2. Requirements for new systems

2.1 Managers Business Management Business Management

Business handling requirements:

The new system can support the various managers to manage and control the circulation of commodity circulation by issuing a library list, a transfer order, a quotation list commodity wholesale and sales order, and an inventory adjustment order.

Data processing requirements:

In the ware list, the transfer order, the price adjustment order, the sales order, and the inventory adjustment order are original credentials, and these original credentials should be saved in the new system: the document number, the credential name, the filler unit, the accept unit, date , Watchmaking;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

2.2 Warehouse Business Management

Business handling requirements: Intrinsic storage, outlet, inventory and query.

The commodity storage is mainly purchased in the warehouse, and must be notified in the library notice to accept the physical object, and fill in the acceptor.

There are two situations in the library: one is to sell the goods into the counter according to the commodity transfer order, the other is wholesale sales, customers take the goods to pick up the goods.

The inventory is mainly in accordance with the inventory account, and the profit and loss of various kinds is found.

Commodity storage, outbound, you must register inventory account, inventory to make a count report

Data processing requirements:

The product inventory of the warehouse records the stock state of the inventory of various commodities in the warehouse, etc., which should be reflected in the following information: Intrinsic Number, product name, unit, quantity, unit price, warehouse date, library position

Inventory, enter and exit, record the warehouse product, this is an increased street account, which should be reflected in the following information: credential number, enter and exit (lending), quantity, unit, unit price, storage number, product name, date, summary.

The library acceptance form is recorded, and the information should be reflected in the following information: the acceptance unit number, the product name, the warehousing number, the number of warehousing, the number of acceptance, the acceptance quality, unit, unit price, inventory number, acceptance date, acceptance People, abstract. Inventory record table record count, you should reflect the following information: inventory date, inventory number, product name, number of books, actual profit, unit, unit price, summary.

2.3 Counter business management

The new system should handle the following business: commodity gauge processing, commodity sales and statistical query of counter commodities.

When the commodity is transferred to the counter, you must receive the goods from the warehouse according to the commodity transfer order, while register the counter commodity account.

When you sell goods, you will drive the goods to customers. If you go to the checkout payment, the customer will pay the payer's salesman and take the goods, the salesperson must carry the goods sold. Register.

In addition, query the main query counter products and sales. Statistical main statistics of daily sales, hair profit and other information.

Data processing requirements:

1. Two accounts that should be registered; one is reflecting the status of the cabinet product, and the other is the stream of water reflecting the changes of the cabinet product.

2. A counter commodity account for recording the situation in which the counter existing commodity inventory should be reflected in the information: the warehouse number, the product name, unit, quantity, and the price.

3. The counter commodities used to record the storage of counter products are stored in the warehousing, which should be reflected in the following information: Voucher number, warehouse number, product name, quantity, unit price, unit, date, summary.

4. Cabinet product sales for recording the sales bank of the counter, should be reflected in the following information: credential number, warehousing number, product name, sales quantity, sales unit, unit, unit gross profit, date, summary.

5. Sales Data: Sale Number, Introduction Number, Product Name, Quantity, Price, Unit, Effective, Counter Name, Date.

6. Commodity Price Data: Product Name, Unit, Price, Date.

2.4 Cashier Management

The main job of the checkout station is to charge the cash by the sales order. The system should provide the following business processing functions: Cashier online management, receiving registration, collection query, sales daily report, and cash daily report generation printing.

Data processing requirements:

. check).

2. Sales Daily, record the sales situation of daily statistics, should be reflected in the following information: Date, counter, warehouse number, product number, quantity, unit, amount.

3. The new system should at least record the following information: the payer's name, password, valid, registration date.

2.5 Product Level 3 Account Management

The main three-level account management is: according to the warehouse acceptance order registers the library record in the commodity account, check if there is a corresponding product when filling the payment, and the inventory to automatically pay the stock and counter in the product account. Communication changes, and sell goods on the counter based on the sales daily report.

Data processing requirements:

1. Commodity inventory account, record the inventory of mall preparation departments: Intrinsic number, product name, inventory unit name, unit, quantity, unit price.

2. Commodity change stream, record changes in inventory of various departments of the mall: Intrinsic number, product name, subject number, lending, unit, quantity, unit price, date, certificate number, summary.

3. Commodity sales flow, record goods sales: Intrinsic numbers, product names, sales sector, sales quantity, unit, price, margin, gross profit, date.

2.6 Code requirements

New systems develop a simple and easy coding scheme, such as sectors, personnel, goods, manufacturers, various vouchers, etc. to facilitate management and use.

The system also requires the system to be a distributed system of a multi-layer architecture.

System design description

In this document, it is to abstract them into four management systems by using the above sectors. The following figure shows a description of the system in the USE Case Diagram View. Although it is a USE Case Diagram, but the content is only package, which does not include the specific USE Case Diagram Actor and Use Case. Figure 1. Systematic diagram of the system

Document management system design description

Use case should be a process, operation rather than an entity object. As shown in the figure, all objects of Use Case (commodity storage list, inventory form, commodity adjustment order, commodity wholesale sales, commodity transfer form) are real in existence. They are not a process, nor is it an operation. Thus, USE Case Diagram is as follows:

Figure 2, Document Management System

.

In the document management system, new systems require new systems to manage and control all aspects of commodity circulation by issuing banks, transfer orders, price adjustment single commodity wholesale sales orders, and inventory adjustment order.

In the Sequence Diagram, for a good mapping for the class and operation, improve the practical use of Sequence Diagram, and use the "two-step method". As shown below, it is a descriptive description of what users care about. In this case, there is no such thing as a specific entity object, and the class is not mapped. Figure 3, "two-step method" painting sequence diagram (1) Figure 4

Like Sequence Diagram, Collaboration Diagram also displays a specific process in cases. Sequence Diagram is the same as the information in Collaboration Diagram, but Collaboration Diagram shows different process views. In Collaboration Diagram, it is easier to see the relationship between objects.

Collaboration Diagram represents collaboration, which contains a set of objects played by objects in Collaboration Diagram, and a specific context. The final SEQUENCE DIAGRAM is converted to become a collaboration diagram shown in Figure 6:

Figure 6. SEQUENCE DIAGRAM is converted to Collaboration Diagram

The C1ASS block diagram shows the class and class packages in the system, providing system components and their relationship static graphics. Class is a project of packaging information and behavior. It is used to putting the information of the system in the database "one, and the behavior is placed in the application side. The characteristics of the object-oriented method - is connected to the behavior of a small interest rate and affecting information. We will influence the information and influence The behavior of information is connected together, and the package is classified. A system usually generates several CIASS block diagrams. Some subsets of the class and their relationships, some display classes, including attributes, and operations, and Some Poke The relationship between the bags and bags.

Next, the above-mentioned list of letters, add some necessary attributes and operations to the classes mapped in Figure 8, and packaged as three packages after the counter-related class class:

Figure 7. After the classification classification is packaged, the package "interface" subordinate class

Figure 9, package "Background Database"

Figure 10, package "middleware" subordinate class

Of course, there is also a description of the relationship between all classes and classes of the entire document management system:

Figure 11, the relational component between the document management system and classes is the physical module of the code. Components can include intercodes and run files. For example, if C is used, each .cpp and .h file are separate components. The EXE file generated after compiling the code is also a component. Before generating a code, map each file map the corresponding component. In C , each class maps two components, a file representing the class, CPP, - a file represent .h. After the component is generated, add the Component Dragram and draw its relationship: Figure 12, the relationship between the components package Figure 13, the relationship between components

Other functional modules Designed that the design of the document management system has been described in detail. From a technical point of view, the implementation process, steps and methods of the warehouse management system, sales management system, account management system are the same. In order to avoid unnecessary redundancy, the following part gives the legend directly and is no longer added. Figure 14, Warehouse Management System

Figure 15. Case Study of Sales Management System

Figure 6. Example of account management system Figure 1, report management sequence diagram

Commercial sales system class map general map 18, background database class map total map 19, interface class map total

Figure 20, Middleware Tutorial Total Figure 2, Commercial Sales System Class Total

Figure 2, Business Sales System Class Map Summit Component Total

I have not solved the problem

1. If this high field has import and export trade, there is no subdivision for the management of import and export commodities. 2. Fully implementation of the interface.

3. Senior managers have a priority right with ordinary users.

Appendix 1. Database Built table code

Use masser

IF exists (Select * from dbo.sysdatabases where name = 'vendition ") DROP DATABASE VENDITION GO

Create Database Vendition Go Use Vendition GO

if exists (select * from dbo.sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'ZreceiverInfo ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (Select * from dbo.sysobjects where id = Object_id (n '[dbo]. [TravelService_LOAN]') And ObjectProperty (ID, n'dorder ') = 1) Drop Table [DBO]. [TravelService_LOAN] Go if EXISTS (SELECT * from dbo.sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'CcheckOrder ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'ZgoodDailyOrder ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo. sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'SgainTotal ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where ID = Object_ID (n '[dbo]. [TravelService_LOAN]') And ObjectProperty (ID, N'CstorageInfo ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N' [dbo]. [TravelService_Loan] ') and OBJECTPROPERTY (id, N' CinStorage ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N' [dbo]. [TravelService_Loan] ') and OBJECTPROPERTY (id, N'CprepareOrder' ) = 1) DROP TABLE [DBO]. [TravelService_LOAN] Go if EXISTS (Select * from dbo.sysObjects where id = Object_id (n '[dbo]. [TravelService_LOAN]') And ObjectProperty (ID, N '

ZmoneyDailyOrder ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N' [dbo]. [TravelService_Loan] ') and OBJECTPROPERTY (id, N'SpayforOrder' ) = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'SpayforOrder ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'SgoodsTotal ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'DorderItem ') = 1) drop table [dbo]. [TravelService_Loan] GO if exists (select * from dbo.sysobjects where id = object_id (N '[dbo]. [TravelService_Loan]') and OBJECTPROPERTY (id, N'CpickUpGoodsOrder ') = 1) drop table [dbo ]. [TravelService_Loan] Go

CREATE TABLE ZreceiverInfo (ReceiverID INTEGER NOT NULL, ReceiverName VARCHAR (255) NOT NULL, ReceiverPassW SMALLINT NOT NULL, Gender SMALLINT NOT NULL, ApplyDate datetime NOT NULL, LastLoginDate datetime NOT NULL, CounterID SMALLINT NOT NULL, Others SMALLINT NOT NULL, ZreceiverInfo_ID INTEGER NOT NULL, CONSTRAINT PK_ZreceiverInfo11 PRIMARY KEY (ZreceiverInfo_ID)); CREATE TABLE Dorder (OrderNumber INTEGER NOT NULL, OrderName VARCHAR (255) NOT NULL, OrderFillUnit VARCHAR (255) NOT NULL, OrderRequreUnit VARCHAR (255) NOT NULL, OrderDate datetime NOT NULL, OrderFillDate datetime NOT NULL, OrderLister VARCHAR (255) NOT NULL, Dorder_ID INTEGER NOT NULL, CONSTRAINT PK_Dorder4 PRIMARY KEY (Dorder_ID)); CREATE TABLE CcheckOrder (CheckNumber INTEGER NOT NULL, CheckPerson VARCHAR (255) NOT NULL, CheckResult SMALLI NT NOT NULL, COL_0 SMALLINT NOT NULL, Dorder_ID INTEGER NOT NULL, GoodName VARCHAR (255) NOT NULL, InStorageOrderID INTEGER NOT NULL, CONSTRAINT PK_CcheckOrder21 PRIMARY KEY (Dorder_ID)); CREATE TABLE ZgoodDailyOrder (ZmoneyDailyOrder_ID INTEGER, SgoodsTotal_ID INTEGER, Dorder_ID INTEGER NOT NULL , CONSTRAINT PK_ZgoodDailyOrder24 PRIMARY KEY (Dorder_ID)); CREATE TABLE SgainTotal (Date datetime NOT NULL, GoodOrderID INTEGER NOT NULL, OrderId INTEGER NOT NULL, SgainTotal_ID INTEGER NOT NULL, TotalCash SMALLINT NOT NULL, CONSTRAINT PK_SgainTotal18 PRIMARY KEY (SgainTotal_ID));

CREATE TABLE CstorageInfo (GoodPlace VARCHAR (255) NOT NULL, Dorder_ID INTEGER NOT NULL, CinStorage_Dorder_ID INTEGER NOT NULL, CONSTRAINT PK_CstorageInfo19 PRIMARY KEY (Dorder_ID)); CREATE TABLE CinStorage (InStorageTime SMALLINT NOT NULL, CpickUpGoodsOrder_ID INTEGER, Dorder_ID INTEGER NOT NULL, CONSTRAINT PK_CinStorage20 PRIMARY KEY (Dorder_ID)); CREATE TABLE CprepareOrder (Dorder_ID INTEGER NOT NULL, CONSTRAINT PK_CprepareOrder22 PRIMARY KEY (Dorder_ID)); CREATE TABLE ZmoneyDailyOrder (OrderId INTEGER NOT NULL, TotalCash DOUBLE PRECISION NOT NULL, Date datetime NOT NULL, GoodOrderId INTEGER NOT NULL, ZmoneyDailyOrder_ID INTEGER NOT NULL, SgainTotal_ID INTEGER, CONSTRAINT PK_ZmoneyDailyOrder14 PRIMARY KEY (ZmoneyDailyOrder_ID)); CREATE TABLE SpayforOrder (Dorder_ID INTEGER NOT NULL, CONSTRAINT PK_SpayforOrder25 PR IMARY KEY (Dorder_ID)); CREATE TABLE ZgatheringOrder (PayForm VARCHAR (255) NOT NULL, CounterID INTEGER NOT NULL, ZmoneyDailyOrder_ID INTEGER, Dorder_ID INTEGER NOT NULL, CONSTRAINT PK_ZgatheringOrder23 PRIMARY KEY (Dorder_ID)); CREATE TABLE SgoodsTotal (OrderId INTEGER NOT NULL, GoodName VARCHAR (255) NOT NULL, GoodTotal INTEGER NOT NULL, SgainTotalID INTEGER NOT NULL, GoodPrice DOUBLE PRECISION NOT NULL, SgoodsTotal_ID INTEGER NOT NULL, CONSTRAINT PK_SgoodsTotal17 PRIMARY KEY (SgoodsTotal_ID));

CREATE TABLE DorderItem (ItemID INTEGER NOT NULL, ItemUnit VARCHAR (255) NOT NULL, ItemNumber INTEGER NOT NULL, ItemPrise DOUBLE PRECISION NOT NULL, ItemTabloid VARCHAR (255) NOT NULL, DorderItem_ID INTEGER NOT NULL, Dorder_ID INTEGER NOT NULL, CONSTRAINT PK_DorderItem5 PRIMARY KEY (DorderItem_ID)); CREATE TABLE CpickUpGoodsOrder (PickUpID SMALLINT NOT NULL, PickUpObject VARCHAR (255) NOT NULL, PickUpTime datetime NOT NULL, PickUpGoodName VARCHAR (255) NOT NULL, PickUpGoodPrice DOUBLE PRECISION NOT NULL, PickUpMoney DOUBLE PRECISION NOT NULL, CpickUpGoodsOrder_ID INTEGER NOT NULL, CONSTRAINT PK_CpickUpGoodsOrder10 PRIMARY KEY (CpickUpGoodsOrder_ID)); CREATE INDEX TC_ZgoodDailyOrder13 ON ZgoodDailyOrder (ZmoneyDailyOrder_ID); CREATE INDEX TC_ZgoodDailyOrder15 ON ZgoodDailyOrder (SgoodsTotal_ID); CREATE INDEX TC_CinStorage9 ON CinStorage (CpickUpGoodsO rder_ID); CREATE INDEX TC_ZmoneyDailyOrder17 ON ZmoneyDailyOrder (SgainTotal_ID); CREATE INDEX TC_ZgatheringOrder11 ON ZgatheringOrder (ZmoneyDailyOrder_ID); CREATE INDEX TC_DorderItem5 ON DorderItem (Dorder_ID); ALTER TABLE CcheckOrder ADD CONSTRAINT FK_CcheckOrder12 FOREIGN KEY (Dorder_ID) REFERENCES Dorder (Dorder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE ZgoodDailyOrder ADD CONSTRAINT FK_ZgoodDailyOrder6 FOREIGN KEY (ZmoneyDailyOrder_ID) REFERENCES ZmoneyDailyOrder (ZmoneyDailyOrder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE ZgoodDailyOrder ADD CONSTRAINT FK_ZgoodDailyOrder15 FOREIGN KEY (Dorder_ID) REFERENCES CinStorage (Dorder_ID) ON DELETE NO ACTION On Update No Action;

ALTER TABLE ZgoodDailyOrder ADD CONSTRAINT FK_ZgoodDailyOrder7 FOREIGN KEY (SgoodsTotal_ID) REFERENCES SgoodsTotal (SgoodsTotal_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE CstorageInfo ADD CONSTRAINT FK_CstorageInfo10 FOREIGN KEY (CinStorage_Dorder_ID) REFERENCES CinStorage (Dorder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE CstorageInfo ADD CONSTRAINT FK_CstorageInfo9 FOREIGN KEY (Dorder_ID) REFERENCES Dorder (Dorder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE CinStorage ADD CONSTRAINT FK_CinStorage4 FOREIGN KEY (CpickUpGoodsOrder_ID) REFERENCES CpickUpGoodsOrder (CpickUpGoodsOrder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE CinStorage ADD CONSTRAINT FK_CinStorage11 FOREIGN KEY (Dorder_ID) REFERENCES Dorder (Dorder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE CprepareOrder ADD CONSTRAINT FK_CprepareOrder13 FOREIGN KEY (Dorder_ID) REFERENCES Dorder (Dorder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; Alter Table ZMON eyDailyOrder ADD CONSTRAINT FK_ZmoneyDailyOrder8 FOREIGN KEY (SgainTotal_ID) REFERENCES SgainTotal (SgainTotal_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE SpayforOrder ADD CONSTRAINT FK_SpayforOrder16 FOREIGN KEY (Dorder_ID) REFERENCES ZgatheringOrder (Dorder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE ZgatheringOrder ADD CONSTRAINT FK_ZgatheringOrder14 FOREIGN KEY (Dorder_ID) REFERENCES Dorder (Dorder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE ZgatheringOrder ADD CONSTRAINT FK_ZgatheringOrder5 FOREIGN KEY (ZmoneyDailyOrder_ID) REFERENCES ZmoneyDailyOrder (ZmoneyDailyOrder_ID) ON DELETE NO ACTION ON UPDATE NO ACTION;

Alter Table DorderItem2 Foreign Key (Dorder_ID) References Dorder (Dorder_ID) On Delete No Action On Update No Action; Appendix II, Several Simple Stored Procedures and Triggers Implementation

/ ************************************************** ********************************** /

CREATE TRIGGER Checkgoods on Cinstroage / * Checks inventory if there is a corresponding item when filling the bill.

For insert

AS

Begin

Declare @goodsname varchar (20),

@Goodsnum int,

@Mark Int, set @ mark = 0

Set @ Goodsname = (Select @goodsname from insert)

Set @ Goodsnum = (SELECT @@ Goodsnum from inserted)

Set @ Mark = (Select (*) from cinstroage where cinstroage.goodname=@goodsname)

IF @ mark = 0

Begin

INSERT INTO CINSTROAGE VALUES (SELECT * from inserted)

end

Else IF

Begin

Update Cinstroage

Set goodsnum = goodsnum @ Goodsnum

Where goodsname = @ goodsname

end

end

/ ************************************************** ********************************** /

CREATE TRIGGER PICKOUT On CPREPAREORDER / * Directs to automatically register in stocks and counter commodities in the product account after completing the order * /

For insert

AS

Begin

Declare @goodsname varchar (20),

@Goodsnum int,

Set @ Goodsname = (Select @goodsname from insert)

Set @ Goodsnum = (SELECT @@ Goodsnum from inserted)

Update Cinstroage

Set goodsnum = goodsnum- @ goodsnum

Where goodsname = @ goodsname

Delete * from cinstroage where goodsnum = 0

Update ScountStroage

Set goodsnum = goodsnum- @ goodsnum

Where goodsname = @ goodsname

Delete * from scountStroage where goodsnum = 0

end

end

/ ************************************************** ********************************** /

Create Proc CDAily / * Sales Daily Report Cash Daily Generation * /

AS

CREATE TABLE CDAILYRESULT / * Create a temporary table CDailyResult * /

(GoodName Varchar (20),

GoodPrice Int, GoodNum Int,

Goodcountcash varchar (10),

)

Go

Declare @goodname varchar (20), / * Summary from the product sales information as the name of the payment order and the bill of lading, in the temporary table * /

@Goodprice int,

@Goodnum int,

@Goodcountcash varchar (10),

@Totalcash varchar (15),

@ looptime1 set @ looptime1 = (Select Count (*) from ZgatheringOrder,

@ looptime2 set @ looptime1 = (Select Count (*) from CPICPUPGOODSORDER)

Declare DailyTotal1 Cursor for

Select A1.GoodName, A1.GoodPrice A1.Goodprice, A1.Goodnum A2.Goodnum, A1.GoodCountcash A2.GoodCountcash

From ZgatheringOrder AS A1, A2

Where a1.dailydate=@cdate

A1.GoodName = a2.goodname

Declare DailyTotal2 Cursor for

Select A1.GoodName, A1.GoodPrice A1.Goodprice, A1.Goodnum A2.Goodnum, A1.GoodCountcash A2.GoodCountcash

From CPICPUPGOODSORDER AS A1, A2

Where dailydate = @ cdate

Open ZgatheringOrder

Open CPICPUPGOODSORDER

While @ LoopTime1! = 0

Begin

Fetch next from zgatheringorder @ Goodname, @ goodprice, @ Goodnum, @ Goodcountcash

Insert Into Result Values ​​(@ Goodname, @ goodprice, @ Goodnum, @ goodcountcash)

Set @ looptime1 = @ LoOptime1-1

end

While @ LoopTime2! = 0

Begin

Fetch next from cpicpupgoodsorder @ Goodname, @ goodprice, @ Goodnum, @ goodcountcash

Insert Into Result Values ​​(@ Goodname, @ goodprice, @ Goodnum, @ goodcountcash)

Set @ looptime1 = @ LoOptime1-1

end

Close ZgatheringOrder

Close CPICPUPGOODSORDER

Deallocate ZgatheringOrder

Deallocate CPICPUPGODSORDER

/ * You must delete the temporary table CDailyResult * /

/ ************************************************** ********************************** /

Create Proc Ccheck (@cdate datetime) / * Some storage procedures are used to complete the product inventory in the warehouse management system * /

AS

CREATE TABLE CCHECKRESULT / * Create a temporary table CDailyResult * / (Checkdate DateTime,

InstareRderId Int,

GoodName Varchar (20),

GoodPrice Int,

RemaningNum Int,

Mark Varchar (10),

Unit varchar (4),

Abstract varchar (200)

)

Go

Declare @InstorageOrderid Int,

@Goodname varchar (20),

@Goodprice int,

@RemaningNum Int,

@Mark Varchar (10),

@Unit varchar (4),

@Abstract varchar (200),

@LoOptime set @ looptime1 = (Select Count (*) from cinstroage,

Declare Dateccheck Cursor for

Select InstoralageOrderid, GoodName, Remaningnum, Mark, Unit, Abstract, Goodprice

From Cinstroage

Open dateccheck

While @LoOptime! = 0

Begin

Fetch next from dateck @ @ goodname, @ goodnum, @ goodprice, @ mark, unit, @ Abstract

Set @ checkdate = @ cdate,

@ Transningnum = (select @ Goodnum * @ goodprice-goodnum

From Cinstroage, SGANTOTAL

WHERE CINSTROAGE.GOODNAME = sgantotal.goodname,

@ Make = (SELECT @ Goodnum-GoodNum

From Cinstroage, SGANTOTAL

WHERE CINSTROAGE.GOODNAME = sgantotal.goodname,

INSERT INTO Result Values ​​(@ checkdate, @ INSTORAGEORDERID, @ Goodname, @ transnunnum, @ mark, unit, @ Abstract)

Set @ looptime1 = @ LoOptime1-1

end

Close Dateccheck

Deallocate Dateccheck

/ * You must delete the temporary table ccheckresult * /

/ ************************************************** ********************************** /

转载请注明原文地址:https://www.9cbs.com/read-69029.html

New Post(0)