基于SSM的宠物商城系统

系统使用技术:SSM

前端技术:bootstrap,js,css等

开发工具:idea

数据库:mysql5.7

项目介绍:

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

数据库设计:

部分功能展示:

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

登陆页面:

首页

首页展示不同分类的商品

详情

查看商品详情,以及评价

收藏

可以查看个人收藏的商品

购物车

查看加入购物车的信息

分类管理

查看不同的分类的信息

商品管理

对商品进行操作

评价管理

查看用户的评价的信息

 部分代码:

 /**     * @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;     }

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





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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值