javaSwing supermarket (sales) management

1. Topic selection background

In recent years, traditional commerce and e-commerce seem to be incompatible with each other, and they are very motivated to live or die. Public opinion has always been one-sided that e-commerce will quickly replace traditional retail. However, in the past few years, the development of e-commerce is indeed worthy of attention. However, although traditional commerce has been affected a lot, it still stands tenaciously.

In fact, in terms of the total size of the retail market, it is still dominated by physical retail, with more than 85% of the market share still in the hands of physical retail. In order to develop better and faster physical retail, it is necessary to use modern science and technology to improve the information management of physical retail, reduce sales costs, and maximize sales benefits.

Commercial automation management has been implemented in Europe, the United States and other countries for many years, and is also the basis of retail industry management. Its main feature is its ability to control in-store sales in real time and accurately. If you can control the sales process and sales situation in real time. This can effectively speed up the turnover rate of goods and improve service quality. General retail sales must be fast and error-free. If the current inventory of goods can be known as early as possible before sales, and the turnover rate of goods can be grasped, the occurrence of oversupply or shortage in sales can be reduced.
Therefore, it is particularly important to develop a sales management system with beautiful interface, data security and flexible application for physical retail. Cumbersome and complicated operations will reduce work efficiency, so the sales system strives to be simple and focused on the purchase, sale and inventory of goods to achieve the expected goals.

1.2 Purpose and significance
With the modern development of commodity sales, its operation and management have become more and more complex. The early form of sales accounting statistics can no longer meet the rapid development of the sales industry. Therefore, there is an urgent need to introduce new ideas and management techniques for sales management.

In traditional manual sales management, there are various negative situations, such as: unable to effectively manage each product, slow payment and settlement speed, prone to business errors, inappropriate product price adjustments, low inventory efficiency, etc., and in daily management, The decision-making process of purchasing, selling and stocking of goods is based on experience and lacks real-time analysis functions. The requirements of managers for timely transmission of data have never been met. With the rapid development of retail sales patterns, the amount of data generated during the sales process has become increasingly large. The number of intermediate links in business operations continues to increase, and primitive manual management can no longer cope with such a complex market. In this way, the demand for modern sales management systems in the retail industry is increasing day by day.

Therefore, in the design of this course, I chose to develop a sales management system that adapts to market demand, informatizes traditional sales management, provides real-time feedback on purchase, sales and inventory status, helps managers make quick decisions in response to market changes, and saves costs. , improve management efficiency and accelerate the development of product sales.

2. Development tools and technologies

This system is based on the C/S architecture and is implemented using the MVC design pattern. The technology selection is the Swing lightweight control in the java8 GUI (graphical interface). In order to improve the data interaction performance of the system, the data persistence layer is encapsulated based on JDBC. Set of basic tools.

The development tools mainly include Eclipse Mars version, MySQL version 5.7, and HeidiSQL version 9.3.

The following is a brief introduction to the C/S architecture, MVC design pattern, Swing programming, Eclipse Mars integrated development environment, MySQL 5.7 database and HeidiSQL 9.3 database management system.

1.3.1 Development tools
(1) Eclipse Mars

Eclipse is a well-known cross-platform free integrated development environment (IDE). Initially mainly used for Java language development, Eclipse can support different computer languages, such as C++ and Python and other development tools by installing different plug-ins. Eclipse itself is just a framework platform, but the support of many plug-ins gives Eclipse flexibility that is difficult to achieve with other IDE software with relatively fixed functions. Many software developers develop their own IDEs using Eclipse as the framework.

Eclipse is the next generation IDE development environment that replaces IBM Visual Age for Java, but its future goal is not only to become an IDE environment specifically for developing Java programs. According to the architecture of Eclipse, through the development of plug-ins, it can be extended to the development of any language. , and can even become a tool for drawing pictures. At present, Eclipse has begun to provide functional plug-ins developed in C language. What’s even more valuable is that Eclipse is an open source project. Anyone can download the source code of Eclipse and develop their own functional plug-ins based on it. In other words, as long as someone needs it in the future, there will be development plug-ins in COBOL, Perl, Python and other languages based on Eclipse. At the same time, you can expand the functions of existing plug-ins by developing new plug-ins, such as adding Tomcat server plug-ins to the existing Java development environment. It can be infinitely expanded and has a unified appearance, operation and system resource management. This is where the potential of Eclipse lies.

Eclipse Mars is the newer stable version of Eclipse and better supports the development of java8.

(2) MySQL 5.7

MySQL is a relational database management system developed by Swedish MySQL AB and currently owned by Oracle. Mysql is the most popular relational database management system. In terms of WEB applications, MySQL is one of the best RDBMS (Relational Database Management System) application software. MySQL is a relational database management system. A relational database stores data in different tables instead of putting all data in one large warehouse, which increases speed and flexibility. The SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts a dual authorization policy (this entry “Authorization Policy”), which is divided into community version and commercial version. Due to its small size, fast speed and low total cost of ownership, especially the characteristics of open source, it is generally used by small and medium-sized enterprises. For website development, MySQL is chosen as the website database. Due to the excellent performance of its community version, it can form a good development environment with PHP and Apache.

