欢迎光临
我们一直在努力

【毕设精品推荐】基于Springboot的自驾游攻略查询系统的设计与实现 (附源码资料)可增删改查,运行部署,毕设选题推荐_Java项目

💖💖作者:计算机毕业设计江挽 💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 深度学习实战项目

目录

  • 基于Springboot的自驾游攻略查询系统介绍
  • 基于Springboot的自驾游攻略查询系统演示视频
  • 基于Springboot的自驾游攻略查询系统演示图片
  • 基于Springboot的自驾游攻略查询系统代码展示
  • 基于Springboot的自驾游攻略查询系统文档展示

基于Springboot的自驾游攻略查询系统介绍

《自驾游攻略查询系统》是一个面向自驾游爱好者的综合性信息管理平台,基于B/S架构设计,支持Java(Spring Boot)和Python(Django)双技术栈运行,前端采用Vue+ElementUI构建用户界面,后端通过MySQL数据库完成数据持久化存储。系统围绕自驾游场景下的信息整合需求,构建了景点管理、游记分享、路线规划、分类标签、综合资讯等核心功能模块,实现了从数据采集、分类检索到可视化展示的完整闭环。具体而言,旅游景点管理模块支持景点名称、地理位置、门票价格、开放时间、景点特色等多维度信息的录入与维护;旅游游记管理模块允许用户记录旅途见闻并关联相关景点与路线;旅游路线管理模块则将分散的景点按照时间顺序与地理位置串联成完整的出行方案;分类标签与景点类型两个模块协同工作,为景点和路线提供多级分类体系,增强检索的精确性。系统管理层面配置了轮播图管理、关于我们、系统简介等基础功能,同时为用户提供个人中心、密码修改等账户设置选项。整体设计注重实用性与可扩展性,既满足了自驾游客获取攻略信息的基本需求,也为后续功能迭代预留了充足空间。

基于Springboot的自驾游攻略查询系统演示视频

演示视频

基于Springboot的自驾游攻略查询系统演示图片

在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述

基于Springboot的自驾游攻略查询系统代码展示

package com.travel.controller;

import org.apache.spark.sql.SparkSession;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.RowFactory;
import org.apache.spark.sql.types.StructType;
import org.apache.spark.sql.types.StructField;
import org.apache.spark.sql.types.DataTypes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.travel.service.ScenicService;
import com.travel.service.TravelNoteService;
import com.travel.service.RouteService;
import com.travel.entity.Scenic;
import com.travel.entity.TravelNote;
import com.travel.entity.Route;
import java.util.*;
import java.text.SimpleDateFormat;

