SpringBoot+Vue協(xié)同過濾推薦餐飲系統(tǒng)

1.技術(shù)介紹

java+springBoot+spring+mysql+mybatis+Vue

開發(fā)工具:eclipse或IDEA

2.主要功能說明:

1)普通用戶

2)賣家

3)管理員

系統(tǒng)分為前臺和管理后臺

網(wǎng)站前臺主要功能:

注冊、登錄、首頁、公告消息、美食資訊、美食商城、餐廳介紹、我的賬戶、我的地址、我的收藏、我的購物車、我的訂單、個人中心

管理后臺功能:

輪播圖管理、公告管理、用戶管理(管理員、賣家、注冊用戶)、內(nèi)容管理(美食資訊、資訊分類)、商城管理(美食商城、分類列表、訂單列表)、餐廳分類、餐廳介紹、意見反饋

關(guān)于演示視頻圖片未顯示說明:

1)上傳圖片和查看圖片功能完好,本人鄭重承諾,如果你發(fā)現(xiàn)此功能有問題,本套源碼免費(fèi)送給你

2)下面代碼會展示上傳的圖片的路徑和上傳功能

3)為什么演示時候圖片未顯示?

幫學(xué)生做的時候,個人數(shù)據(jù)都沒有添加,只開發(fā)功能,后面的數(shù)據(jù)都是學(xué)生自己添加的,不在自己的電腦上,在學(xué)生的電腦上,所以圖片不顯示

下面是我自己上傳的圖片

