springboot农机电招平台源码和论文

2024-01-24 21:04

本文主要是介绍springboot农机电招平台源码和论文,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

随着农机电招行业的不断发展,农机电招在现实生活中的使用和普及,农机电招行业成为近年内出现的一个新行业,并且能够成为大群众广为认可和接受的行为和选择。设计农机电招平台的目的就是借助计算机让复杂的销售操作变简单,变高效。

农机电招平台采用了B/S结构,JAVA作为开发语言,数据库采用了B/S结构,Mysql数据库进行开发。该系统包括前台操作和后台管理两个部分,一方面,为用户提供首页,农机,系统公告,个人中心,后台管理等功能;另一方面,为管理员提供首页,个人中心,农机机主管理,使用者管理,农机类型管理,农机管理,农机预约管理,系统管理等功能。

【关键词】农机电招;JAVA;B/S结构

springboot农机电招平台源码和论文326

演示视频:

springboot农机电招平台源码和论文

Abstract

With the continuous development of the agricultural mechanical and electrical recruitment industry, the use and popularization of agricultural mechanical and electrical recruitment in real life, the agricultural mechanical and electrical recruitment industry has become a new industry that has emerged in recent years, and can become a behavior and choice widely recognized and accepted by the masses. The purpose of designing the agricultural mechanical and electrical recruitment platform is to make complex sales operations simple and efficient with the help of computers.

The agricultural mechanical and electrical recruitment platform adopts the B/S structure, JAVA as the development language, the database adopts the B/S structure, and the Mysql database is developed. The system includes two parts of front-end operation and background management, on the one hand, to provide users with the home page, agricultural machinery, system announcements, personal center, background management and other functions; on the other hand, to provide administrators with homepage, personal center, agricultural machinery master management, user management, agricultural machinery type management, agricultural machinery management, agricultural machinery appointment management, system management and other functions.

