• SpringBoot+Vue项目社区团购系统


    文末获取源码

    开发语言:Java

    框架:springboot

    JDK版本:JDK1.8

    服务器:tomcat7

    数据库:mysql 5.7/8.0

    数据库工具:Navicat11

    开发软件:eclipse/myeclipse/idea

    Maven包:Maven3.3.9

    浏览器:谷歌浏览器

    系统采用了Java技术,将所有业务模块采用以浏览器交互的模式,选择MySQL作为系统的数据库,开发工具选择 idea来进行系统的设计。基本实现了社区团购系统应有的主要功能模块,本系统有以下功能:

    (1)前台:首页、商品信息、公告信息、个人中心、后台管理、购物车。 

    (2)管理员:首页、个人中心、用户管理、商品分类管理、商品信息管理、系统管理、订单管理。

    (3)用户:首页、个人中心、修改密码、个人信息。

    系统展示

    前台 

    商品信息

    个人中心

    管理员功能

    登录 

    首页 

    用户管理

    商品分类管理

    商品信息管理 

    系统管理 

    部分核心代码

    1. # Tomcat
    2. server:
    3. tomcat:
    4. uri-encoding: UTF-8
    5. port: 8080
    6. servlet:
    7. context-path: /springbootf63od
    8. spring:
    9. datasource:
    10. driverClassName: com.mysql.jdbc.Driver
    11. url: jdbc:mysql://127.0.0.1:3306/springbootf63od?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
    12. username: root
    13. password:
    14. # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
    15. # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootf63od
    16. # username: sa
    17. # password: 123456
    18. servlet:
    19. multipart:
    20. max-file-size: 300MB
    21. max-request-size: 300MB
    22. resources:
    23. static-locations: classpath:static/,file:static/
    24. #mybatis
    25. mybatis-plus:
    26. mapper-locations: classpath*:mapper/*.xml
    27. #实体扫描,多个package用逗号或者分号分隔
    28. typeAliasesPackage: com.entity
    29. global-config:
    30. #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
    31. id-type: 1
    32. #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
    33. field-strategy: 1
    34. #驼峰下划线转换
    35. db-column-underline: true
    36. #刷新mapper 调试神器
    37. refresh-mapper: true
    38. #逻辑删除配置
    39. logic-delete-value: -1
    40. logic-not-delete-value: 0
    41. #自定义SQL注入器
    42. sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
    43. configuration:
    44. map-underscore-to-camel-case: true
    45. cache-enabled: false
    46. call-setters-on-nulls: true
    47. #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other)
    48. jdbc-type-for-null: 'null'

     

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

  • 相关阅读:
    问题:用来表示证券收益的波动性,值越大说明()。 #媒体#经验分享
    MySQL 核心模块揭秘 | 15 期 | 事务模块小结
    IDEA创建一个JavaWeb项目详细步骤
    计算机的分类
    C语言中的常量、变量及关键字
    在二叉树中找到两个节点的最近公共祖先
    matlab bin格式转txt输出
    记一次生产中使用CompletableFuture遇到的坑
    Pod控制器
    JAVA:面向对象++封装+继承【详细】
  • 原文地址:https://blog.csdn.net/m0_49113107/article/details/126178840