Parcourir la source

异物侵限报警修改

gao.qiang il y a 2 semaines
Parent
commit
2a03a93b52

+ 5 - 8
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -96,8 +96,6 @@ public class MsgAlarmController extends BaseController {
     private BaseUserService baseUserService;
     @Autowired
     private ISysDeptService deptService;
-    @Autowired
-    private BaseCameraVersionMapper baseCameraVersionMapper;
 
     /**
      * web更多消息-总数,已读数
@@ -480,15 +478,14 @@ public class MsgAlarmController extends BaseController {
             msgAlarmResp.setAlarmAttrName(stringBuilder);
             msgAlarmResp.setCardNum(baseCameraManagement.getCardNum());
             msgAlarmResp.setCameraSn(baseCameraManagement.getCameraSn());
-            BaseCameraVersion baseCameraVersion = baseCameraVersionMapper.selectById(baseCameraManagement.getId());
-            if (!ObjectUtils.isEmpty(baseCameraVersion)) {
-                if (!StringUtils.isEmpty(baseCameraVersion.getVersionName())) {
-                    msgAlarmResp.setVersionName(baseCameraVersion.getVersionName());
+            if (!ObjectUtils.isEmpty(baseCameraManagement)) {
+                if (!StringUtils.isEmpty(baseCameraManagement.getVersionName())) {
+                    msgAlarmResp.setVersionName(baseCameraManagement.getVersionName());
                 }else {
                     msgAlarmResp.setVersionName(" ");
                 }
-                if (!StringUtils.isEmpty(baseCameraVersion.getVersionNum())) {
-                    msgAlarmResp.setVersionNum(baseCameraVersion.getVersionNum());
+                if (!StringUtils.isEmpty(baseCameraManagement.getVersionNum())) {
+                    msgAlarmResp.setVersionNum(baseCameraManagement.getVersionNum());
                 }else {
                     msgAlarmResp.setVersionNum(" ");
                 }

+ 10 - 1
hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

@@ -1081,10 +1081,19 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
 
         List<BaseDeviceResume> resumes = new ArrayList<>();
         for (String cameraCode : cameraCodes) {
+            BaseDeviceDynamicManagement deviceDynamicManagement = baseDeviceDynamicManagementService.getOne(
+                    new LambdaQueryWrapper<BaseDeviceDynamicManagement>()
+                            .eq(BaseDeviceDynamicManagement::getCameraCode, cameraCode));
+
+            boolean shouldDisable = (status == 1) || (deviceDynamicManagement != null && deviceDynamicManagement.getIsDisable().equals(1));
+
             BaseDeviceResume resume = new BaseDeviceResume();
             resume.setCameraCode(cameraCode);
             resume.setIsDisable(status);
-            resumes.add(resume);
+
+            if (shouldDisable) {
+                resumes.add(resume);
+            }
         }
 
         // 批量保存