|
|
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; |
|
|
|
import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; |
|
|
|
import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; |
|
|
|
import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; |
|
|
|
import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo; |
|
|
|
import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.datasearch.soe.ISoeClient; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.datasearch.soe.domian.SoeData; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.HzPage; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.HzPage; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.Result; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.Result; |
|
|
|
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; |
|
|
|
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; |
|
|
@ -15,11 +18,13 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
@ -31,6 +36,8 @@ import java.util.Map; |
|
|
|
@RequiredArgsConstructor |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class AlarmTabulateServiceImpl implements AlarmTabulateService { |
|
|
|
public class AlarmTabulateServiceImpl implements AlarmTabulateService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ISoeClient soeClient; |
|
|
|
|
|
|
|
|
|
|
|
private final SoeDataClient soeDataClient; |
|
|
|
private final SoeDataClient soeDataClient; |
|
|
|
|
|
|
|
|
|
|
|
private final DeviceDataClient deviceDataClient; |
|
|
|
private final DeviceDataClient deviceDataClient; |
|
|
@ -51,7 +58,7 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { |
|
|
|
param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER)); |
|
|
|
param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER)); |
|
|
|
} |
|
|
|
} |
|
|
|
param.setPage((int) page.getCurrent()); |
|
|
|
param.setPage((int) page.getCurrent()); |
|
|
|
param.setStation(tabulateEarly.getStationCode()); |
|
|
|
param.setStations(Collections.singletonList(tabulateEarly.getStationCode())); |
|
|
|
param.setPageSize((int) page.getSize()); |
|
|
|
param.setPageSize((int) page.getSize()); |
|
|
|
Result<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param); |
|
|
|
Result<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param); |
|
|
|
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){ |
|
|
|
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){ |
|
|
@ -82,4 +89,54 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { |
|
|
|
page.setRecords((List<Object>) data.get("data")); |
|
|
|
page.setRecords((List<Object>) data.get("data")); |
|
|
|
return page; |
|
|
|
return page; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 视频告警 |
|
|
|
|
|
|
|
* @param page |
|
|
|
|
|
|
|
* @param param |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public IPage<Object> video(IPage<Object> page, TabulateLevelVo param) { |
|
|
|
|
|
|
|
Result<Map<String, Object>> result = deviceDataClient.getDeviceSoeData(param.getProjectId(),param.getDimension(),param.getId(),param.getSoeType(),param.getStartTime(),param.getEndTime(), |
|
|
|
|
|
|
|
true,(int) page.getCurrent(),(int)page.getSize()); |
|
|
|
|
|
|
|
if(!result.isSuccess() || MapUtils.isEmpty(result.getData())){ |
|
|
|
|
|
|
|
return page; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Map<String,Object> data = result.getData(); |
|
|
|
|
|
|
|
page.setTotal((Long) data.get("total")); |
|
|
|
|
|
|
|
page.setRecords((List<Object>) data.get("data")); |
|
|
|
|
|
|
|
return page; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* HZ3000告警 |
|
|
|
|
|
|
|
* @param page |
|
|
|
|
|
|
|
* @param param |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public IPage<SoeData> hz3000(IPage<SoeData> page, TabulateLevelVo param) { |
|
|
|
|
|
|
|
SoeQueryConditionByStation query = new SoeQueryConditionByStation(); |
|
|
|
|
|
|
|
query.setNeedPage(true); |
|
|
|
|
|
|
|
query.setPage((int) page.getCurrent()); |
|
|
|
|
|
|
|
query.setLimit((int) page.getSize()); |
|
|
|
|
|
|
|
query.setStationIds(Collections.singletonList(param.getProjectId())); |
|
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(param.getTypes())){ |
|
|
|
|
|
|
|
query.setTypes(param.getTypes()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtil.isNotBlank(param.getStartTime())){ |
|
|
|
|
|
|
|
query.setBeginTime(LocalDateTime.parse(param.getStartTime(),DateUtil.DATETIME_FORMATTER)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtil.isNotBlank(param.getEndTime())){ |
|
|
|
|
|
|
|
query.setEndTime(LocalDateTime.parse(param.getEndTime(), DateUtil.DATETIME_FORMATTER)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Result<HzPage<SoeData>> result = soeClient.getByStationsAndTime(query); |
|
|
|
|
|
|
|
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){ |
|
|
|
|
|
|
|
return page; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
page.setTotal(result.getData().getTotal()); |
|
|
|
|
|
|
|
page.setRecords(result.getData().getRecords()); |
|
|
|
|
|
|
|
return page; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |