|
|
@@ -1,15 +1,19 @@
|
|
|
package com.xunmei.iot.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.xunmei.common.core.domain.iot.domain.IotServerInfo;
|
|
|
import com.xunmei.common.core.domain.video.MediatorVideoDiagnosisRecord;
|
|
|
import com.xunmei.iot.mapper.IotDeviceInfoMapper;
|
|
|
import com.xunmei.iot.mapper.VideoDaysCheckMapper;
|
|
|
import com.xunmei.iot.mapper.VideoDiagnosisRecordMapper;
|
|
|
+import com.xunmei.iot.service.IotServerInfoService;
|
|
|
import com.xunmei.iot.service.IotService;
|
|
|
import com.xunmei.system.api.domain.iot.IotDeviceInfo;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
public class IotServiceImpl implements IotService {
|
|
|
@@ -20,6 +24,9 @@ public class IotServiceImpl implements IotService {
|
|
|
VideoDiagnosisRecordMapper diagnosisRecordMapper;
|
|
|
@Resource
|
|
|
IotDeviceInfoMapper iotDeviceInfoMapper;
|
|
|
+ @Resource
|
|
|
+ IotServerInfoService iotServerInfoService;
|
|
|
+
|
|
|
@Override
|
|
|
public Integer selectVideoDayExceptionChannelNums(Long orgId) {
|
|
|
//此处考虑录像完整性和录像天数,任意一个异常就算异常
|
|
|
@@ -31,10 +38,15 @@ public class IotServiceImpl implements IotService {
|
|
|
public Integer selectVideoDiagnosisExceptionChannelNums(Long orgId) {
|
|
|
LambdaQueryWrapper<IotDeviceInfo> channelWrapper = new LambdaQueryWrapper<>();
|
|
|
channelWrapper.eq(IotDeviceInfo::getOrgId, orgId);
|
|
|
- channelWrapper.in(IotDeviceInfo::getDeviceType, 2,3);
|
|
|
+ channelWrapper.eq(IotDeviceInfo::getDeleted, 0);
|
|
|
+ channelWrapper.in(IotDeviceInfo::getDeviceType, 2, 3);
|
|
|
if (iotDeviceInfoMapper.selectCount(channelWrapper) < 1) {
|
|
|
return null;
|
|
|
}
|
|
|
+ final List<IotServerInfo> list = iotServerInfoService.selectConnectOrg(false, orgId, null);
|
|
|
+ if (ObjectUtil.isEmpty(list)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
LambdaQueryWrapper<MediatorVideoDiagnosisRecord> wrapper = new LambdaQueryWrapper<MediatorVideoDiagnosisRecord>();
|
|
|
wrapper.eq(MediatorVideoDiagnosisRecord::getOrgId, orgId);
|
|
|
wrapper.eq(MediatorVideoDiagnosisRecord::getIsAlarm, 1);
|