Quellcode durchsuchen

住建事件列表

lyq vor 1 Jahr
Ursprung
Commit
8410d2ae0a

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

@@ -1,36 +0,0 @@
-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));
-    }
-}

+ 11 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CenterEventViewController.java

@@ -137,4 +137,15 @@ public class CenterEventViewController extends BaseController {
         startPage();
         return getDataTable(centerEventViewService.listAll(visuForestCloudMapVO));
     }
+
+    /**
+     * 住建事件列表
+     *
+     * @param visuForestCloudMapVO
+     * @return
+     */
+    @PostMapping("/getHousingConstructionEventList")
+    public R getHousingConstructionEventList(@RequestBody VisuForestCloudMapVO visuForestCloudMapVO) {
+        return R.ok(centerEventViewService.getHousingConstructionEventList(visuForestCloudMapVO));
+    }
 }

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

@@ -1,17 +0,0 @@
-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);
-}

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

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

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

@@ -1,17 +0,0 @@
-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);
-}

+ 2 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICenterEventViewService.java

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

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

@@ -1,63 +0,0 @@
-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;
-    }
-}

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

@@ -302,4 +302,29 @@ public class CenterEventViewServiceImpl extends BaseService implements ICenterEv
         });
         return result;
     }
+
+    @Override
+    public List<VisuForestCloudMapEventListBO> getHousingConstructionEventList(VisuForestCloudMapVO visuForestCloudMapVO) {
+        List<VisuForestCloudMapEventListBO> result = centerEventViewMapper.getHousingConstructionEventList(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.setPicturePath(FilePrefixUtils.getUrlPrefix(attach.getPictureSource(), keyMap) + attach.getPicturePath() + "?token=" + token);
+                    } else {
+                        event.setPicturePath(FilePrefixUtils.getUrlPrefix(attach.getPictureSource(), keyMap) + attach.getPicturePath());
+                    }
+                }
+            }
+        });
+        return result;
+    }
 }

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

@@ -1,28 +0,0 @@
-<?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>

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

@@ -426,4 +426,28 @@
         </if>
         order by create_time desc
     </select>
+
+    <select id="getHousingConstructionEventList" parameterType="VisuForestCloudMapVO"
+            resultType="VisuForestCloudMapEventListBO">
+        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 YEARWEEK( create_time ) = YEARWEEK( CURDATE() )
+        <if test="createBy != null and createBy != ''">
+            and create_by in ( ${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>