客户催单
OrderController
java
/**
* 催单
*/
@GetMapping("/reminder/{id}")
@ApiOperation("催单")
public Result reminder(@PathVariable("id") Long id) {
orderService.reminder(id);
return Result.success();
}
OrderServer
java
/**
* 催单
*/
void reminder(Long id);
OrderServerImpl
java
/**
* 催单
*/
@Override
public void reminder(Long id) {
Orders ordersDB = orderMapper.selectById(id);
if (ordersDB == null) {
throw new OrderBusinessException(MessageConstant.ORDER_NOT_FOUND);
}
Map map = new HashMap();
map.put("type", 2);//2表示催单提醒
map.put("orderId", ordersDB.getId());
map.put("content", "订单号: " + ordersDB.getNumber() + " 有催单,请及时处理!");
String json = JSON.toJSONString(map);
webSocketServer.sendToAllClient(json);
}