【Keywords】Agricultural mechanical and electrical moves; JAVA; B/S structure

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.NongjijizhuEntity;
import com.entity.view.NongjijizhuView;import com.service.NongjijizhuService;
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 2022-04-18 15:38:13*/
@RestController
@RequestMapping("/nongjijizhu")
public class NongjijizhuController {@Autowiredprivate NongjijizhuService nongjijizhuService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {NongjijizhuEntity user = nongjijizhuService.selectOne(new EntityWrapper<NongjijizhuEntity>().eq("jizhuzhanghao", username));if(user==null || !user.getMima().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(), username,"nongjijizhu",  "农机机主" );return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@RequestMapping("/register")public R register(@RequestBody NongjijizhuEntity nongjijizhu){//ValidatorUtils.validateEntity(nongjijizhu);NongjijizhuEntity user = nongjijizhuService.selectOne(new EntityWrapper<NongjijizhuEntity>().eq("jizhuzhanghao", nongjijizhu.getJizhuzhanghao()));if(user!=null) {return R.error("注册用户已存在");}Long uId = new Date().getTime();nongjijizhu.setId(uId);nongjijizhuService.insert(nongjijizhu);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");NongjijizhuEntity user = nongjijizhuService.selectById(id);return R.ok().put("data", user);}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){NongjijizhuEntity user = nongjijizhuService.selectOne(new EntityWrapper<NongjijizhuEntity>().eq("jizhuzhanghao", username));if(user==null) {return R.error("账号不存在");}user.setMima("123456");nongjijizhuService.updateById(user);return R.ok("密码已重置为:123456");}/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,NongjijizhuEntity nongjijizhu,HttpServletRequest request){EntityWrapper<NongjijizhuEntity> ew = new EntityWrapper<NongjijizhuEntity>();PageUtils page = nongjijizhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, nongjijizhu), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,NongjijizhuEntity nongjijizhu, HttpServletRequest request){EntityWrapper<NongjijizhuEntity> ew = new EntityWrapper<NongjijizhuEntity>();PageUtils page = nongjijizhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, nongjijizhu), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( NongjijizhuEntity nongjijizhu){EntityWrapper<NongjijizhuEntity> ew = new EntityWrapper<NongjijizhuEntity>();ew.allEq(MPUtil.allEQMapPre( nongjijizhu, "nongjijizhu")); return R.ok().put("data", nongjijizhuService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(NongjijizhuEntity nongjijizhu){EntityWrapper< NongjijizhuEntity> ew = new EntityWrapper< NongjijizhuEntity>();ew.allEq(MPUtil.allEQMapPre( nongjijizhu, "nongjijizhu")); NongjijizhuView nongjijizhuView =  nongjijizhuService.selectView(ew);return R.ok("查询农机机主成功").put("data", nongjijizhuView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){NongjijizhuEntity nongjijizhu = nongjijizhuService.selectById(id);return R.ok().put("data", nongjijizhu);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){NongjijizhuEntity nongjijizhu = nongjijizhuService.selectById(id);return R.ok().put("data", nongjijizhu);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody NongjijizhuEntity nongjijizhu, HttpServletRequest request){nongjijizhu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(nongjijizhu);NongjijizhuEntity user = nongjijizhuService.selectOne(new EntityWrapper<NongjijizhuEntity>().eq("jizhuzhanghao", nongjijizhu.getJizhuzhanghao()));if(user!=null) {return R.error("用户已存在");}nongjijizhu.setId(new Date().getTime());nongjijizhuService.insert(nongjijizhu);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody NongjijizhuEntity nongjijizhu, HttpServletRequest request){nongjijizhu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(nongjijizhu);NongjijizhuEntity user = nongjijizhuService.selectOne(new EntityWrapper<NongjijizhuEntity>().eq("jizhuzhanghao", nongjijizhu.getJizhuzhanghao()));if(user!=null) {return R.error("用户已存在");}nongjijizhu.setId(new Date().getTime());nongjijizhuService.insert(nongjijizhu);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody NongjijizhuEntity nongjijizhu, HttpServletRequest request){//ValidatorUtils.validateEntity(nongjijizhu);nongjijizhuService.updateById(nongjijizhu);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){nongjijizhuService.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<NongjijizhuEntity> wrapper = new EntityWrapper<NongjijizhuEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = nongjijizhuService.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.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.ShiyongzheEntity;
import com.entity.view.ShiyongzheView;import com.service.ShiyongzheService;
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 2022-04-18 15:38:13*/
@RestController
@RequestMapping("/shiyongzhe")
public class ShiyongzheController {@Autowiredprivate ShiyongzheService shiyongzheService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {ShiyongzheEntity user = shiyongzheService.selectOne(new EntityWrapper<ShiyongzheEntity>().eq("yonghuming", username));if(user==null || !user.getMima().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(), username,"shiyongzhe",  "使用者" );return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@RequestMapping("/register")public R register(@RequestBody ShiyongzheEntity shiyongzhe){//ValidatorUtils.validateEntity(shiyongzhe);ShiyongzheEntity user = shiyongzheService.selectOne(new EntityWrapper<ShiyongzheEntity>().eq("yonghuming", shiyongzhe.getYonghuming()));if(user!=null) {return R.error("注册用户已存在");}Long uId = new Date().getTime();shiyongzhe.setId(uId);shiyongzheService.insert(shiyongzhe);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");ShiyongzheEntity user = shiyongzheService.selectById(id);return R.ok().put("data", user);}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){ShiyongzheEntity user = shiyongzheService.selectOne(new EntityWrapper<ShiyongzheEntity>().eq("yonghuming", username));if(user==null) {return R.error("账号不存在");}user.setMima("123456");shiyongzheService.updateById(user);return R.ok("密码已重置为:123456");}/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,ShiyongzheEntity shiyongzhe,HttpServletRequest request){EntityWrapper<ShiyongzheEntity> ew = new EntityWrapper<ShiyongzheEntity>();PageUtils page = shiyongzheService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shiyongzhe), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,ShiyongzheEntity shiyongzhe, HttpServletRequest request){EntityWrapper<ShiyongzheEntity> ew = new EntityWrapper<ShiyongzheEntity>();PageUtils page = shiyongzheService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shiyongzhe), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( ShiyongzheEntity shiyongzhe){EntityWrapper<ShiyongzheEntity> ew = new EntityWrapper<ShiyongzheEntity>();ew.allEq(MPUtil.allEQMapPre( shiyongzhe, "shiyongzhe")); return R.ok().put("data", shiyongzheService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(ShiyongzheEntity shiyongzhe){EntityWrapper< ShiyongzheEntity> ew = new EntityWrapper< ShiyongzheEntity>();ew.allEq(MPUtil.allEQMapPre( shiyongzhe, "shiyongzhe")); ShiyongzheView shiyongzheView =  shiyongzheService.selectView(ew);return R.ok("查询使用者成功").put("data", shiyongzheView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){ShiyongzheEntity shiyongzhe = shiyongzheService.selectById(id);return R.ok().put("data", shiyongzhe);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){ShiyongzheEntity shiyongzhe = shiyongzheService.selectById(id);return R.ok().put("data", shiyongzhe);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody ShiyongzheEntity shiyongzhe, HttpServletRequest request){shiyongzhe.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(shiyongzhe);ShiyongzheEntity user = shiyongzheService.selectOne(new EntityWrapper<ShiyongzheEntity>().eq("yonghuming", shiyongzhe.getYonghuming()));if(user!=null) {return R.error("用户已存在");}shiyongzhe.setId(new Date().getTime());shiyongzheService.insert(shiyongzhe);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody ShiyongzheEntity shiyongzhe, HttpServletRequest request){shiyongzhe.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(shiyongzhe);ShiyongzheEntity user = shiyongzheService.selectOne(new EntityWrapper<ShiyongzheEntity>().eq("yonghuming", shiyongzhe.getYonghuming()));if(user!=null) {return R.error("用户已存在");}shiyongzhe.setId(new Date().getTime());shiyongzheService.insert(shiyongzhe);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody ShiyongzheEntity shiyongzhe, HttpServletRequest request){//ValidatorUtils.validateEntity(shiyongzhe);shiyongzheService.updateById(shiyongzhe);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){shiyongzheService.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<ShiyongzheEntity> wrapper = new EntityWrapper<ShiyongzheEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = shiyongzheService.selectCount(wrapper);return R.ok().put("count", count);}}

这篇关于springboot农机电招平台源码和论文的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/640993

相关文章

Java如何根据word模板导出数据

《Java如何根据word模板导出数据》这篇文章主要为大家详细介绍了Java如何实现根据word模板导出数据,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... pom.XML文件导入依赖 <dependency> <groupId>cn.afterturn</groupId>

Java应用如何防止恶意文件上传

《Java应用如何防止恶意文件上传》恶意文件上传可能导致服务器被入侵,数据泄露甚至服务瘫痪,因此我们必须采取全面且有效的防范措施来保护Java应用的安全,下面我们就来看看具体的实现方法吧... 目录恶意文件上传的潜在风险常见的恶意文件上传手段防范恶意文件上传的关键策略严格验证文件类型检查文件内容控制文件存储

浅析Java如何保护敏感数据

《浅析Java如何保护敏感数据》在当今数字化时代,数据安全成为了软件开发中至关重要的课题,本文将深入探讨Java安全领域,聚焦于敏感数据保护的策略与实践,感兴趣的小伙伴可以了解下... 目录一、Java 安全的重要性二、敏感数据加密技术(一)对称加密(二)非对称加密三、敏感数据的访问控制(一)基于角色的访问

Java计算经纬度距离的示例代码

《Java计算经纬度距离的示例代码》在Java中计算两个经纬度之间的距离,可以使用多种方法(代码示例均返回米为单位),文中整理了常用的5种方法,感兴趣的小伙伴可以了解一下... 目录1. Haversine公式(中等精度,推荐通用场景)2. 球面余弦定理(简单但精度较低)3. Vincenty公式(高精度,

使用Java将实体类转换为JSON并输出到控制台的完整过程

《使用Java将实体类转换为JSON并输出到控制台的完整过程》在软件开发的过程中,Java是一种广泛使用的编程语言,而在众多应用中,数据的传输和存储经常需要使用JSON格式,用Java将实体类转换为J... 在软件开发的过程中,Java是一种广泛使用的编程语言,而在众多应用中,数据的传输和存储经常需要使用j

Java实现视频格式转换的完整指南

《Java实现视频格式转换的完整指南》在Java中实现视频格式的转换,通常需要借助第三方工具或库,因为视频的编解码操作复杂且性能需求较高,以下是实现视频格式转换的常用方法和步骤,需要的朋友可以参考下... 目录核心思路方法一:通过调用 FFmpeg 命令步骤示例代码说明优点方法二:使用 Jaffree(FF

Java实现图片淡入淡出效果

《Java实现图片淡入淡出效果》在现代图形用户界面和游戏开发中,**图片淡入淡出(FadeIn/Out)**是一种常见且实用的视觉过渡效果,它可以用于启动画面、场景切换、轮播图、提示框弹出等场景,通过... 目录1. 项目背景详细介绍2. 项目需求详细介绍2.1 功能需求2.2 非功能需求3. 相关技术详细

Java如何用乘号来重复字符串的功能

《Java如何用乘号来重复字符串的功能》:本文主要介绍Java使用乘号来重复字符串的功能,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Java乘号来重复字符串的功能1、利用循环2、使用StringBuilder3、采用 Java 11 引入的String.rep

SpringBoot中HTTP连接池的配置与优化

《SpringBoot中HTTP连接池的配置与优化》这篇文章主要为大家详细介绍了SpringBoot中HTTP连接池的配置与优化的相关知识,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一... 目录一、HTTP连接池的核心价值二、Spring Boot集成方案方案1:Apache HttpCl

Spring Boot项目打包和运行的操作方法

《SpringBoot项目打包和运行的操作方法》SpringBoot应用内嵌了Web服务器,所以基于SpringBoot开发的web应用也可以独立运行,无须部署到其他Web服务器中,下面以打包dem... 目录一、打包为JAR包并运行1.打包为可执行的 JAR 包2.运行 JAR 包二、打包为WAR包并运行