|
|
@@ -681,8 +681,31 @@ public class IotScreenServiceImpl implements IIotScreenService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<IotYbqEnvData> ybqEnvChartList(IotYbqdataReqVo reqVo) {
|
|
|
- return iotYbqEnvDataService.selectIotYbqEnvStatList(reqVo);
|
|
|
+ public IPage ybqPredictChartList(IotYbqdataReqVo reqVo) {
|
|
|
+ String devBid = reqVo.getDevBid();
|
|
|
+ if (StringUtils.isEmpty(devBid)) {
|
|
|
+ throw new IotBizException(IotErrorCode.FAILURE.getCode(), "设备id不可为空");
|
|
|
+ }
|
|
|
+ String ybqType = reqVo.getDateDevType();
|
|
|
+ if (StringUtils.isEmpty(ybqType)) {
|
|
|
+ throw new IotBizException(IotErrorCode.FAILURE.getCode(), "数据类型不可为空");
|
|
|
+ }
|
|
|
+ String startDate = reqVo.getStartDate();
|
|
|
+ String endDate = reqVo.getEndDate();
|
|
|
+ Map<String, Object> map = BeanUtil.beanToMap(reqVo);
|
|
|
+ // 预测时间可能会被更新,所以用修改时间,创建时候这个值会默认有
|
|
|
+ if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
|
|
|
+ startDate = DateUtils.parseDateToStr("yyyyMMdd", DateUtils.parseDate(startDate));
|
|
|
+ endDate = DateUtils.parseDateToStr("yyyyMMdd", DateUtils.parseDate(endDate));
|
|
|
+ map.put("timeStr_computeDate", startDate + "," + endDate);
|
|
|
+ }
|
|
|
+ map.remove("startDate");
|
|
|
+ map.remove("endDate");
|
|
|
+
|
|
|
+ PageDomain queryRequest = TableSupport.buildPageRequest();
|
|
|
+ queryRequest.setOrderByColumn("computeDate asc,ybqdataCreatedDate asc");
|
|
|
+ queryRequest.setIsAsc("desc");
|
|
|
+ return mongoService.findListPage(IotYbqPredictData.class, map, queryRequest);
|
|
|
}
|
|
|
|
|
|
/**
|