完成客户催单功能
This commit is contained in:
parent
682786dd27
commit
1116905790
@ -118,4 +118,16 @@ public class OrderController {
|
||||
orderService.repetition(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户催单
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/reminder/{id}")
|
||||
@ApiOperation("用户催单")
|
||||
public Result reminder(@PathVariable Long id) {
|
||||
orderService.reminder(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
@ -99,4 +99,10 @@ public interface OrderService {
|
||||
* @param id
|
||||
*/
|
||||
void complete(Long id);
|
||||
|
||||
/**
|
||||
* 订单催单
|
||||
* @param id
|
||||
*/
|
||||
void reminder(Long id);
|
||||
}
|
||||
|
@ -478,6 +478,25 @@ public class OrderServiceImpl implements OrderService {
|
||||
orderMapper.update(orders);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单催单
|
||||
* @param id
|
||||
*/
|
||||
public void reminder(Long id) {
|
||||
// 查询订单是否存在
|
||||
Orders orders = orderMapper.getById(id);
|
||||
if (orders == null) {
|
||||
throw new OrderBusinessException(MessageConstant.ORDER_NOT_FOUND);
|
||||
}
|
||||
|
||||
//基于WebSocket实现催单
|
||||
Map map = new HashMap();
|
||||
map.put("type", 2);//2代表用户催单
|
||||
map.put("orderId", id);
|
||||
map.put("content", "订单号:" + orders.getNumber());
|
||||
webSocketServer.sendToAllClient(JSON.toJSONString(map));
|
||||
}
|
||||
|
||||
private List<OrderVO> getOrderVOList(Page<Orders> page) {
|
||||
//需要返回订单菜品信息,自定义OrderVO响应结果
|
||||
List<OrderVO> orderVOList = new ArrayList<>();
|
||||
|
Loading…
Reference in New Issue
Block a user