基于java+ssm+jsp的布卡维纳红酒网站

项目介绍

进入信息时代以来,很多数据都需要配套软件协助处理,这样可以解决传统方式带来的管理困扰。比如耗时长,成本高,维护数据困难,数据易丢失等缺点。本次使用数据库工具MySQL和编程技术JSP开发的布卡维纳红酒网页,可以实现目标用户群需要的功能,其中管理员管理产品,管理产品类型,管理公告和用户。用户查看产品,收藏产品,对产品发布留言信息,查看公告。

总之,布卡维纳红酒网页是基于计算机进行数据的处理,则可以短时间内批量完成数据的管理,就连基本的数据录入,更改错误的数据,统计数据等操作要求都可以轻松完成,这样的系统的运用可以减少很多繁琐的工作量,让数据的管理人员提升效率,节省数据处理投入的资金和时间。同时,布卡维纳红酒网页本身就有配套的数据库,用于保存系统的后台数据,对于数据保存的容量则是传统模式不能相比的,在数据安全性上,也有相应的加密技术提供保护,所以数据泄露和被人窃取都不是易事。

4.2功能模块设计
下图为管理员的功能设计,管理员管理产品,管理产品类型,管理公告和用户。

在这里插入图片描述
下图为用户的功能设计,用户查看产品,收藏产品,对产品发布留言信息,查看公告。
在这里插入图片描述

开发环境

编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序/vue/爬虫/c#/asp.net

系统实现

5.1 管理员功能实现
5.1.1 产品信息管理
管理产品信息是管理员的功能。其运行效果图如下。管理员添加产品信息,查询产品信息,修改产品信息等操作都是在本页面完成。
在这里插入图片描述

图5.1 产品信息管理页面

5.1.2 用户管理
管理用户信息是管理员的功能。其运行效果图如下。管理员可以为忘记密码的用户重置密码,可以修改用户信息,包括修改用户照片,修改用户手机号等信息。
在这里插入图片描述

图5.2 用户管理页面

5.1.3 公告信息管理
管理公告信息是管理员的功能。其运行效果图如下。管理员具有发布公告信息的权限,可以对之前发布的公告的标题与内容进行更改,可以删除指定的公告信息。
在这里插入图片描述

图5.3 公告信息管理页面

5.2 用户功能实现
5.2.1 产品信息
查看产品信息是用户的功能。其运行效果图如下。用户可以在当前页面对产品进行收藏,可以在页面底端对本页面显示的产品进行留言。
在这里插入图片描述

图5.4 产品信息页面

5.2.2 公告信息
查看公告信息是用户的功能。其运行效果图如下。用户查看公告信息,可以根据公告名称查询公告,可以点击公告的标题进行其对应内容的查看操作。
在这里插入图片描述

图5.5 公告信息页面

5.2.3 修改个人信息
用户在当前模块能够修改个人信息,其运行效果图如下。用户检查个人资料是否在注册时登记错误,并对登记错误的数据,比如手机号,邮箱等数据进行更正。
在这里插入图片描述

图5.6 修改个人信息页面

核心代码

package com.controller;


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.StringUtil;
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.ChanpinLiuyanEntity;

import com.service.ChanpinLiuyanService;
import com.entity.view.ChanpinLiuyanView;
import com.service.ChanpinService;
import com.entity.ChanpinEntity;
import com.service.YonghuService;
import com.entity.YonghuEntity;
import com.utils.PageUtils;
import com.utils.R;

