ssm+vue中国咖啡文化宣传网站源码和论文

ssm+vue中国咖啡文化宣传网站源码和论文078

 开发工具:idea 
 数据库mysql5.7+
 数据库链接工具:navcat,小海豚等
  技术:ssm

课题背景

随着时代的发展和人们生活理念的进一步改变,咖啡业已经成为了全球经济中发展最迅猛的产业之一。咖啡业在城市经济发展中的产品位置、经济作用逐渐加强,大量出现的咖啡网站正成为城市文明进步、经济增长的亮点,带动了咖啡消费量的增加,形成巨大消费潜在市场。

尼尔森研究显示:中国咖啡消费市场10年的高速增长,而且每年市场增长速度为15%以上,在全世界实属罕见,而国际发达国家市场每年增长速度仅为2 -3%。有关专家预计,2030年之前,中国咖啡消费市场可能会到2~3万亿元人民币,成熟的中国咖啡消费市场,应该会在3~4万亿元人民币。同时,二三线城市咖啡消费量不断增加,所占的市场分额也不断增加,将成为中国咖啡市场及未来20年的核心推动市场。

package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.YonghuEntity;
import com.entity.view.YonghuView;import com.service.YonghuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;/*** 用户* 后端接口* @author * @email * @date 2021-03-09 12:43:16*/
@RestController
@RequestMapping("/yonghu")
public class YonghuController {@Autowiredprivate YonghuService yonghuService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("zhanghao", username));if(user==null || !user.getMima().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(), username,"yonghu",  "用户" );return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@RequestMapping("/register")public R register(@RequestBody YonghuEntity yonghu){//ValidatorUtils.validateEntity(yonghu);YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("zhanghao", yonghu.getZhanghao()));if(user!=null) {return R.error("注册用户已存在");}Long uId = new Date().getTime();yonghu.setId(uId);yonghuService.insert(yonghu);return R.ok();}/*** 退出*/@RequestMapping("/logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");YonghuEntity user = yonghuService.selectById(id);return R.ok().put("data", user);}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("zhanghao", username));if(user==null) {return R.error("账号不存在");}user.setMima("123456");yonghuService.updateById(user);return R.ok("密码已重置为:123456");}/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,YonghuEntity yonghu, HttpServletRequest request){EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params));return R.ok().put("data", page);}/*** 前端列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,YonghuEntity yonghu, HttpServletRequest request){EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( YonghuEntity yonghu){EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();ew.allEq(MPUtil.allEQMapPre( yonghu, "yonghu")); return R.ok().put("data", yonghuService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(YonghuEntity yonghu){EntityWrapper< YonghuEntity> ew = new EntityWrapper< YonghuEntity>();ew.allEq(MPUtil.allEQMapPre( yonghu, "yonghu")); YonghuView yonghuView =  yonghuService.selectView(ew);return R.ok("查询用户成功").put("data", yonghuView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){YonghuEntity yonghu = yonghuService.selectById(id);return R.ok().put("data", yonghu);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){YonghuEntity yonghu = yonghuService.selectById(id);return R.ok().put("data", yonghu);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){yonghu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(yonghu);YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("zhanghao", yonghu.getZhanghao()));if(user!=null) {return R.error("用户已存在");}yonghu.setId(new Date().getTime());yonghuService.insert(yonghu);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){yonghu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(yonghu);YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("zhanghao", yonghu.getZhanghao()));if(user!=null) {return R.error("用户已存在");}yonghu.setId(new Date().getTime());yonghuService.insert(yonghu);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request){//ValidatorUtils.validateEntity(yonghu);yonghuService.updateById(yonghu);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){yonghuService.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<String, Object> 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<YonghuEntity> wrapper = new EntityWrapper<YonghuEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = yonghuService.selectCount(wrapper);return R.ok().put("count", count);}}

 

package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.AddressEntity;
import com.entity.view.AddressView;import com.service.AddressService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;/*** 地址* 后端接口* @author * @email * @date 2021-03-09 12:43:16*/
@RestController
@RequestMapping("/address")
public class AddressController {@Autowiredprivate AddressService addressService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,AddressEntity address, HttpServletRequest request){if(!request.getSession().getAttribute("role").toString().equals("管理员")) {address.setUserid((Long)request.getSession().getAttribute("userId"));}EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));return R.ok().put("data", page);}/*** 前端列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,AddressEntity address, HttpServletRequest request){if(!request.getSession().getAttribute("role").toString().equals("管理员")) {address.setUserid((Long)request.getSession().getAttribute("userId"));}EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( AddressEntity address){EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();ew.allEq(MPUtil.allEQMapPre( address, "address")); return R.ok().put("data", addressService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(AddressEntity address){EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();ew.allEq(MPUtil.allEQMapPre( address, "address")); AddressView addressView =  addressService.selectView(ew);return R.ok("查询地址成功").put("data", addressView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){AddressEntity address = addressService.selectById(id);return R.ok().put("data", address);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){AddressEntity address = addressService.selectById(id);return R.ok().put("data", address);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody AddressEntity address, HttpServletRequest request){address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(address);address.setUserid((Long)request.getSession().getAttribute("userId"));Long userId = (Long)request.getSession().getAttribute("userId");if(address.getIsdefault().equals("是")) {addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));}address.setUserid(userId);addressService.insert(address);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody AddressEntity address, HttpServletRequest request){address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(address);address.setUserid((Long)request.getSession().getAttribute("userId"));Long userId = (Long)request.getSession().getAttribute("userId");if(address.getIsdefault().equals("是")) {addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));}address.setUserid(userId);addressService.insert(address);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody AddressEntity address, HttpServletRequest request){//ValidatorUtils.validateEntity(address);if(address.getIsdefault().equals("是")) {addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));}addressService.updateById(address);//全部更新return R.ok();}/*** 获取默认地址*/@RequestMapping("/default")public R defaultAddress(HttpServletRequest request){Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));AddressEntity address = addressService.selectOne(wrapper);return R.ok().put("data", address);}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){addressService.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<String, Object> 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<AddressEntity> wrapper = new EntityWrapper<AddressEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}if(!request.getSession().getAttribute("role").toString().equals("管理员")) {wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));}int count = addressService.selectCount(wrapper);return R.ok().put("count", count);}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/110559.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SELinux 入门 pt.2