![在這里插入圖片描述](https://img-blog.csdnimg.cn/3abebac7a8f74138a1539bb71ea29389.png)

關(guān)于協(xié)同過濾算法說明:

本文主要根據(jù)用戶收藏的餐廳用戶行為,利用協(xié)同過濾算法計(jì)算相似度,給用戶推薦餐廳,首頁推薦餐廳那里,如果給用戶推薦的餐廳為空,還是會展示四個餐廳,是根據(jù)餐廳的瀏覽量來的

另外本文有詳細(xì)的安裝文檔,代碼講解,當(dāng)然有償服務(wù),獲取代碼方式參考下方的演示地址

3.部分代碼展示

```java

@PostMapping("/upload")

? ? public Map<String, Object> upload(@RequestParam("file") MultipartFile file) {

? ? ? ? log.info("進(jìn)入方法");

? ? ? ? if (file.isEmpty()) {

? ? ? ? ? ? return error(30000, "沒有選擇文件");

? ? ? ? }

? ? ? ? try {

? ? ? ? ? ? //判斷有沒路徑,沒有則創(chuàng)建

? ? ? ? ? ? String filePath = System.getProperty("user.dir") + "\\target\\classes\\static\\upload\\";

? ? ? ? ? ? File targetDir = new File(filePath);

? ? ? ? ? ? if (!targetDir.exists() && !targetDir.isDirectory()) {

? ? ? ? ? ? ? ? if (targetDir.mkdirs()) {

? ? ? ? ? ? ? ? ? ? log.info("創(chuàng)建目錄成功");

? ? ? ? ? ? ? ? } else {

? ? ? ? ? ? ? ? ? ? log.error("創(chuàng)建目錄失敗");

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

//? ? ? ? ? ? String path = ResourceUtils.getURL("classpath:").getPath() + "static/upload/";

//? ? ? ? ? ? String filePath = path.replace('/', '\\').substring(1, path.length());

? ? ? ? ? ? String fileName = file.getOriginalFilename();

? ? ? ? ? ? File dest = new File(filePath + fileName);

? ? ? ? ? ? log.info("文件路徑:{}", dest.getPath());

? ? ? ? ? ? log.info("文件名:{}", dest.getName());

? ? ? ? ? ? file.transferTo(dest);

? ? ? ? ? ? JSONObject jsonObject = new JSONObject();

? ? ? ? ? ? jsonObject.put("url", "/api/upload/" + fileName);

? ? ? ? ? ? return success(jsonObject);

? ? ? ? } catch (IOException e) {

? ? ? ? ? ? log.info("上傳失?。簕}", e.getMessage());

? ? ? ? }

? ? ? ? return error(30000, "上傳失敗");

? ? }```

餐廳介紹

```java

<template>

<div class="diy_list page_restaurant_introduction" id="restaurant_introduction_list">

<div class="warp">

<div class="container diy_list_container">

<div class="diy_list_title">

<div class="col">

<span class="title">餐廳介紹列表</span>

</div>

</div>

<div class="row diy_list_search">

<div class="col">

<!-- 搜索欄 -->

<div class="view">

<span class="diy_list_search_title">關(guān)鍵字搜索:</span>

<b-form-input size="sm" class="mr-sm-2" placeholder="餐廳名稱搜索" v-model="query['restaurant_name']" />

<b-form-input size="sm" class="mr-sm-2" placeholder="餐廳類別搜索" v-model="query['restaurant_category']" />

<b-form-input size="sm" class="mr-sm-2" placeholder="地址搜索" v-model="query['address']" />

<b-button size="sm" @click="search()" >

<b-icon icon="search"/>

</b-button>

</div>

<!-- /搜索欄 -->

</div>

</div>

<div class="diy_list_select_box">

<span class="diy_list_select_title">下拉搜索:</span>

<div class="diy_list_dropdown_box">

<div class="col">

<!-- 篩選 -->

<div class="view">

<b-dropdown text="餐廳類別" variant="outline-dark" left>

<b-dropdown-item @click="filter_set('全部','restaurant_category')">全部</b-dropdown-item>

<b-dropdown-item v-for="(o, i) in list_restaurant_category" :key="i" @click="filter_set(o['restaurant_category'],'restaurant_category')" >

{{ o['restaurant_category'] }}

</b-dropdown-item>

</b-dropdown>

</div>

<!-- /篩選 -->

</div>

</div>

<div class="diy_list_sort_box">

<div class="col">

<!-- 排序 -->

<div class="view">

<b-dropdown text="排序" variant="outline-dark" left>

<b-dropdown-item v-for="(o, i) in list_sort" :key="i" @click="set_sort(o)" >

{{ o.name }}

</b-dropdown-item>

</b-dropdown>

</div>

<!--/排序 -->

</div>

</div>

</div>

<div class="row diy_list_box">

<div class="col">

<!-- 列表 -->

<list_restaurant_introduction :list="list" />

<!-- /列表 -->

</div>

</div>

<div class="row diy_list_page_box">

<div class="col overflow-auto flex_cc">

<!-- 分頁器 -->

<!-- <diy_pager v-model="query['page']" :size="query['size']" :count="count" v-on:toPage="toPage" v-on:toSize="toSize" ></diy_pager>-->

? ? ? ? ? ? <b-pagination

? ? ? ? ? ? ? ? v-model="query.page"

? ? ? ? ? ? ? ? :total-rows="count"

? ? ? ? ? ? ? ? :per-page="query.size"

? ? ? ? ? ? ? ? @change="goToPage"

? ? ? ? ? ? />

<!-- /分頁器 -->

</div>

</div>

</div>

</div>

</div>

</template>

<script>

import list_restaurant_introduction from "@/components/diy/list_restaurant_introduction.vue";

import diy_pager from "@/components/diy/diy_pager";

import mixin from "@/mixins/page.js";

export default {

mixins: [mixin],

components: {

diy_pager,

list_restaurant_introduction

},

data() {

return {

url_get_list: "~/api/restaurant_introduction/get_list?like=0",

// 查詢條件

query: {

keyword: "",

page: 1,

size: 10,

"restaurant_name": "", // 餐廳名稱

"restaurant_category": "", // 餐廳類別

"address": "", // 地址

"examine_state": "已通過", // 審核狀態(tài)

},

// 排序內(nèi)容

list_sort: [{

name: "創(chuàng)建時間從高到低",

value: "create_time desc",

},

{

name: "創(chuàng)建時間從低到高",

value: "create_time asc",

},

{

name: "更新時間從高到低",

value: "update_time desc",

},

{

name: "更新時間從低到高",

value: "update_time asc",

},

{

name: "餐廳名稱正序",

value: "restaurant_name asc",

},

{

name: "餐廳名稱倒序",

value: "restaurant_name desc",

},

{

name: "餐廳類別正序",

value: "restaurant_category asc",

},

{

name: "餐廳類別倒序",

value: "restaurant_category desc",

},

{

name: "地址正序",

value: "address asc",

},

{

name: "地址倒序",

value: "address desc",

},

],

// 餐廳類別列表

"list_restaurant_category": [],

}

},

methods: {

? ? ? get_list_before(param) {

? ? ? },

/**

* 篩選選擇

*/

filter_set(o,key) {

? ? if (o == "全部") {

? ? ? ? this.query[key] = "";

? ? } else {

? ? ? ? this.query[key] = o;

? ? }

? ? this.search();

},

/**

* 排序

*/

set_sort(o) {

? ? this.query.orderby = o.value;

? ? this.search();

},

/**

* 獲取餐廳類別列表

*/

async get_list_restaurant_category() {

var json = await this.$get("~/api/restaurant_classification/get_list?");

if (json.result) {

this.list_restaurant_category = json.result.list;

} else if (json.error) {

console.log(json.error);

}

},

/**

* 篩選

*/

filter_restaurant_category(o) {

if (o == "全部") {

this.query["restaurant_category"] = "";

} else {

this.query["restaurant_category"] = o;

}

this.search();

},

/**

* 重置

*/

reset() {

this.query.restaurant_name = ""

this.query.restaurant_category = ""

this.query.address = ""

this.search();

},

// 返回條數(shù)

toSize(i){

this.query.size = i;

this.first();

},

// 返回頁數(shù)

toPage(i){

this.query.page = i;

this.first();

},

? ? ? goToPage(v){

? ? ? ? this.query.page = v;

? ? ? ? this.goToNew(v)

? ? ? },

},

computed: {

},

created() {

/**

* 獲取餐廳類別列表

*/

this.get_list_restaurant_category();

}

}

</script>

<style>

</style>

```

4.系統(tǒng)演示地址:

鏈接:https://pan.baidu.com/s/1SjcOrOVHtfHW9BRiwrjXSw

提取碼:jhwd

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容