|
|
@@ -1,19 +1,28 @@
|
|
|
package com.sooka.sponest.event.centereventteventcollect.service.impl;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import com.alibaba.nacos.common.utils.UuidUtils;
|
|
|
-import com.ruoyi.common.core.text.UUID;
|
|
|
+import com.ruoyi.common.core.utils.SpringUtils;
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
-import com.ruoyi.common.core.utils.uuid.IdUtils;
|
|
|
-import com.ruoyi.common.security.utils.DictUtils;
|
|
|
+import com.ruoyi.common.core.utils.file.FilePrefixUtils;
|
|
|
+import com.ruoyi.common.datascope.base.service.BaseService;
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
|
|
+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.CenterEventViewMapper;
|
|
|
import com.sooka.sponest.event.centereventteventcollect.domain.CentereventTEventCollect;
|
|
|
import com.sooka.sponest.event.centereventteventcollect.mapper.CentereventTEventCollectMapper;
|
|
|
import com.sooka.sponest.event.centereventteventcollect.service.ICentereventTEventCollectService;
|
|
|
+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业务层处理
|
|
|
*
|
|
|
@@ -21,10 +30,13 @@ import org.springframework.stereotype.Service;
|
|
|
* @date 2025-06-24
|
|
|
*/
|
|
|
@Service
|
|
|
-public class CentereventTEventCollectServiceImpl implements ICentereventTEventCollectService {
|
|
|
+public class CentereventTEventCollectServiceImpl extends BaseService implements ICentereventTEventCollectService {
|
|
|
@Autowired
|
|
|
private CentereventTEventCollectMapper centereventTEventCollectMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CenterEventViewMapper centerEventViewMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询事件收藏
|
|
|
*
|
|
|
@@ -47,7 +59,35 @@ public class CentereventTEventCollectServiceImpl implements ICentereventTEventCo
|
|
|
if(StringUtils.isBlank(centereventTEventCollect.getUserId())){
|
|
|
centereventTEventCollect.setUserId(SecurityUtils.getUserId().toString());
|
|
|
}
|
|
|
- return centereventTEventCollectMapper.selectCentereventTEventCollectList(centereventTEventCollect);
|
|
|
+ List<CentereventTEventCollect> result = centereventTEventCollectMapper.selectCentereventTEventCollectList(centereventTEventCollect);
|
|
|
+
|
|
|
+ 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(CentereventTEventCollect::getEventCode).collect(Collectors.toList());
|
|
|
+// centereventTEventCollect
|
|
|
+
|
|
|
+ VisuForestCloudMapVO visuForestCloudMapVO = new VisuForestCloudMapVO();
|
|
|
+ visuForestCloudMapVO.setEventStatus(eventCodes);
|
|
|
+ setSookaDataBase(visuForestCloudMapVO);
|
|
|
+ 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.setPicturePath(FilePrefixUtils.getUrlPrefix(attach.getPictureSource(), keyMap) + attach.getPicturePath() + "?token=" + token);
|
|
|
+ } else {
|
|
|
+ event.setPicturePath(FilePrefixUtils.getUrlPrefix(attach.getPictureSource(), keyMap) + attach.getPicturePath());
|
|
|
+ }
|
|
|
+ event.setPictureSource(attach.getReportSource());
|
|
|
+ event.setPictureType(attach.getPictureType());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|