哈喽大家好&#xff0c;我是咸鱼 在《SELinux 入门 pt.1》中&#xff0c;咸鱼向各位小伙伴介绍了 SELinux 所使用的 MAC 模型、以及几个重要的概念&#xff08;主体、目标、策略、安全上下文&#xff09; 我们还讲到&#xff1a; 对于受 SELinux 管制的进程&#xff0c;会先…

React绑定antd输入框,点击清空或者确定按钮实现清空输入框内容

其实实现原理和vue的双向绑定是一样的&#xff0c;就是监听输入框的onChange事件&#xff0c;绑定value值&#xff0c;当输入框内容发生变化后&#xff0c;就重新设置这个value值。 示例代码&#xff1a;我这里是统一在handleCancel这个函数里面处理清空逻辑了&#xff0c;你们…

手机云控设计思路

本系统为任务分发系统,上游发布任务或者接受其他平台系统分发的任务,对任务进行规则引擎处理后分类,由核心分发系统部分进行对存活的空闲终端进行分发任务,终端做完任务后进行反馈给任务系统. 核心要处理的点是终端存活与空闲的统计、任务平均分布下发给终端的算法,保证分布的…

idea 创建mybatis xml文件时找不到

1、File >Settings 如图 &#xff1a; 2、添加模板&#xff1a;如下图 3、添加xml模板 如下图&#xff1a; 模板内容&#xff1a; <?xml version"1.0" encoding"UTF-8" ?> <!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//E…

13.搬砖

目录 题目 Description Input Output 思路&#xff08;归并排序&#xff09; 具体步骤如下 C整体代码&#xff08;含详细注释&#xff09; 归并排序总结 核心步骤 代码模板 题目 Description 小张在暑假时间来到工地搬砖挣钱。包工头交给他一项艰巨的任务&#xff0…

【进阶篇】MySQL 存储引擎详解

文章目录 0.前言1.基础介绍2.1. InnoDB存储引擎底层原理InnoDB记录存储结构和索引页结构InnoDB记录存储结构&#xff1a;InnoDB索引页结构&#xff1a; 3. MVCC 详解3.1. 版本号分配&#xff1a;3.2. 数据读取&#xff1a;3.3. 数据写入&#xff1a;3.4. 事务隔离级别&#xff…

OpenHarmony设备截屏的5种方式

本文转载自《OpenHarmony设备截屏的5种方式 》&#xff0c;作者westinyang 目录 方式1&#xff1a;系统控制中心方式2&#xff1a;OHScrcpy投屏工具方式3&#xff1a;DevEcoStudio截屏功能方式4&#xff1a;hdc shell snapshot_display方式5&#xff1a;hdc shell wukong持续关…

alpha shapes提取二维点云边界(附python代码)

alpha shapes算法是一种简单、有效的快速提取边界点算法。其克服了点云边界点形状影响的缺点,可快速准确提取边界点,其原理如下: 如下图所示,对于任意形状的平面点云,若一个半径为a的圆,绕其进行滚动。若滚动圆半径a足够小时,则点云中每一点均为边界点;若适当增大到一…

linux内网yum源服务器搭建

