SpringBoot+Vue项目社区团购系统

网友投稿 328 2022-09-03

SpringBoot+Vue项目社区团购系统

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

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

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

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

系统展示

前台

商品信息

个人中心

管理员功能

登录

首页

用户管理

商品分类管理

商品信息管理

系统管理

部分核心代码

# Tomcatserver: tomcat: uri-encoding: UTF-8 port: 8080 servlet: context-path: /springbootf63odspring: datasource: driverClassName: com.mysql.jdbc.Driver url: jdbc:mysql://127.0.0.1:3306/springbootf63od?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimeznotallow=true&useLegacyDatetimeCode=false&serverTimeznotallow=GMT%2B8 username: root password:# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootf63od# username: sa# password: 123456 servlet: multipart: max-file-size: 300MB max-request-size: 300MB resources: static-locations: classpath:static/,file:static/#mybatismybatis-plus: mapper-locations: classpath*:mapper/*.xml #实体扫描,多个package用逗号或者分号分隔 typeAliasesPackage: com.entity global-config: #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; id-type: 1 #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" field-strategy: 1 #驼峰下划线转换 db-column-underline: true #刷新mapper 调试神器 refresh-mapper: true #逻辑删除配置 logic-delete-value: -1 logic-not-delete-value: 0 #自定义SQL注入器 sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector configuration: map-underscore-to-camel-case: true cache-enabled: false call-setters-on-nulls: true #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other) jdbc-type-for-null: 'null'

/** * 商品信息 * 后端接口 * @author * @email * @date 2022-05-03 22:35:02 */@RestController@RequestMapping("/shangpinxinxi")public class ShangpinxinxiController { @Autowired private ShangpinxinxiService shangpinxinxiService; @Autowired private StoreupService storeupService; /** * 后端列表 */ @RequestMapping("/page") public R page(@RequestParam Map params,ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request){ EntityWrapper ew = new EntityWrapper(); PageUtils page = shangpinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shangpinxinxi), params), params)); return R.ok().put("data", page); } /** * 前端列表 */ @IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map params,ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request){ EntityWrapper ew = new EntityWrapper(); PageUtils page = shangpinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shangpinxinxi), params), params)); return R.ok().put("data", page); } /** * 列表 */ @RequestMapping("/lists") public R list( ShangpinxinxiEntity shangpinxinxi){ EntityWrapper ew = new EntityWrapper(); ew.allEq(MPUtil.allEQMapPre( shangpinxinxi, "shangpinxinxi")); return R.ok().put("data", shangpinxinxiService.selectListView(ew)); } /** * 查询 */ @RequestMapping("/query") public R query(ShangpinxinxiEntity shangpinxinxi){ EntityWrapper< ShangpinxinxiEntity> ew = new EntityWrapper< ShangpinxinxiEntity>(); ew.allEq(MPUtil.allEQMapPre( shangpinxinxi, "shangpinxinxi")); ShangpinxinxiView shangpinxinxiView = shangpinxinxiService.selectView(ew); return R.ok("查询商品信息成功").put("data", shangpinxinxiView); } /** * 后端详情 */ @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ ShangpinxinxiEntity shangpinxinxi = shangpinxinxiService.selectById(id); shangpinxinxi.setClicknum(shangpinxinxi.getClicknum()+1); shangpinxinxi.setClicktime(new Date()); shangpinxinxiService.updateById(shangpinxinxi); return R.ok().put("data", shangpinxinxi); } /** * 前端详情 */ @IgnoreAuth @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ ShangpinxinxiEntity shangpinxinxi = shangpinxinxiService.selectById(id); shangpinxinxi.setClicknum(shangpinxinxi.getClicknum()+1); shangpinxinxi.setClicktime(new Date()); shangpinxinxiService.updateById(shangpinxinxi); return R.ok().put("data", shangpinxinxi); } /** * 后端保存 */ @RequestMapping("/save") public R save(@RequestBody ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request){ shangpinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(shangpinxinxi); shangpinxinxiService.insert(shangpinxinxi); return R.ok(); } /** * 前端保存 */ @RequestMapping("/add") public R add(@RequestBody ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request){ shangpinxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(shangpinxinxi); shangpinxinxiService.insert(shangpinxinxi); return R.ok(); } /** * 修改 */ @RequestMapping("/update") @Transactional public R update(@RequestBody ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request){ //ValidatorUtils.validateEntity(shangpinxinxi); shangpinxinxiService.updateById(shangpinxinxi);//全部更新 return R.ok(); } /** * 删除 */ @RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ shangpinxinxiService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } /** * 提醒接口 */ @RequestMapping("/remind/{columnName}/{type}") public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map map) { map.put("column", columnName); map.put("type", type); if(type.equals("2")) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar c = Calendar.getInstance(); Date remindStartDate = null; Date remindEndDate = null; if(map.get("remindstart")!=null) { Integer remindStart = Integer.parseInt(map.get("remindstart").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart); remindStartDate = c.getTime(); map.put("remindstart", sdf.format(remindStartDate)); } if(map.get("remindend")!=null) { Integer remindEnd = Integer.parseInt(map.get("remindend").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindEnd); remindEndDate = c.getTime(); map.put("remindend", sdf.format(remindEndDate)); } } Wrapper wrapper = new EntityWrapper(); if(map.get("remindstart")!=null) { wrapper.ge(columnName, map.get("remindstart")); } if(map.get("remindend")!=null) { wrapper.le(columnName, map.get("remindend")); } int count = shangpinxinxiService.selectCount(wrapper); return R.ok().put("count", count); } /** * 前端智能排序 */ @IgnoreAuth @RequestMapping("/autoSort") public R autoSort(@RequestParam Map params,ShangpinxinxiEntity shangpinxinxi, HttpServletRequest request,String pre){ EntityWrapper ew = new EntityWrapper(); Map newMap = new HashMap(); Map param = new HashMap(); Iterator> it = param.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = it.next(); String key = entry.getKey(); String newKey = entry.getKey(); if (pre.endsWith(".")) { newMap.put(pre + newKey, entry.getValue()); } else if (StringUtils.isEmpty(pre)) { newMap.put(newKey, entry.getValue()); } else { newMap.put(pre + "." + newKey, entry.getValue()); } } params.put("sort", "clicknum"); params.put("order", "desc"); PageUtils page = shangpinxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shangpinxinxi), params), params)); return R.ok().put("data", page); }}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:行业强监管背景下,网红品牌敷尔佳靠营销驱动能走多远?
下一篇:【kafka源码】TopicCommand之alter源码解析(分区扩容)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~