From fb97e421bb792344c963a5eaebc1da71c81e5394 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Thu, 22 May 2025 20:01:58 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=9A=82=E6=80=81-=E7=94=B5=E5=8E=8B?= =?UTF-8?q?=E5=B9=85=E5=80=BC=E5=8D=95=E4=BD=8D=E9=97=AE=E9=A2=98=202?= =?UTF-8?q?=E3=80=81=E8=84=9A=E6=9C=AC=E4=B8=8EICD=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=97=B610500=E9=94=99=E8=AF=AF=E7=A0=81=203=E3=80=81=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=96=AD=E5=BC=80WebSocket=E8=BF=9E=E6=8E=A5=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E5=8F=B0=E6=9C=8D=E5=8A=A1=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=92=8C=E6=BA=90=E3=80=81=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=9A=84Socket=E8=BF=9E=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gather/detection/handler/SocketDevResponseService.java | 4 ++++ .../gather/detection/pojo/enums/SourceResponseCodeEnum.java | 1 + .../detection/service/impl/PreDetectionServiceImpl.java | 1 + .../com/njcn/gather/detection/util/socket/CnSocketUtil.java | 2 ++ .../njcn/gather/detection/util/socket/WebServiceManager.java | 3 +++ .../gather/storage/service/impl/AdNonHarmonicServiceImpl.java | 2 +- 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java index 8d87b7c9..c7afed23 100644 --- a/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java +++ b/detection/src/main/java/com/njcn/gather/detection/handler/SocketDevResponseService.java @@ -948,6 +948,10 @@ public class SocketDevResponseService { WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg)); CnSocketUtil.quitSend(param); break; + case ICD_NOT_FOUND: + WebServiceManager.sendMsg(param.getUserPageId(), JSON.toJSONString(socketDataMsg)); + CnSocketUtil.quitSend(param); + break; default: CnSocketUtil.sendUnSocket(param.getUserPageId()); break; diff --git a/detection/src/main/java/com/njcn/gather/detection/pojo/enums/SourceResponseCodeEnum.java b/detection/src/main/java/com/njcn/gather/detection/pojo/enums/SourceResponseCodeEnum.java index 39cc43a5..d440c3e6 100644 --- a/detection/src/main/java/com/njcn/gather/detection/pojo/enums/SourceResponseCodeEnum.java +++ b/detection/src/main/java/com/njcn/gather/detection/pojo/enums/SourceResponseCodeEnum.java @@ -13,6 +13,7 @@ public enum SourceResponseCodeEnum { SUCCESS(10200, "请求成功"), UNPROCESSED_BUSINESS(10201, "立即响应,业务还未处理,类似肯定应答"), NORMAL_RESPONSE(10202, "正常响应中间状态码"), + ICD_NOT_FOUND(10500, "未找到对应ICD"), MESSAGE_PARSING_ERROR(10520, "报文解析有误"), CONTROLLED_SOURCE_ERROR(10521, "程控源参数有误"), TEST_ITEM_PARSING_ERROR(10522, "测试项解析有误"), diff --git a/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java b/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java index 4bf62670..e8af2e53 100644 --- a/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/detection/service/impl/PreDetectionServiceImpl.java @@ -133,6 +133,7 @@ public class PreDetectionServiceImpl implements PreDetectionService { private void sendYtxSocket(PreDetectionParam param) { + WebServiceManager.addPreDetectionParam(param); AdPlan plan = iAdPlanService.getById(param.getPlanId()); AdPlanSource planSource = adPlanSourceService.getOne(new LambdaQueryWrapper().eq(AdPlanSource::getPlanId, param.getPlanId())); param.setSourceId(planSource.getSourceId()); diff --git a/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java b/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java index 52763701..454b7f9f 100644 --- a/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java +++ b/detection/src/main/java/com/njcn/gather/detection/util/socket/CnSocketUtil.java @@ -25,6 +25,7 @@ public class CnSocketUtil { socketMsg.setRequestId(SourceOperateCodeEnum.QUITE.getValue()); socketMsg.setOperateCode(SourceOperateCodeEnum.QUIT_INIT_03.getValue()); SocketManager.sendMsg(param.getUserPageId() + devTag, JSON.toJSONString(socketMsg)); + WebServiceManager.removePreDetectionParam(); } /** @@ -38,6 +39,7 @@ public class CnSocketUtil { jsonObject.put("sourceId", param.getSourceId()); socketMsg.setData(jsonObject.toJSONString()); SocketManager.sendMsg(param.getUserPageId() + sourceTag, JSON.toJSONString(socketMsg)); + WebServiceManager.removePreDetectionParam(); } /** diff --git a/detection/src/main/java/com/njcn/gather/detection/util/socket/WebServiceManager.java b/detection/src/main/java/com/njcn/gather/detection/util/socket/WebServiceManager.java index 5a5b49b0..455c1e79 100644 --- a/detection/src/main/java/com/njcn/gather/detection/util/socket/WebServiceManager.java +++ b/detection/src/main/java/com/njcn/gather/detection/util/socket/WebServiceManager.java @@ -55,6 +55,9 @@ public class WebServiceManager { channel.writeAndFlush(wd); }else { log.error("{}-websocket推送消息失败;当前用户-{}-客户端已经断开连接", LocalDateTime.now(),userId); + PreDetectionParam param = preDetectionParamMap.get("preDetectionParam"); + CnSocketUtil.quitSend(param); + CnSocketUtil.quitSendSource(param); } } diff --git a/storage/src/main/java/com/njcn/gather/storage/service/impl/AdNonHarmonicServiceImpl.java b/storage/src/main/java/com/njcn/gather/storage/service/impl/AdNonHarmonicServiceImpl.java index c1b5b46b..def2ab99 100644 --- a/storage/src/main/java/com/njcn/gather/storage/service/impl/AdNonHarmonicServiceImpl.java +++ b/storage/src/main/java/com/njcn/gather/storage/service/impl/AdNonHarmonicServiceImpl.java @@ -264,7 +264,7 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl