springboot(ssm交通管理在线服务系统 交通管理平台 Java系统

springboot(ssm交通管理在线服务系统 交通管理平台 Java系统

开发语言:Java

框架:ssm/springboot + vue

JDK版本:JDK1.8(或11)

服务器:tomcat

数据库:mysql 5.7(或8.0)

数据库工具:Navicat

开发软件:eclipse//idea

依赖管理包:Maven

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

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

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

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.format.annotation.DateTimeFormat;
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.NewsEntity;
import com.entity.view.NewsView;import com.service.NewsService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;/*** 后端接口* @author * @email * @date 2023-03-25 14:13:13*/
@RestController
@RequestMapping("/news")
public class NewsController {@Autowiredprivate NewsService newsService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,NewsEntity news,HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,NewsEntity news, HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( NewsEntity news){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news")); return R.ok().put("data", newsService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(NewsEntity news){EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news")); NewsView newsView =  newsService.selectView(ew);return R.ok("查询食堂资讯成功").put("data", newsView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody NewsEntity news, HttpServletRequest request){//ValidatorUtils.validateEntity(news);newsService.updateById(news);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){newsService.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<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = newsService.selectCount(wrapper);return R.ok().put("count", count);}}

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

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

相关文章

AUTOSAR从入门到精通-可变速率 CAN 总线控制器设计与实现

目录 前言 研究现状 2通信协议及产品特性研究 2.1总线概述 2.2通信协议研究

【资源分享】免费好用的API接口汇总

IP归属地-IPv4城市级&#xff1a;根据IP地址查询归属地信息&#xff0c;支持到城市级&#xff0c;包含国家、省、市、和运营商等信息。IP归属地-IPv6城市级&#xff1a;根据IP地址&#xff08;IPv6版本&#xff09;查询归属地信息&#xff0c;支持到中国大陆地区&#xff08;不…

1317:【例5.2】组合的输出

1317&#xff1a;【例5.2】组合的输出 时间限制: 1000 ms 内存限制: 65536 KB 【题目描述】 排列与组合是常用的数学方法&#xff0c;其中组合就是从n个元素中抽出r个元素(不分顺序且r≤n)&#xff0c;我们可以简单地将n个元素理解为自然数1&#xff0c;2&#xff0c;…&#…

基于ssm食用菌菌棒溯源系统的开发与设计论文

食用菌菌棒溯源系统 摘要 随着信息互联网购物的飞速发展&#xff0c;一般企业都去创建属于自己的管理系统。本文介绍了食用菌菌棒溯源系统的开发全过程。通过分析企业对于食用菌菌棒溯源系统的需求&#xff0c;创建了一个计算机管理食用菌菌棒溯源系统的方案。文章介绍了食用菌…

深入理解Mysql MHA高可用集群搭建:从实验到实战

1. 简介 MHA&#xff08;Master High Availability&#xff09;是一个高效的开源MySQL高可用性解决方案。由日本开发者yoshinorim&#xff08;前DeNA员工&#xff0c;现在Facebook&#xff09;创建&#xff0c;MHA支持MySQL的主从复制架构&#xff0c;自动化主节点故障转移。当…

<JavaEE> TCP 的通信机制(五) -- 延时应答、捎带应答、面向字节流

目录 TCP的通信机制的核心特性 七、延时应答 1&#xff09;什么是延时应答&#xff1f; 2&#xff09;延时应答的作用 八、捎带应答 1&#xff09;什么是捎带应答&#xff1f; 2&#xff09;捎带应答的作用 九、面向字节流 1&#xff09;沾包问题 2&#xff09;“沾包…

Go配置镜像源

1. 简介 GOPROXY是一个加速Go语言包下载和更新的工具。它通过镜像源的方式&#xff0c;帮助开发者快速获取Go语言包&#xff0c;提高开发效率。GOPROXY的使用非常简单&#xff0c;只需在终端中设置其地址&#xff0c;然后使用go get、go mod等命令即可享受更快的下载速度。对于…

帕金森病的病因是什么?

帕金森病是一种常见的神经系统变性疾病&#xff0c;其确切的病因尚未完全明了&#xff0c;但可以确定的是&#xff0c;它是多种因素共同作用的结果。下面将从多个方面详细介绍帕金森病的病因。 首先&#xff0c;年龄老化是帕金森病发病最主要的因素之一。随着年龄的增长&#…

node实现对git仓库的管理

一、项目背景 一份代码&#xff0c;发布多个小程序。想让技术支持部通过脚本自己获取代码&#xff0c;并通过脚本自动提交到客户的小程序后台。他们自行发布。 现已注册第三方平台&#xff0c;开发人员通过“开发小程序”上传模板。开发人员把代码上传到模板&#xff0c;支持…

JavaSE基础50题:28.(数组练习)冒泡排序

概述 给定一个整型数组&#xff0c;实现冒泡排序。 如&#xff1a;给一组数组{5&#xff0c;10&#xff0c;8&#xff0c;3&#xff0c;7}进行冒泡排序。 j一直往下走&#xff0c;和下一个数字进行比较&#xff0c;如果当前数字大于下一个数字&#xff0c;则两个数字交换&…

【Java干货教程】JSON,JSONObject,JSONArray类详解

一、定义 JSON&#xff1a;就是一种轻量级的数据交换格式&#xff0c;被广泛应用于WEB应用程序开发。JSON的简洁和清晰的层次结构&#xff0c;易于阅读和编写&#xff1b;同时也易于机器解析和生成&#xff0c;有效的提升网络传输效率&#xff1b;支持多种语言&#xff0c;很多…

ERROR: No matching distribution found for torch==2.0.1解决方案

大家好&#xff0c;我是水滴~~ 本文主要介绍在安装 stable-diffusion-webui 时出现的 ERROR: No matching distribution found for torch2.0.1 问题的解决方案&#xff0c;希望能对你有所帮助。 《Python入门核心技术》专栏总目录・点这里 文章目录 问题描述解决方案离线安装 …

Mysql相关面试题及答案

1、什么是MySQL&#xff1f; MySQL是一个开源的关系型数据库管理系统&#xff08;RDBMS&#xff09;&#xff0c;它基于SQL&#xff08;Structured Query Language&#xff0c;结构化查询语言&#xff09;进行操作。MySQL是最流行的数据库系统之一&#xff0c;特别是对于Web应…

对于高速链路,需要考虑 TVS 管结电容的要求

TVS管,即瞬态电压抑制器,是一种用于保护电路免受瞬态过电压损害的半导体器件。在高速链路(如USB、HDMI、以太网等)中,TVS管被广泛用于抑制外部电涌、静电放电(ESD)等引起的瞬态电压,以保护敏感的电子组件。 TVS管的结电容:是在TVS管的PN结上形成的固有电容…

前端通过增加XHR钩子来全局增加header

引言 前端通过修改 XHR 原型来全局增加 header 是采用 XMLHttpRequest 加 hook 方式实现一个简单业务场景。这样可以提高代码的可维护性和可扩展性&#xff0c;减少重复代码的编写。 比如&#xff0c;在用户登录后&#xff0c;后端返回了一个 token&#xff0c;前端需要在发送…

PostgreSQL 数据库归档最近被问及的问题问题 与 4 毋 处世学

开头还是介绍一下群&#xff0c;如果感兴趣PolarDB ,MongoDB ,MySQL ,PostgreSQL ,Redis, Oceanbase, Sql Server等有问题&#xff0c;有需求都可以加群群内&#xff0c;可以解决你的问题。加群请联系 liuaustin3 &#xff0c;&#xff08;共1790人左右 1 2 3 4 5&#xff0…

小型企业成为网络犯罪分子获取数据的目标

在过去十年的大部分时间里&#xff0c;网络犯罪的巨额资金来自针对大型组织的勒索软件攻击。这种威胁仍然存在。但犯罪分子可能会将注意力转向中小企业 (SMB)。这对消费者的影响将是巨大的。 将软件即服务 (SaaS) 技术用于核心业务功能继续将中小企业整合到全球供应链中。由于…

优雅的处理tkMapper批量插入、分批次插入

Springboot框架下tkMapper想实现批量插入&#xff0c;一般是需要自定义BaseMapper来继承InsertListMapper tkmapper提供的有两个insertList方法&#xff0c; 一个支持主键自动生成 tk.mybatis.mapper.additional.insert 一个不支持主键生成 tk.mybatis.mapper.common.specia…

Linux期末考试复习

gcc编译 案例.c源代码-E预处理后.i文件gcc -E test.c -o test.i-S编译后.s文件gcc -S test.i -o test.s-c汇编.o文件 库文件gcc -c test.s -o test.o-I 链接后目标文件 gcc 不使用 –E、–S 和 –c选项&#xff0c;则会依次自动执行预处理、编译和汇编。 头文件#include <…

Java内存溢出如何解决,Java oom排查方法,10个定位解决办法

引言 在Java开发过程中&#xff0c;有效的内存管理是保证应用程序稳定性和性能的关键。不正确的内存使用可能导致内存泄露甚至是致命的OutOfMemoryError&#xff08;OOM&#xff09;。为了避免这些问题&#xff0c;本文将分享10个关于Java内存管理的实用技巧。 正文 1、使用…