当前位置:   article > 正文

springboot/ssm滑雪场管理系统Java滑雪溜冰馆预约管理系统web

springboot/ssm滑雪场管理系统Java滑雪溜冰馆预约管理系统web

springboot/ssm滑雪场管理系统Java滑雪溜冰馆预约管理系统web

基于springboot(可改ssm)+vue项目

开发语言:Java

框架:springboot/可改ssm + vue

JDK版本:JDK1.8(或11)

服务器:tomcat

数据库:mysql 5.7(或8.0)

数据库工具:Navicat/sqlyog

开发软件:eclipse//idea

依赖管理包:Maven

如需了解更多代码细节或修改代码功能界面,本人都能提供技术支持。(声音嘎嘎好听喔!)

祝你早日找到合适的代码哦~

注:主页千套源码&文档,文章最下方获取源码哦

  1. package com.controller;
  2. import java.text.SimpleDateFormat;
  3. import java.util.ArrayList;
  4. import java.util.Arrays;
  5. import java.util.Calendar;
  6. import java.util.Map;
  7. import java.util.HashMap;
  8. import java.util.Iterator;
  9. import java.util.Date;
  10. import java.util.List;
  11. import javax.servlet.http.HttpServletRequest;
  12. import com.utils.ValidatorUtils;
  13. import org.apache.commons.lang3.StringUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.format.annotation.DateTimeFormat;
  16. import org.springframework.web.bind.annotation.PathVariable;
  17. import org.springframework.web.bind.annotation.RequestBody;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RequestParam;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  22. import com.baomidou.mybatisplus.mapper.Wrapper;
  23. import com.annotation.IgnoreAuth;
  24. import com.entity.NewsEntity;
  25. import com.entity.view.NewsView;
  26. import com.service.NewsService;
  27. import com.service.TokenService;
  28. import com.utils.PageUtils;
  29. import com.utils.R;
  30. import com.utils.MD5Util;
  31. import com.utils.MPUtil;
  32. import com.utils.CommonUtil;
  33. import java.io.IOException;
  34. /**
  35. * 后端接口
  36. * @author
  37. * @email
  38. * @date 2023-03-25 14:13:13
  39. */
  40. @RestController
  41. @RequestMapping("/news")
  42. public class NewsController {
  43. @Autowired
  44. private NewsService newsService;
  45. /**
  46. * 后端列表
  47. */
  48. @RequestMapping("/page")
  49. public R page(@RequestParam Map<String, Object> params,NewsEntity news,
  50. HttpServletRequest request){
  51. EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
  52. PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
  53. return R.ok().put("data", page);
  54. }
  55. /**
  56. * 前端列表
  57. */
  58. @IgnoreAuth
  59. @RequestMapping("/list")
  60. public R list(@RequestParam Map<String, Object> params,NewsEntity news,
  61. HttpServletRequest request){
  62. EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
  63. PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
  64. return R.ok().put("data", page);
  65. }
  66. /**
  67. * 列表
  68. */
  69. @RequestMapping("/lists")
  70. public R list( NewsEntity news){
  71. EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
  72. ew.allEq(MPUtil.allEQMapPre( news, "news"));
  73. return R.ok().put("data", newsService.selectListView(ew));
  74. }
  75. /**
  76. * 查询
  77. */
  78. @RequestMapping("/query")
  79. public R query(NewsEntity news){
  80. EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();
  81. ew.allEq(MPUtil.allEQMapPre( news, "news"));
  82. NewsView newsView = newsService.selectView(ew);
  83. return R.ok("查询食堂资讯成功").put("data", newsView);
  84. }
  85. /**
  86. * 后端详情
  87. */
  88. @RequestMapping("/info/{id}")
  89. public R info(@PathVariable("id") Long id){
  90. NewsEntity news = newsService.selectById(id);
  91. return R.ok().put("data", news);
  92. }
  93. /**
  94. * 前端详情
  95. */
  96. @IgnoreAuth
  97. @RequestMapping("/detail/{id}")
  98. public R detail(@PathVariable("id") Long id){
  99. NewsEntity news = newsService.selectById(id);
  100. return R.ok().put("data", news);
  101. }
  102. /**
  103. * 后端保存
  104. */
  105. @RequestMapping("/save")
  106. public R save(@RequestBody NewsEntity news, HttpServletRequest request){
  107. news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
  108. //ValidatorUtils.validateEntity(news);
  109. newsService.insert(news);
  110. return R.ok();
  111. }
  112. /**
  113. * 前端保存
  114. */
  115. @RequestMapping("/add")
  116. public R add(@RequestBody NewsEntity news, HttpServletRequest request){
  117. news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
  118. //ValidatorUtils.validateEntity(news);
  119. newsService.insert(news);
  120. return R.ok();
  121. }
  122. /**
  123. * 修改
  124. */
  125. @RequestMapping("/update")
  126. public R update(@RequestBody NewsEntity news, HttpServletRequest request){
  127. //ValidatorUtils.validateEntity(news);
  128. newsService.updateById(news);//全部更新
  129. return R.ok();
  130. }
  131. /**
  132. * 删除
  133. */
  134. @RequestMapping("/delete")
  135. public R delete(@RequestBody Long[] ids){
  136. newsService.deleteBatchIds(Arrays.asList(ids));
  137. return R.ok();
  138. }
  139. /**
  140. * 提醒接口
  141. */
  142. @RequestMapping("/remind/{columnName}/{type}")
  143. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
  144. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
  145. map.put("column", columnName);
  146. map.put("type", type);
  147. if(type.equals("2")) {
  148. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  149. Calendar c = Calendar.getInstance();
  150. Date remindStartDate = null;
  151. Date remindEndDate = null;
  152. if(map.get("remindstart")!=null) {
  153. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
  154. c.setTime(new Date());
  155. c.add(Calendar.DAY_OF_MONTH,remindStart);
  156. remindStartDate = c.getTime();
  157. map.put("remindstart", sdf.format(remindStartDate));
  158. }
  159. if(map.get("remindend")!=null) {
  160. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
  161. c.setTime(new Date());
  162. c.add(Calendar.DAY_OF_MONTH,remindEnd);
  163. remindEndDate = c.getTime();
  164. map.put("remindend", sdf.format(remindEndDate));
  165. }
  166. }
  167. Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();
  168. if(map.get("remindstart")!=null) {
  169. wrapper.ge(columnName, map.get("remindstart"));
  170. }
  171. if(map.get("remindend")!=null) {
  172. wrapper.le(columnName, map.get("remindend"));
  173. }
  174. int count = newsService.selectCount(wrapper);
  175. return R.ok().put("count", count);
  176. }
  177. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/256817
推荐阅读
相关标签
  

闽ICP备14008679号