Title: Small supermarket management system
1, project plan
1. 1 system development purpose
(1) greatly improves the operation efficiency of the supermarket;
(2) Help to improve the decision-making level of supermarkets through comprehensive information collection and processing;
(3) Using this system can quickly improve the management level of supermarkets and provide effective technical support for reducing operating costs, improving efficiency and enhancing the expansion of supermarkets.
1.2 background description
2 1 century, the competition of supermarkets has also entered a brand-new field. Competition is no longer the competition of scale, but the competition of technology, management and talents. The upgrading of technology and management is the core of supermarket industry competition. At present, the retail field is developing in a diversified trend, and supermarkets, warehouse stores, convenience stores, franchise stores, specialty stores, warehouses and other formats coexist. How to increase sales, reduce operating costs and expand operating scale in the fierce competition has become the goal pursued by supermarket operators.
1.3 Project Establishment
According to the characteristics of supermarkets, in order to help supermarkets solve the problems they are facing now and improve the competitiveness of small supermarkets, we will develop the following systems: front-end POS sales system and back-end management system, in which these two subsystems contain other sub-functions.
1.4 Scope of application
The system is suitable for all kinds of small supermarkets.
1.5 definition
(1) product barcode: each product has a unique barcode. For some products with the same price, you can use a custom barcode.
(2) Transaction list: including the transaction serial number, the trade name and quantity of each commodity, the total amount of such commodities, the transaction time, and the employee number in charge of the cashier.
(3) backlog of goods: in a certain period of time, goods far from completing the sales plan will cause backlog.
(4) Promotion: In a certain period of time, some goods will be sold at a promotion price lower than the original price.
Inventory alarm prompt: when the inventory quantity of goods is lower than the inventory alarm quantity, prompt will be given.
(5) Inventory: calculate business indicators such as inventory, sales and profit.
1.6 reference
Principle and Design of Database, edited by Tao, Tsinghua University Publishing House.
"Practical Course of SQL Server 2000" edited by Fan Linan, Tsinghua University Publishing House.
"SQL Server 2000 Programmer's Guide" edited by Li, published by Beijing Hope Electronic Publishing House.
Simple Programming of SQL Server 2000, edited by Rebecca M Riordan.
Software Engineering Code, edited by Watts S.Humphrey, Tsinghua University Publishing House.
Theory and Practice of Software Engineering, edited by Shari Lawrence Pfleeger, Tsinghua University Publishing House.
Software requirements analysis, edited by Swapna Kishore, Machinery Industry Press.
Rui Lin's thoughts on software engineering.
2. Logical analysis and detailed analysis
2. 1 system function
(1) Retail Front Desk (POS) management system, which must have the following functions:
Commodity input: according to the characteristics of supermarket business, relevant functions are formulated, and accurate or fuzzy commodity scanning input can be realized by inputting unique numbers, scanning barcodes, commodity names, etc. This scanning input method can fully ensure that people of all computer operation levels can scan and input goods accurately and quickly.
Cashier business: the total amount of this transaction is automatically calculated by scanning the barcode or directly inputting the commodity name (the number of similar commodities added at one time). After the customer pays, the change is automatically calculated and the transaction list is printed (including the transaction serial number, the trade name and quantity of each commodity, the total amount of such commodities, the transaction time, and the employee number in charge of the cashier). If the customer is a member of our store and holds his own membership card, scan the membership card before the transaction, and all the purchased goods will be 15% off, and the total amount of the purchased goods will be accumulated into the total consumption amount of the member. The membership card is valid for one year. If you don't renew your card after one year, your membership card will be cancelled.
Security: OS login, exit, shift change, operation lock and other rights verification protection; Power failure automatic protection prevents accidents and malicious illegal operations to the maximum extent.
Independent operation: some cash registers can still work normally even if the network server is disconnected or the network is blocked.
(2), the background management system, this system must have the following functions
Procurement management: according to the sales situation and inventory situation, the procurement plan is automatically made (or modified manually), which can avoid the backlog of goods caused by blind procurement. According to the plan list, automatic warehousing registration is selectively carried out. Inquire and print the planned purchasing and warehousing records and amounts comprehensively.
Sales management: control normal sales, promotions and quotas, deadlines and sales bans. Check all kinds of detailed sales records, cashier records all over the country, and pay and settle accounts. Generate sales leaderboards through statistics in various ways, and flexibly view and print daily, monthly and annual reports of commodity sales.
Inventory management: comprehensively query inventory detailed records. Automatic alarm prompt for inventory status. Such as backlog, shortage, shortage, etc. The software provides you with early warning to avoid the loss and shortage of goods in stock. Automatic inventory counting calculation.
Personnel management: the registration and management of basic information such as employees, members, suppliers and manufacturers. Management of employee's operation authority. Customer sales authority management.
(3) System structure
Overall structure of system
Modular subsystem structure
Function description: Commodity entry subsystem requires fast entry of commodities, so it must support barcode scanning.
Function description: The cashier business subsystem can calculate the total transaction amount, print the transaction list and discount according to the membership card.
Function Description: The purchasing management subsystem can automatically specify the purchasing plan according to the inventory, automatically grade when purchasing, and provide the functions of querying and printing the planned purchasing and warehousing records.
Function Description: The sales management subsystem can control whether a commodity is allowed to be sold, query the sales situation of each commodity, generate annual report, monthly report and daily report, and generate sales charts.
Function Description: The inventory management subsystem provides the basic functions of inquiring inventory detailed records, giving an alarm according to inventory status and automatic statistical calculation.
Function Description: The personnel management subsystem provides basic information registration management, employee operation authority management and customer sales authority management functions.
2.2, flow chart
Foreground management system
Top DFD diagram
Layer 0 DFD diagram
DFD diagram of 1 layer
2.3, home types and functions
(1), employee (salesperson):
Enter the goods into the purchase list through barcode scanning.
Operate the software to calculate the total transaction amount.
The operating software outputs the transaction list.
Scan the membership card to get a discount.
(2),: supermarket manager
Input goods, suppliers and manufacturers through operating software.
Operate software to make purchasing plan
Query and print planned purchasing and warehousing records.
Operate software to control the sale of goods or not.
Asking about the sales of printed matter
Operating software to generate sales leaderboards
Query inventory detail records
Input goods according to the inventory alarm issued by the software.
Operate inventory calculation software.
(3) General Manager:
Basic information registration management
Employee operation authority management
Customer sales authority management
2.4, unified development steps
Identify participants and related use cases
Design the process for each use case
Establish a sequence diagram to determine the collaboration of objects in each script.
Create classes to identify objects in scripts.
Design, coding, testing and integration courses
Write a system test case for the process.
Run test cases and test the system.
2.5, system environment requirements
system model
This system adopts C/S mode as the development mode.
hardware environment
Server side:
A high-performance computer,
Ordinary twisted pair is used as the connection.
Client: an ordinary computer or workstation,
Ordinary twisted pair is used as the connection.
software environment
Server side: install the server version of SQL Server 2000,
Install the version of windows 2000 server,
Norton and other necessary antivirus software have been configured.
Client: install the server version of SQL Server2000,
Install visual development tools such as VB.
Install the version of windows2000 server.
2.6, system security issues
Although the information system has powerful functions and advanced technology, it also contains many unsafe factors due to the limitations of its own architecture, design ideas and operating mechanism. Common factors are: data input, output, access and backup, source program and application software, database, operating system and other loopholes or defects, hardware, communication loopholes, internal factors, viruses, "hackers" and other factors. Therefore, in order to make this system work safely, reliably and stably, the following problems must be considered: in order to ensure safety, the system should not be damaged by accidents, and the system should be able to prevent fire, theft or other forms of man-made damage.
The system should be able to rebuild.
The system should be auditable.
The system should be able to effectively control and have strong anti-interference ability.
The rights of system users are identifiable.
3. Modeling based on UML.
3. 1 semantic rules
The basic components of use case view are use case, participant and system. Use cases are used to describe the functions of the system, that is, from the perspective of external users, what functions the system should support to help analysts understand the behavior of the system. It is a macro description of the system function. A complete system usually contains several use cases, each of which specifies the function to be completed and represents all the basic functions (sets) of the system. Roles are external entities that interact with the system. It can be a system user or other systems or hardware devices. In short, anything that needs to interact with the system can be called a role. The area within the system boundary line (that is, the active area of the use case) abstractly represents all the basic functions that the system can realize. In a system whose basic functions (sets) have been realized, the general process of system operation is: the external role initializes the use case first, then the use case executes the functions it represents, and after the execution, the use case returns some values to the role, which can be anything that the role needs the system to provide.
UML: it is a standard graphical modeling language and a standard representation of object-oriented analysis and design; It is not a visual programming language, but a visual modeling language. It is not the specification of tools or knowledge base, but the specification of modeling language, which is the standard of expression; It is neither a process nor a method, but any process or method is allowed to use it.
Use case:
Actor:
3.2, UML model
3.2 1, system UML model
3.22, subsystem UML model
(1) Use Case View of Retail Front Office (POS) Management System
(2) Use case view of background management system
3.3, system realization diagram
4. Conceptual design document of supermarket sales system
(1), system ER diagram
(2) Description of the system ER diagram
1) All users (employees) in the store can sell a variety of commodities, and each commodity can be sold by different users (employees);
2) Each customer can buy a variety of goods, and different goods can be bought by different customers;
3) Each supplier can supply a variety of different commodities, and each commodity can be supplied by multiple suppliers.
(3) View design
1) transaction view (v _ dealing)-a view for querying transaction status;
2) Planned Purchase View (v _ Planned Inventory)-View for querying purchase plans;
3) Sales view (V _ SALE)-a view for querying sales details;
4) Receipt view (V _ stock)- View for querying receipt status.
5. Logical design documents
(1), system relation model
A) Commodity information table (commodity number, commodity name, price, barcode, promotion price, promotion start date, promotion end date, allowable discount, inventory quantity, inventory alarm quantity, planned purchase quantity, allowable sales, manufacturer number and supplier number)
B) User table (user number, user name, user password and user type)
C) member list (member number, member card number, accumulated consumption amount and registration date)
D) sales table (sales number, commodity number, sales quantity, sales amount and sales date)
E) transaction table (transaction number, user name, transaction amount, member card number and transaction date)
F) Purchase list (purchase number, purchase commodity number, purchase quantity, single amount, total amount, purchase date, planned purchase date and purchase status)
G) supplier list (supplier number, supplier name, supplier address and supplier telephone number)
H) Supplier list (supplier number, supplier name, supplier address, supplier telephone number)
(2), the system database table structure
Database table index
Chinese name of table name
MerchInfo commodity information table
User user table
membership list
Sales table
Transaction table
Inventory entry and exit list
Provide supplier list
List of factory manufacturers
MerchInfo (Merchinfo)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
MerchID int 4 P Not null commodity number
MerchName Varchar 50 non-empty commodity name
MerchPrice Money 4 non-empty price
MerchNum Int 4 is not an empty inventory quantity.
Reason number int 4 is not empty inventory alarm quantity.
Planned Qty Int 4 Planned Purchase Qty is empty.
Barcode Varchar 50 non-empty barcode
Sales expenses 4 promotion price
Date and time of selling products 8 Promotion start date
Sales production date time 8 promotion end date
Allowbate int 4 not null allows discounts.
AllowSale Int 4 Not null allows sales.
Factory id varchar 10 f non-empty manufacturer number
Provideidvarchar 10 f non-empty supplier number
User Table (Users)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
UserID varchar 10 P non-empty user number.
User name Varchar 25 non-empty user name.
User password is not empty.
UserStyle Int 4 Not null user type
List of members (members)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
Member varchar 10 p non-empty member number
MemberCard Varchar 20 Not null member card number
Total cost amount 4 is not empty. Cumulative consumption amount
Registration Date Date Time 8 is not an empty registration date.
Sales Table (Sales)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
SaleID Varchar 10 P Not null sales number
MerChID Varchar 10 F non-empty commodity number
Sales Date Date Time 8 is not an empty sales date.
SaleNum Int 4 Not null sales quantity
Sales price amount 4 is not empty sales order amount.
Transaction table (transaction)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
Transaction id varchar 10 p is not empty.
Transaction price amount 4 is not empty.
Transaction date Currency 4 is not empty.
Membership varchar10 membership card number
User name varchar 10f is not empty.
Inventory record form (inventory)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
StockID Varchar 10 P non-empty warehouse number
Merchid varchar10 f not null entry commodity number
MerchNum Int 4 Not null received quantity
MerchPrice Money 4 Single amount is not empty.
Total amount in currency 4 of total price is not empty.
Inventory date date time 8 date time warehousing date
Planned Date Date Time 8 Date Time Planned Purchase Date
Inventory status Int 4 is not in empty warehouse status.
List of suppliers (provided)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
Provideidvarchar 10 p non-empty supplier number
ProvideName Varchar 50 non-empty supplier name
Supplier address
Provide telephone Varchar 25 supplier telephone.
List of suppliers (provided)
Field Name Field Type Length Primary/Foreign Key Field Value Constraint Corresponding Chinese Name
Factory id varchar 10 p non-empty manufacturer number.
Factornamevarchar50 non-empty manufacturer name
FactoryAddress Varchar 250 manufacturer's address
FactoryPhone Varchar 25 factory phone
6, physical design documents
/*-Create database */
Create a database supermarket
During the primary election
(
name=SuperMarketdb,
filename = ' C:\ Program Files \ Microsoft SQL Server \ MSSQL \ Data \ supermarketdb . MDF ',
size= 100MB,
maxsize=200MB,
File growth =20MB
)
log in
(
name=SuperMarketlog,
filename = ' C:\ Program Files \ Microsoft SQL Server \ MSSQL \ Data \ supermarketdb . ldf ',
Size =60MB,
maxsize=200MB,
File growth =20MB
)
go to
/*-Create basic table */
Use [supermarket database]
go to
/* Create a transaction table */
Create a table transaction (
DealingID int identity( 1, 1) primary key,
DealingDate date time is not empty.
The transaction price is not empty.
User name varchar(25) NULL,
MemberCard varchar(20) NULL
)
go to
/* Create supplier table */
Create a table factory (
FactoryID varchar( 10) primary key,
Factornamevarchar (50) is not empty.
FactoryAddress varchar(250) NULL,
FactoryPhone varchar(50) NULL
)
go to
/* Create membership table */
Create table members (
MemberID varchar( 10) primary key,
MemberCard varchar(20) is not empty.
Total cost amount is not empty.
RegDate date time is not empty.
)
go to
/* Create a commodity information table */
Create table MerchInfo (
MerchID int identity( 1, 1) primary key,
merch name varchar(50)Unique NOT NULL,
Commodity price is not empty,
MerchNum int is not empty.
Warning int is not empty,
PlanNum int is not empty.
Barcode varchar(20) is not empty,
The sales price is empty.
SalesProDateS date time is empty.
SalesProDateE date time is empty.
AllowAbate int is not empty.
AllowSale int is not empty.
Factoridint is not empty.
ProvideID int is not empty.
)
go to
/* Create supplier table */
Create a table to provide (
ProvideID varchar( 10) primary key,
ProvideName varchar(50) is not empty.
ProvideAddress varchar(250) NULL,
ProvidePhone varchar(25) NULL
)
go to
/* Create a sales table */
Create form sales (
Salesid intidentity (1,1) primary key,
MerChID int is not empty.
Sales date, date and time are not empty.
SaleNum int is not empty.
Sales price amount is not empty.
)
go to
/* Create a receipt table */
Create a tabular inventory (
StockID int identity( 1, 1) primary key,
MerchID int is not empty.
MerchNum int is not empty.
Commodity price is empty,
The total amount is empty.
The planned date, date and time are empty.
StockDate date time is empty.
Inventory status int is not empty.
)
go to
/* Create User Table */
User who created the table (
UserID varchar( 10) primary key,
User name varchar(25) is not empty.
UserPW varchar(50) is not empty.
UserStyle int is not empty.
)
go to
/*-Create constraints between tables */
/* Foreign key constraint between supplier number in commodity information table and supplier number in supplier table */
Change table MerchInfo add
Constraint [FK _ merchin fo _ factory] foreign key
(
[FactoryID]
) reference factory (
[FactoryID]
),
Constraint [FK_MerchInfo_Provide] foreign key
(
[provide ID]
) reference materials provided (
[provide ID]
)
go to
/* Foreign key constraint between commodity number in sales table and commodity information table */
Change table sales add
Constraint [FK _ Sales _ Business Information] foreign key
(
[tacit understanding]
) reference MerchInfo (
[tacit understanding]
) When deleting a cascade,
go to
/* Foreign key constraint between commodity number and commodity information table in receiving table */
Change table inventory add
Constraint [FK stock information] foreign key
(
[tacit understanding]
) reference MerchInfo (
[tacit understanding]
) When deleting a cascade,
go to
/*-Create an index.
/* Create a nonclustered index, with the transaction number and date as the index entries on the transaction table */
Create nonclustered index IX_Dealing on Dealing(DealingID, DealingDate).
go to
/* Create a nonclustered index with the commodity number as the index item of the commodity information table */
Create nonclustered index IX_MerchInfo on MerchInfo(MerchID).
go to
/* Create a nonclustered index with the sales number and date as the index items of the sales table */
Create nonclustered index IX_Sale ON Sale(SaleID, SaleDate).
go to
/* Create a nonclustered index, with warehouse number, warehouse date and commodity number as index items on the warehouse table */
Create nonclustered index IX_Stock on Stock(StockID, StockDate, MerchID).
go to
/*-Create a view.
/* Create a view for querying the transaction status */
Create view v_Dealing
be like
Select the transaction date as the transaction date,
User name as employee name,
MemberCard as a member card number,
The transaction price is the transaction amount.
From trading
go to
/* Create a view for querying purchase plans */
Create view v_PlanStock
be like
Select stocks. StockID is SID,
MerchInfo。 MerchName as a commodity name,
MerchInfo。 Bar code as a bar code,
Factory. Name of the factory As a manufacturer,
Provide. Provide the supplier name,
Stock. Mercury as the planned purchase quantity,
Stock. The planned date is the planned purchase date.
From inventory, MerchInfo, suppliers, factories
Where are the stocks? MerchID = MerchInfo。 Mohid
And provide. ProvideID=MerchInfo。 ProvideID
And factories. FactoryID=MerchInfo。 FactoryID
And stocks. Inventory status =0
go to
/* Create a view for querying sales detail records */
Create view v_Sale
be like
Select MerchInfo. MerchName as a commodity name,
MerchInfo。 Bar code as a bar code,
MerchInfo。 Commodity prices as commodity prices,
Sales. Sales price as the sales price,
Sales. Salenumas sales quantity,
Sales. Sales date as sales date.
Internal connection from sales
MerchInfo is on sale MerChID = MerchInfo。 Mohid
go to
/* Create a view for querying receipt status */
Create view v_Stock
be like
Select MerchInfo. MerchName as a commodity name,
MerchInfo。 Bar code as a bar code,
Factory. Name of the factory As a manufacturer,
Provide. Provide the supplier name,
Stock. As the storage price,
Stock. Mershnumas warehousing quantity,
Total inventory. The total price is:
Stock. Inventory date as the warehousing date.
From inventory, MerchInfo, suppliers, factories
Where are the stocks? MerchID = MerchInfo。 Mohid
And provide. ProvideID=MerchInfo。 ProvideID
And factories. FactoryID=MerchInfo。 FactoryID
And stocks. Inventory status = 1
go to
7. Summary
Compared with the traditional management mode, the use of this system will undoubtedly greatly improve the operational efficiency of supermarkets, help to improve the decision-making level and management level of supermarkets, and provide effective technical support for reducing operating costs, improving efficiency, reducing errors, saving manpower, reducing customer shopping time, increasing passenger flow, improving customer satisfaction and enhancing supermarket capacity.
Due to the limited ability of developers and short time, this system will inevitably have some shortcomings, such as:
This system is only suitable for small supermarkets, not for medium and large supermarkets.
Supermarket management system involves a wide range, many problems to be solved, complex functions and great difficulty in implementation, but due to time constraints, this system can only achieve some of its functions;
We apologize for the above problems. If other problems are found, I hope the teacher will criticize and correct me.