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

客户催单

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);
    }
相关推荐
m0_6398171511 分钟前
基于springboot火锅店管理系统【带源码和文档】
java·spring boot·后端
MasterLi802325 分钟前
我的读书清单
android·linux·学习
hssfscv26 分钟前
JAVA学习笔记——集合的概念和习题
笔记·学习
ha204289419441 分钟前
Linux操作系统学习之---初识网络
linux·网络·学习
怪兽20141 小时前
fastjson在kotlin不使用kotlin-reflect库怎么使用?
android·开发语言·kotlin
ClearLiang1 小时前
Kotlin-协程的挂起与恢复
开发语言·kotlin
彭同学学习日志1 小时前
Kotlin Fragment 按钮跳转报错解决:Unresolved reference ‘floatingActionButton‘
android·开发语言·kotlin
海域云赵从友1 小时前
破解跨境数据传输瓶颈:中国德国高速跨境组网专线与本地化 IP 的协同策略
开发语言·php
咚咚王者1 小时前
人工智能之编程进阶 Python高级:第九章 爬虫类模块
开发语言·python
会编程的林俊杰1 小时前
SpringBoot项目启动时的依赖处理
java·spring boot·后端