Răsfoiți Sursa

物联总览bug修改

jingyuanchao 1 an în urmă
părinte
comite
257e958b9f

+ 2 - 2
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotBoardServiceImpl.java

@@ -344,7 +344,7 @@ public class IotBoardServiceImpl implements IotBoardService {
         //物联设备最近90天的告警数据
         List<Map<String, String>> alarmCountMap = alarmDataService.selectAlarmCount(orgPath);
         //计算alarmCountMap 所有nums的总和
-        int nums = alarmCountMap.stream().mapToInt(m -> Integer.parseInt(m.get(MAP_VALUE))).sum();
+        int nums = alarmCountMap.stream().filter(m -> ObjectUtil.notEqual(Integer.parseInt(m.get(DEVICE_TYPE)), SensorType.ALARM_SENSOR.getCode())).mapToInt(m -> Integer.parseInt(m.get(MAP_VALUE))).sum();
         totalData.setTotalAlerts(nums);
 
         //传感器数据
@@ -407,7 +407,7 @@ public class IotBoardServiceImpl implements IotBoardService {
         List<MediatorVideoIntegrityCheckLog> videoIntegrityCheckLogs = iotBoardMapper.selectVideoCheckSelf(org.getPath(), DateUtil.format(offsetDay, "yyyy-MM-dd"), DateUtil.format(now, "yyyy-MM-dd"));
         if (ObjectUtil.isEmpty(videoIntegrityCheckLogs)) {
             videoInspection.setLostRate("-");
-        }else {
+        } else {
             videoInspection.setUpdateTime(videoIntegrityCheckLogs.get(0).getUpdateTime());
         }
         //获取通道数量

+ 1 - 1
soc-modules/soc-modules-iot/src/main/resources/mapper/IotAlarmDataMapper.xml

@@ -179,7 +179,7 @@
     </select>
 
     <select id="selectAlarmCount" resultType="java.util.Map">
-        select d.source_type as deviceType, CAST(SUM(1) AS CHAR) as nums
+        select CAST(d.source_type as CHAR) deviceType, CAST(SUM(1) AS CHAR) as nums
         from iot_alarm_data d
                  inner join sys_org o on o.id = d.org_id
         where o.deleted = 0 and data_type=0