1.nginx: location / {root /usr/local/Kylin-Server-V10-SP3-General-Release-2303-X86_64;autoindex on;autoindex_localtime on;autoindex_exact_size off; } 注:指定到镜像的包名 2.修改yum源地址 cd /etc/yum.repos.d/vim kylin_x86_64.repo 注: --enabled设置为1 3.重…

java内存分区

按照垃圾收集&#xff0c;将 Java 堆划分为**新生代 &#xff08;Young Generation&#xff09;和老年代&#xff08;Old Generation&#xff09;**两个区域&#xff0c; 新生代存放存活时间短的对象&#xff0c;而每次回收后存活的少量对象&#xff0c;将会逐步晋升到老年代中…

Qt:界面实时响应鼠标拖动绘制

采用双缓冲实现界面实时响应鼠标的拖动绘制。 思想如下&#xff1a;首先需要两张画布pix和tempPix&#xff0c;他们都是QPixmap实例&#xff1b;pix用来保存初始界面或上一阶段以完成的绘制&#xff1b;tempPix用来作为鼠标拖动时的实时界面绘制&#xff1b;当鼠标左键按下后拖…

Ubuntu 22.04.3 LTS 维护更新发布

近日消息&#xff0c;Canonical 今天发布了代号为 Jammy Jellyfish、长期支持的 Ubuntu 22.04 第 3 个维护版本更新&#xff0c;距离上个版本相隔 6 周时间。 Ubuntu 22.04.3 LTS 最大的亮点在于内核升级到 Linux Kernel 6.2&#xff0c;此外 Mesa 图形堆栈也升级到 23.0.4 版…

记一种不错的缓存设计思路

之前与同事讨论接口性能问题时听他介绍了一种缓存设计思路&#xff0c;觉得不错&#xff0c;做个记录供以后参考。 场景 假设有个以下格式的接口&#xff1a; GET /api?keys{key1,key2,key3,...}&types{1,2,3,...} 其中 keys 是业务主键列表&#xff0c;types 是想要取到的…

呈现数据的精妙之道:选择合适的可视化方法

在当今数据时代&#xff0c;数据可视化已成为理解和传达信息的重要手段。然而&#xff0c;选择适合的数据可视化方法对于有效地呈现数据至关重要。不同的数据和目标需要不同的可视化方法&#xff0c;下面我们将探讨如何选择最佳的数据可视化方法来呈现数据。 1. 理解数据类型&a…

构建安全可信、稳定可靠的RISC-V安全体系

安全之安全(security)博客目录导读 2023 RISC-V中国峰会 安全相关议题汇总 说明&#xff1a;本文参考RISC-V 2023中国峰会如下议题&#xff0c;版权归原作者所有。

OpenCV 没有xfeatures2d解决方法

运行程序出现错误——无法打开包括文件: “opencv2/xfeatures2d.hpp”: No such file or directory 参考&#xff1a;博主1,博主2 从该链接下载与opencv版本一致的opencv_contrib&#xff0c;我安装的opencv是3.4.15&#xff0c;下载了opencv_contrib-3.4。 下面代码可以查看…

NetMarvel机器学习促广告收益最大化,加速获客

游戏出海的竞争日益激烈&#xff0c;这并非空穴来风。 从2021年第一季度至2022年第四季度&#xff0c;iOS平台的CPI增长了88%&#xff0c;意味着厂商需要花费近两倍的钱才能获取一个新用户。与此同时数据隐私政策持续收紧&#xff0c;更加提高了营销成本。 在成本高涨的当下&…

替代LT8711龙讯替代RTD2172 CS5265中文规格书4K60HZ转接线 设计Type-C转HDMI2.0高清投屏方案

龙迅LT8711是一款Type-C/DP1.2 to HDMI2.0方案芯片&#xff0c;北京集睿致远&#xff08;ASL&#xff09;推出的CS5265可以完全代替LT8711UX&#xff0c;封装尺寸比LT8711UX小的同时&#xff0c;CS5265的芯片集成度高&#xff0c;内置MCU&#xff0c;内置lLDO等&#xff0c;CS5…

无涯教程-Android - 系统架构

Android操作系统是一堆软件组件&#xff0c;大致分为五个部分和四个主要层&#xff0c;如体系结构图中所示。 Linux内核 底层是Linux-Linux 3.6&#xff0c;带有大约115个补丁&#xff0c;这在设备硬件之间提供了一定程度的抽象&#xff0c;并且包含所有必需的硬件驱动程序&am…

【PLSQL】PLSQL基础

文章目录 一&#xff1a;记录类型1.语法2.代码实例 二&#xff1a;字符转换三&#xff1a;%TYPE和%ROWTYPE1.%TYPE2.%ROWTYPE 四&#xff1a;循环1.LOOP2.WHILE&#xff08;推荐&#xff09;3.数字式循环 五&#xff1a;游标1.游标定义及读取2.游标属性3.NO_DATA_FOUND和%NOTFO…