|
@@ -0,0 +1,63 @@
|
|
|
+package com.sooka.sponest.event.centereventteventcatalogue.service.impl;
|
|
|
+
|
|
|
+import com.ruoyi.common.core.utils.SpringUtils;
|
|
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
|
+import com.ruoyi.common.core.utils.file.FilePrefixUtils;
|
|
|
+import com.ruoyi.common.datascope.base.service.BaseService;
|
|
|
+import com.ruoyi.system.api.RemoteConfigService;
|
|
|
+import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudMapEventListBO;
|
|
|
+import com.sooka.sponest.event.centereventteventcatalogue.domain.vo.VisuForestCloudMapVO;
|
|
|
+import com.sooka.sponest.event.centereventteventcatalogue.mapper.CenterEventHousingConstructionMapper;
|
|
|
+import com.sooka.sponest.event.centereventteventcatalogue.mapper.CenterEventViewMapper;
|
|
|
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICenterEventHousingConstructionService;
|
|
|
+import com.sooka.sponest.event.utils.RemoteApiUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import static com.sooka.sponest.event.utils.EventConstants.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 事件中心-住建可视化Service业务层处理
|
|
|
+ *
|
|
|
+ * @author lyq
|
|
|
+ * @date 2024-7-31
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class CenterEventHousingConstructionServiceImpl extends BaseService implements ICenterEventHousingConstructionService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CenterEventHousingConstructionMapper centerEventHousingConstructionMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CenterEventViewMapper centerEventViewMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<VisuForestCloudMapEventListBO> getEventList(VisuForestCloudMapVO visuForestCloudMapVO) {
|
|
|
+ List<VisuForestCloudMapEventListBO> result = centerEventHousingConstructionMapper.getEventList(visuForestCloudMapVO);
|
|
|
+ if (StringUtils.isEmpty(result)) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ Map<String, String> keyMap = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigMap(Arrays.asList(FILE_PREFIX_LOCAL, FILE_PREFIX_HIK1, FILE_PREFIX_HIK2, FILE_PREFIX_DH1, FILE_PREFIX_DH2)).getData();
|
|
|
+ String token = RemoteApiUtil.getInstance().getToken();// 大华token
|
|
|
+ List<String> eventCodes = result.stream().map(VisuForestCloudMapEventListBO::getEventCode).collect(Collectors.toList());
|
|
|
+ visuForestCloudMapVO.setEventStatus(eventCodes);
|
|
|
+ List<VisuForestCloudMapEventListBO> attachs = centerEventViewMapper.getEventFile(visuForestCloudMapVO);
|
|
|
+ result.forEach(event -> {
|
|
|
+ for (VisuForestCloudMapEventListBO attach : attachs) {
|
|
|
+ if (event.getEventCode().equals(attach.getEventCode())) {
|
|
|
+ if ("DH_1".equals(attach.getPictureSource())) {
|
|
|
+ event.getPicturePathList().add(FilePrefixUtils.getUrlPrefix(attach.getPictureSource(), keyMap) + attach.getPicturePath() + "?token=" + token);
|
|
|
+ } else {
|
|
|
+ event.getPicturePathList().add(FilePrefixUtils.getUrlPrefix(attach.getPictureSource(), keyMap) + attach.getPicturePath());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+}
|