forked from Q-1515/reggie_parent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
931 additions
and
15 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
reggie_server/src/main/java/com/reggie/config/WebSocketConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.reggie.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.socket.server.standard.ServerEndpointExporter; | ||
|
||
/** | ||
* WebSocket配置类,用于注册WebSocket的Bean | ||
*/ | ||
@Configuration | ||
public class WebSocketConfiguration { | ||
|
||
@Bean | ||
public ServerEndpointExporter serverEndpointExporter() { | ||
return new ServerEndpointExporter(); | ||
} | ||
|
||
} |
139 changes: 139 additions & 0 deletions
139
reggie_server/src/main/java/com/reggie/controller/admin/OrderController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
package com.reggie.controller.admin; | ||
|
||
import com.reggie.dto.OrdersCancelDTO; | ||
import com.reggie.dto.OrdersConfirmDTO; | ||
import com.reggie.dto.OrdersRejectionDTO; | ||
import com.reggie.result.PageResult; | ||
import com.reggie.result.R; | ||
import com.reggie.service.OrderService; | ||
import com.reggie.vo.OrderStatisticsVO; | ||
import com.reggie.vo.OrderVO; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.format.annotation.DateTimeFormat; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* 订单管理 | ||
*/ | ||
@RestController("adminOrderController") | ||
@RequestMapping("/admin/order") | ||
@Slf4j | ||
@Api(tags = "订单管理接口") | ||
public class OrderController { | ||
|
||
@Autowired | ||
private OrderService orderService; | ||
|
||
/** | ||
* 订单搜索 | ||
* | ||
* @param page | ||
* @param pageSize | ||
* @param number | ||
* @param phone | ||
* @param status | ||
* @param beginTime | ||
* @param endTime | ||
* @return | ||
*/ | ||
@GetMapping("/conditionSearch") | ||
@ApiOperation("订单搜索") | ||
public R<PageResult> conditionSearch(int page, int pageSize, String number, String phone, Integer status, | ||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime, | ||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) { | ||
|
||
PageResult pageResult = orderService.conditionSearch(page, pageSize, number, phone, status, beginTime, endTime); | ||
return R.success(pageResult); | ||
} | ||
|
||
/** | ||
* 各个状态的订单数量统计 | ||
* | ||
* @return | ||
*/ | ||
@GetMapping("/statistics") | ||
@ApiOperation("各个状态的订单数量统计") | ||
public R<OrderStatisticsVO> statistics() { | ||
OrderStatisticsVO orderStatisticsVO = orderService.statistics(); | ||
return R.success(orderStatisticsVO); | ||
} | ||
|
||
/** | ||
* 订单详情 | ||
* | ||
* @param id | ||
* @return | ||
*/ | ||
@GetMapping("/details/{id}") | ||
@ApiOperation("查询订单详情") | ||
public R<OrderVO> details(@PathVariable("id") Long id) { | ||
OrderVO orderVO = orderService.details(id); | ||
return R.success(orderVO); | ||
} | ||
|
||
/** | ||
* 接单 | ||
* | ||
* @return | ||
*/ | ||
@PutMapping("/confirm") | ||
@ApiOperation("接单") | ||
public R confirm(@RequestBody OrdersConfirmDTO ordersConfirmDTO) { | ||
orderService.confirm(ordersConfirmDTO); | ||
return R.success(); | ||
} | ||
|
||
/** | ||
* 拒单 | ||
* | ||
* @return | ||
*/ | ||
@PutMapping("/rejection") | ||
@ApiOperation("拒单") | ||
public R rejection(@RequestBody OrdersRejectionDTO ordersRejectionDTO) { | ||
orderService.rejection(ordersRejectionDTO); | ||
return R.success(); | ||
} | ||
|
||
/** | ||
* 取消订单 | ||
* | ||
* @return | ||
*/ | ||
@PutMapping("/cancel") | ||
@ApiOperation("取消订单") | ||
public R cancel(@RequestBody OrdersCancelDTO ordersCancelDTO) { | ||
orderService.cancel(ordersCancelDTO); | ||
return R.success(); | ||
} | ||
|
||
/** | ||
* 派送订单 | ||
* | ||
* @return | ||
*/ | ||
@PutMapping("/delivery/{id}") | ||
@ApiOperation("派送订单") | ||
public R delivery(@PathVariable("id") Long id) { | ||
orderService.delivery(id); | ||
return R.success(); | ||
} | ||
|
||
/** | ||
* 完成订单 | ||
* | ||
* @return | ||
*/ | ||
@PutMapping("/complete/{id}") | ||
@ApiOperation("完成订单") | ||
public R complete(@PathVariable("id") Long id) { | ||
orderService.complete(id); | ||
return R.success(); | ||
} | ||
|
||
} |
75 changes: 75 additions & 0 deletions
75
reggie_server/src/main/java/com/reggie/controller/admin/WorkSpaceController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.reggie.controller.admin; | ||
|
||
import com.reggie.result.R; | ||
import com.reggie.service.WorkSpaceService; | ||
import com.reggie.vo.BusinessDataVO; | ||
import com.reggie.vo.DishOverViewVO; | ||
import com.reggie.vo.OrderOverViewVO; | ||
import com.reggie.vo.SetmealOverViewVO; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.LocalTime; | ||
|
||
@RestController | ||
@RequestMapping("/admin/workspace") | ||
@Slf4j | ||
@Api(tags = "工作台接口") | ||
public class WorkSpaceController { | ||
|
||
@Autowired | ||
private WorkSpaceService workSpaceService; | ||
|
||
|
||
/** | ||
* 查询今日营业数据 | ||
* | ||
* @return 今日营业数据 | ||
*/ | ||
@GetMapping("/businessData") | ||
@ApiOperation("查询今日营业数据") | ||
public R<BusinessDataVO> dataOverView() { | ||
log.info("今日数据接口"); | ||
//获取今天的开始和结束时间啊 | ||
LocalDateTime beginTime = LocalDateTime.now().with(LocalTime.MIN); | ||
LocalDateTime endTime = LocalDateTime.now().with(LocalTime.MAX); | ||
BusinessDataVO businessData = workSpaceService.getBusinessData(beginTime, endTime); | ||
return R.success(businessData); | ||
|
||
} | ||
/** | ||
* 查询订单管理数据 | ||
* @return | ||
*/ | ||
@GetMapping("/overviewOrders") | ||
@ApiOperation("查询订单管理数据") | ||
public R<OrderOverViewVO> orderOverView(){ | ||
return R.success(workSpaceService.getOrderOverView()); | ||
} | ||
|
||
/** | ||
* 查询菜品总览 | ||
* @return | ||
*/ | ||
@GetMapping("/overviewDishes") | ||
@ApiOperation("查询菜品总览") | ||
public R<DishOverViewVO> dishOverView(){ | ||
return R.success(workSpaceService.getDishOverView()); | ||
} | ||
|
||
/** | ||
* 查询套餐总览 | ||
* @return | ||
*/ | ||
@GetMapping("/overviewSetmeals") | ||
@ApiOperation("查询套餐总览") | ||
public R<SetmealOverViewVO> setmealOverView(){ | ||
return R.success(workSpaceService.getSetmealOverView()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.