瀏覽代碼

铁塔事件复核

lyq 3 月之前
父節點
當前提交
8f5e45521e

+ 7 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/FireIncidentController.java

@@ -10,6 +10,7 @@ import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.DaHuaEventBO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.sensor.SensorEventVo;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.tower.TowerEventVo;
 import com.sooka.sponest.event.centereventteventcatalogue.service.AlarmEventService;
 import com.sooka.sponest.event.centereventtreportmessage.domain.CentereventTReportmessage;
 import com.sooka.sponest.event.centereventtreportmessage.service.ICentereventTReportmessageService;
@@ -85,6 +86,12 @@ public class FireIncidentController {
         if (StringUtils.isNull(centereventTReportmessage)) {
             return AjaxResult.success("参数异常");
         }
+        if (centereventTReportmessage.getSource().contains("铁塔")) {
+            // 解析报文
+            JSONObject jsonObject = JSONObject.parseObject(centereventTReportmessage.getContext());
+            TowerEventVo towerEventVo = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), TowerEventVo.class);
+            return AjaxResult.success(alarmEventService.updateFireEventImage(towerEventVo, eventBO.getLogId()));
+        }
         // 解析报文
         JSONObject context = JSONObject.parseObject(centereventTReportmessage.getContext()).getJSONObject("info");
         eventBO.setAlarmCode(context.getString("alarmCode"));

+ 3 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/AlarmEventService.java

@@ -30,6 +30,9 @@ public interface AlarmEventService {
     // 铁塔事件
     String insertTowerEvent(TowerEventVo towerEventVo);
 
+    // 铁塔事件-图片回查
+    String updateFireEventImage(TowerEventVo towerEventVo, String logId);
+
 
     // 传感器事件
     String insertSensorEvent(SensorEventVo sensorEventVo);

+ 40 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/AlarmEventServiceImpl.java

@@ -549,6 +549,46 @@ public class AlarmEventServiceImpl implements AlarmEventService {
         return centereventTEventcatalogue.getEventCode();
     }
 
+    @Override
+    public String updateFireEventImage(TowerEventVo towerEventVo, String logId) {
+        List<CenterdataTAttach> attachList = new ArrayList<>();
+        String orderCode = SpringUtils.getBean(RemoteMonitorService.class).getOrderCodeByChinaTowerDeviceCode(towerEventVo.getDeviceCode());
+        if (StringUtils.isNotBlank(towerEventVo.getOriginalPictureUrl())) {
+            String[] pictures = towerEventVo.getOriginalPictureUrl().split(",");
+            for (String picture : pictures) {
+                CenterdataTAttach tAttach = new CenterdataTAttach();
+                tAttach.setBusId(logId);
+                tAttach.setAttachPath(GWHttpUtilsTest65.encrypt(picture, orderCode));
+                tAttach.setBusIndx(BUS_INDEX_2);
+                tAttach.setBusSource("TT_1");
+                tAttach.setFileType(FILE_TYPE_1);
+                attachList.add(tAttach);
+            }
+        }
+        if (StringUtils.isNotBlank(towerEventVo.getAlarmPictureUrl())) {
+            String[] pictures = towerEventVo.getAlarmPictureUrl().split(",");
+            for (String picture : pictures) {
+                CenterdataTAttach tAttach = new CenterdataTAttach();
+                tAttach.setBusId(logId);
+                tAttach.setAttachPath(GWHttpUtilsTest65.encrypt(picture, orderCode));
+                tAttach.setBusIndx(BUS_INDEX_2);
+                tAttach.setBusSource("TT_1");
+                tAttach.setFileType(FILE_TYPE_1);
+                attachList.add(tAttach);
+            }
+        }
+        if (StringUtils.isNotBlank(towerEventVo.getAlarmVideoUrl())) {
+            CenterdataTAttach tAttach = new CenterdataTAttach();
+            tAttach.setBusId(logId);
+            tAttach.setAttachPath(GWHttpUtilsTest65.encrypt(towerEventVo.getAlarmVideoUrl(), orderCode));
+            tAttach.setBusIndx(BUS_INDEX_2);
+            tAttach.setBusSource("TT_1");
+            tAttach.setFileType(FILE_TYPE_2);
+            attachList.add(tAttach);
+        }
+        return remoteDataService.delAndInsertBatch(JSON.toJSONString(attachList)).getMsg();
+    }
+
     @Transactional
     @Override
     public String insertSensorEvent(SensorEventVo sensorEventVo) {