Java 實(shí)戰(zhàn)項(xiàng)目錘煉之在線美食網(wǎng)站系統(tǒng)的實(shí)現(xiàn)流程
一、項(xiàng)目簡(jiǎn)述
功能:用戶的注冊(cè)登錄,美食瀏覽,美食文化,收藏百 科,趣味問答,食譜等等功能等等。
二、項(xiàng)目運(yùn)行
環(huán)境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
項(xiàng)目技術(shù): JSP +Springboot+ SpringMVC + MyBatis + ThymeLeaf + FTP+ JavaScript + JQuery + Ajax + maven等等。




評(píng)論控制器:
/**
* 評(píng)論控制器
*/
@RestController
@RequestMapping("/reception/comment")
public class CommentController {
@Autowired
private CommentService commentService;
/**
* 用戶發(fā)表評(píng)論
* @param vo
* @param session
* @return
*/
@RequestMapping("/add")
public String addComment(CommentVo vo, HttpSession session){
Map<String, Object> map = commentService.addComment(vo, session);
return JSON.toJSONString(map);
}
/**
* 查詢?cè)摬似废碌乃性u(píng)論
* @param foodId
* @return
*/
@RequestMapping("/findByFood")
public String findByFood(Long foodId){
Map<String, Object> map = commentService.findByFood(foodId);
return JSON.toJSONString(map);
}
/**
* 查詢?cè)撚脩舻乃性u(píng)論
* @param session
* @return
*/
@RequestMapping("/findByUser")
public String findByUser(HttpSession session){
Map<String, Object> map = commentService.findByUser(session);
return JSON.toJSONString(map);
}
}
投訴控制器代碼:
/**
* 投訴 控制器
*/
@RestController
@RequestMapping("/reception/complaint")
public class ComplaintController {
@Autowired
private ComplaintService complaintService;
/**
* 用戶發(fā)表投訴
* @param session
* @param vo
* @return
*/
@RequestMapping("/add")
public String addComplaint(ComplaintVo vo, HttpSession session){
Map<String, Object> map = complaintService.addComplaint(vo, session);
return JSON.toJSONString(map);
}
/**
* 根據(jù)頁面?zhèn)鬟f的條件查詢對(duì)應(yīng)的投訴信息
* @param vo
* @return
*/
@RequestMapping("/list")
public String findComplaintListByPage(ComplaintVo vo){
LayuiTableDataResult complaintListByPage = complaintService.findComplaintListByPage(vo);
return JSON.toJSONString(complaintListByPage);
}
/**
* 查詢?cè)撚脩舻乃型对V
* @param session
* @return
*/
@RequestMapping("/findByUser")
public String findByUser(HttpSession session){
Map<String, Object> map = complaintService.findByUser(session);
return JSON.toJSONString(map);
}
}
配送員管理控制器 :
/**
* 配送員管理控制器
*/
@RestController
@RequestMapping("/backstage/deliver")
public class DeliverManageController {
@Autowired
private DeliverService deliverService;
/**
* 根據(jù)頁面的條件查詢配送員列表
* @param vo
* @return
*/
@RequestMapping("/list")
public String findDeliverListByPage(DeliverVo vo){
LayuiTableDataResult deliverListByPage = deliverService.findDeliverListByPage(vo);
return JSON.toJSONString(deliverListByPage);
}
/**
* 配送員證件照文件上傳
* @return
*/
@RequestMapping("/uploadFile")
public String uploadFile(MultipartFile deliverImage){
Map<String, Object> map = deliverService.uploadFile(deliverImage);
return JSON.toJSONString(map);
}
/**
* 查找不是配送員的用戶
* @return
*/
@RequestMapping("/findUser")
public String findUserListNotDeliver(){
Map<String, Object> map = deliverService.findUserListNotDeliver();
return JSON.toJSONString(map);
}
/**
* 添加配送員
* @param vo
* @return
*/
@RequestMapping("/add")
public String addDeliver(DeliverVo vo){
Map<String, Object> map = deliverService.addDeliver(vo);
return JSON.toJSONString(map);
}
/**
* 修改配送員
* @param vo
* @return
*/
@RequestMapping("/modify")
public String modifyDeliver(DeliverVo vo){
Map<String, Object> map = deliverService.modifyDeliver(vo);
return JSON.toJSONString(map);
}
/**
* 配送員離職
* @return
*/
@RequestMapping("/leave")
public String leaveDeliver(String deliverId, Long userId){
Map<String, Object> map = deliverService.leaveDeliver(deliverId, userId);
return JSON.toJSONString(map);
}
/**
* 配送員復(fù)職
* @return
*/
@RequestMapping("/reJoin")
public String reJoinDeliver(String deliverId, Long userId){
Map<String, Object> map = deliverService.reJoinDeliver(deliverId, userId);
return JSON.toJSONString(map);
}
/**
* 查找接單數(shù)、差評(píng)數(shù)、結(jié)單數(shù)的最大值
* @return
*/
@RequestMapping("/findMax")
public String findMax(){
Map<String, Object> max = deliverService.findMax();
return JSON.toJSONString(max);
}
/**
* 查詢正式的配送員信息(未離職且已實(shí)名)
* @return
*/
@RequestMapping("/findFormalDeliver")
public String findFormalDeliver(){
List<DeliverEntity> formalDeliver = deliverService.findFormalDeliver();
return JSON.toJSONString(formalDeliver);
}
}
菜品SKU屬性集管理控制器:
/**
* 菜品SKU屬性集管理控制器
*/
@RestController
@RequestMapping("/backstage/foodattr")
public class FoodattrManageController {
@Autowired
private FoodattrService foodattrService;
/**
* 根據(jù)頁面返回信息查找符合條件的菜品規(guī)格組集合
* @param vo
* @return
*/
@RequestMapping("/list")
public String findFoodattrListByPage(FoodattrVo vo){
LayuiTableDataResult foodattrListByPage = foodattrService.findFoodattrListByPage(vo);
return JSON.toJSONString(foodattrListByPage);
}
/**
* 添加菜品規(guī)格組
* @param vo
* @return
*/
@RequestMapping("/add")
public String addFoodattr(FoodattrVo vo){
Map<String, Object> map = foodattrService.addFoodattr(vo);
return JSON.toJSONString(map);
}
/**
* 修改菜品規(guī)格組
* @param vo
* @return
*/
@RequestMapping("/modify")
public String modifyFoodattr(FoodattrVo vo){
Map<String, Object> map = foodattrService.modifyFoodattr(vo);
return JSON.toJSONString(map);
}
/**
* 刪除菜品規(guī)格組
* @param vo
* @return
*/
@RequestMapping("/delete")
public String deleteFoodattr(FoodattrVo vo){
Map<String, Object> map = foodattrService.deleteFoodattr(vo);
return JSON.toJSONString(map);
}
/**
* 查詢所有的菜品類別
* @return
*/
@RequestMapping("/findAllFoodattr")
public String findAllFoodattr(){
Map<String, Object> allFoodattr = foodattrService.findAllFoodattr();
return JSON.toJSONString(allFoodattr);
}
}
前臺(tái)點(diǎn)餐中心控制器:
/**
* 前臺(tái)點(diǎn)餐中心控制器
*/
@RestController
@RequestMapping("/reception/food")
public class FoodController {
@Autowired
private FoodService foodService;
/**
* 查找所有上架類別的所有上架菜品
* @return
*/
@RequestMapping(value = "/findFoodType", produces = "application/json;charset=utf-8")
public String findFood(){
List<FoodTypeEntity> foodTypeList = foodService.findFoodType();
return JSON.toJSONString(foodTypeList);
}
/**
* 根據(jù)類別ID查詢上架菜品
* @param typeId
* @return
*/
@RequestMapping(value = "/findFood", produces = "application/json;charset=utf-8")
public String findOnshelfFoodByType(Long typeId){
List<FoodEntity> onshelfFoodByType = foodService.findOnshelfFoodByType(typeId);
return JSON.toJSONString(onshelfFoodByType);
}
/**
* 根據(jù)菜品編號(hào)查詢所有菜品信息
* @param foodId
* @return
*/
@RequestMapping(value = "/findFoodInfo", produces = "application/json;charset=utf-8")
public String findFoodInfoById(Long foodId){
Map<String, Object> foodInfo = foodService.findFoodInfoById(foodId);
return JSON.toJSONString(foodInfo);
}
/**
* 查詢所有上架的推薦和熱銷菜品
* @return
*/
@RequestMapping(value = "/findRecommendAndHotSaleFood", produces = "application/json;charset=utf-8")
public String findRecommendAndHotSaleFood(){
Map<String, Object> map = foodService.findRecommendAndHotSaleFood();
return JSON.toJSONString(map);
}
}
我的評(píng)論頁面:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>我的評(píng)論</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/resources/css/myTicket.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/plugins/layui/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/plugins/layui/css/public.css" media="all">
<link href="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/css/style.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/js/-jquery-1.8.3.min.js"></script>
<link href="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/css/nav2.css" type="text/css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/css/amazeui.min.css" rel="stylesheet" />
<script src="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/js/amazeui.min.js"></script>
<link href="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/css/fanda.css" type="text/css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/js/MagicZoom.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/plugins/Ruidan_Page/js/ShopShow.js"></script>
<link href="${pageContext.request.contextPath}/static/plugins/productStore/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<script>
function formatDateTime(inputTime) {
var date = new Date(inputTime);
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
var h = date.getHours();
h = h < 10 ? ('0' + h) : h;
var minute = date.getMinutes();
var second = date.getSeconds();
minute = minute < 10 ? ('0' + minute) : minute;
second = second < 10 ? ('0' + second) : second;
return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
};
</script>
<style>
.orderBox {
width: 90.5%;
margin: 0 auto 24px;
background-color: #ffffff;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
border-radius: 5px;
overflow: hidden;
padding: 30px;
}
.myOrderBolder{
font-size: 20px;
font-weight: 600;
color: #333333;
}
.myOrderFont{
font-size: 16px;
font-weight: 300;
color: #333333;
}
.layui-form-item{
margin-bottom: 0;
}
</style>
</head>
<body style="width: 100%;">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header" style="position: relative;margin-left: 44px;">
<button type="button" class="btn btn-default navbar-btn" onclick="javascript:window.history.go(-1);"> < 返回</button>
<p class="navbar-text" style="position:absolute;top: 0px;left: 68px;width: 199px;">我的評(píng)論</p>
</div>
</div>
</nav>
<div id="commentList"></div>
<div style="width: 100%;">
<div class="qing banq" style="margin: 0 auto 20px;width: 457px;">閩ICP備201721086021號(hào) Copyright 宿遞By <font color="#1aa094"><b>LiangJ</b></font>,All Rights Reserved</div>
</div>
</body>
<script id="demo" type="text/html">
<div class="qing juzhong">
<div class="lf tu-prk" style="width: 100%;">
<div class="tu-pr">
<div class="qing cpxk shu12 layui-form-item" style="padding: 22px 30px 22px;line-height: 28px;position: relative">
{{# layui.each(d.list, function(index, comment){ }}
<div>
<div class="layui-form-item">購買【{{ comment.skuName }}】后發(fā)表評(píng)論:</div>
<textarea readonly style="width: 100%;height: 80px;border: 1px solid rgba(0,0,0,.1);padding: 5px 16px 5px 16px;font-size: 16px;color: #333333;">
{{ comment.commentContent }}
</textarea>
<div style="color: #ffb800;font-size: 17px;" class="layui-inline">評(píng)分:{{ comment.commentScore }} <i class="layui-icon layui-icon-star-fill"></i></div>
<div style="float: right">評(píng)論時(shí)間:{{ formatDateTime(comment.commentTime) }}</div>
<hr style="color: #333333">
</div>
{{# }) }}
</div>
</div>
</div>
</div>
</script>
<script src="${pageContext.request.contextPath}/static/plugins/layui/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['jquery', 'layer', 'laytpl', 'rate', 'form'], function () {
var $ = layui.jquery,
laytpl = layui.laytpl,
rate = layui.rate,
form = layui.form,
layer = layui.layer;
var url;//提交的請(qǐng)求地址
var index;//打開窗口的索引
/**
* 請(qǐng)求后端查詢?cè)撚脩舻乃性u(píng)論
*/
$.post("${pageContext.request.contextPath}/reception/comment/findByUser", function (result) {
if (result.flag){
/**
* 渲染模版
* @type {{title: string, list: *}}
*/
var templetData = { //數(shù)據(jù)
"title":"Layui常用模塊"
,"list":result.commentList
}
var getTpl = demo.innerHTML;
var commentList = document.getElementById('commentList');
laytpl(getTpl).render(templetData, function(html){
commentList.innerHTML = html;
});
}
}, "json");
});
</script>
</html>
到此這篇關(guān)于Java 實(shí)戰(zhàn)項(xiàng)目錘煉之在線美食網(wǎng)站系統(tǒng)的實(shí)現(xiàn)流程的文章就介紹到這了,更多相關(guān)Java 美食網(wǎng)站系統(tǒng)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- Java 實(shí)戰(zhàn)項(xiàng)目之精美物流管理系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目基于遺傳算法學(xué)校排課系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目之在線點(diǎn)餐系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目之CRM客戶管理系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目錘煉之嘟嘟健身房管理系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目之倉庫管理系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目錘煉之小區(qū)物業(yè)管理系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目之誠途旅游系統(tǒng)的實(shí)現(xiàn)流程
相關(guān)文章
Java Chassis3注冊(cè)中心分區(qū)隔離技術(shù)解密
這篇文章主要為大家介紹了Java Chassis3注冊(cè)中心分區(qū)隔離技術(shù)解密,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2024-01-01
如何巧用HashMap一行代碼統(tǒng)計(jì)單詞出現(xiàn)次數(shù)詳解
這篇文章主要給大家介紹了關(guān)于如何巧用HashMap一行代碼統(tǒng)計(jì)單詞出現(xiàn)次數(shù)的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2020-07-07
java 過濾器模式(Filter/Criteria Pattern)詳細(xì)介紹
這篇文章主要介紹了java 過濾器模式(Filter/Criteria Pattern)詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下2016-10-10
Springboot ApplicationRunner的使用解讀
這篇文章主要介紹了Springboot ApplicationRunner的使用解讀,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-05-05
Springboot實(shí)現(xiàn)Excel批量導(dǎo)入數(shù)據(jù)并保存到本地
這篇文章主要為大家詳細(xì)介紹了Springboot實(shí)現(xiàn)Excel批量導(dǎo)入數(shù)據(jù)并將文件保存到本地效果的方法,文中的示例代講解詳細(xì),需要的可以參考一下2022-09-09

