Author Homepage: Programming Compass
About the author: High-quality creator in the Java field, CSDN blog expert, CSDN content partner, invited author of Nuggets, Alibaba Cloud blog expert, 51CTO invited author, many years of architect design experience, resident lecturer of Tencent classroom
Main content: Java project, Python project, front-end project, artificial intelligence and big data, resume template, learning materials, interview question bank, technical mutual assistance
Favorites, likes, don't get lost, it's good to follow the author
Get the source code at the end of the article
Item number: BS-PT-088
1. Environmental introduction
Locale: Java: jdk1.8
Database: Mysql: mysql5.7
Application server: Tomcat: tomcat8.5.31
Development tools: IDEA or eclipse
Background development technology: springboot+mybatis-plus
Front-end development technology: vue+elementui
2. Project introduction
2.1 Introduction
With the improvement of people's living standards in the past ten years, a large number of comprehensive large-scale shopping malls have been built in large and medium-sized cities to meet people's growing consumption and experience needs, which not only strongly stimulates the local economy, but also greatly enriched people's living standards. The gathering of various brands here not only provides people with richer choices, but also provides better products and services. At the same time, how to use Internet information technology to make large-scale shopping malls more widely known to surrounding customer groups and provide better services is the main purpose of this research project.
This topic focuses on the construction of a comprehensive shopping mall service platform, which mainly realizes the promotion of major brands in the shopping mall, and at the same time provides parking and deduction services for customers, and realizes the platform's function of issuing coupons for customers, etc. The system uses the learned JAVA development technology, uses Springboot to realize the background interface service development of the system, uses VUE to complete the front-end page development of the system, uses MYSQL to store business data in the shopping mall platform, and finally realizes a comprehensive shopping mall with front-end and back-end separation Development and construction of service platforms.
2.2 Demand Analysis
For the business function modules of the shopping mall comprehensive service platform system, after visiting some enterprises and understanding some needs, I consulted relevant literature knowledge from the Internet, referred to similar shopping mall comprehensive service platform systems, and concluded after careful analysis and thinking The specific functions are as follows.
There are two main types of system users, one is shopping mall customers, and the other is shopping mall administrators. Different users have different operating permissions.
After the shopping mall user logs in to the system, the main operations are as follows:
(1) Personal information management: Check the situation of your dormitory and personal information, and perform corresponding management operations on personal information.
(2) Shopping mall brand browsing: You can browse the information of some high-quality brand service providers released by the shopping mall management platform, such as brand introduction, brand location, etc.
(3) Shopping mall parking service: You can check the availability of parking spaces in shopping malls, realize parking billing and payment services, and check your own parking records.
(4) System announcement service: You can view the relevant announcement information issued by the mall.
(3) Use of coupons: You can check the coupons issued by the mall for users, and use the coupons offline.
After logging in to the system, the administrator of the shopping mall comprehensive service platform performs the following operations:
(1) Personal information management module: mainly manages personal information.
(2) Parking space management module: mainly manages the parking space information owned by the mall.
(3) Parking space use record management module: mainly manages the details of all parking spaces being used.
(4) Basic data management module: mainly manages the basic data of comprehensive shopping malls, such as announcement type data, brand type data, membership status data, coupon type management, and announcement type data management.
(5) Announcement management module: The platform system administrator publishes the announcement information of the platform in the background, and performs related management operations on the information.
(6) Brand management module: The platform system administrator performs corresponding management operations on the brand information published on the platform in the background, and can also manage users' collection records of various brands.
(7) Coupon management module: The platform system administrator performs corresponding management operations on the coupons issued by the background platform.
(8) Carousel map management module: The platform system administrator manages the carousel map information displayed on the front end of the background platform.
2.3 Function structure diagram
Based on the above demand analysis, the functional structure diagram corresponding to the roles of front-end users and background management users in the comprehensive service platform system of large shopping malls is shown in the following figure:
Figure 1 Front-end member user function module diagram
Figure 2 Functional module diagram of the administrator background
2.4 Database design
1. Member information form (yonghu): the basic information of the member information form, as shown in Table 4-1.
name |
type |
null |
Defaults |
other |
Remark |
id |
int(11) |
no |
self-increment |
primary key |
|
username |
varchar(200) |
yes |
<empty> _ |
account |
|
password |
varchar(200) |
yes |
<empty> _ |
password |
|
yonghu_name |
varchar(200) |
yes |
<empty> _ |
Username Search111 |
|
yonghu_phone |
varchar(200) |
yes |
<empty> _ |
User phone number |
|
yonghu_id_number |
varchar(200) |
yes |
<empty> _ |
User ID number |
|
yonghu_photo |
varchar(200) |
yes |
<empty> _ |
profile picture |
|
sex_types |
int(11) |
yes |
<empty> _ |
gender |
|
yonghuhuiyuan_types |
int(11) |
yes |
<empty> _ |
Member Status Search111 |
|
yonghu_email |
varchar(200) |
yes |
<empty> _ |
|
|
new_money |
numeric(10,2) |
yes |
<empty> _ |
balance |
|
create_time |
timestamp |
yes |
<empty> _ |
creation time |
Table 4-1 Member Information Form
2. Administrator table (users): mainly records the information of the system administrator, as shown in Table 4-2.
name |
type |
null |
Defaults |
other |
Remark |
id |
bigint(20) |
no |
self-increment |
primary key |
|
username |
varchar(100) |
no |
username |
||
password |
varchar(100) |
no |
password |
||
role |
varchar(100) |
yes |
administrator |
Role |
|
addtime |
timestamp |
no |
current time |
add time |
3. Parking space information table (chewei): It mainly records the detailed information table of each parking space owned by the mall. As shown in Table 4-3.
name |
type |
null |
Defaults |
other |
Remark |
id |
int(11) |
no |
self-increment |
primary key |
|
chewei_uuid_number |
varchar(200) |
yes |
<empty> _ |
parking space number |
|
chewei_name |
varchar(200) |
yes |
<empty> _ |
Parking space name Search111 |
|
chewei_address |
varchar(200) |
yes |
<empty> _ |
parking space |
|
shoufeijine |
numeric(10,2) |
yes |
<empty> _ |
Billing amount/hour |
|
chewei_types |
int(11) |
yes |
<empty> _ |
Parking statusSearch111 |
|
insert_time |
timestamp |
yes |
<empty> _ |
Entry Time |
|
create_time |
timestamp |
yes |
<empty> _ |
create time show3 listShow |
surface4-3 Parking Information Form
4. Parking space usage record table (chewei_shiyong): It mainly records the detailed information of each parking space usage, as shown in Table 4-4.
name |
type |
null |
Defaults |
other |
Remark |
id |
int(11) |
no |
self-increment |
primary key |
|
yonghu_id |
int(11) |
yes |
<empty> _ |
user |
|
chewei_id |
int(11) |
yes |
<empty> _ |
parking space |
|
insert_time |
timestamp |
yes |
<empty> _ |
parking time |
|
kaizou_time |
timestamp |
yes |
<empty> _ |
drive away time |
|
chewei_shiyong_shichang |
varchar(200) |
yes |
<empty> _ |
duration of use |
|
huafei_jine |
numeric(10,2) |
yes |
<empty> _ |
Amount spent |
|
create_time |
timestamp |
yes |
<empty> _ |
create time show3 listShow |
Table 4-4 Parking Space Usage Record Form
5. Announcement information table: mainly records the announcement information released, as shown in Table 4-5.
Table 4-5 Announcement information table
name |
type |
null |
Defaults |
other |
Remark |
id |
int(11) |
no |
self-increment |
primary key |
|
gonggao_name |
varchar(200) |
yes |
<empty> _ |
Announcement Name Search111 |
|
gonggao_photo |
varchar(200) |
yes |
<empty> _ |
Announcement image |
|
gonggao_types |
int(11) |
no |
Announcement Type Search111 |
||
insert_time |
timestamp |
yes |
<empty> _ |
Announcement release time |
|
gonggao_content |
text |
yes |
Announcement details |
||
create_time |
timestamp |
yes |
<empty> _ |
创建时间 show1 show2 nameShow |
6.会员权益信息表:用来记录各等级会员的权益信息,如表4-6所示。
名称 |
类型 |
空 |
默认值 |
其他 |
备注 |
id |
int(11) |
否 |
自增 |
主键 |
|
yonghuhuiyuan_types |
int(11) |
是 |
<空> |
会员状态 Search111 |
|
huiyuanquanyi_content |
text |
是 |
权益内容 |
||
insert_time |
timestamp |
是 |
<空> |
发布时间 |
|
create_time |
timestamp |
是 |
<空> |
创建时间 show3 listShow |
7.品牌信息表:用来存储商场平台发布的品牌的相关信息,如表4-7所示。
表4-7 品牌信息表
名称 |
类型 |
空 |
默认值 |
其他 |
备注 |
id |
int(11) |
否 |
自增 |
主键 |
|
pinpai_uuid_number |
varchar(200) |
是 |
<空> |
品牌编号 |
|
pinpai_name |
varchar(200) |
是 |
<空> |
品牌名称 Search111 |
|
pinpai_photo |
varchar(200) |
是 |
<空> |
品牌照片 |
|
pinpai_address |
varchar(200) |
是 |
<空> |
店铺位置 |
|
yingyeshijian |
varchar(200) |
是 |
<空> |
营业时间 |
|
pinpai_types |
int(11) |
是 |
<空> |
品牌类型 Search111 |
|
pinpai_clicknum |
int(11) |
是 |
<空> |
品牌热度 |
|
pinpai_content |
text |
是 |
品牌介绍 |
||
pinpai_delete |
int(11) |
是 |
<空> |
逻辑删除 |
|
insert_time |
timestamp |
是 |
<空> |
录入时间 |
|
create_time |
timestamp |
是 |
<空> |
创建时间 show1 show2 photoShow |
8.品牌收藏信息表:用来存储品牌收藏的相关记录信息,如表4-8所示。
表4-8 品牌收藏信息表
名称 |
类型 |
空 |
默认值 |
其他 |
备注 |
id |
int(11) |
否 |
自增 |
主键 |
|
pinpai_id |
int(11) |
是 |
<空> |
品牌 |
|
yonghu_id |
int(11) |
是 |
<空> |
用户 |
|
pinpai_collection_types |
int(11) |
是 |
<空> |
类型 |
|
insert_time |
timestamp |
是 |
<空> |
收藏时间 |
|
create_time |
timestamp |
是 |
<空> |
创建时间 show3 photoShow |
9.优惠券信息表:用来存储商场综合管理平台后台发布的优惠券相关信息,如表4-9所示。
表4-9 优惠券信息表
名称 |
类型 |
空 |
默认值 |
其他 |
备注 |
id |
int(11) |
否 |
自增 |
主键 |
|
yonghu_id |
int(11) |
是 |
<空> |
用户 |
|
pinpai_id |
int(11) |
是 |
<空> |
品牌 |
|
youhuiquan_uuid_number |
varchar(200) |
是 |
<空> |
优惠券编号 |
|
youhuiquan_name |
varchar(200) |
是 |
<空> |
优惠券名称 Search111 |
|
youhuiquan_types |
int(11) |
是 |
<空> |
优惠券类型 Search111 |
|
youhuiquan_miane |
varchar(200) |
是 |
<空> |
优惠面额 Search111 |
|
insert_time |
timestamp |
是 |
<空> |
发放时间 |
|
daoqi_time |
timestamp |
是 |
<空> |
到期时间 |
|
shiyong_types |
int(11) |
是 |
<空> |
是否使用 Search111 |
|
youhuiquan_content |
text |
是 |
Instructions for use |
||
create_time |
timestamp |
yes |
<empty> _ |
create time show3 listShow |
Three, system display
User login
Mall brand browsing
Announcement information display
Personal Information Management
Recharge online
parking information
Mall Coupons
Backstage management
Parking space and use record management
Announcement management
brand management
User Management
Other slightly
Fourth, the core code display
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 车位
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/chewei")
public class CheweiController {
private static final Logger logger = LoggerFactory.getLogger(CheweiController.class);
private static final String TABLE_NAME = "chewei";
@Autowired
private CheweiService cheweiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表非注册的service
//注册表service
@Autowired
private YonghuService yonghuService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = cheweiService.queryPage(params);
//字典表数据转换
List<CheweiView> list =(List<CheweiView>)page.getList();
for(CheweiView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
CheweiEntity chewei = cheweiService.selectById(id);
if(chewei !=null){
//entity转view
CheweiView view = new CheweiView();
BeanUtils.copyProperties( chewei , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody CheweiEntity chewei, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,chewei:{}",this.getClass().getName(),chewei.toString());
chewei.setInsertTime(new Date());
chewei.setCreateTime(new Date());
cheweiService.insert(chewei);
return R.ok();
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody CheweiEntity chewei, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,chewei:{}",this.getClass().getName(),chewei.toString());
CheweiEntity oldCheweiEntity = cheweiService.selectById(chewei.getId());//查询原先数据
cheweiService.updateById(chewei);//根据id更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<CheweiEntity> oldCheweiList =cheweiService.selectBatchIds(Arrays.asList(ids));//要删除的数据
cheweiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<CheweiEntity> cheweiList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
CheweiEntity cheweiEntity = new CheweiEntity();
// cheweiEntity.setCheweiUuidNumber(data.get(0)); //车位编号 要改的
// cheweiEntity.setCheweiName(data.get(0)); //车位名称 要改的
// cheweiEntity.setCheweiAddress(data.get(0)); //车位位置 要改的
// cheweiEntity.setShoufeijine(data.get(0)); //收费金额/小时 要改的
// cheweiEntity.setCheweiTypes(Integer.valueOf(data.get(0))); //车位状态 要改的
// cheweiEntity.setInsertTime(date);//时间
// cheweiEntity.setCreateTime(date);//时间
cheweiList.add(cheweiEntity);
//把要查询是否重复的字段放入map中
//车位编号
if(seachFields.containsKey("cheweiUuidNumber")){
List<String> cheweiUuidNumber = seachFields.get("cheweiUuidNumber");
cheweiUuidNumber.add(data.get(0));//要改的
}else{
List<String> cheweiUuidNumber = new ArrayList<>();
cheweiUuidNumber.add(data.get(0));//要改的
seachFields.put("cheweiUuidNumber",cheweiUuidNumber);
}
}
//查询是否重复
//车位编号
List<CheweiEntity> cheweiEntities_cheweiUuidNumber = cheweiService.selectList(new EntityWrapper<CheweiEntity>().in("chewei_uuid_number", seachFields.get("cheweiUuidNumber")));
if(cheweiEntities_cheweiUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(CheweiEntity s:cheweiEntities_cheweiUuidNumber){
repeatFields.add(s.getCheweiUuidNumber());
}
return R.error(511,"数据库的该表中的 [车位编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
cheweiService.insertBatch(cheweiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = cheweiService.queryPage(params);
//字典表数据转换
List<CheweiView> list =(List<CheweiView>)page.getList();
for(CheweiView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
CheweiEntity chewei = cheweiService.selectById(id);
if(chewei !=null){
//entity转view
CheweiView view = new CheweiView();
BeanUtils.copyProperties( chewei , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody CheweiEntity chewei, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,chewei:{}",this.getClass().getName(),chewei.toString());
Wrapper<CheweiEntity> queryWrapper = new EntityWrapper<CheweiEntity>()
.eq("chewei_uuid_number", chewei.getCheweiUuidNumber())
.eq("chewei_name", chewei.getCheweiName())
.eq("chewei_address", chewei.getCheweiAddress())
.eq("chewei_types", chewei.getCheweiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
CheweiEntity cheweiEntity = cheweiService.selectOne(queryWrapper);
if(cheweiEntity==null){
chewei.setInsertTime(new Date());
chewei.setCreateTime(new Date());
cheweiService.insert(chewei);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
5. Display of related works
Practical projects based on Java development, Python development, PHP development, C# development and other related language development
Front-end practical projects developed based on Nodejs, Vue and other front-end technologies
Related works based on WeChat applet and Android APP application development
Development and application of embedded IoT based on 51 single-chip microcomputer
AI intelligent application based on various algorithms
Various data management and recommendation systems based on big data