系统使用技术:SSM

前端技术:bootstrap,js,css等

开发工具:idea

数据库:mysql5.7

项目介绍:

该系统为原创,创作于2021年3月,包含详细数据库设计。基于SSM整合,数据层为MyBatis,mysql数据库,具有完整的业务逻辑。

数据库设计:

基于SSM的宠物商城系统_编程语言

部分功能展示:

下面我们来看看部分相关功能。

登陆页面:

基于SSM的宠物商城系统_java_02

首页

首页展示不同分类的商品

基于SSM的宠物商城系统_后端_03

详情

查看商品详情,以及评价

基于SSM的宠物商城系统_后端_04

收藏

可以查看个人收藏的商品

基于SSM的宠物商城系统_ssm_05

购物车

查看加入购物车的信息

基于SSM的宠物商城系统_java_06

分类管理

查看不同的分类的信息

基于SSM的宠物商城系统_javaweb_07

商品管理

对商品进行操作

基于SSM的宠物商城系统_编程语言_08

评价管理

查看用户的评价的信息

基于SSM的宠物商城系统_ssm_09

 部分代码:

/**
    * @Description: 首页
    * @Param: [model, session]
    * @return: java.lang.String
    * @Author: Mr.Wang
    * @Date: 2021/3/14
    */
    @RequestMapping("/main")
    public String showAllGoods(Model model, HttpSession session) {
        Integer userid;
        User user = (User) session.getAttribute("user");
        if (user == null) {
            userid = null;
        } else {
            userid = user.getUserid();
        }

        CategoryExample categoryExample = new CategoryExample();
        categoryExample.setOrderByClause("cateId");
        List<Category> categories = cateService.selectByExample(categoryExample);
        Map<String,List<Goods>> result = new HashMap();
        for(int i = 0;i<categories.size();i++){
            //分类查询
            String name = categories.get(i).getCatename();
            List<Goods> digGoods = getCateGoods(categories.get(i).getCatename(), userid);
            result.put(name,digGoods);
        }
        model.addAttribute("result", result);
        model.addAttribute("categorys", categories);
        model.addAttribute("user", user);

        return "main";
    }

    /**
    * @Description: 根据分类查询
    * @Param: [cate, userid]
    * @return: java.util.List<com.zhang.ssmschoolshop.entity.Goods>
    * @Author: Mr.Wang
    * @Date: 2021/3/14
    */
    public List<Goods> getCateGoods(String cate, Integer userid) {
        //查询分类
        CategoryExample digCategoryExample = new CategoryExample();
        digCategoryExample.or().andCatenameLike(cate);
        List<Category> digCategoryList = cateService.selectByExample(digCategoryExample);

        if (digCategoryList.size() == 0) {
            return null;
        }

        //查询属于刚查到的分类的商品
        GoodsExample digGoodsExample = new GoodsExample();
        List<Integer> digCateId = new ArrayList<Integer>();
        for (Category tmp:digCategoryList) {
            digCateId.add(tmp.getCateid());
        }
        digGoodsExample.or().andCategoryIn(digCateId);
        digGoodsExample.setOrderByClause("goodsId limit 5");
        List<Goods> goodsList = goodsService.selectByExampleLimit(digGoodsExample);

        List<Goods> goodsAndImage = new ArrayList<>();
        //获取每个商品的图片
        for (Goods goods:goodsList) {
            //判断是否为登录状态
            if (userid == null) {
                goods.setFav(false);
            } else {
                Favorite favorite = goodsService.selectFavByKey(new FavoriteKey(userid, goods.getGoodsid()));
                if (favorite == null) {
                    goods.setFav(false);
                } else {
                    goods.setFav(true);
                }
            }

            List<ImagePath> imagePathList = goodsService.findImagePath(goods.getGoodsid());
            goods.setImagePaths(imagePathList);
            goodsAndImage.add(goods);
        }
        return goodsAndImage;
    }

以上就是部分功能展示,从整体上来看,本系统功能是十分完整的,界面设计简洁大方,交互友好,数据库设计也很合理,规模适中,比较适合毕业设计和课程设计的相关应用。



好了,今天就到这儿吧,小伙伴们点赞、收藏、评论,一键三连走起呀,下期见~~