Quellcode durchsuchen

Merge branch 'V0.1.1_alarm' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.1.1_alarm

zhulu vor 1 Jahr
Ursprung
Commit
560f731362

+ 4 - 4
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotCommonSensorServiceImpl.java

@@ -193,14 +193,13 @@ public class IotCommonSensorServiceImpl extends ServiceImpl<IotCommonSensorMappe
             if (ObjectUtil.isNull(deviceStatus)) {
                 throw new ServiceException("未获取到设备状态");
             }
-
-
+            final BaseDeviceTypeEnum deviceTypeEnum = BaseDeviceTypeEnum.getEnumByCode(deviceInfo.getDeviceType());
             SensorAppVo vo = new SensorAppVo();
             BeanUtils.copyProperties(deviceInfo, vo);
             BeanUtils.copyProperties(deviceStatus, vo);
             vo.setDeviceType(deviceStatus.getDeviceType());
             vo.setInfos(deviceStatus.getInfo());
-            vo.setDeviceTypeText(DictUtils.getDictLabel(DictConstants.APP_SENSOR_DEVICE_TYPE, Integer.parseInt(vo.getDeviceType())));
+            vo.setDeviceTypeText(deviceTypeEnum.getDesc());
             vo.setStateText(DictUtils.getDictLabel(DictConstants.SENSOR_ALARM_STATUS, vo.getState()));
             vo.setOrgName(orgService.concatOrgName(deviceInfo.getOrgId(), SecurityConstants.INNER));
             return vo;
@@ -209,11 +208,12 @@ public class IotCommonSensorServiceImpl extends ServiceImpl<IotCommonSensorMappe
         if (defenceArea == null) {
             throw new ServiceException("该传感器数据不存在!");
         }
+        final BaseDeviceTypeEnum deviceTypeEnum = BaseDeviceTypeEnum.getEnumByCode(defenceArea.getSensorType());
         SensorAppVo vo = new SensorAppVo();
         BeanUtils.copyProperties(defenceArea, vo);
         vo.setState("alarm".equals(defenceArea.getState()) ? 1 : 0);
         vo.setDeviceType(defenceArea.getSensorType());
-        vo.setDeviceTypeText(defenceArea.getSensorTypeName());
+        vo.setDeviceTypeText(deviceTypeEnum.getDesc());
         vo.setDeviceName(defenceArea.getDefenceAreaName());
         return vo;
     }

+ 6 - 7
soc-modules/soc-modules-iot/src/main/resources/mapper/IotDvrChannelMapper.xml

@@ -288,20 +288,19 @@
     <select id="selectAppVideoCheckChannels" resultType="com.xunmei.iot.vo.videoDiagnosis.VideoDiagnosisAppPageChannelVo">
         select dc.device_code as channelCode,
         dc.device_name as channelName,
-        if(vdc.status=0 and vic.status=0 ,0,if(vdc.status =1 or vic.status>0,1,2))
+        if( vic.status=0 ,0,if( vic.status>0,1,2))
         as state
         FROM iot_device_info dc
-        LEFT JOIN mediator_video_days_check vdc on dc.host_code=vdc.equipment_code and dc.device_code =vdc.channel_code
         LEFT JOIN mediator_video_integrity_check vic on dc.host_code=vic.equipment_code and dc.device_code =vic.channel_code
         where dc.host_code=#{hostCode} and dc.deleted=0
         <if test="state==0">
-            and (vdc.`status`=0 or vic.`status`=0)
+            and ( vic.`status`=0)
         </if>
         <if test="state==1">
-            and (vdc.`status`=1 or vic.`status`>0)
+            and ( vic.`status`>0)
         </if>
         <if test="state==2">
-            and (vdc.`status` is null or vic.`status` is null)
+            and ( vic.`status` is null)
         </if>
         order by dc.device_code asc
     </select>
@@ -424,7 +423,7 @@
             and org_id=#{pageDto.orgId}
         </if>
         and deleted=0
-        <if test="pageDto.state!=null">
+        <!--<if test="pageDto.state!=null">
             and device_code in (
             SELECT dc.host_code
             FROM iot_device_info dc
@@ -448,7 +447,7 @@
             </if>
             GROUP BY dc.host_code
             )
-        </if>
+        </if>-->
     </select>
     <select id="selectAppVideoDiagnosisPage" resultMap="appVideoDiagnosisPageMap">
         SELECT device_code as hostCode,