Explorar o código

住建事件列表

lyq hai 1 ano
pai
achega
70d89969b9

+ 36 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CenterEventHousingConstructionController.java

@@ -0,0 +1,36 @@
+package com.sooka.sponest.event.centereventteventcatalogue.controller;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.vo.VisuForestCloudMapVO;
+import com.sooka.sponest.event.centereventteventcatalogue.service.ICenterEventHousingConstructionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @program: sooka
+ * @description: 事件中心-住建可视化控制器
+ * @author: lyq
+ * @create: 2024-7-31
+ **/
+@RestController
+@RequestMapping("/eventzj")
+public class CenterEventHousingConstructionController extends BaseController {
+
+    @Autowired
+    private ICenterEventHousingConstructionService centerEventHousingConstructionService;
+
+    /**
+     * 事件列表
+     *
+     * @param visuForestCloudMapVO
+     * @return
+     */
+    @PostMapping("/getEventList")
+    public R getEventList(@RequestBody VisuForestCloudMapVO visuForestCloudMapVO) {
+        return R.ok(centerEventHousingConstructionService.getEventList(visuForestCloudMapVO));
+    }
+}

+ 17 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CenterEventHousingConstructionMapper.java

@@ -0,0 +1,17 @@
+package com.sooka.sponest.event.centereventteventcatalogue.mapper;
+
+import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudMapEventListBO;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.vo.VisuForestCloudMapVO;
+
+import java.util.List;
+
+/**
+ * 事件中心-住建可视化Mapper接口
+ *
+ * @author lyq
+ * @date 2024-7-31
+ */
+public interface CenterEventHousingConstructionMapper {
+
+    List<VisuForestCloudMapEventListBO> getEventList(VisuForestCloudMapVO visuForestCloudMapVO);
+}

+ 0 - 2
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CenterEventViewMapper.java

@@ -35,6 +35,4 @@ public interface CenterEventViewMapper {
     VisuForestEventTodayEventListBO eventPush(VisuForestCloudMapVO visuForestCloudMapVO);
 
     List<VisuForestCloudMapEventListBO> listAll(VisuForestCloudMapVO visuForestCloudMapVO);
-
-    List<VisuForestCloudMapEventListBO> getEventFileAll(VisuForestCloudMapVO visuForestCloudMapVO);
 }

+ 17 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICenterEventHousingConstructionService.java

@@ -0,0 +1,17 @@
+package com.sooka.sponest.event.centereventteventcatalogue.service;
+
+import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.VisuForestCloudMapEventListBO;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.vo.VisuForestCloudMapVO;
+
+import java.util.List;
+
+/**
+ * 事件中心-住建可视化Service接口
+ *
+ * @author lyq
+ * @date 2024-7-31
+ */
+public interface ICenterEventHousingConstructionService {
+
+    List<VisuForestCloudMapEventListBO> getEventList(VisuForestCloudMapVO visuForestCloudMapVO);
+}

+ 63 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CenterEventHousingConstructionServiceImpl.java

@@ -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;
+    }
+}

+ 3 - 3
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CenterEventViewServiceImpl.java

@@ -174,11 +174,11 @@ public class CenterEventViewServiceImpl extends BaseService implements ICenterEv
         resultMap.put("visuForestCloudYuAnBo", yuAnMap);
         resultMap.put("eventlog", logs);
         // 摄像头上报
