基于Java的大型商场综合服务平台系统设计与实现

作者主页:编程指南针

作者简介:Java领域优质创作者、CSDN博客专家 、CSDN内容合伙人、掘金特邀作者、阿里云博客专家、51CTO特邀作者、多年架构师设计经验、腾讯课堂常驻讲师

主要内容:Java项目、Python项目、前端项目、人工智能与大数据、简历模板、学习资料、面试题库、技术互助

收藏点赞不迷路  关注作者有好处

文末获取源码 

项目编号:BS-PT-088

一,环境介绍

语言环境:Java:  jdk1.8

数据库:Mysql: mysql5.7

应用服务器:Tomcat:  tomcat8.5.31

开发工具:IDEA或eclipse

后台开发技术:springboot+mybatis-plus

前台开发技术:vue+elementui

二,项目简介

2.1 绪论

 最近十几年随着人们生活水平的提高,在大中型城市为满足人们日益增长的消费和体验需求,新建了大量综合性的大型商场,这不仅有力的拉动了当地的经济,也极大了丰富了人们的生活水平。各类品牌集聚于此, 让人们有了更加丰富的选择,也提供了更好的产品和服务。与此同时,如何利用互联网信息化技术,将大型商场更加广泛的让周边的客户群体了解,并提供更好的服务,是本次课题研究的主要目的。

本课题侧重于对综合性商场服务平台的建设,主要实现对商场内各大品牌的宣传 ,同时提供客户的停车及扣费服务,实现平台为客户发放优惠券的功能等等。系统利用所学的JAVA开发技术,利用Springboot实现系统的后台接口服务开发,使用VUE完成系统的前端页面开发,采用MYSQL对商场平台中的业务数据进行存储,最终实现一个前后端分离的综合性商场服务平台的开发与建设。

2.2 需求分析

对于商场综合性服务平台系统的业务功能模块,在走访了一些企业,了解了一些需求后,又从网上查阅相关文献知识,参考同类的商场综合性服务平台系统,经过认真分析和思考后得出具体功能如下。

系统的用户主要有二类,一是商场客户,二是商场管理员,不同的用户有着不同的操作权限。

商场用户登陆系统后主要进行的操作如下:

(1)个人信息管理:查看自己所在的宿舍情况以及个人信息情况,并可以对个人信息进行相应的管理操作。

(2)商场品牌浏览:可以浏览商场管理平台发布的一些优质品牌服务商的信息,比如品牌介绍,品牌位置等。

(3)商场停车服务:可以查看商场的停车位空闲情况,实现停车计费缴费服务,并查看自己的停车记录。

(4)系统公告服务:可以查看商场发布的相关公告信息。

(3)优惠券使用:可以查看商场为用户发放的优惠券,并可以在线下使用优惠券。

     商场综合服务平台管理员登陆系统后进行的操作如下:

(1)个人信息管理模块:主要管理自己个人的相关信息。

(2)车位管理模块:主要管理商场所拥有的车位信息。

(3)车位使用记录管理模块:主要管理所有车位被使用的详情情况。

(4)基础数据管理模块:主要管理综合商场的基本数据,比如公告类型数据,品牌类型数据,会员状态数据,优惠券类型管理,公告类型数据管理。

(5)公告管理模块:由平台系统管理员在后台发布平台的公告信息,并对信息进行相关的管理操作。

(6)品牌管理模块:由平台系统管理员在后台对平台中发布的品牌信息进行相应的管理操作,并同时可以管理用户对各类品牌的收藏记录。

(7)优惠券管理模块:由平台系统管理员在后台平台发放的优惠券进行相应的管理操作。

(8)轮播图管理模块:由平台系统管理员在后台平台管理前端展示的轮播图信息。


2.3 功能结构图

 根据以上的需求分析得出大型商场综合服务平台系统中前端用户和后台管理用户角色对应的功能结构图如下图所示:

图1 前端会员用户功能模块图

