|
|
@@ -93,6 +93,7 @@ public class IIotQxzCommService extends IotDeviceBaseServiceImpl implements IotD
|
|
|
rspData.setMsg(ErrorCode.SUCCESS.getMessage());
|
|
|
rspData.setData(new ArrayList<>());
|
|
|
rspData.setTotal(0);
|
|
|
+ boolean isNotPage = reqVo.isNotPage();
|
|
|
|
|
|
IotDevice findDevice = iotDeviceService.selectIotDeviceByDevBid(reqVo.getDevBid());
|
|
|
|
|
|
@@ -135,21 +136,33 @@ public class IIotQxzCommService extends IotDeviceBaseServiceImpl implements IotD
|
|
|
if(tableClass == null){
|
|
|
throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(), "设备类型不存在");
|
|
|
}
|
|
|
- PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
- IPage<QxzDataListDto> qxzDataListDtoIPage = mongoService.aggregate(tableClass, aggregation, QxzDataListDto.class, pageDomain);
|
|
|
+ long total = 0;
|
|
|
+ List<QxzDataListDto> qxzDataListDtoList = new ArrayList<>();
|
|
|
+ if(isNotPage) {
|
|
|
+ List<QxzDataListDto> dtoList = mongoService.aggregate(tableClass, aggregation, QxzDataListDto.class);
|
|
|
+ if(dtoList != null){
|
|
|
+ total = dtoList.size();
|
|
|
+ qxzDataListDtoList = dtoList;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ IPage<QxzDataListDto> qxzDataListDtoIPage = mongoService.aggregate(tableClass, aggregation, QxzDataListDto.class, pageDomain);
|
|
|
+ qxzDataListDtoList = qxzDataListDtoIPage.getRecords();
|
|
|
+ total = qxzDataListDtoIPage.getTotal();
|
|
|
+ }
|
|
|
+
|
|
|
//查出该设备的“自定义要素信息列表”
|
|
|
IotDevicefactor param = new IotDevicefactor();
|
|
|
param.setDevBid(devBid);
|
|
|
List<IotDevicefactor> factorList = iotDevicefactorService.selectIotDevicefactorList(param);
|
|
|
-
|
|
|
List<List<IotQxzDataListRseVo>> rest = new ArrayList<>();
|
|
|
- for(QxzDataListDto item: qxzDataListDtoIPage.getRecords()){
|
|
|
+ for(QxzDataListDto item: qxzDataListDtoList){
|
|
|
List<QxzDataDto> dataList = item.getDataList();
|
|
|
List<IotQxzDataListRseVo> iotQxzDataListRseVoList = ElementFactorUtil.qxzListProcessData(dataList, factorList, findDevice, isDisable);
|
|
|
rest.add(iotQxzDataListRseVoList);
|
|
|
}
|
|
|
rspData.setData(rest);
|
|
|
- rspData.setTotal(qxzDataListDtoIPage.getTotal());
|
|
|
+ rspData.setTotal(total);
|
|
|
return rspData;
|
|
|
}
|
|
|
|