当前位置:网站首页>Background management system of e-commerce platform -- > preliminary preparation of the project (demand analysis, system design, environment construction and configuration files)
Background management system of e-commerce platform -- > preliminary preparation of the project (demand analysis, system design, environment construction and configuration files)
2022-07-18 05:04:00 【@Misty rain fell on the city】
1 The introduction
Today, with the increasing development of the computer age , Computer technology is rapidly integrating into every field of this society . Since computers have been used in the field of management , The development and application of information system have achieved amazing development , E-commerce also came into being .
With the continuous expansion of e-commerce website , Various information about the backstage management of e-commerce websites has also doubled , Facing the huge amount of information , It is necessary to develop the background management system of e-commerce platform to improve the efficiency of management . This topic starts from the basic principle of design , Through an example of e-commerce —— Analysis of e-commerce platform background management system , Thus, it concretely describes the close combination of e-commerce and background server .
The development of e-commerce platform background management system is based on B/S Pattern , The background to use SSM Integrate , Front end use EasyUI The framework realizes the background management system of e-commerce platform , It is mainly used after the administrator logs in to the system , Product information , Commodity type , Manage order information and customer information .
2 Demand analysis
According to the demand analysis , The administrator has the following functional permissions :
(1) Commodity management : Including adding items , The goods are off the shelves , Modify the goods , Query products .
(2) Commodity type management : Including adding product types , Modify item type .
(3) Order management : Including creating orders , Query order , Delete order and view order details .
(4) Customer management : Check with customers , Disable or enable customers
3 The system design
According to the demand analysis , You can get the functional structure diagram of the system , Pictured 3.1 Shown .
3.1 Database design
According to the system requirements , Create name as eshop The database of , establish 8 Data sheets , As shown below .
(1) Customer information sheet user_info, It is used to record the basic information of front desk customers
(2) Administrator information table admin_info, Used to record basic administrator information
(3) Commodity information table type, Used to record various commodity types
(4) Commodity information table product_info, Used to record product information
(5) Order information sheet order_info, It is used to record the main information of the order
(6) Order details order_detail, Used to record order details
(7) System menu functions, Used to record system function information
(8) Permissions on the table powers, Used to record administrator permissions
- Customer information sheet user_info The field description of is shown in table 3-1 Shown .

- Administrator information table admin_info The field description of is shown in table 3-2 Shown .

- Commodity type table type The field description of is shown in table 3-3 Shown .

- Commodity information table product_info The field description of is shown in table 3-4 Shown .

- Order information sheet order_info The field description of is shown in table 3-5 Shown .

- Order details order_detail The fields of are shown in table 3-6 Shown .

- System menu functions The field description of is shown in table 3-7 Shown .

- Permissions on the table powers The field description of is shown in table 3-8 Shown .

When creating a data table , You also need to set the association relationship between data tables , Pictured 3.2 Shown .
4 Environment setup and configuration file
4.1 Table of contents