As its latest version, MySQL 5.7 has stronger performance and better compatibility, which greatly improves the availability, manageability and security of the database.

(3) HeidiSQL 9.3

HeidiSQL is a very powerful MySQL client software. It is an open source tool developed by German programmer Ansgar Becker and several Delphi programmers. To manage a database through HeidiSQL, the user should log in to the MySQL server with valid credentials and create a session. The biggest feature of HeidiSQL is that it is easy to operate, has a reasonable interface design, and the most practical functions. It is especially suitable for DBAs. It places more emphasis on parameter setting and performance monitoring of MySQL runtime.

As a graphical interface designed to simplify your MySQL server and database management, HeidiSQL software allows you to browse your database, manage tables, view and edit records, manage user permissions, and more. In addition, you can import data from text files, run SQL queries, synchronize tables between two databases and export selected tables to other databases or SQL scripts. HeidiSQL provides a simple and easy-to-use interface for switching between database browsing and tabbing SQL queries with syntax highlighting. Other features include BLOB and MEMO editing, large SQL script support, user process management, etc. HeidiSQL software resources are open. HeidiSQL can browse and edit data, create and edit tables, views, procedures, triggers and schedules. Additionally, structure and data SQL files can be exported.

HeidiSQL can connect to multiple server windows and use the command line to connect to the server. HeidiSQL can directly import data from one server/database to another server/database. HeidiSQL can manage user permissions and import text files. HeidiSQL does wiki markup for LaTeX and exports table rows for CSV, HTML, XML and SQL. HeidiSQL allows users to modify tables in batches (move to DB, change engine, organize, etc.). HeidiSQL allows users to batch insert ASCII or binary files into tables. HeidiSQL can customize syntax highlighting and code automatic query completion. HeidiSQL provides beautiful SQL formatting functions, monitoring and killing client processes. HeidiSQL provides a specific text server that helps you find all tables in all databases. HeidiSQL provides batch optimization and table repair tools.

Its latest version is version 9.3.

1.3.2 Development language
Development is mainly done using Swing lightweight controls of Java8 GUI (Graphical User Interface).

(1) GUI

Graphical User Interface (GUI for short, also known as graphical user interface), that is, human-computer interaction graphical user interface design, refers to a computer operation user interface displayed graphically. Graphical interfaces were more visually accessible to users than the command line interfaces used in early computers.

(2) Swing

Swing is a set of Java program components that can create graphical user interface (GUI) components, such as buttons and scroll bars, that are independent of the windowing system of a specific operating system. Swing components use Java Foundation Classes (JFC). Swing developers can use Swing’s rich, flexible features and modular components to create elegant user interfaces with only a small amount of code. All packages in the toolkit are named after swing, such as javax.swing, javax.swing.event. It can create graphical user interface (GUI) elements, such as buttons and scroll bars, that are independent of the windowing system of a specific operating system. Swing components use Java Foundation Classes (JFC).

1.3.3 Architecture and design patterns
(1) C/S architecture

C/S structure is the well-known client and server structure. It is a software system architecture that can make full use of the advantages of the hardware environment at both ends and reasonably allocate tasks to the client and server, reducing the communication overhead of the system. At present, most application software systems have a two-layer structure in the form of Client/Server. Since current software application systems are developing towards distributed Web applications, both Web and Client/Server applications can perform the same business processing and apply different modules. Shared logical components; therefore, both internal and external users can access new and existing applications, and new applications can be extended through the logic in existing applications. This is the current development direction of application systems.

(2) MVC design pattern

The full name of MVC is Model View Controller, which is the abbreviation of model-view-controller. It is a software design model that organizes code using a method that separates business logic, data, and interface display. The business logic is gathered into a component, and there is no need to rewrite the business logic while improving and personalizing the interface and user interaction. MVC was uniquely developed to map traditional input, processing, and output functions into a logical graphical user interface structure. Adopting the MVC design pattern can greatly reduce the coupling of the program and conform to the standards of modern software.

3. Logical structure design of database

Since the database conceptual model is independent of any specific database management system, it needs to be converted according to the characteristics of the specific database management system used. That is, it is converted into a logical relational model processed from a computer perspective. The conversion of the E-R model to the relational database model should follow the following principles:

1. Each entity must be converted into a relationship

2. All primary keys must be defined as NOT NULL

3. For binary relationships, foreign keys should be defined according to one-to-many, weak-to-real, one-to-one, many-to-many and other relationships.

According to the E-R model, the library management system has established the following logical data structure. The following is a detailed description of each data table:

⑴Logical structure of user table

⑵Logical structure of classification table

⑶Logical structure of warehouse table

⑷Logical structure of product table

⑸Logical structure of sales order table

⑹ Logical structure of the inbound and outbound order table

?

4. Program screenshot






5. Communication and contact

Q:969060742 Document plus code plus sql