苍穹外卖学习笔记(二十七)

客户催单

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);
    }
相关推荐
lsx20240627 分钟前
jQuery 删除元素
开发语言
2601_949816225 小时前
Redis 配置日志
java
遇见你...5 小时前
A01-Spring概述
java·后端·spring
紫金修道7 小时前
【DeepAgent】概述
开发语言·数据库·python
Via_Neo7 小时前
JAVA中以2为底的对数表示方式
java·开发语言
书到用时方恨少!8 小时前
Python multiprocessing 使用指南:突破 GIL 束缚的并行计算利器
开发语言·python·并行·多进程
cch89188 小时前
PHP五大后台框架横向对比
开发语言·php
天真萌泪8 小时前
JS逆向自用
开发语言·javascript·ecmascript
野生技术架构师9 小时前
一线大厂Java面试八股文全栈通关手册(含源码级详解)
java·开发语言·面试
摇滚侠9 小时前
如何选择 nodejs 版本,nodejs 版本号详解
学习