Эх сурвалжийг харах

Merge branch 'V0.0.6-iot' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.6-iot

lijun 1 жил өмнө
parent
commit
216eaab2ab

+ 7 - 0
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/IotAlarmSubSystemServiceImpl.java

@@ -196,6 +196,13 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
         protection.setStatusUpdatorId(null);
         protection.setStatusUpdatorName(null);
         this.updateById(protection);
+        //临时换文件处理,等下次打完整包的时候删除这段代码
+        LambdaUpdateWrapper<IotAlarmSubsystem> updateWrapper=new LambdaUpdateWrapper<>();
+        updateWrapper.eq(IotAlarmSubsystem::getId,protection.getId());
+        updateWrapper.set(IotAlarmSubsystem::getStatusUpdatorId,null);
+        updateWrapper.set(IotAlarmSubsystem::getStatusUpdatorName,null);
+        this.update(updateWrapper);
+
         this.northStatisticsSyncService.saveOrUpdateBusinessCountByDateAndDataType(DateUtil.today(), DataType.protectionStatusCount.getIndex(), 1L);
         this.saveProtectionLog(protection);
         return result;

+ 19 - 10
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/IotDvrDiskServiceImpl.java

@@ -9,10 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.CacheConstants;
-import com.xunmei.common.core.domain.iot.domain.IotAlarmDefenceArea;
-import com.xunmei.common.core.domain.iot.domain.IotDevice;
-import com.xunmei.common.core.domain.iot.domain.IotDvrDisk;
-import com.xunmei.common.core.domain.iot.domain.IotDvrHardDiskDetection;
+import com.xunmei.common.core.domain.iot.domain.*;
 import com.xunmei.common.core.enums.CategoryDataEnum;
 import com.xunmei.common.core.utils.IDHelper;
 import com.xunmei.common.redis.utils.RedisUtils;
@@ -29,6 +26,7 @@ import com.xunmei.system.api.enums.DataType;
 import com.xunmei.system.api.util.LogUtils;
 import com.xunmei.system.api.vo.SysOrgVO;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -58,6 +56,8 @@ public class IotDvrDiskServiceImpl extends ServiceImpl<IotDvrDiskMapper, IotDvrD
     private NorthErrorService northErrorService;
     @Autowired
     private IIotDeviceService iotDeviceService;
+    @Autowired
+    private IotDvrDiskLogService diskLogService;
 
 
     @Override
@@ -74,13 +74,15 @@ public class IotDvrDiskServiceImpl extends ServiceImpl<IotDvrDiskMapper, IotDvrD
                 continue;
             }
             final Optional<IotDvrDisk> first = list.stream().filter(disk -> ObjectUtil.equal(disk.getDiskIndex(), String.valueOf(index))).findFirst();
-            if (first.isPresent()) {
-                final IotDvrDisk iotDvrDisk = first.get();
-                iotDvrDisk.setState((Integer) map.get("state"));
-                iotDvrDisk.setStateUpdateTime(videoRecorderHardDiskDetection.getCheckTime());
-                iotDvrDisk.setUpdateTime(LocalDateTime.now());
-                diskArrayList.add(iotDvrDisk);
+            if (!first.isPresent()) {
+                LogUtils.STATUS_INFO_DISKS.error("硬盘检测上报消息处理磁盘状态时未找到对应磁盘,主机code:{},磁盘号:{}",equipmentCode,index);
+                continue;
             }
+            final IotDvrDisk iotDvrDisk = first.get();
+            iotDvrDisk.setState((Integer) map.get("state"));
+            iotDvrDisk.setStateUpdateTime(videoRecorderHardDiskDetection.getCheckTime());
+            iotDvrDisk.setUpdateTime(LocalDateTime.now());
+            diskArrayList.add(iotDvrDisk);
         }
         updateBatchById(diskArrayList);
     }
@@ -119,6 +121,13 @@ public class IotDvrDiskServiceImpl extends ServiceImpl<IotDvrDiskMapper, IotDvrD
             wrapper.in(IotDvrDisk::getOrgId, orgIdLIst);
             this.remove(wrapper);
             this.saveOrUpdateBatch(dvrdisks);
+            for (IotDvrDisk dvrdisk : dvrdisks) {
+                final IotDvrDiskLog diskLog = new IotDvrDiskLog();
+                BeanUtils.copyProperties(dvrdisk, diskLog, "id");
+                diskLog.setIotDvrDiskId(dvrdisk.getId());
+                diskLogService.save(diskLog);
+            }
+
         }
     }
 

+ 2 - 1
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/IotDvrHardDiskDetectionServiceImpl.java

@@ -191,9 +191,10 @@ public class IotDvrHardDiskDetectionServiceImpl extends ServiceImpl<IotDvrHardDi
         this.saveOrUpdate(videoRecorderHardDiskDetection);
         videoRecorderHardDiskDetectionLogService.saveOrUpdate(videoRecorderHardDiskDetectionLog);
         try {
+            LogUtils.STATUS_INFO_DISKS.info("硬盘检测上报状态消息,开始处理对应盘符状态.....");
             iotDvrDiskService.updateStatusByDiskDetection(videoRecorderHardDiskDetection);
         } catch (Exception e) {
-            LogUtils.STATUS_INFO_DISKS.error("硬盘检测处理处理磁盘状态时发生异常!内容:{}",e.getMessage());
+            LogUtils.STATUS_INFO_DISKS.error("硬盘检测处理处理对应盘符状态时发生异常!内容:{}",e.getMessage());
             throw new RuntimeException(e);
         }
 

+ 3 - 0
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/VideoIntegrityCheckServiceImpl.java

@@ -151,12 +151,15 @@ public class VideoIntegrityCheckServiceImpl extends ServiceImpl<VideoIntegrityCh
         MediatorVideoIntegrityCheckLog logData = integrityCheckLogService.findByOrgIdAndEquipmentCodeAndChannelCode(videoIntegrityCheck.getOrgId(), videoIntegrityCheck.getEquipmentCode(), videoIntegrityCheck.getChannelCode(), videoIntegrityCheck.getRecordDate());
         if (logData != null) {
             BeanUtils.copyProperties(videoIntegrityCheck, logData, "id");
+            logData.setUpdateTime(new Date());
             integrityCheckLogService.updateById(logData);
             return;
         }
         BeanUtils.copyProperties(videoIntegrityCheck, newLog);
         newLog.setId(IdWorker.getId());
         newLog.setVideoIntegrityCheckId(videoIntegrityCheck.getId());
+        newLog.setCreateTime(new Date());
+        newLog.setUpdateTime(new Date());
         integrityCheckLogService.save(newLog);
 
     }