|
@@ -581,6 +581,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(DmpDeviceInfo::getProductId,DmpDeviceInfo::getDeviceId,DmpDeviceInfo::getDeviceName,DmpDeviceInfo::getDeviceType,DmpDeviceInfo::getInstallAddress)
|
|
|
.eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
|
|
|
+ .eq(DmpDeviceInfo::getDeleteFlag,0)
|
|
|
.eq(requestVO.getDeviceType() != null,DmpDeviceInfo::getDeviceType,requestVO.getDeviceType())
|
|
|
.eq(StringUtils.isNotBlank(requestVO.getDeviceId()),DmpDeviceInfo::getDeviceId,requestVO.getDeviceId())
|
|
|
.orderByDesc(DmpDeviceInfo::getId);
|
|
@@ -602,6 +603,10 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
List<ProductTVAttributeVO> attributeVOList = baseMapper.attributeList(productIdList);
|
|
|
|
|
|
if(deviceIdList.size() > 0){
|
|
|
+ LambdaQueryWrapper<DmpDeviceStatus> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper1.in(DmpDeviceStatus::getDeviceId,deviceIdList);
|
|
|
+ List<DmpDeviceStatus> deviceStatusList = dmpDeviceStatusService.list(queryWrapper1);
|
|
|
+
|
|
|
List<DataRealTimeResponseVO> dataRealList = deviceDataClient.data(null,deviceIdList);
|
|
|
for(int i=0;i<page.getRecords().size();i++){
|
|
|
DataTVResponseVO dataTVResponseVO = new DataTVResponseVO();
|
|
@@ -609,6 +614,14 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
dataTVResponseVO.setDeviceName(page.getRecords().get(i).getDeviceName());
|
|
|
dataTVResponseVO.setDeviceType(page.getRecords().get(i).getDeviceType());
|
|
|
dataTVResponseVO.setInstallAddress(page.getRecords().get(i).getInstallAddress());
|
|
|
+ if(CollectionUtils.isNotEmpty(deviceStatusList)){
|
|
|
+ for (int j = 0; j < deviceStatusList.size(); j++) {
|
|
|
+ if(page.getRecords().get(i).getDeviceId().equals(deviceStatusList.get(j).getDeviceId())){
|
|
|
+ dataTVResponseVO.setDeviceStatus(deviceStatusList.get(j).getDeviceStatus());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
List<DeviceAttributeVO> list1 = new ArrayList<>();
|
|
|
if(dataRealList.size() > 0){
|
|
|
for (int j = 0; j < dataRealList.size(); j++) {
|
|
@@ -647,6 +660,32 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
return new CommonPage<>(list,page.getTotal(),page.getSize(),page.getCurrent());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<DataTVStatisticResponseVO> dataTVStatistic(DataTVRequestVO requestVO){
|
|
|
+ List<DataTVStatisticResponseVO> list = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.select(DmpDeviceInfo::getProductId,DmpDeviceInfo::getDeviceId,DmpDeviceInfo::getDeviceName,DmpDeviceInfo::getDeviceType,DmpDeviceInfo::getInstallAddress)
|
|
|
+ .eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
|
|
|
+ .eq(DmpDeviceInfo::getDeleteFlag,0)
|
|
|
+ .eq(requestVO.getDeviceType() != null,DmpDeviceInfo::getDeviceType,requestVO.getDeviceType())
|
|
|
+ .orderByDesc(DmpDeviceInfo::getId);
|
|
|
+ List<DmpDeviceInfo> list1 = this.list(queryWrapper);
|
|
|
+ if(CollectionUtils.isNotEmpty(list1)){
|
|
|
+ List<String> deviceIdList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < list1.size(); i++) {
|
|
|
+ deviceIdList.add(list1.get(i).getDeviceId());
|
|
|
+ }
|
|
|
+ Integer alarmCount = baseMapper.baseAlarmCount(deviceIdList);
|
|
|
+ Integer offlineCount = baseMapper.deviceOfflineCount(deviceIdList);
|
|
|
+ DataTVStatisticResponseVO responseVO = new DataTVStatisticResponseVO();
|
|
|
+ responseVO.setAlarmNum(alarmCount);
|
|
|
+ responseVO.setOfflineNum(offlineCount);
|
|
|
+ list.add(responseVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<String,Object>> deviceDataTotal(DataTotalRequestVO requestVO){
|
|
|
List<Map<String,Object>> list = dataQueryClient.deviceDataTotal(requestVO);
|