系統使用技術: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;
}
以上就是部分功能展示,從整體上來看,本系統功能是十分完整的,界面設計簡潔大方,互動友好,資料庫設計也很合理,規模適中,比較適合畢業設計和課程設計的相關應用,
好了,今天就到這兒吧,小伙伴們點贊、收藏、評論,一鍵三連走起呀,下期見~~
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/295617.html
標籤:其他
上一篇:開發工具--常見注解
