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

客户催单

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);
    }
相关推荐
ysa05103018 分钟前
动态规划-逆向
c++·笔记·算法
Whisper_Sy26 分钟前
Flutter for OpenHarmony移动数据使用监管助手App实战 - 网络状态实现
android·java·开发语言·javascript·网络·flutter·php
乂爻yiyao32 分钟前
1.1 JVM 内存区域划分
java·jvm
Bony-1 小时前
Go语言垃圾回收机制详解与图解
开发语言·后端·golang
hmywillstronger1 小时前
【Rhino】【Python】 查询指定字段并cloud标注
开发语言·python
新缸中之脑1 小时前
Weave.js:开源实时白板库
开发语言·javascript·开源
我能坚持多久1 小时前
D16—C语言内功之数据在内存中的存储
c语言·开发语言
leo__5201 小时前
C#与三菱PLC串口通信源码实现(基于MC协议)
开发语言·c#
没有bug.的程序员1 小时前
Spring Cloud Eureka:注册中心高可用配置与故障转移实战
java·spring·spring cloud·eureka·注册中心
杭州杭州杭州2 小时前
李沐动手学深度学习笔记(4)---物体检测基础
人工智能·笔记·深度学习