limeng 2 mesiacov pred
rodič
commit
2a05ff5fab

+ 10 - 0
event-ui/src/api/event/eventProcess/eventProcess.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 查询报文日志列表
+export function selectCompositeEventList(query) {
+  return request({
+    url: '/center-event/eventProcess/selectCompositeEventList',
+    method: 'get',
+    params: query
+  })
+}

+ 3 - 3
event-ui/src/views/event/eventMessage/index.vue

@@ -21,9 +21,9 @@
 
     <el-table v-loading="loading" :data="eventMessageList">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="报文来源" align="left" prop="eventSource" />
-      <el-table-column label="报文接收时间" align="left" prop="createTime" />
-      <el-table-column label="报文内容" align="left" prop="eventMessage" >
+      <el-table-column label="报文来源" align="left" width="300" prop="eventSource" />
+      <el-table-column label="报文接收时间" align="left" width="300" prop="createTime" />
+      <el-table-column label="报文内容" align="left" min-width="300" prop="eventMessage">
         <template slot-scope="scope">
           <json-viewer :value="JSON.parse(scope.row.eventMessage)" :expand-depth="0" :copyable="true" :boxed="true">
             <template v-slot:copy>

+ 178 - 0
event-ui/src/views/event/eventProcess/index.vue

@@ -0,0 +1,178 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="96px">
+      <el-form-item label="事件名称" prop="eventName">
+        <el-input v-model="queryParams.eventName" placeholder="请输入事件名称" clearable style="width: 240px"
+                  @keyup.enter.native="handleQuery"/>
+      </el-form-item>
+      <el-form-item label="上报时间" prop="reportTimeRange">
+        <el-date-picker v-model="queryParams.reportTimeRange" start-placeholder="开始日期" end-placeholder="结束日期"
+                        type="daterange" range-separator="-" value-format="yyyy-MM-dd" style="width: 240px" :clearable="false"
+                        @keyup.enter.native="handleQuery"></el-date-picker>
+      </el-form-item>
+      <el-form-item label="事件来源" prop="reportSource">
+        <el-select v-model="queryParams.reportSource" placeholder="请选择事件来源" clearable style="width: 240px"
+                   @keyup.enter.native="handleQuery">
+          <el-option v-for="dict in dict.type.reporting_source" :key="dict.value" :label="dict.label" :value="dict.value"/>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="事件状态" prop="eventStatus">
+        <el-select v-model="queryParams.eventStatus" placeholder="请选择事件状态" style="width: 240px"
+                   @keyup.enter.native="handleQuery">
+          <el-option v-for="dict in dict.type.event_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="事件分类" prop="eventType" width="500">
+        <el-cascader ref="eventType" :options="eventTypeOptions" :show-all-levels="true" v-model="queryParams.eventType" :props="props" clearable @change="handleEventTypeChange"/>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-plus" size="mini">新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="warning" plain icon="el-icon-download" size="mini">下载录像</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="selectCompositeEventList"></right-toolbar>
+    </el-row>
+    <el-table v-loading="loading" :data="compositeEventList" >
+      <el-table-column type="selection" align="center" width="50"/>
+      <el-table-column label="事件名称" align="center" prop="eventName" width="180"/>
+      <el-table-column label="事件描述" align="center" prop="eventDescription" width="450"/>
+      <el-table-column label="事件类型" align="center" prop="eventTypeName"/>
+      <el-table-column label="事件来源" align="center" prop="reportSource" width="100">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.reporting_source" :value="scope.row.reportSource"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="事件状态" align="center" prop="eventStatus" width="100">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.event_status" :value="scope.row.eventStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-view">详情</el-button>
+          <el-button size="mini" type="text" icon="el-icon-document">事件日志</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="selectCompositeEventList"/>
+  </div>
+</template>
+<script>
+import {selectCompositeEventList} from "@/api/event/eventProcess/eventProcess";
+import {getEventTypeTree} from "@/api/event/eventType/eventType";
+
+export default {
+  name: "eventProcess",
+  components: {},
+  dicts: ['reporting_source', 'event_status'],
+  data() {
+    return {
+      // 总条数
+      total: 0,
+      // 选中数组
+      ids: [],
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        reportTimeRange: [],
+        reportTimeStart: null,
+        reportTimeEnd: null,
+        eventName: null,
+        reportSource: null,
+        eventStatus: null,
+        eventType: null,
+      },
+      compositeEventList: [],
+      eventTypeOptions: [], // 事件类型树形数据源
+      props: {
+        multiple: false
+      },
+    }
+  },
+  async mounted() {
+    //设置上报时间默认值
+    this.setDefaultReportTime();
+    //设置事件状态默认值
+    await this.setDefaultEventStatus();
+    await this.getEventTypeTree();
+    //查询数据列表
+    this.selectCompositeEventList();
+  },
+  created() {
+
+  },
+  methods: {
+    /** 查询数据列表 */
+    selectCompositeEventList() {
+      this.loading = true;
+      const param = {
+        ...this.queryParams,
+        reportTimeStart: this.queryParams.reportTimeRange[0],
+        reportTimeEnd: this.queryParams.reportTimeRange[1],
+      }
+      selectCompositeEventList(param).then(response => {
+        this.compositeEventList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 获取事件类型数据源 */
+    getEventTypeTree() {
+      getEventTypeTree().then(response => {
+        this.eventTypeOptions = response.data
+      })
+    },
+    /** 获取选中事件类型 */
+    handleEventTypeChange(value) {
+      if (Array.isArray(value) && value.length > 0) {
+        // 获取最后一项(叶子节点)
+        this.queryParams.eventType = value[value.length - 1];
+      } else {
+        this.queryParams.eventType = null;
+      }
+    },
+    /** 设置事件状态默认值 */
+    setDefaultEventStatus() {
+      const trySetDefault = () => {
+        if (this.dict?.type?.event_status?.length) {
+          this.queryParams.eventStatus = this.dict.type.event_status[0].value;
+        } else {
+          setTimeout(trySetDefault, 200); // 数据未准备好则递归重试
+        }
+      };
+      trySetDefault();
+    },
+    /** 设置上报时间默认值 */
+    setDefaultReportTime() {
+      const date = new Date().toISOString().split('T')[0];
+      this.queryParams.reportTimeRange = [date, date];
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.selectCompositeEventList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      //设置上报时间默认值
+      this.setDefaultReportTime();
+      //设置事件状态默认值
+      this.setDefaultEventStatus();
+      this.handleQuery();
+    },
+  },
+}
+</script>

+ 12 - 0
src/main/java/com/sooka/sponest/event/eventProcess/controller/EventProcessController.java

@@ -35,6 +35,18 @@ public class EventProcessController extends BaseController {
 
     @Resource
     private EventLogService eventLogService;
+
+    /**
+     * 事件中心 - 综合查询
+     * @author limeng
+     * */
+    @GetMapping("/selectCompositeEventList")
+    public TableDataInfo selectCompositeEventList(EventInfo eventInfo) {
+        startPage();
+        List<EventInfoBO> list = eventProcessService.selectCompositeEventList(eventInfo);
+        return getDataTable(list);
+    }
+
     //******************************************待确认事件块**************************************************/
 
     /**

+ 15 - 0
src/main/java/com/sooka/sponest/event/eventProcess/domain/EventInfo.java

@@ -38,6 +38,11 @@ public class EventInfo extends BaseBusinessEntity {
     private String eventType;
 
     /**
+     * 事件分类名称
+     */
+    private String eventTypeName;
+
+    /**
      * 事件名称
      */
     @NotBlank(message = "事件名称不能为空")
@@ -78,6 +83,16 @@ public class EventInfo extends BaseBusinessEntity {
     private Date reportTime;
 
     /**
+     * 上报时间_范围查询_开始
+     */
+    private String reportTimeStart;
+
+    /**
+     * 上报时间_范围查询_结束
+     */
+    private String reportTimeEnd;
+
+    /**
      * 摄像头编码
      */
     private String cameraCode;

+ 6 - 0
src/main/java/com/sooka/sponest/event/eventProcess/service/EventProcessService.java

@@ -13,6 +13,12 @@ import java.util.List;
 public interface EventProcessService {
 
     /**
+     * 事件中心 - 综合查询
+     * @author limeng
+     * */
+    List<EventInfoBO> selectCompositeEventList(EventInfo eventInfo);
+
+    /**
      * 插入大华 XC5300 类型事件
      *
      * @param daHuaOtherEventVO 事件类型

+ 26 - 4
src/main/java/com/sooka/sponest/event/eventProcess/service/impl/EventProcessServiceImpl.java

@@ -31,6 +31,7 @@ import com.sooka.sponest.event.eventProcess.service.EventProcessService;
 import com.sooka.sponest.event.eventType.domain.EventType;
 import com.sooka.sponest.event.eventType.service.EventTypeService;
 import com.sooka.sponest.event.utils.AddAttachPrefix;
+import com.sooka.sponest.event.utils.eventConstants.EventConstants;
 import com.sooka.sponest.event.utils.eventEnum.EventEnum;
 import com.sooka.sponest.monitor.api.RemoteMonitorService;
 import com.sooka.sponest.monitor.api.domain.CenterdataTAidevicedept;
@@ -42,10 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
@@ -77,6 +75,30 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
 
     private final Lock lock = new ReentrantLock(true); // 公平锁
 
+    /**
+     * 事件中心 - 综合查询
+     * @author limeng
+     * */
+    @Override
+    @DataScopeMutiDept(deptAlias = "d")
+    public List<EventInfoBO> selectCompositeEventList(EventInfo eventInfo) {
+        // 入参校验
+        if (eventInfo == null || eventInfo.getReportTimeStart() == null || eventInfo.getReportTimeEnd() == null ) return new ArrayList<>();
+        // 处理事件状态
+        String eventStatus = Optional.ofNullable(eventInfo.getEventStatus()).orElseGet(() -> {
+                                eventInfo.setEventStatus(EVENT_STATUS_1);
+                                return EVENT_STATUS_1;
+                            });
+        setSookaDataBase(eventInfo);
+        if (eventStatus.equals(EVENT_STATUS_1)) { // 上报
+            return eventProcessMapper.selectUnConfirmedList(eventInfo);
+        } else if (eventStatus.equals(EVENT_STATUS_98) || eventStatus.equals(EVENT_STATUS_99)) { // 误报 重复
+            return eventProcessMapper.selectUsualList(eventInfo);
+        } else { // 确认 签收 办结 审核通过 归档
+            return eventProcessMapper.selectEventProcessList(eventInfo);
+        }
+    }
+
     @Override
     public void insertDaHuaOtherEvent(DaHuaOtherEventVO daHuaOtherEventVO) {
         try {

+ 3 - 4
src/main/java/com/sooka/sponest/event/eventType/controller/EventTypeController.java

@@ -73,12 +73,11 @@ public class EventTypeController extends BaseController {
         return toAjax(eventTypeService.deleteEventTypeByIds(ids));
     }
 
-
     /**
-     * 查询事件类型列表
+     * 根据父ID查询事件类型列表
      */
-    @GetMapping("/getEventTypeByParentId")
-    public AjaxResult getEventTypeByParentId(EventType eventType) {
+    @GetMapping("/selectEventTypeList")
+    public AjaxResult selectEventTypeList(EventType eventType) {
         return AjaxResult.success(eventTypeService.selectEventTypeList(eventType));
     }
 

+ 3 - 3
src/main/java/com/sooka/sponest/event/eventType/service/impl/EventTypeServiceImpl.java

@@ -31,12 +31,12 @@ public class EventTypeServiceImpl implements EventTypeService {
     /**
      * 查询事件类型列表
      *
-     * @param EventType 事件类型
+     * @param eventType 事件类型
      * @return 事件类型
      */
     @Override
-    public List<EventType> selectEventTypeList(EventType EventType) {
-        return eventTypeMapper.selectEventTypeList(EventType);
+    public List<EventType> selectEventTypeList(EventType eventType) {
+        return eventTypeMapper.selectEventTypeList(eventType);
     }
 
     /**

+ 37 - 12
src/main/resources/mapper/event/eventProcess/EventProcessMapper.xml

@@ -10,6 +10,7 @@
     <resultMap type="EventInfoBO" id="EventInfoResult">
         <result property="eventId" column="event_id"/>
         <result property="eventType" column="event_type"/>
+        <result property="eventTypeName" column="event_type_name"/>
         <result property="eventName" column="event_name"/>
         <result property="eventDescription" column="event_description"/>
         <result property="reportSource" column="report_source"/>
@@ -45,6 +46,7 @@
     <resultMap type="EventInfo" id="EventDetailResult">
         <result property="eventId" column="event_id"/>
         <result property="eventType" column="event_type"/>
+        <result property="eventTypeName" column="event_type_name"/>
         <result property="eventName" column="event_name"/>
         <result property="eventDescription" column="event_description"/>
         <result property="reportSource" column="report_source"/>
@@ -103,6 +105,7 @@
     <resultMap type="EventInfoBO" id="EventInfoProcessResult">
         <result property="eventId" column="event_id"/>
         <result property="eventType" column="event_type"/>
+        <result property="eventTypeName" column="event_type_name"/>
         <result property="eventName" column="event_name"/>
         <result property="eventDescription" column="event_description"/>
         <result property="reportSource" column="report_source"/>
@@ -138,6 +141,7 @@
     <resultMap type="EventInfo" id="EventDetailProcessResult">
         <result property="eventId" column="event_id"/>
         <result property="eventType" column="event_type"/>
+        <result property="eventTypeName" column="event_type_name"/>
         <result property="eventName" column="event_name"/>
         <result property="eventDescription" column="event_description"/>
         <result property="reportSource" column="report_source"/>
@@ -196,24 +200,51 @@
 
     <!--  *************************************** sql块 开始***********************************************  -->
     <sql id="selectUnconfirmedEventInfoVo">
-        SELECT a.event_id, a.event_type, a.event_name, a.event_description, a.report_source, a.longitude, a.latitude,
+        SELECT DISTINCT a.event_id, a.event_type, b.event_type_name, a.event_name, a.event_description, a.report_source, a.longitude, a.latitude,
                a.reporter, a.camera_code, a.report_time, a.event_status, a.address, a.is_urged, a.urge_count,
                a.create_by, a.create_time, a.update_by, a.update_time
         FROM event_unconfirmed a
+        LEFT JOIN event_type b ON a.event_type = b.id
     </sql>
 
     <sql id="selectEventProcessInfoVo">
-        SELECT a.event_id, a.event_type, a.event_name, a.event_description, a.report_source, a.longitude, a.latitude,
+        SELECT DISTINCT a.event_id, a.event_type, b.event_type_name, a.event_name, a.event_description, a.report_source, a.longitude, a.latitude,
                a.reporter, a.camera_code, a.report_time, a.event_status, a.address, a.is_urged, a.urge_count,
                a.create_by, a.create_time, a.update_by, a.update_time
         FROM event_process a
+        LEFT JOIN event_type b ON a.event_type = b.id
     </sql>
 
     <sql id="selectUsualEventInfoVo">
-        SELECT a.event_id, a.event_type, a.event_name, a.event_description, a.report_source, a.longitude, a.latitude,
+        SELECT DISTINCT a.event_id, a.event_type, b.event_type_name, a.event_name, a.event_description, a.report_source, a.longitude, a.latitude,
                a.reporter, a.camera_code, a.report_time, a.event_status, a.address, a.is_urged, a.urge_count,
                a.create_by, a.create_time, a.update_by, a.update_time
         FROM event_usual a
+        LEFT JOIN event_type b ON a.event_type = b.id
+    </sql>
+
+    <sql id="selectEventListWhere">
+        <if test="eventId!= null and eventId!= ''">
+            and a.event_id = #{eventId}
+        </if>
+        <if test="eventType!= null and eventType!= ''">
+            and a.event_type = #{eventType}
+        </if>
+        <if test="eventName!= null and eventName!= ''">
+            and a.event_name LIKE CONCAT('%', #{eventName}, '%')
+        </if>
+        <if test="reportTimeStart != null and reportTimeEnd != null">
+            and a.report_time between
+            concat(#{reportTimeStart}, ' 00:00:00')
+            and
+            concat(#{reportTimeEnd}, ' 23:59:59')
+        </if>
+        <if test="reportSource!= null and reportSource!= ''">
+            and a.report_source = #{reportSource}
+        </if>
+        <if test="eventStatus!= null and eventStatus!= ''">
+            and a.event_status = #{eventStatus}
+        </if>
     </sql>
     <!--  *************************************** sql块 结束***********************************************  -->
 
@@ -265,9 +296,7 @@
         LEFT JOIN event_dept ed on a.event_id = ed.event_id
         LEFT JOIN ${database_system}.sys_dept d on ed.dept_id = d.dept_id
         <where>
-            <if test="eventId != null and eventId != ''">
-                a.event_id = #{eventId}
-            </if>
+            <include refid="selectEventListWhere"/>
             ${params.dataScope}
         </where>
         order by a.create_time desc
@@ -283,9 +312,7 @@
         LEFT JOIN event_dept ed on a.event_id = ed.event_id
         LEFT JOIN ${database_system}.sys_dept d on ed.dept_id = d.dept_id
         <where>
-            <if test="eventId != null and eventId != ''">
-                a.event_id = #{eventId}
-            </if>
+            <include refid="selectEventListWhere"/>
             ${params.dataScope}
         </where>
         order by a.create_time desc
@@ -301,9 +328,7 @@
         LEFT JOIN event_dept ed on a.event_id = ed.event_id
         LEFT JOIN ${database_system}.sys_dept d on ed.dept_id = d.dept_id
         <where>
-            <if test="eventId!= null and eventId!= ''">
-                a.event_id = #{eventId}
-            </if>
+            <include refid="selectEventListWhere"/>
             ${params.dataScope}
         </where>
         order by a.create_time desc