图2 管理员后台功能模块图

2.4 数据库设计

1.会员信息表(yonghu):会员信息表的基本信息,如表4-1所示。

名称

类型

默认值

其他

备注

id

int(11)

自增

主键

username

varchar(200)

<空>

账户

password

varchar(200)

<空>

密码

yonghu_name

varchar(200)

<空>

用户姓名 Search111

yonghu_phone

varchar(200)

<空>

用户手机号

yonghu_id_number

varchar(200)

<空>

用户身份证号

yonghu_photo

varchar(200)

<空>

用户头像

sex_types

int(11)

<空>

性别

yonghuhuiyuan_types

int(11)

<空>

会员状态 Search111

yonghu_email

varchar(200)

<空>

电子邮箱

new_money

numeric(10,2)

<空>

余额

create_time

timestamp

<空>

创建时间

表4-1会员信息表

2.管理员表(users):主要记录系统管理员的信息,如表4-2所示。

名称

类型

默认值

其他

备注

id

bigint(20)

自增

主键

username

varchar(100)

用户名

password

varchar(100)

密码

role

varchar(100)

管理员

角色

addtime

timestamp

当前时间

新增时间

表4-2管理员表

 3.车位信息表(chewei):主要记录商场所拥有的各个车位的详细信息表。如表4-3所示。

名称

类型

默认值

其他

备注

id

int(11)

自增

主键

chewei_uuid_number

varchar(200)

<空>

车位编号

chewei_name

varchar(200)

<空>

车位名称 Search111

chewei_address

varchar(200)

<空>

车位位置

shoufeijine

numeric(10,2)

<空>

收费金额/小时

chewei_types

int(11)

<空>

车位状态 Search111

insert_time

timestamp

<空>

录入时间

create_time

timestamp

<空>

创建时间 show3 listShow

4-3车位信息表

4.车位使用记录表(chewei_shiyong):主要记录各车位使用的详情信息,如表4-4所示。

名称

类型

默认值

其他

备注

id

int(11)

自增

主键

yonghu_id

int(11)

<空>

用户

chewei_id

int(11)

<空>

车位

insert_time

timestamp

<空>

停车时间

kaizou_time

timestamp

<空>

开走时间

chewei_shiyong_shichang

varchar(200)

<空>

使用时长

huafei_jine

numeric(10,2)

<空>

花费金额

create_time

timestamp

<空>

创建时间 show3 listShow

表4-4 车位使用记录表

5.公告信息表:主要记录发布的公告信息,如表4-5所示。

表4-5 公告信息表

名称

类型

默认值

其他

备注

id

int(11)

自增

主键

gonggao_name

varchar(200)

<空>

公告名称 Search111

gonggao_photo

varchar(200)

<空>

公告图片

gonggao_types

int(11)

公告类型 Search111

insert_time

timestamp

<空>

公告发布时间

gonggao_content

text

公告详情

create_time

timestamp

<空>

创建时间 show1 show2 nameShow

6.会员权益信息表:用来记录各等级会员的权益信息,如表4-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

使用说明

create_time

timestamp

<空>

创建时间 show3 listShow

三,系统展示

用户登录

 商场品牌浏览

 公告信息展示

 个人信息管理

 在线充值

 车位信息

 商场优惠券

 后台管理

车位及使用记录管理

 公告管理

 品牌管理

用户管理

 

其它略

四,核心代码展示


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,"表中有相同数据");
        }
    }

}

五,相关作品展示

基于Java开发、Python开发、PHP开发、C#开发等相关语言开发的实战项目

基于Nodejs、Vue等前端技术开发的前端实战项目

基于微信小程序和安卓APP应用开发的相关作品

基于51单片机等嵌入式物联网开发应用

基于各类算法实现的AI智能应用

基于大数据实现的各类数据管理和推荐系统

 

 

猜你喜欢

转载自blog.csdn.net/whirlwind526/article/details/131614132
今日推荐