@RestController
@RequestMapping("/api")
public class TravelController {
@Autowired private ScenicService scenicService;
@Autowired private TravelNoteService travelNoteService;
@Autowired private RouteService routeService;

@GetMapping("/scenic/list")
public Map<String, Object> getScenicList(@RequestParam(required=false) String name,
@RequestParam(required=false) String type,
@RequestParam(defaultValue="1") Integer page,
@RequestParam(defaultValue="10") Integer size) {
Map<String, Object> result = new HashMap<>();
int offset = (page 1) * size;
List<Scenic> list = scenicService.selectByCondition(name, type, offset, size);
int total = scenicService.countByCondition(name, type);
result.put("list", list);
result.put("total", total);
SparkSession spark = SparkSession.builder().appName("ScenicStats").master("local[*]").getOrCreate();
List<Scenic> allScenics = scenicService.selectAll();
List<Row> rows = new ArrayList<>();
for (Scenic s : allScenics) {
String scenicType = s.getType() != null ? s.getType() : "未分类";
rows.add(RowFactory.create(s.getId(), s.getName(), scenicType, s.getProvince()));
}
StructType schema = DataTypes.createStructType(new StructField[]{
DataTypes.createStructField("id", DataTypes.IntegerType, true),
DataTypes.createStructField("name", DataTypes.StringType, true),
DataTypes.createStructField("type", DataTypes.StringType, true),
DataTypes.createStructField("province", DataTypes.StringType, true)
});
Dataset<Row> df = spark.createDataFrame(rows, schema);
df.createOrReplaceTempView("scenic_view");
Dataset<Row> statsDf = spark.sql("SELECT type, COUNT(*) as count FROM scenic_view GROUP BY type ORDER BY count DESC");
List<Row> statsList = statsDf.collectAsList();
List<Map<String, Object>> statsResult = new ArrayList<>();
for (Row row : statsList) {
Map<String, Object> item = new HashMap<>();
item.put("type", row.getString(0));
item.put("count", row.getLong(1));
statsResult.add(item);
}
result.put("typeStats", statsResult);
spark.stop();
return result;
}

@PostMapping("/scenic/add")
public Map<String, Object> addScenic(@RequestBody Scenic scenic) {
Map<String, Object> result = new HashMap<>();
if (scenic.getName() == null || scenic.getName().trim().isEmpty()) {
result.put("code", 400);
result.put("msg", "景点名称不能为空");
return result;
}
if (scenic.getLocation() == null || scenic.getLocation().trim().isEmpty()) {
result.put("code", 400);
result.put("msg", "景点位置不能为空");
return result;
}
scenic.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
int rows = scenicService.insert(scenic);
if (rows > 0) {
result.put("code", 200);
result.put("msg", "添加成功");
} else {
result.put("code", 500);
result.put("msg", "添加失败");
}
return result;
}

@PutMapping("/scenic/update")
public Map<String, Object> updateScenic(@RequestBody Scenic scenic) {
Map<String, Object> result = new HashMap<>();
if (scenic.getId() == null) {
result.put("code", 400);
result.put("msg", "景点ID不能为空");
return result;
}
Scenic exist = scenicService.selectById(scenic.getId());
if (exist == null) {
result.put("code", 404);
result.put("msg", "景点不存在");
return result;
}
if (scenic.getName() != null && !scenic.getName().trim().isEmpty()) {
exist.setName(scenic.getName());
}
if (scenic.getType() != null && !scenic.getType().trim().isEmpty()) {
exist.setType(scenic.getType());
}
if (scenic.getLocation() != null && !scenic.getLocation().trim().isEmpty()) {
exist.setLocation(scenic.getLocation());
}
if (scenic.getPrice() != null) {
exist.setPrice(scenic.getPrice());
}
if (scenic.getOpeningHours() != null && !scenic.getOpeningHours().trim().isEmpty()) {
exist.setOpeningHours(scenic.getOpeningHours());
}
if (scenic.getDescription() != null && !scenic.getDescription().trim().isEmpty()) {
exist.setDescription(scenic.getDescription());
}
int rows = scenicService.update(exist);
if (rows > 0) {
result.put("code", 200);
result.put("msg", "更新成功");
} else {
result.put("code", 500);
result.put("msg", "更新失败");
}
return result;
}

@DeleteMapping("/scenic/delete/{id}")
public Map<String, Object> deleteScenic(@PathVariable Integer id) {
Map<String, Object> result = new HashMap<>();
if (id == null) {
result.put("code", 400);
result.put("msg", "景点ID不能为空");
return result;
}
Scenic exist = scenicService.selectById(id);
if (exist == null) {
result.put("code", 404);
result.put("msg", "景点不存在");
return result;
}
int rows = scenicService.deleteById(id);
if (rows > 0) {
result.put("code", 200);
result.put("msg", "删除成功");
} else {
result.put("code", 500);
result.put("msg", "删除失败");
}
return result;
}

@PostMapping("/note/add")
public Map<String, Object> addTravelNote(@RequestBody TravelNote note) {
Map<String, Object> result = new HashMap<>();
if (note.getTitle() == null || note.getTitle().trim().isEmpty()) {
result.put("code", 400);
result.put("msg", "游记标题不能为空");
return result;
}
if (note.getContent() == null || note.getContent().trim().isEmpty()) {
result.put("code", 400);
result.put("msg", "游记内容不能为空");
return result;
}
if (note.getUserId() == null) {
result.put("code", 400);
result.put("msg", "用户ID不能为空");
return result;
}
note.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
note.setViewCount(0);
note.setLikeCount(0);
int rows = travelNoteService.insert(note);
if (rows > 0 && note.getScenicIds() != null && !note.getScenicIds().isEmpty()) {
String[] ids = note.getScenicIds().split(",");
for (String sid : ids) {
if (sid != null && !sid.trim().isEmpty()) {
travelNoteService.insertNoteScenicRelation(note.getId(), Integer.parseInt(sid.trim()));
}
}
}
SparkSession spark = SparkSession.builder().appName("NoteScenicAnalysis").master("local[*]").getOrCreate();
List<TravelNote> allNotes = travelNoteService.selectAll();
List<Row> noteRows = new ArrayList<>();
for (TravelNote n : allNotes) {
String relatedScenics = n.getScenicIds() != null ? n.getScenicIds() : "";
String[] scenicIdArray = relatedScenics.split(",");
for (String sid : scenicIdArray) {
if (sid != null && !sid.trim().isEmpty()) {
noteRows.add(RowFactory.create(n.getId(), n.getTitle(), Integer.parseInt(sid.trim()), n.getViewCount()));
}
}
}
if (!noteRows.isEmpty()) {
StructType noteSchema = DataTypes.createStructType(new StructField[]{
DataTypes.createStructField("noteId", DataTypes.IntegerType, true),
DataTypes.createStructField("title", DataTypes.StringType, true),
DataTypes.createStructField("scenicId", DataTypes.IntegerType, true),
DataTypes.createStructField("viewCount", DataTypes.IntegerType, true)
});
Dataset<Row> noteDf = spark.createDataFrame(noteRows, noteSchema);
noteDf.createOrReplaceTempView("note_scenic_view");
Dataset<Row> hotScenicDf = spark.sql("SELECT scenicId, COUNT(*) as refCount, SUM(viewCount) as totalViews FROM note_scenic_view GROUP BY scenicId ORDER BY refCount DESC LIMIT 5");
List<Row> hotList = hotScenicDf.collectAsList();
List<Map<String, Object>> hotScenics = new ArrayList<>();
for (Row row : hotList) {
Map<String, Object> item = new HashMap<>();
item.put("scenicId", row.getInt(0));
item.put("refCount", row.getLong(1));
item.put("totalViews", row.getLong(2));
hotScenics.add(item);
}
result.put("hotScenics", hotScenics);
}
spark.stop();
if (rows > 0) {
result.put("code", 200);
result.put("msg", "游记发布成功");
result.put("noteId", note.getId());
} else {
result.put("code", 500);
result.put("msg", "游记发布失败");
}
return result;
}

@GetMapping("/note/list")
public Map<String, Object> getNoteList(@RequestParam(required=false) String title,
@RequestParam(required=false) Integer userId,
@RequestParam(defaultValue="1") Integer page,
@RequestParam(defaultValue="10") Integer size) {
Map<String, Object> result = new HashMap<>();
int offset = (page 1) * size;
List<TravelNote> list = travelNoteService.selectByCondition(title, userId, offset, size);
int total = travelNoteService.countByCondition(title, userId);
result.put("list", list);
result.put("total", total);
return result;
}

@GetMapping("/note/detail/{id}")
public Map<String, Object> getNoteDetail(@PathVariable Integer id) {
Map<String, Object> result = new HashMap<>();
TravelNote note = travelNoteService.selectById(id);
if (note == null) {
result.put("code", 404);
result.put("msg", "游记不存在");
return result;
}
travelNoteService.incrementViewCount(id);
note.setViewCount(note.getViewCount() + 1);
List<Integer> scenicIds = travelNoteService.selectScenicIdsByNoteId(id);
List<Scenic> scenics = new ArrayList<>();
for (Integer sid : scenicIds) {
Scenic s = scenicService.selectById(sid);
if (s != null) {
scenics.add(s);
}
}
result.put("note", note);
result.put("relatedScenics", scenics);
result.put("code", 200);
return result;
}

@PostMapping("/route/generate")
public Map<String, Object> generateRoute(@RequestBody Route route) {
Map<String, Object> result = new HashMap<>();
if (route.getName() == null || route.getName().trim().isEmpty()) {
result.put("code", 400);
result.put("msg", "路线名称不能为空");
return result;
}
if (route.getScenicIds() == null || route.getScenicIds().trim().isEmpty()) {
result.put("code", 400);
result.put("msg", "至少选择2个景点才能生成路线");
return result;
}
String[] sidArray = route.getScenicIds().split(",");
if (sidArray.length < 2) {
result.put("code", 400);
result.put("msg", "至少选择2个景点才能生成路线");
return result;
}
List<Scenic> selectedScenics = new ArrayList<>();
for (String sid : sidArray) {
if (sid != null && !sid.trim().isEmpty()) {
Scenic s = scenicService.selectById(Integer.parseInt(sid.trim()));
if (s != null) {
selectedScenics.add(s);
}
}
}
SparkSession spark = SparkSession.builder().appName("RouteOptimization").master("local[*]").getOrCreate();
List<Row> routeRows = new ArrayList<>();
for (int i = 0; i < selectedScenics.size(); i++) {
Scenic s = selectedScenics.get(i);
routeRows.add(RowFactory.create(s.getId(), s.getName(), s.getProvince(), s.getLocation(), i));
}
StructType routeSchema = DataTypes.createStructType(new StructField[]{
DataTypes.createStructField("id", DataTypes.IntegerType, true),
DataTypes.createStructField("name", DataTypes.StringType, true),
DataTypes.createStructField("province", DataTypes.StringType, true),
DataTypes.createStructField("location", DataTypes.StringType, true),
DataTypes.createStructField("orderIndex", DataTypes.IntegerType, true)
});
Dataset<Row> routeDf = spark.createDataFrame(routeRows, routeSchema);
routeDf.createOrReplaceTempView("route_scenic_view");
Dataset<Row> sortedDf = spark.sql("SELECT id, name, province, location FROM route_scenic_view ORDER BY orderIndex");
List<Row> sortedList = sortedDf.collectAsList();
StringBuilder routeDesc = new StringBuilder();
for (int i = 0; i < sortedList.size(); i++) {
Row row = sortedList.get(i);
routeDesc.append(i + 1).append(". ").append(row.getString(1));
if (row.getString(2) != null) {
routeDesc.append("(").append(row.getString(2)).append(")");
}
if (i < sortedList.size() 1) {
routeDesc.append(" → ");
}
}
route.setDescription(routeDesc.toString());
route.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
int rows = routeService.insert(route);
if (rows > 0) {
for (String sid : sidArray) {
if (sid != null && !sid.trim().isEmpty()) {
routeService.insertRouteScenicRelation(route.getId(), Integer.parseInt(sid.trim()));
}
}
result.put("code", 200);
result.put("msg", "路线生成成功");
result.put("routeId", route.getId());
result.put("routeDescription", routeDesc.toString());
} else {
result.put("code", 500);
result.put("msg", "路线生成失败");
}
spark.stop();
return result;
}

@GetMapping("/route/list")
public Map<String, Object> getRouteList(@RequestParam(required=false) String name,
@RequestParam(defaultValue="1") Integer page,
@RequestParam(defaultValue="10") Integer size) {
Map<String, Object> result = new HashMap<>();
int offset = (page 1) * size;
List<Route> list = routeService.selectByCondition(name, offset, size);
int total = routeService.countByCondition(name);
for (Route r : list) {
List<Integer> scenicIds = routeService.selectScenicIdsByRouteId(r.getId());
List<Scenic> scenics = new ArrayList<>();
for (Integer sid : scenicIds) {
Scenic s = scenicService.selectById(sid);
if (s != null) {
scenics.add(s);
}
}
r.setScenicList(scenics);
}
result.put("list", list);
result.put("total", total);
return result;
}

@GetMapping("/route/detail/{id}")
public Map<String, Object> getRouteDetail(@PathVariable Integer id) {
Map<String, Object> result = new HashMap<>();
Route route = routeService.selectById(id);
if (route == null) {
result.put("code", 404);
result.put("msg", "路线不存在");
return result;
}
List<Integer> scenicIds = routeService.selectScenicIdsByRouteId(id);
List<Scenic> scenics = new ArrayList<>();
for (Integer sid : scenicIds) {
Scenic s = scenicService.selectById(sid);
if (s != null) {
scenics.add(s);
}
}
result.put("route", route);
result.put("scenics", scenics);
result.put("code", 200);
return result;
}
}

基于Springboot的自驾游攻略查询系统文档展示

在这里插入图片描述

💖💖作者:计算机毕业设计江挽 💙💙个人简介:曾长期从事计算机专业培训教学,本人也热爱上课教学,语言擅长Java、微信小程序、Python、Golang、安卓Android等,开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 深度学习实战项目

赞(0)
未经允许不得转载:171主机测评 » 【毕设精品推荐】基于Springboot的自驾游攻略查询系统的设计与实现 (附源码资料)可增删改查,运行部署,毕设选题推荐_Java项目
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址