|
|
|
@ -91,14 +91,21 @@ public class CentralMonitorServiceImpl implements CentralMonitorService {
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public IPage<PointDataVo> selectOriginalDataByRealIds(Integer page, Integer size, String roleId) { |
|
|
|
|
public IPage<PointDataVo> selectOriginalDataByRealIds(Integer page, Integer size, String roleId,Date start,Date end) { |
|
|
|
|
OriginalDataQuery originalDataQuery = new OriginalDataQuery(); |
|
|
|
|
originalDataQuery.setRealId(roleId); |
|
|
|
|
originalDataQuery.setLimit(size); |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
originalDataQuery.setEndTime(calendar.getTime()); |
|
|
|
|
calendar.add(Calendar.HOUR_OF_DAY,-1); |
|
|
|
|
originalDataQuery.setBeginTime(calendar.getTime()); |
|
|
|
|
// 当日
|
|
|
|
|
if(ObjectUtil.isEmpty(start) && ObjectUtil.isEmpty(end)){ |
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
|
originalDataQuery.setEndTime(calendar.getTime()); |
|
|
|
|
calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); |
|
|
|
|
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE)); |
|
|
|
|
calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND)); |
|
|
|
|
originalDataQuery.setBeginTime(calendar.getTime()); |
|
|
|
|
} |
|
|
|
|
originalDataQuery.setBeginTime(start); |
|
|
|
|
originalDataQuery.setEndTime(end); |
|
|
|
|
Result<HzPage<PointData>> originalDataByRealIds = historyDataSearchClient.getOriginalDataByRealIds(originalDataQuery); |
|
|
|
|
if (!originalDataByRealIds.isSuccess()) { |
|
|
|
|
throw new ServiceException("数据不存在"); |
|
|
|
|