feat(printer): 实现打印机任务WebSocket实时推送功能

- 新增PrinterTaskPushService接口及实现,负责任务推送逻辑
- 在PrinterServiceImpl中集成WebSocket推送,在任务创建和审核通过时主动推送
- 新增WebSocket配置类和处理器,支持打印机通过WebSocket连接接收任务
- 实现连接管理器,维护打印机在线状态并支持心跳保活
- 添加相关模型类如WsMessage、WsMessageType等,规范通信协议
- 在PrinterMapper中增加查询待处理任务列表的方法
- 完善异常处理和日志记录,确保推送可靠性
This commit is contained in:
2025-12-01 09:59:21 +08:00
parent 1de760fc87
commit d590286b13
13 changed files with 710 additions and 1 deletions

View File

@@ -26,6 +26,8 @@ public interface PrinterMapper {
PrintTaskResp findTaskByPrinterId(Integer printerId);
List<PrintTaskResp> listPendingTasksByPrinterId(Integer printerId);
int updateTaskStatus(@Param("id") Integer id, @Param("status") Integer status);
int compareAndSetTaskStatus(@Param("id") Integer id,