-        if ("reporting_source_1".equals(catalogue.getReportSource())) {
+        if (REPORTING_SOURCE_1.equals(catalogue.getReportSource())) {
             resultMap.put("centermonitorTCamera", SpringUtils.getBean(RemoteMonitorService.class).selectByCameraId(catalogue.getCreateBy()).getData());
         }
         // 传感器上报
-        if ("reporting_source_4".equals(catalogue.getReportSource())) {
+        if (REPORTING_SOURCE_4.equals(catalogue.getReportSource())) {
             resultMap.put("centermonitorTCamera", new CenterdataTCamera(catalogue.getCreateBy(), catalogue.getCreateName()));
         }
         return resultMap;
@@ -288,7 +288,7 @@ public class CenterEventViewServiceImpl extends BaseService implements ICenterEv
         String token = RemoteApiUtil.getInstance().getToken();// 大华token
         List<String> eventCodes = result.stream().map(VisuForestCloudMapEventListBO::getEventCode).collect(Collectors.toList());
         visuForestCloudMapVO.setEventStatus(eventCodes);
-        List<VisuForestCloudMapEventListBO> attachs = centerEventViewMapper.getEventFileAll(visuForestCloudMapVO);
+        List<VisuForestCloudMapEventListBO> attachs = centerEventViewMapper.getEventFile(visuForestCloudMapVO);
         result.forEach(event -> {
             for (VisuForestCloudMapEventListBO attach : attachs) {
                 if (event.getEventCode().equals(attach.getEventCode())) {

+ 2 - 2
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTEventcatalogueServiceImpl.java

@@ -510,14 +510,14 @@ public class CentereventTEventcatalogueServiceImpl extends BaseService implement
                 break;
             case "gd":
                 centereventTEventcatalogue.setEventStatus("归档");
-                centereventTEventcatalogue.setEventStatusValue("forest_event_status_6");
+                centereventTEventcatalogue.setEventStatusValue(FOREST_EVENT_STATUS_6);
                 centereventTEventcatalogue.setGdTime(new Date());
                 // 填写火灾报告
                 centereventtDeptEventBO.setEventType(centereventTEventcatalogue.getEventTypeXl());
                 insertReportByEventtype(centereventtDeptEventBO);
 
                 centereventTDeptEvent.setEventStatus("归档");
-                centereventTDeptEvent.setEventStatusValue("forest_event_status_6");
+                centereventTDeptEvent.setEventStatusValue(FOREST_EVENT_STATUS_6);
                 break;
             default:
                 break;

+ 28 - 0
src/main/resources/mapper/centereventteventcatalogue/CenterEventHousingConstructionMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.event.centereventteventcatalogue.mapper.CenterEventHousingConstructionMapper">
+
+    <select id="getEventList" parameterType="VisuForestCloudMapVO" resultType="map">
+        select event_code eventCode,event_name eventName,longitude,latitude,reportor,event_status
+        eventStatus,event_status_value eventStatusValue,create_time createTime,urge_count urgeCount,event_type_xl
+        eventType,report_source reportSource
+        from centerevent_t_eventcatalogue where DATEDIFF( now(), create_time ) &lt;= 6
+        <if test="createBy != null and createBy != ''">
+            and create_by = #{createBy}
+        </if>
+        <if test="eventTypeIdDl != null and eventTypeIdDl.length > 0">
+            and event_type in
+            <foreach item="eventTypeIdDl" collection="eventTypeIdDl" open="(" separator="," close=")">
+                #{eventTypeIdDl}
+            </foreach>
+        </if>
+        <if test="eventTypeId != null and eventTypeId.length > 0">
+            and event_type_xl in
+            <foreach item="eventTypeId" collection="eventTypeId" open="(" separator="," close=")">
+                #{eventTypeId}
+            </foreach>
+        </if>
+    </select>
+</mapper>

+ 0 - 16
src/main/resources/mapper/centereventteventcatalogue/CenterEventViewMapper.xml

@@ -426,20 +426,4 @@
         </if>
         order by create_time desc
     </select>
-
-    <select id="getEventFileAll" resultType="VisuForestCloudMapEventListBO">
-        select event_code eventCode,attach_path picturePath,bus_source pictureSource,file_type pictureType from (
-        select SUBSTRING_INDEX(GROUP_CONCAT(id order by create_time),',',1) id,event_code
-        from centerevent_t_fire_log
-        <where>
-            <if test="eventStatus != null and eventStatus.size > 0">
-                and event_code in
-                <foreach item="item" collection="eventStatus" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-        </where>
-        group by event_code) l
-        left join ${database_data}.centerdata_t_attach f on f.bus_id = l.id
-    </select>
 </mapper>