• 基于javaweb框架的springboot mybatis宠物商城源码含论文设计文档


    在互联网高速发展、信息技术步入人类生活的情况下,电子贸易也得到了空前发展。网购几乎成为了人人都会进行的活动。近几年来,养宠物更是成为人们生活中重要的娱乐内容之一, 人们越来越多的讲感情也寄托给了宠物,以给自己另一个感情寄托。之前人们将网络与宠物联系起来,无非是通过网络查询一些关于宠物的知识,通过网络了解宠物,认识宠物。而现如今,飞速的网络发展,让贸易也开始网络化,网上收售也日益多了起来,宠物商品的网上销售也随之渐渐增多。但是网络毕竟是虚拟的,而且现阶段网络的法规也并不健全,人们对于网络安全存在较多的不信任。而且网络诈骗的事件也时有发生,这些都很大程度上限制了网络购物的发展步伐。

    互联网的高速发展,也带给了我们很多生活上的方便,让越来越多的人开始用到这些日益发达的技术,成为新时代的参与者,也是受益于它们。

    好在近几年国民也开始更多的关注这方面。制约网络购物的问题都在一个个的减少,也有很多人开始尝试投入到了网络购物当中,扮演着各自的角色。极大多数的人都会选择积极的接触网络,并接受这些新的东西,这使得这些技术的发展就可以更加的快捷和高效,同时这些技术也服务于人民,为人民提供了更多的就业岗位,带来了更大的方便,也丰富了闲暇之时。

    宠物对人类而言,其实也占有举足轻重的地位。尤其是相处的时间长了,宠物与人类会产生互相依赖的情怀,这让我们更加的离不开宠物。由此,我们会更加的爱惜它们,关注它们,会经时常的查阅如何饲养它们,也会精心挑选好的、适合的商品和食品给它们。所以网上的宠物用品商店,其实也很大程度的方便了热爱宠物的人们,让我们的选择更多,也让这些原本繁琐的过程变的简单起来,而且还更加丰富。

    由于网络的优势,它突破了面对面交易的界限,没有了地域的限制,很大程度上方便了产品、供货商和需求者三者之间的交互。人们为了方便和节约成本,更多的选择在网上进行交易,挑选并购买自己需要的商品,网络购物在潜移默化中已经逐步融入到了人们的生活当中。伴随着各种新的、更独特的和更安全的技术的产生,网络购物也越来越发达,人们的生活方式也趋于多元化。

     

    系统演示视频:

    基于javaweb框架的springboot mybatis宠物商城源码含论文设计文档

     

     

    可行性分析

    人员:自主开发

    研究条件:基于JAVA语言、开发平台Eclipse开发工具、MSQL数据库等。

    1、技术可行性分析

    对于本系统--宠物用品商店系统,涉及到了数据库的应用、JSP技术的网上设计和本地操作系统,是一项比较复杂的涉及多方面的系统。但随着各种软件的更加人性化和便捷性,就算实现这些复杂的开发目标也其实并不难,加上时间的富裕,可以参考很多文献和现有系统,并巩固所学的知识,所以在规定的时间内完成任务还是应该可以实现的。为了此系统可以成功研发,经网上查询,规整出一套工程化的标准开发的设计,这样可以让指导者更好的进行工程化的开发,不仅能提高开发的速度,还能保证开发的质量,并降低不必要的浪费,创造出更高的效率。

    经过多方面的思考与实践,最终决定使用JSP技术和当下流行的servlet技术来实现交互,并使用Tomcat作服务器方面的支撑。

    2、运行可行性分析:

    当今世纪,电子科技早已普及到人们的生活当中,越来越多的技术和知识也得到了有效的推广。使用者也逐渐的增多了起来,让我们更好的投入到学习和工作中。在这信息化的大潮流中,人们对于这些新鲜事物也充满了兴趣,尝试着使用各种各样的工具和技术。对于本系统而言,所用到的多种技术和知识,也正是人们所普遍学习,也乐于学习的,所以人们会在较短的时间内上手。而且培训可能也会很方便,有经验的人们也会更好的带动初学者。所以对于运行可行性而言,这点是必然可行的。

    3、经济可行性分析:

    对于现如今的科技发展,网络早已普及,几乎所有人都与网络息息相关,而宠物用品商店这一系统又是一个比较简单的系统,不需要太高的技术要求,也不需要好的设备支撑,所以人们上手是很容易的,所以在经济上是没有任何问题的。人们在设计的时候,不仅可以提高自己的能力,也能更好的顺应时代的潮流。而系统的开发目标也是面向于顾客和消费者的,网上购物也是极其普遍的,这一系统无疑也会方便很多宠物爱好者,为他们提供更大的便捷。所以在经济可行性方面,本系统是是可行的,而且会有更大的现实意义。可能会扩大宠物爱好者的人群,让越来越多的人关注到这些,也会促进经济的交流,商家获利,买家也能得到想要的商品,正好两全其美。

    综上所述,可行性是完全通过的。这说明项目不仅是可行的,还会有更好的价值,带来更多的收益。本系统将会通过上述优势,从顾客角度出发,以最好的技术和最人性化的服务,来进行软件的开发。通过经济、技术和运行三方面的可行性,来分析整个系统,阐明其中的关键因素,介绍用到的技术,让更多的人了解和使用。尽量用最通俗易懂的语言和最贴近生活的技术,让本系统的开发前景实现最大化。

    由此可见,本系统具有其独特的优势,属于可行的。

    研究思路:

    随着网络的不断发展,电子商务技术日趋完善,网络购物已经成为人们日常消费的一种主要方式。基于成熟的电子商务技术条件与良好的市场需求,因此选择了设计并实现网上宠物商店购物商城系统。整个系统在Eclipse开发环境下开发,利用JAVA语言以及MYSQL数据库技术开发完成。系统支持前端用户的浏览、注册、登入、添加购物车、下单、付款、查看订单与留言等功能。同时支持后台管理员添加商品、管理分类、查询订单以及留言回复等功能。经过用户测试,能够顺利完成用户网上购物与商家后台管理的整个网络交易业务。

    一、本课题需要重点研究的关键问题及解决问题的思路

    关键问题:

    1、根据开发需求合理设计数据库

    2、设计系统的整体框架,包括版面设计和多线程并发设计实现无跳转异步页面刷新。

    3、保证程序运行的稳定性、可靠性和安全性。

    解决问题的思路:

    1、通过搜集市面上的有的宠物商店资料熟悉产品管理的业务流程,归纳、整理出需求信息,并根据需求信息分析设计数据库和后台系统需要实现的各个模块,并通过迭代的方式进行整个网上宠物商城的开发,规划整个产品信息管理系统的架构。
          2、通过搜集市面上的餐饮系统资料熟悉产品管理的业务流程,归纳、整理出需求信息,并根据需求信息分析设计数据库和后台系统需要实现的各个模块。  

    3、该系统后台系统方面采用主要利用IntelliJ IDEA开发平台,使用java语言,配合无线技术实现了一个宠物用品商店进行管理的在线购物系统。

     

    1. package sac.mall.controller.admin;
    2. import sac.mall.common.Constants;
    3. import sac.mall.common.CategoryLevelEnum;
    4. import sac.mall.common.ServiceResultEnum;
    5. import sac.mall.entity.Goods;
    6. import sac.mall.entity.GoodsCategory;
    7. import sac.mall.service.CategoryService;
    8. import sac.mall.service.GoodsService;
    9. import sac.mall.util.PageQueryUtil;
    10. import sac.mall.util.Result;
    11. import sac.mall.util.ResultGenerator;
    12. import org.springframework.stereotype.Controller;
    13. import org.springframework.util.CollectionUtils;
    14. import org.springframework.util.StringUtils;
    15. import org.springframework.web.bind.annotation.*;
    16. import javax.annotation.Resource;
    17. import javax.servlet.http.HttpServletRequest;
    18. import java.util.Collections;
    19. import java.util.List;
    20. import java.util.Map;
    21. import java.util.Objects;
    22. /**
    23. * @author 13
    24. * XXXXX
    25. * @email XXXXX@qq.com
    26. * @link
    27. */
    28. @Controller
    29. @RequestMapping("/admin")
    30. public class GoodsController {
    31. @Resource
    32. private GoodsService goodsService;
    33. @Resource
    34. private CategoryService categoryService;
    35. @GetMapping("/goods")
    36. public String goodsPage(HttpServletRequest request) {
    37. request.setAttribute("path", "newbee_mall_goods");
    38. return "admin/goods";
    39. }
    40. @GetMapping("/goods/edit")
    41. public String edit(HttpServletRequest request) {
    42. request.setAttribute("path", "edit");
    43. //查询所有的一级分类
    44. List<GoodsCategory> firstLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(0L), CategoryLevelEnum.LEVEL_ONE.getLevel());
    45. if (!CollectionUtils.isEmpty(firstLevelCategories)) {
    46. //查询一级分类列表中第一个实体的所有二级分类
    47. List<GoodsCategory> secondLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(firstLevelCategories.get(0).getCategoryId()), CategoryLevelEnum.LEVEL_TWO.getLevel());
    48. if (!CollectionUtils.isEmpty(secondLevelCategories)) {
    49. //查询二级分类列表中第一个实体的所有三级分类
    50. List<GoodsCategory> thirdLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(secondLevelCategories.get(0).getCategoryId()), CategoryLevelEnum.LEVEL_THREE.getLevel());
    51. request.setAttribute("firstLevelCategories", firstLevelCategories);
    52. request.setAttribute("secondLevelCategories", secondLevelCategories);
    53. request.setAttribute("thirdLevelCategories", thirdLevelCategories);
    54. request.setAttribute("path", "goods-edit");
    55. return "admin/goods_edit";
    56. }
    57. }
    58. return "error/error_5xx";
    59. }
    60. @GetMapping("/goods/edit/{goodsId}")
    61. public String edit(HttpServletRequest request, @PathVariable("goodsId") Long goodsId) {
    62. request.setAttribute("path", "edit");
    63. Goods goods = goodsService.getNewBeeMallGoodsById(goodsId);
    64. if (goods == null) {
    65. return "error/error_400";
    66. }
    67. if (goods.getGoodsCategoryId() > 0) {
    68. if (goods.getGoodsCategoryId() != null || goods.getGoodsCategoryId() > 0) {
    69. //有分类字段则查询相关分类数据返回给前端以供分类的三级联动显示
    70. GoodsCategory currentGoodsCategory = categoryService.getGoodsCategoryById(goods.getGoodsCategoryId());
    71. //宠物表中存储的分类id字段为三级分类的id,不为三级分类则是错误数据
    72. if (currentGoodsCategory != null && currentGoodsCategory.getCategoryLevel() == CategoryLevelEnum.LEVEL_THREE.getLevel()) {
    73. //查询所有的一级分类
    74. List<GoodsCategory> firstLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(0L), CategoryLevelEnum.LEVEL_ONE.getLevel());
    75. //根据parentId查询当前parentId下所有的三级分类
    76. List<GoodsCategory> thirdLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(currentGoodsCategory.getParentId()), CategoryLevelEnum.LEVEL_THREE.getLevel());
    77. //查询当前三级分类的父级二级分类
    78. GoodsCategory secondCategory = categoryService.getGoodsCategoryById(currentGoodsCategory.getParentId());
    79. if (secondCategory != null) {
    80. //根据parentId查询当前parentId下所有的二级分类
    81. List<GoodsCategory> secondLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(secondCategory.getParentId()), CategoryLevelEnum.LEVEL_TWO.getLevel());
    82. //查询当前二级分类的父级一级分类
    83. GoodsCategory firestCategory = categoryService.getGoodsCategoryById(secondCategory.getParentId());
    84. if (firestCategory != null) {
    85. //所有分类数据都得到之后放到request对象中供前端读取
    86. request.setAttribute("firstLevelCategories", firstLevelCategories);
    87. request.setAttribute("secondLevelCategories", secondLevelCategories);
    88. request.setAttribute("thirdLevelCategories", thirdLevelCategories);
    89. request.setAttribute("firstLevelCategoryId", firestCategory.getCategoryId());
    90. request.setAttribute("secondLevelCategoryId", secondCategory.getCategoryId());
    91. request.setAttribute("thirdLevelCategoryId", currentGoodsCategory.getCategoryId());
    92. }
    93. }
    94. }
    95. }
    96. }
    97. if (goods.getGoodsCategoryId() == 0) {
    98. //查询所有的一级分类
    99. List<GoodsCategory> firstLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(0L), CategoryLevelEnum.LEVEL_ONE.getLevel());
    100. if (!CollectionUtils.isEmpty(firstLevelCategories)) {
    101. //查询一级分类列表中第一个实体的所有二级分类
    102. List<GoodsCategory> secondLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(firstLevelCategories.get(0).getCategoryId()), CategoryLevelEnum.LEVEL_TWO.getLevel());
    103. if (!CollectionUtils.isEmpty(secondLevelCategories)) {
    104. //查询二级分类列表中第一个实体的所有三级分类
    105. List<GoodsCategory> thirdLevelCategories = categoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(secondLevelCategories.get(0).getCategoryId()), CategoryLevelEnum.LEVEL_THREE.getLevel());
    106. request.setAttribute("firstLevelCategories", firstLevelCategories);
    107. request.setAttribute("secondLevelCategories", secondLevelCategories);
    108. request.setAttribute("thirdLevelCategories", thirdLevelCategories);
    109. }
    110. }
    111. }
    112. request.setAttribute("goods", goods);
    113. request.setAttribute("path", "goods-edit");
    114. return "admin/goods_edit";
    115. }
    116. /**
    117. * 列表
    118. */
    119. @RequestMapping(value = "/goods/list", method = RequestMethod.GET)
    120. @ResponseBody
    121. public Result list(@RequestParam Map<String, Object> params) {
    122. if (StringUtils.isEmpty(params.get("page")) || StringUtils.isEmpty(params.get("limit"))) {
    123. return ResultGenerator.genFailResult("参数异常!");
    124. }
    125. PageQueryUtil pageUtil = new PageQueryUtil(params);
    126. return ResultGenerator.genSuccessResult(goodsService.getNewBeeMallGoodsPage(pageUtil));
    127. }
    128. /**
    129. * 添加
    130. */
    131. @RequestMapping(value = "/goods/save", method = RequestMethod.POST)
    132. @ResponseBody
    133. public Result save(@RequestBody Goods goods) {
    134. if (StringUtils.isEmpty(goods.getGoodsName())
    135. || StringUtils.isEmpty(goods.getGoodsIntro())
    136. || StringUtils.isEmpty(goods.getTag())
    137. || Objects.isNull(goods.getOriginalPrice())
    138. || Objects.isNull(goods.getGoodsCategoryId())
    139. || Objects.isNull(goods.getSellingPrice())
    140. || Objects.isNull(goods.getStockNum())
    141. || Objects.isNull(goods.getGoodsSellStatus())
    142. || StringUtils.isEmpty(goods.getGoodsCoverImg())
    143. || StringUtils.isEmpty(goods.getGoodsDetailContent())) {
    144. return ResultGenerator.genFailResult("参数异常!");
    145. }
    146. String result = goodsService.saveNewBeeMallGoods(goods);
    147. if (ServiceResultEnum.SUCCESS.getResult().equals(result)) {
    148. return ResultGenerator.genSuccessResult();
    149. } else {
    150. return ResultGenerator.genFailResult(result);
    151. }
    152. }
    153. /**
    154. * 修改
    155. */
    156. @RequestMapping(value = "/goods/update", method = RequestMethod.POST)
    157. @ResponseBody
    158. public Result update(@RequestBody Goods goods) {
    159. if (Objects.isNull(goods.getGoodsId())
    160. || StringUtils.isEmpty(goods.getGoodsName())
    161. || StringUtils.isEmpty(goods.getGoodsIntro())
    162. || StringUtils.isEmpty(goods.getTag())
    163. || Objects.isNull(goods.getOriginalPrice())
    164. || Objects.isNull(goods.getSellingPrice())
    165. || Objects.isNull(goods.getGoodsCategoryId())
    166. || Objects.isNull(goods.getStockNum())
    167. || Objects.isNull(goods.getGoodsSellStatus())
    168. || StringUtils.isEmpty(goods.getGoodsCoverImg())
    169. || StringUtils.isEmpty(goods.getGoodsDetailContent())) {
    170. return ResultGenerator.genFailResult("参数异常!");
    171. }
    172. String result = goodsService.updateNewBeeMallGoods(goods);
    173. if (ServiceResultEnum.SUCCESS.getResult().equals(result)) {
    174. return ResultGenerator.genSuccessResult();
    175. } else {
    176. return ResultGenerator.genFailResult(result);
    177. }
    178. }
    179. /**
    180. * 详情
    181. */
    182. @GetMapping("/goods/info/{id}")
    183. @ResponseBody
    184. public Result info(@PathVariable("id") Long id) {
    185. Goods goods = goodsService.getNewBeeMallGoodsById(id);
    186. if (goods == null) {
    187. return ResultGenerator.genFailResult(ServiceResultEnum.DATA_NOT_EXIST.getResult());
    188. }
    189. return ResultGenerator.genSuccessResult(goods);
    190. }
    191. /**
    192. * 批量修改销售状态
    193. */
    194. @RequestMapping(value = "/goods/status/{sellStatus}", method = RequestMethod.PUT)
    195. @ResponseBody
    196. public Result delete(@RequestBody Long[] ids, @PathVariable("sellStatus") int sellStatus) {
    197. if (ids.length < 1) {
    198. return ResultGenerator.genFailResult("参数异常!");
    199. }
    200. if (sellStatus != Constants.SELL_STATUS_UP && sellStatus != Constants.SELL_STATUS_DOWN) {
    201. return ResultGenerator.genFailResult("状态异常!");
    202. }
    203. if (goodsService.batchUpdateSellStatus(ids, sellStatus)) {
    204. return ResultGenerator.genSuccessResult();
    205. } else {
    206. return ResultGenerator.genFailResult("修改失败");
    207. }
    208. }
    209. }

     

  • 相关阅读:
    Vite 配置 Eslint 规范代码
    zlMediaKit 7 utils模块--ringbuffer&&发布订阅&&
    开运算闭运算
    使用新版Visual Studio编译老项目部分报错处理
    聚观早报 | OPPO Find N3首发;AI带来新红利
    水牛社软件适合网络新手吗?说说我的看法
    JVM内存模型(面试题)
    Oracle 学习之 DML 语句
    第二证券|汽车板块现涨停潮!多只地产债再涨到临停
    Eureka快速入门
  • 原文地址:https://blog.csdn.net/weixin_46437112/article/details/128176634