Explorar o código

报警接口修改

gao.qiang hai 10 meses
pai
achega
f97f70d304

+ 6 - 2
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -745,9 +745,13 @@ public class BaseCameraManagementController extends BaseController {
 //        if (!StringUtils.isEmptySunhh(baseCameraManagementList) && baseCameraManagementList.size() > 0) {
 //            String url = cameraUtil.streamConversion(baseCameraManagementList.get(0).getCameraCode());
         if (!ObjectUtils.isEmpty(msgAlarm)){
-            return new AjaxResult(200, "ok", msgAlarm.getReleasedUrl());
+            if (StringUtils.isNotEmpty(msgAlarm.getReleasedUrl())) {
+                return new AjaxResult(200, "ok", msgAlarm.getReleasedUrl());
+            }else {
+                return AjaxResult.error("暂未生成报警视频");
+            }
         } else {
-            return AjaxResult.error("未生成报警视频");
+            return AjaxResult.error("生成报警视频");
         }
     }
 

+ 12 - 1
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -77,6 +77,8 @@ public class MsgAlarmController extends BaseController {
     private BaseTerminalService baseTerminalService;
     @Autowired
     private CameraUtil cameraUtil;
+    @Resource
+    private MsgAlarmExtService msgAlarmExtService;
 
     /**
      * web更多消息-总数,已读数
@@ -208,6 +210,11 @@ public class MsgAlarmController extends BaseController {
                     String name = stringBuilder.toString();
                     o.setTrainNumName(name.substring(0, stringBuilder.lastIndexOf(",")));
                 }
+                List<MsgAlarmExt> list1 = msgAlarmExtService.list(new LambdaQueryWrapper<MsgAlarmExt>().eq(MsgAlarmExt::getAlarmId, o.getAlarmId()));
+                if (!ObjectUtils.isEmpty(list1)) {
+                    List<String> collect = list1.stream().map(MsgAlarmExt::getAlarmAttPath).collect(Collectors.toList());
+                    o.setImageUrls(collect);
+                }
                 return o;
             }).collect(Collectors.toList());
             page.setRecords(dto1);
@@ -378,7 +385,11 @@ public class MsgAlarmController extends BaseController {
             if (msgAlarm.getAlarmType() == 2) {
                 msgAlarmResp.setAlarmUrl("https://rtmp01open.ys7.com:9188/v3/openlive/K38316196_1_1.flv?expire=1745409016&id=704781554165264384&t=477265ab4d36debe072836e0b16755ba50303c3b8eb165a628bc9c0a0328afb5&ev=100");
             }else {
-                msgAlarmResp.setAlarmUrl(cameraUtil.getPlayFlv(baseCameraManagement.getCameraCode(), "channel"));
+                if (StringUtils.isNotEmpty(baseCameraManagement.getCameraCode())) {
+                    msgAlarmResp.setAlarmUrl(cameraUtil.getPlayFlv(baseCameraManagement.getCameraCode(), "channel"));
+                }else {
+                    return success("该报警信息无匹配相机");
+                }
             }
             return AjaxResult.success(msgAlarmResp);
         } else {