4.2 stay pom Add the dependencies used by the project in the file
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- Servlet API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
<scope>provided</scope>
</dependency>
<!-- Spring Web -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.3.RELEASE</version>
</dependency>
<!-- Spring SpringMVC -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.3.RELEASE</version>
</dependency>
<!-- Spring JDBC -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.0.3.RELEASE</version>
</dependency>
<!-- Spring Aspects -->
<!-- https://mvnrepository.com/artifact/org.springframework/spring-aspects -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>5.0.3.RELEASE</version>
</dependency>
<!-- MyBatis -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.5</version>
</dependency>
<!-- MyBatis Spring -->
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.1</version>
</dependency>
<!-- C3P0 -->
<!-- https://mvnrepository.com/artifact/c3p0/c3p0 -->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<!-- MySQL Drive pack -->
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.45</version>
</dependency>
<!-- JSTL -->
<!-- https://mvnrepository.com/artifact/jstl/jstl -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.5</version>
</dependency>
</dependencies>
4.3 Integrate relevant configuration files
1. To write web.xml file
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<!--1、 start-up Spring The container of -->
<!-- needed for ContextLoaderListener -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<!-- The listener class can receive notification of when the event occurs and what to respond with . This is used to start Spring The configuration file applicationContext.xml -->
<!--Bootstraps the root web application context before servlet initialization -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--2、springmvc Front end controller for , Intercept all requests , Will automatically read dispatcherServlet-servlet.xml, If the controller configuration file uses a different name , Use init-param Statement -->
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!--<init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springmvc.xml</param-value> </init-param>-->
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- 3、 Character encoding filter , Be sure to put it in front of all filters -->
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
<init-param>
<param-name>forceRequestEncoding</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>forceResponseEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 4、 Use Rest Style URI, Make the page plain post Request to be converted to specified delete perhaps put request -->
<filter>
<filter-name>HiddenHttpMethodFilter</filter-name>
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>HiddenHttpMethodFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>HttpPutFormContentFilter</filter-name>
<filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>HttpPutFormContentFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
2. To write SpringMVC The configuration file /ssm/src/main/webapp/WEB-INF/dispatcherServlet-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Start the scanner function -->
<context:component-scan base-package="com.hcz" use-default-filters="false">
<!-- Just scan the controller -->
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!-- Trying to configure parser -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"/>
<property name="suffix" value=".jsp"/>
</bean>
<!-- Two standard configurations -->
<mvc:default-servlet-handler/>
<mvc:annotation-driven/>
<!-- Upload files -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- The maximum size of the uploaded file is 10MB -->
<property name="maxUploadSize" value="10485760"/>
<!-- Character encoding -->
<property name="defaultEncoding" value="UTF-8"/>
</bean>
</beans>
3. To write Spring The configuration file /ssm/src/main/resources/applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<!-- Auto scan package , Start with @Component,@Repository,@Service Scanning of annotated classes , But with @Controller Annotated classes are not scanned -->
<context:component-scan base-package="com.hcz">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!--Spring Configuration file for , The main configuration here is related to business logic -->
<!-- data source -->
<context:property-placeholder location="classpath:dbconfig.properties"/>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="jdbcUrl" value="${jdbc.jdbcUrl}"/>
<property name="driverClass" value="${jdbc.driverClass}"/>
<property name="user" value="${jdbc.user}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<!-- To configure SqlSessionFactoryBean-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!--set Inject , Pay the database connection pool dataSource attribute -->
<property name="dataSource" ref="dataSource" />
</bean>
<!-- register Mapper Scanner -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- Appoint SqlSessionFactory Object's id-->
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
<!-- Specify package name , The name of the bag is dao The package name of the interface -->
<property name="basePackage" value="com.hcz.dao"/>
</bean>
<!-- To configure DataSourceTransactionManager( Business management )-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- Start the annotation based declarative transaction manager -->
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
4. Create database connection information property file dbconfig.properties
jdbc.jdbcUrl=jdbc:mysql://localhost:3366/eshop?useUnicode=true&characterEncoding=utf-8
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.user=root
jdbc.password=123456
4.4 Create entity class
stay src/main/java Under the table of contents , Create a new one com.hcz.pojo package , It stores entity class objects , Here the entity class object set、get Methods omit and do not write .
1. establish UserInfo Entity class object
/** * User information object */
public class UserInfo {
private int id;
private String userName;
private String password;
private String realName;
private String sex;
private String address;
private String email;
private String regDate;
private int status;
2. establish AdminInfo Entity class object
public class AdminInfo {
private int id;
private String name;
private String pwd;
// Association attribute
private List<Function> fs;
3. establish Function Entity class object
public class Function implements Comparable<Function>{
private int id;
private String name;
private int parentid;
private boolean isleaf;
// Association attribute
private Set ais = new HashSet();
// Compare 2 individual ID, Return... When the same 0, Otherwise return to non 0 Count
@Override
public int compareTo(Function o) {
// Compare the two id value , Same back 0, Otherwise, it returns nonzero
return ((Integer)this.getId()).compareTo((Integer)(o.getId()));
}
4. establish ProductInfo Entity class object
/** * Commodity information : */
public class ProductInfo {
private int id;// Product id
private String code;// Commodity code
private String name;// Name of commodity
// Association attribute Commodity type
private Type type;
private String brand;// Brand of goods
private String pic;// A little picture of commodities
private int num;// The number
private double price;// commodity price
private String intro; // Product introduction 【 This attribute was omitted before, which led to a long search for errors 】
private int status;// Goods state
private double priceFrom;
private double priceTo;
5. establish Pager Entity class object
/** * Paging display class */
public class Pager {
private int curPage;// The current page
private int perPageRows;// Number of row records displayed per page
private int rowCount;// Record the total number
private int pageCount;// Total number of pages
6. establish TreeNode Entity class object
public class TreeNode {
private int id;// node
private String text;// The name of the node
private int fid;// Parent node
private List<TreeNode> children;// Included child nodes
7. establish Type Entity class object
/** * Commodity type */
public class Type {
private int id;// Product type number
private String name;// Product type name
8. establish OrderInfo Entity class object
/** * Order information entity class */
public class OrderInfo {
private Integer id;
private int uid;// Customer id
private UserInfo ui;// User information object
private String status;// The order status
private String ordertime;// Order time
private double orderprice;// Order amount
private String orderTimeFrom;// Order start time for query
private String orderTimeTo;// Order end time for query
9. establish OrderDetail Entity class object
/** * Order details */
public class OrderDetail {
private int id;
private int oid;// Order id
private OrderInfo oi;// Order information object
private int pid;// goods id
private ProductInfo pi;// Commodity information objects
private int num;// Purchase quantity
private double price;// item pricing
private double totalprice;// Subtotal of amount : Quantity times unit price
4.5 Create a tool class JsonFactory
stay src/main/java Under the table of contents , Create a new one com.hcz.util package , It stores tool class objects
public class JsonFactory {
public static List<TreeNode> buildTree(List<TreeNode> nodes,int id){
List<TreeNode> treeNodes = new ArrayList<>();
for (TreeNode treeNode:nodes){
TreeNode node = new TreeNode();
node.setId(treeNode.getId());
node.setText(treeNode.getText());
if (id == treeNode.getFid()){
// call buildTree Methods TreeNode Medium children Attribute assignment
node.setChildren(buildTree(nodes,node.getId()));
treeNodes.add(node);
}
}
return treeNodes;
}
}
边栏推荐
- 牛客2021暑期训练3-J-Counting Triangles
- Niuke 2021 summer training 8-f-robots
- Generate XML file of VOC dataset
- I / II. Advanced part - MySQL logical architecture, performance and join
- Sword finger offer16- integer power bit operation of numeric value
- image 标签 中的 mode=“widthFix“ 属性
- 设置圆弧形按钮 设置在正中间居中显示
- Uni app call function
- 信息系统项目管理师必背核心考点(四)UML类与类之间的关系
- 什么是服务器内存?如何选择服务器内存?
猜你喜欢

“认养一头牛”IPO的三只拦路虎

1、 MySQL Foundation

网络请求接口 层数(2/3层)是什么意思

Sqli labs less-1 (updatexml of error injection)

How to create threads

信息系统项目管理师必背核心考点(三)UML的14种图形工具

Redis03:Redis的5大常用数据类型

3、 Index optimization

E-commerce platform background management system --- > system detailed design (order management module)

普歌—码上鸿鹄团队 winSCP和Xshell 基本配置用法
随机推荐
电商平台后台管理系统--->系统详细设计(用户登录、商品管理模块)
牛客2021暑期训练4-J-Average
Three main reasons for cloud disruption
Six ways to simplify the process adopted by it suppliers
ASTM e595-15 (2021) outgassing latest standard for degassing test
分布式事务集成netcore.Cap
Redis01 : NoSQL和Redis简介
Experience first! What kind of experience is it to write fluent in the browser?
winform去掉右上角关闭按钮
普歌—码上鸿鹄团队 winSCP和Xshell 基本配置用法
动作捕捉协助中国电力科学研究院建立边云协同电力自主巡检系统
Talk about several ways spark implements topn
Trees and binary trees
A 59 year old doctor studying in the United States, today received his fifth listed company
牛客2021暑期训练3-B-Black and white
A new UI testing method: visual perception test
电商平台后台管理系统--->操作方法说明
信息系统项目管理师必背核心考点(四)UML类与类之间的关系
uni-app请求获取数据
Dynamic memory functions and common dynamic memory errors