From 09c4bfc9924fa21d264578292e0226c2b79e3759 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期五, 06 三月 2026 10:01:07 +0800
Subject: [PATCH] 处理设备消息推送

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/WarningServiceImpl.java           |   29 --------------
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java     |    7 ++-
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java |   18 ++-------
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java            |   27 ++++++++++++-
 4 files changed, 32 insertions(+), 49 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
index 72f6c8f..d66c345 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
@@ -54,6 +54,8 @@
     private SystemDictDataBiz systemDictDataBiz;
     @Autowired
     private PlatformBroadcastLogMapper platformBroadcastLogMapper;
+    @Autowired
+    private InterfaceLogMapper interfaceLogMapper;
 
 
     @Override
@@ -279,9 +281,9 @@
         String input = "";
 
         model.setSendInfo(param.getSendInfo());
-        return  sendBroadcaseBobaoHttpBiz(model);
+        return  sendBroadcaseBobaoHttpBiz(model,interfaceLogMapper);
     }
-    public static String sendBroadcaseBobaoHttpBiz(Device model){
+    public static String sendBroadcaseBobaoHttpBiz(Device model,InterfaceLogMapper interfaceLogMapper){
         //閲嶆柊涓嬪彂璁″垝
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("command","start");
@@ -298,8 +300,27 @@
         log.error("========娴峰悍骞挎挱鎾斁鍏ュ弬鍐呭 : " + params);
         String result = HttpsUtil.doPutHk(model.getIp(),Integer.parseInt(StringUtils.defaultString(model.getPort(),"80")),model.getDoorId(), model.getDoorName()
                 ,"/ISAPI/AccessControl/EventCardLinkageCfg/TTSAudio?format=json",params);
-
         log.error("========娴峰悍骞挎挱鎾斁杩斿洖鍐呭 : " + result);
+
+        JSONObject resultJson = JSONObject.parseObject(result);
+        Boolean success = false;
+        if(Constants.equalsInteger(resultJson.getInteger("statusCode"),Constants.ONE)){
+            success = true;
+        }
+        InterfaceLog log = new InterfaceLog();
+        log.setCreateDate(new Date());
+        log.setUrl("/ISAPI/AccessControl/EventCardLinkageCfg/TTSAudio?format=json");
+        log.setEditDate(log.getCreateDate());
+        log.setPlat(Constants.ZERO);
+        log.setName("娴峰悍骞挎挱鎾斁");
+        log.setIsdeleted(Constants.ZERO);
+        log.setRequest(params);
+        log.setType(Constants.ZERO);
+        log.setSuccess(success?Constants.ZERO:Constants.ONE);
+        log.setRepose(result);
+        interfaceLogMapper.insert(log);
+
+
         return result;
     }
     @Override
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java
index cf3faef..29b9403 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/JkCabinetGridServiceImpl.java
@@ -67,6 +67,9 @@
     private DeviceMapper deviceMapper;
 
     @Autowired
+    private InterfaceLogMapper interfaceLogMapper;
+
+    @Autowired
     private MemberMapper memberMapper;
 
     @Autowired
@@ -715,9 +718,7 @@
                         warningEvent.setStatus(Constants.TWO);
                         warningEventMapper.updateById(warningEvent);
                     }
-
                 }
-
             }
         }
     }
@@ -732,7 +733,7 @@
             if(CollectionUtils.isNotEmpty(deviceList)){
                 for (Device device:deviceList) {
                     device.setSendInfo(warningRule.getDeviceNoticeContent());
-                    DeviceServiceImpl.sendBroadcaseBobaoHttpBiz(device);
+                    DeviceServiceImpl.sendBroadcaseBobaoHttpBiz(device,interfaceLogMapper);
                 }
             }
         }
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/WarningServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/WarningServiceImpl.java
index da0bdca..cdf162f 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/WarningServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/WarningServiceImpl.java
@@ -315,9 +315,6 @@
                     model.setSubscribeStatus(Constants.TWO);
                     model.setSubscribeInfo(response.getMsg());
                 }
-
-               startCheckThirdDest(eventParam);
-
             }else{
                 model.setSubscribeStatus(Constants.ZERO);
             }
@@ -326,32 +323,6 @@
         model.setEditDate(new Date());
         model.setEditor(param.getLoginUserInfo().getId());
         warningMapper.updateById(model);
-    }
-
-    /**
-     * 妫�鏌ヤ笁鏂规槸鍚﹂渶瑕佽闃呮捣搴蜂簨浠�
-     * @param eventParam
-     */
-
-    private void startCheckThirdDest(EventSubRequest eventParam) {
-        try {
-            String thirdpath =systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_PUSH_THIRD_URL).getCode();
-            if(StringUtils.isNotBlank(thirdpath)){
-                String[] ss = thirdpath.split(";");
-                for(String s : ss){
-                    eventParam.setEventDest(s);
-                    BaseResponse response =   HKService.eventSub(eventParam);
-                    if(Objects.nonNull(response)&&StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
-                        log.error("========璁㈤槄鍏朵粬涓夋柟鍦板潃鎴愬姛:"+s);
-                    }else{
-                        log.error("========璁㈤槄鍏朵粬涓夋柟鍦板潃閿欒:"+s);
-                    }
-                }
-            }
-        }catch (Exception e){
-        log.error("========璁㈤槄鍏朵粬涓夋柟鍦板潃閿欒"+e.getMessage());
-        }
-
     }
 
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index 4adad16..50a1a94 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -506,7 +506,7 @@
                     if(Objects.nonNull(warningConfig)){
                         List<Integer> ruleIdList =  impl.processWarnFront(warningConfig);
 
-                        Boolean falg = false;
+                        Boolean falg = true;
                         if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ruleIdList)){
                             for (Integer ruleId:ruleIdList) {
                                 WarningRule warningRule = warningRuleMapper.selectById(ruleId);
@@ -544,31 +544,21 @@
                                         //                dingTalk.getAlarmNoticeMsg(warningPush.getRegion(),DateUtil.getCurrDateTime(),warningConfig.getInfo()));
 //                                  warningPush.setStatus(noticeFlag?Constants.ONE:Constants.TWO);
                                     }
-                                    warningPushMapper.insert(warningPush);
                                     impl.sendDeviceNotice(warningRule);
+                                    warningPushMapper.insert(warningPush);
 
-                                    falg = true;
                                 }catch (Exception e){
+                                    falg = false;
                                     warningEvent.setStatus(Constants.TWO);
                                     warningEventMapper.updateById(warningEvent);
                                 }
                             }
                         }
-                        if(falg){
+                        if(!falg){
                             warningEvent.setStatus(Constants.ONE);
                             warningEventMapper.updateById(warningEvent);
                         }
-
-
-
-
-
-
                     }
-
-
-
-
                 }
 
             }

--
Gitblit v1.9.3