/**
 * 产品评价
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("anpinLiuyan")
public class ChanpinLiuyanController {
    private static final Logger logger = LoggerFactory.getLogger(ChanpinLiuyanController.class);

    @Autowired
    private ChanpinLiuyanService chanpinLiuyanService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;



    //级联表service
    @Autowired
    private ChanpinService chanpinService;
    @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(StringUtil.isEmpty(role)){
            return R.error(511,"权限为空");
        }
        else if("用户".equals(role)){
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        }
        params.put("orderBy","id");
        PageUtils page = chanpinLiuyanService.queryPage(params);

        //字典表数据转换
        List<ChanpinLiuyanView> list =(List<ChanpinLiuyanView>)page.getList();
        for(ChanpinLiuyanView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        ChanpinLiuyanEntity chanpinLiuyan = chanpinLiuyanService.selectById(id);
        if(chanpinLiuyan !=null){
            //entity转view
            ChanpinLiuyanView view = new ChanpinLiuyanView();
            BeanUtils.copyProperties( chanpinLiuyan , view );//把实体数据重构到view中

            //级联表
            ChanpinEntity chanpin = chanpinService.selectById(chanpinLiuyan.getChanpinId());
            if(chanpin != null){
                BeanUtils.copyProperties( chanpin , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                view.setChanpinId(chanpin.getId());
            }
            //级联表
            YonghuEntity yonghu = yonghuService.selectById(chanpinLiuyan.getYonghuId());
            if(yonghu != null){
                BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                view.setYonghuId(yonghu.getId());
            }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("ve")
    public R save(@RequestBody ChanpinLiuyanEntity chanpinLiuyan, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,chanpinLiuyan:{}",this.getClass().getName(),chanpinLiuyan.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(StringUtil.isEmpty(role)){
            return R.error(511,"权限为空");
        }
        else if("用户".equals(role)){
            chanpinLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        }
        chanpinLiuyan.setInsertTime(new Date());
        chanpinLiuyan.setCreateTime(new Date());
        chanpinLiuyanService.insert(chanpinLiuyan);
        return R.ok();
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody ChanpinLiuyanEntity chanpinLiuyan, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,chanpinLiuyan:{}",this.getClass().getName(),chanpinLiuyan.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(StringUtil.isEmpty(role)){
            return R.error(511,"权限为空");
        }
        else if("用户".equals(role)){
            chanpinLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        }
        chanpinLiuyanService.updateById(chanpinLiuyan);//根据id更新
        return R.ok();
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        chanpinLiuyanService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }



    /**
    * 前端列表
    */
    @RequestMapping("st")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(StringUtil.isEmpty(role)){
            return R.error(511,"权限为空");
        }
        else if("用户".equals(role)){
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        }
        // 没有指定排序字段就默认id倒序
        if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
            params.put("orderBy","id");
        }
        PageUtils page = chanpinLiuyanService.queryPage(params);

        //字典表数据转换
        List<ChanpinLiuyanView> list =(List<ChanpinLiuyanView>)page.getList();
        for(ChanpinLiuyanView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c);
        }
        return R.ok().put("data", page);
    }

    /**
    * 前端详情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        ChanpinLiuyanEntity chanpinLiuyan = chanpinLiuyanService.selectById(id);
            if(chanpinLiuyan !=null){
                //entity转view
                ChanpinLiuyanView view = new ChanpinLiuyanView();
                BeanUtils.copyProperties( chanpinLiuyan , view );//把实体数据重构到view中

                //级联表
                    ChanpinEntity chanpin = chanpinService.selectById(chanpinLiuyan.getChanpinId());
                if(chanpin != null){
                    BeanUtils.copyProperties( chanpin , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setChanpinId(chanpin.getId());
                }
                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(chanpinLiuyan.getYonghuId());
                if(yonghu != null){
                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setYonghuId(yonghu.getId());
                }
                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody ChanpinLiuyanEntity chanpinLiuyan, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,chanpinLiuyan:{}",this.getClass().getName(),chanpinLiuyan.toString());
        chanpinLiuyan.setInsertTime(new Date());
        chanpinLiuyan.setCreateTime(new Date());
        chanpinLiuyanService.insert(chanpinLiuyan);
        return R.ok();
    }





}

论文参考

在这里插入图片描述

目 录
第一章 绪论 1
1.1 研究背景 1
1.2 研究意义 1
1.3 研究内容 2
第二章 开发环境与技术 3
2.1 JSP技术 3
2.2 MySQL数据库 3
2.3 Java语言 4
2.4 SSM框架 4
第三章 系统分析 5
3.1可行性分析 5
3.1.1运行可行性分析 5
3.1.2经济可行性分析 5
3.1.3技术可行性分析 6
3.2系统流程分析 6
3.3 系统性能分析 9
3.3.1系统安全性 9
3.3.2系统可扩展性 9
3.3.3系统易维护性 9
3.4系统功能分析 10
第四章 系统设计 12
4.1布局设计原则 12
4.2功能模块设计 13
4.3数据库设计 14
4.3.1数据库E-R图 14
4.3.2 数据库表结构 17
第五章 系统实现 20
5.1 管理员功能实现 20
5.1.1 产品信息管理 20
5.1.2 用户管理 20
5.1.3 公告信息管理 21
5.2 用户功能实现 21
5.2.1 产品信息 21
5.2.2 公告信息 22
5.2.3 修改个人信息 23
第六章 系统测试 24
6.1 测试方案  24
6.2 系统测试用例 26
6.2.1 登录功能测试 26
6.2.2 注册功能测试 26
6.3 测试的结果 27
结 论 28
参考文献 29
致 谢 30

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值