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

客户催单

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);
    }
相关推荐
心 -2 分钟前
java八股文IOC
java
Never_Satisfied3 分钟前
在c#中,使用windows自带功能将文件夹打包为ZIP
开发语言·windows·c#
楼田莉子6 分钟前
C++项目:日志&&线程池
linux·c++·学习·visual studio code
weixin_4215850119 分钟前
表示学习发展历程
学习
hnxaoli19 分钟前
win10程序(十六)通达信参数清洗器
开发语言·python·小程序·股票·炒股
电饭叔34 分钟前
文本为 “ok”、前景色为白色、背景色为红色,且点击后触发 processOK 回调函数的 tkinter 按钮
开发语言·python
EmbedLinX1 小时前
嵌入式Linux之U-Boot
linux·服务器·笔记·学习
I_LPL2 小时前
day34 代码随想录算法训练营 动态规划专题2
java·算法·动态规划·hot100·求职面试
亓才孓2 小时前
【MyBatis Exception】Public Key Retrieval is not allowed
java·数据库·spring boot·mybatis