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

客户催单

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);
    }
相关推荐
_MyFavorite_2 分钟前
JAVA重点基础、进阶知识及易错点总结(10)Map 接口(HashMap、LinkedHashMap、TreeMap)
java·开发语言
Rsun045513 分钟前
AI智能体学习路线
人工智能·学习
qqty12178 分钟前
Spring Boot管理用户数据
java·spring boot·后端
feasibility.9 分钟前
SSH Agent Forwarding 与 tmux 排障笔记
linux·运维·服务器·经验分享·笔记·ssh
Flittly12 分钟前
【SpringAIAlibaba新手村系列】(1)初识 Spring AI Alibaba 框架
java·spring
charlie11451419113 分钟前
通用GUI编程技术——Win32 原生编程实战(十六)——Visual Studio 资源编辑器使用指南
开发语言·c++·ide·学习·gui·visual studio·win32
知识分享小能手19 分钟前
MongoDB入门学习教程,从入门到精通,MongoDB查询(4)
数据库·学习·mongodb
weixin_4093831219 分钟前
godot等轴视角tilemaplayer的学习 isocheric的素材xy大小怎么调
学习·游戏引擎·godot
LSL666_43 分钟前
MybatisPlus条件构造器(上)
java·数据库·mysql·mybatisplus
2201_754864781 小时前
学习日记(2026年3月23日)
学习