Bladeren bron

磁盘查询bug处理

jingyuanchao 1 jaar geleden
bovenliggende
commit
16c656a965

+ 1 - 1
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/video/service/impl/IotDvrDiskServiceImpl.java

@@ -98,10 +98,10 @@ public class IotDvrDiskServiceImpl extends ServiceImpl<IotDvrDiskMapper, IotDvrD
                 iotDvrDisk.setOrgName(req.getOrgName());
                 iotDvrDisk.setOrgPath(req.getOrgPath());
                 iotDvrDisk.setHostCode(req.getEquipmentCode());
-                iotDvrDisk.setIotToken(token);
                 iotDvrDisk.setDiskIndex(index);
                 iotDvrDisk.setSource(1);
             }
+            iotDvrDisk.setIotToken(token);
             String totalBytes = String.valueOf(map.get("totalBytes"));
             String availableBytes = String.valueOf(map.get("availableBytes"));
             String originState = String.valueOf(map.get("originState"));

+ 2 - 2
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/video/service/impl/IotDvrHardDiskDetectionServiceImpl.java

@@ -268,7 +268,7 @@ public class IotDvrHardDiskDetectionServiceImpl extends ServiceImpl<IotDvrHardDi
             throw new RuntimeException(e);
         }
 
-        TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
+       /* TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
             @Override
             public void afterCommit() {
                 try {
@@ -277,6 +277,6 @@ public class IotDvrHardDiskDetectionServiceImpl extends ServiceImpl<IotDvrHardDi
                     throw new RuntimeException(e);
                 }
             }
-        });
+        });*/
     }
 }

+ 2 - 3
soc-modules/soc-modules-iot/src/main/resources/mapper/DvrDiskMapper.xml

@@ -213,7 +213,7 @@
         SUM(dd.exceptionCount) as diskExceptionCount
         FROM iot_device_info d
         LEFT JOIN
-        (SELECT host_code,count(0) as count,SUM(if(state=1,1,0)) as exceptionCount from iot_dvr_disk WHERE
+        (SELECT  org_id, host_code,count(0) as count,SUM(if(state=1,1,0)) as exceptionCount from iot_dvr_disk WHERE
         deleted=0
         <if test="pageDto.checkSub==true">
             and org_path like concat(#{orgPath},"%")
@@ -221,8 +221,7 @@
         <if test="pageDto.checkSub==false">
             and org_id = #{pageDto.orgId}
         </if>
-
-        group by host_code) dd on dd.host_code =d.device_code
+        group by org_id,host_code ) dd on dd.host_code =d.device_code and d.org_id=dd.org_id
         where d.deleted=0 and d.device_type=1
         <if test="pageDto.checkSub==true">
             and d.org_path like concat(#{orgPath},"%")