feat:打印机客户端连接异常提醒

This commit is contained in:
yanshikui 2024-11-25 15:50:57 +08:00
parent b795c96814
commit 6c3e07e6e4

View File

@ -229,7 +229,6 @@ public class PrintController {
if (CollectionUtils.isEmpty(pcBarcodes)) {
return AjaxResult.error("未查询到二维码信息!" + "(" + businessCode + ")");
}
//TODO
Long routeId = -1L, processId = -1L;
ProRouteProduct proRouteProduct = new ProRouteProduct();
proRouteProduct.setItemId(proCard.getItemId());
@ -388,6 +387,9 @@ public class PrintController {
//根据客户端和通道信息
ConcurrentHashMap<SocketAddress, Channel> channels = PrintServerDefaultHandler.chanelMap;
Channel channel = channels.get(socketAddress.get(clientIp));
if (channel == null) {
return AjaxResult.error("打印机客户端连接异常" + "(" + clientIp + ")");
}
channel.writeAndFlush(msg);
return AjaxResult.success("打印成功");
}