• SpringBoot+Vue+Element-UI实现鞋类秒杀商城


    文末获取源码

    开发语言:Java

    框架:springboot

    JDK版本:JDK1.8

    服务器:tomcat7

    数据库:mysql 5.7/8.0

    数据库工具:Navicat11

    开发软件:eclipse/myeclipse/idea

    Maven包:Maven3.3.9

    浏览器:谷歌浏览器

    前言介绍 

    系统管理也都将通过计算机进行整体智能化操作,对于鞋类秒杀商城所牵扯的管理及数据保存都是非常多的,例如管理员;首页、个人中心、用户管理、鞋类商品管理、鞋子分类管理、系统管理、订单管理。用户;首页、个人中心、我的收藏管理。前台首页;首页、鞋类商品、活动公告、个人中心、后台管理、购物车、在线咨询等,这给管理者的工作带来了巨大的挑战,面对大量的信息,传统的管理系统,都是通过笔记的方式进行详细信息的统计,后来出现电脑,通过电脑输入软件将纸质的信息统计到电脑上,这种方式比较传统,而且想要统计数据信息比较麻烦,还受时间和空间的影响,所以为此开发了鞋类秒杀商城;为用户提供了方便管理平台,方便管理员查看及维护,并且可以通过需求进行内容的编辑及维护等;对于用户而言,可以随时进行查看球鞋竞拍信息,管理员可以足不出户就可以获取到系统的数据信息等,而且还能节省用户很多时间,所以开发鞋类秒杀商城给管理者带来了很大的方便,同时也方便管理员对用户信息进行处理。

    本论文鞋类秒杀商城主要牵扯到的程序,数据库与计算机技术等。覆盖知识面大,可以大大的提高系统人员工作效率。

    项目设计目标与原则

    1、关于网上球鞋竞拍系统的基本要求

    1)功能要求:可以管理首页、个人中心、用户管理、鞋类商品管理、鞋子分类管理、系统管理、订单管理等功能模块。

    2)性能:在不同操作系统上均能无差错实现在不同类型的用户登入相应界面后能不出差错、方便地进行预期操作。

    3)安全与保密要求:用户都必须通过管理员审核才能进入系统。

    4)环境要求:支持Windows系列、Vista系统等多种操作系统使用。

    2、开发目标

    网上球鞋竞拍系统的主要开发目标如下:

    1)实现管理系统信息关系的系统化、规范化和自动化;

    2)减少维护人员的工作量以及实现用户对信息的控制和管理;

    3)方便查询信息及管理信息等;

    4)通过网络操作,提高改善处理问题和操作人员工作的效率;

    5)考虑到用户多样性特点,要求界面和操作简便易懂。

    3、设计原则

    网上球鞋竞拍系统采用SSM技术,Mysql数据库开发,充分保证了系统稳定性、完整性。

    网上球鞋竞拍系统的设计与实现的设计思想如下:

    1、操作简单方便、系统界面安全良好、简单明了的页面布局、方便查询管理相关信息。

    2、即时可见:对网上球鞋竞拍系统信息的处理将立马在对应地点可以查询到,从而实现“即时发布、即时见效”的系统功能。

    3、功能的完善性:可以管理管理员;首页、个人中心、用户管理、鞋类商品管理、鞋子分类管理、系统管理、订单管理,

    用户;首页、个人中心、我的收藏管理,

    前台首页;首页、鞋类商品、活动公告、个人中心、后台管理、购物车、在线咨询的修改维护操作。

    系统展示 

    首页

    鞋类商品 

    个人中心

     

    管理员页面 

    用户管理

    鞋类商品管理

    部分核心代码

    鞋类商品

    1. **
    2. * 鞋类商品
    3. * 后端接口
    4. * @author
    5. * @email
    6. * @date 2021-04-19 16:54:47
    7. */
    8. @RestController
    9. @RequestMapping("/xieleishangpin")
    10. public class XieleishangpinController {
    11. @Autowired
    12. private XieleishangpinService xieleishangpinService;
    13. /**
    14. * 后端列表
    15. */
    16. @RequestMapping("/page")
    17. public R page(@RequestParam Map<String, Object> params,XieleishangpinEntity xieleishangpin,
    18. HttpServletRequest request){
    19. EntityWrapper<XieleishangpinEntity> ew = new EntityWrapper<XieleishangpinEntity>();
    20. PageUtils page = xieleishangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xieleishangpin), params), params));
    21. return R.ok().put("data", page);
    22. }
    23. /**
    24. * 前端列表
    25. */
    26. @IgnoreAuth
    27. @RequestMapping("/list")
    28. public R list(@RequestParam Map<String, Object> params,XieleishangpinEntity xieleishangpin, HttpServletRequest request){
    29. EntityWrapper<XieleishangpinEntity> ew = new EntityWrapper<XieleishangpinEntity>();
    30. PageUtils page = xieleishangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xieleishangpin), params), params));
    31. return R.ok().put("data", page);
    32. }
    33. /**
    34. * 列表
    35. */
    36. @RequestMapping("/lists")
    37. public R list( XieleishangpinEntity xieleishangpin){
    38. EntityWrapper<XieleishangpinEntity> ew = new EntityWrapper<XieleishangpinEntity>();
    39. ew.allEq(MPUtil.allEQMapPre( xieleishangpin, "xieleishangpin"));
    40. return R.ok().put("data", xieleishangpinService.selectListView(ew));
    41. }
    42. /**
    43. * 查询
    44. */
    45. @RequestMapping("/query")
    46. public R query(XieleishangpinEntity xieleishangpin){
    47. EntityWrapper< XieleishangpinEntity> ew = new EntityWrapper< XieleishangpinEntity>();
    48. ew.allEq(MPUtil.allEQMapPre( xieleishangpin, "xieleishangpin"));
    49. XieleishangpinView xieleishangpinView = xieleishangpinService.selectView(ew);
    50. return R.ok("查询鞋类商品成功").put("data", xieleishangpinView);
    51. }
    52. /**
    53. * 后端详情
    54. */
    55. @RequestMapping("/info/{id}")
    56. public R info(@PathVariable("id") Long id){
    57. XieleishangpinEntity xieleishangpin = xieleishangpinService.selectById(id);
    58. xieleishangpin.setClicknum(xieleishangpin.getClicknum()+1);
    59. xieleishangpin.setClicktime(new Date());
    60. xieleishangpinService.updateById(xieleishangpin);
    61. return R.ok().put("data", xieleishangpin);
    62. }
    63. /**
    64. * 前端详情
    65. */
    66. @IgnoreAuth
    67. @RequestMapping("/detail/{id}")
    68. public R detail(@PathVariable("id") Long id){
    69. XieleishangpinEntity xieleishangpin = xieleishangpinService.selectById(id);
    70. xieleishangpin.setClicknum(xieleishangpin.getClicknum()+1);
    71. xieleishangpin.setClicktime(new Date());
    72. xieleishangpinService.updateById(xieleishangpin);
    73. return R.ok().put("data", xieleishangpin);
    74. }
    75. /**
    76. * 后端保存
    77. */
    78. @RequestMapping("/save")
    79. public R save(@RequestBody XieleishangpinEntity xieleishangpin, HttpServletRequest request){
    80. xieleishangpin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    81. //ValidatorUtils.validateEntity(xieleishangpin);
    82. xieleishangpinService.insert(xieleishangpin);
    83. return R.ok();
    84. }
    85. /**
    86. * 前端保存
    87. */
    88. @RequestMapping("/add")
    89. public R add(@RequestBody XieleishangpinEntity xieleishangpin, HttpServletRequest request){
    90. xieleishangpin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    91. //ValidatorUtils.validateEntity(xieleishangpin);
    92. xieleishangpinService.insert(xieleishangpin);
    93. return R.ok();
    94. }
    95. /**
    96. * 修改
    97. */
    98. @RequestMapping("/update")
    99. public R update(@RequestBody XieleishangpinEntity xieleishangpin, HttpServletRequest request){
    100. //ValidatorUtils.validateEntity(xieleishangpin);
    101. xieleishangpinService.updateById(xieleishangpin);//全部更新
    102. return R.ok();
    103. }
    104. /**
    105. * 删除
    106. */
    107. @RequestMapping("/delete")
    108. public R delete(@RequestBody Long[] ids){
    109. xieleishangpinService.deleteBatchIds(Arrays.asList(ids));
    110. return R.ok();
    111. }
    112. /**
    113. * 提醒接口
    114. */
    115. @RequestMapping("/remind/{columnName}/{type}")
    116. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
    117. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    118. map.put("column", columnName);
    119. map.put("type", type);
    120. if(type.equals("2")) {
    121. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    122. Calendar c = Calendar.getInstance();
    123. Date remindStartDate = null;
    124. Date remindEndDate = null;
    125. if(map.get("remindstart")!=null) {
    126. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    127. c.setTime(new Date());
    128. c.add(Calendar.DAY_OF_MONTH,remindStart);
    129. remindStartDate = c.getTime();
    130. map.put("remindstart", sdf.format(remindStartDate));
    131. }
    132. if(map.get("remindend")!=null) {
    133. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    134. c.setTime(new Date());
    135. c.add(Calendar.DAY_OF_MONTH,remindEnd);
    136. remindEndDate = c.getTime();
    137. map.put("remindend", sdf.format(remindEndDate));
    138. }
    139. }
    140. Wrapper<XieleishangpinEntity> wrapper = new EntityWrapper<XieleishangpinEntity>();
    141. if(map.get("remindstart")!=null) {
    142. wrapper.ge(columnName, map.get("remindstart"));
    143. }
    144. if(map.get("remindend")!=null) {
    145. wrapper.le(columnName, map.get("remindend"));
    146. }
    147. int count = xieleishangpinService.selectCount(wrapper);
    148. return R.ok().put("count", count);
    149. }
    150. /**
    151. * 前端智能排序
    152. */
    153. @IgnoreAuth
    154. @RequestMapping("/autoSort")
    155. public R autoSort(@RequestParam Map<String, Object> params,XieleishangpinEntity xieleishangpin, HttpServletRequest request,String pre){
    156. EntityWrapper<XieleishangpinEntity> ew = new EntityWrapper<XieleishangpinEntity>();
    157. Map<String, Object> newMap = new HashMap<String, Object>();
    158. Map<String, Object> param = new HashMap<String, Object>();
    159. Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
    160. while (it.hasNext()) {
    161. Map.Entry<String, Object> entry = it.next();
    162. String key = entry.getKey();
    163. String newKey = entry.getKey();
    164. if (pre.endsWith(".")) {
    165. newMap.put(pre + newKey, entry.getValue());
    166. } else if (StringUtils.isEmpty(pre)) {
    167. newMap.put(newKey, entry.getValue());
    168. } else {
    169. newMap.put(pre + "." + newKey, entry.getValue());
    170. }
    171. }
    172. params.put("sort", "clicknum");
    173. params.put("order", "desc");
    174. PageUtils page = xieleishangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xieleishangpin), params), params));
    175. return R.ok().put("data", page);
    176. }
    177. }

     上传文件

    1. @RestController
    2. @RequestMapping("file")
    3. @SuppressWarnings({"unchecked","rawtypes"})
    4. public class FileController{
    5. @Autowired
    6. private ConfigService configService;
    7. /**
    8. * 上传文件
    9. */
    10. @RequestMapping("/upload")
    11. public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
    12. if (file.isEmpty()) {
    13. throw new EIException("上传文件不能为空");
    14. }
    15. String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
    16. File path = new File(ResourceUtils.getURL("classpath:static").getPath());
    17. if(!path.exists()) {
    18. path = new File("");
    19. }
    20. File upload = new File(path.getAbsolutePath(),"/upload/");
    21. if(!upload.exists()) {
    22. upload.mkdirs();
    23. }
    24. String fileName = new Date().getTime()+"."+fileExt;
    25. File dest = new File(upload.getAbsolutePath()+"/"+fileName);
    26. file.transferTo(dest);
    27. if(StringUtils.isNotBlank(type) && type.equals("1")) {
    28. ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
    29. if(configEntity==null) {
    30. configEntity = new ConfigEntity();
    31. configEntity.setName("faceFile");
    32. configEntity.setValue(fileName);
    33. } else {
    34. configEntity.setValue(fileName);
    35. }
    36. configService.insertOrUpdate(configEntity);
    37. }
    38. return R.ok().put("file", fileName);
    39. }
    40. /**
    41. * 下载文件
    42. */
    43. @IgnoreAuth
    44. @RequestMapping("/download")
    45. public ResponseEntity<byte[]> download(@RequestParam String fileName) {
    46. try {
    47. File path = new File(ResourceUtils.getURL("classpath:static").getPath());
    48. if(!path.exists()) {
    49. path = new File("");
    50. }
    51. File upload = new File(path.getAbsolutePath(),"/upload/");
    52. if(!upload.exists()) {
    53. upload.mkdirs();
    54. }
    55. File file = new File(upload.getAbsolutePath()+"/"+fileName);
    56. if(file.exists()){
    57. /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
    58. getResponse().sendError(403);
    59. }*/
    60. HttpHeaders headers = new HttpHeaders();
    61. headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
    62. headers.setContentDispositionFormData("attachment", fileName);
    63. return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
    64. }
    65. } catch (IOException e) {
    66. e.printStackTrace();
    67. }
    68. return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
    69. }
    70. }

  • 相关阅读:
    拓世科技集团打造数字人营销解决方案,为车企提供新的“增长担当”
    数据仓库(6)数仓分层设计
    算法笔记-lc-788. 旋转数字(中等)
    去除pdf/word的水印艺术字
    学习软件测试需要注意的几点
    Centos 8升级到 Centos Stream
    SQL教程之 了解 SQL EXISTS 子句,当你应该考虑使用它时
    【前端】HTML
    JSON结构示例
    Patroni的执行流
  • 原文地址:https://blog.csdn.net/m0_49113107/article/details/126625773