Pārlūkot izejas kodu

事件推送-119接处警

lyq 1 gadu atpakaļ
vecāks
revīzija
9923300eab

+ 35 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTEventcatalogueController.java

@@ -31,8 +31,10 @@ import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
 import com.sooka.sponest.event.utils.EventProducerUtil;
 import com.sooka.sponest.event.utils.ExcelUtil;
 import com.sooka.sponest.event.utils.RemoteApiUtil;
+import com.sooka.sponest.monitor.api.RemoteExchangeService;
 import com.sooka.sponest.monitor.api.RemoteMonitorService;
 import com.sooka.sponest.monitor.api.domain.CenterdataTAidevicedept;
+import com.sooka.sponest.monitor.api.domain.FireEventVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -381,4 +383,37 @@ public class CentereventTEventcatalogueController extends BaseController {
             return AjaxResult.success(centereventTEventcatalogueService.eventhandleDownload(id));
         }
     }
+
+    /**
+     * 119事件推送
+     *
+     * @param fireEventVO
+     * @return
+     */
+    @PostMapping("/push3rdSystemEvent")
+    public R push3rdSystemEvent(@Validated @RequestBody FireEventVO fireEventVO) {
+        if (StringUtils.isBlank(fireEventVO.getEventId()) || StringUtils.isBlank(fireEventVO.getEventCode())) {
+            return R.ok(HttpStatus.UNSUPPORTED_TYPE, "参数异常");
+        }
+        // 101森林火情、102秸秆禁烧、103建筑物火情、1002消防占道、510水压监测异常、1001电瓶车进电梯
+        if (!Arrays.asList("101", "102", "103", "510", "1001", "1002", "1003", "1004").contains(fireEventVO.getEventType())) {
+            return R.ok(HttpStatus.UNSUPPORTED_TYPE, "无法推送该类型事件");
+        }
+        List<String> pictures = fireEventVO.getEventPicture().stream().map(item -> item.substring(item.indexOf("group1"))).collect(Collectors.toList());
+        fireEventVO.setPictureUrlList(pictures);
+        R result = SpringUtils.getBean(RemoteExchangeService.class).receiveEventData(fireEventVO);
+        if (200 == result.getCode()) {
+            // log
+            CentereventTFireLog log = new CentereventTFireLog();
+            log.setId(IdUtils.simpleUUID());
+            log.setEventCode(fireEventVO.getEventCode());
+            log.setLogContent(SecurityUtils.getLoginUser().getSysUser().getNickName() + "推送该事件至119接处警");
+            centereventTFireLogService.insertCentereventTFireLog(log);
+            CentereventTEventcatalogue centereventTEventcatalogue = new CentereventTEventcatalogue();
+            centereventTEventcatalogue.setId(fireEventVO.getEventId());
+            centereventTEventcatalogue.setIsPush("1");
+            return R.ok(centereventTEventcatalogueService.updateCentereventTEventcatalogue(centereventTEventcatalogue));
+        }
+        return result;
+    }
 }

+ 1 - 1
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/FireIncidentController.java

@@ -9,13 +9,13 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.api.model.LoginUser;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.DaHuaEventBO;
-import com.sooka.sponest.event.centereventteventcatalogue.domain.FireEventVO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.sensor.SensorEventVo;
 import com.sooka.sponest.event.centereventteventcatalogue.service.AlarmEventService;
 import com.sooka.sponest.event.centereventteventtype.domain.CentereventTEventtype;
 import com.sooka.sponest.event.centereventteventtype.service.ICentereventTEventtypeService;
 import com.sooka.sponest.event.centereventtreportmessage.domain.CentereventTReportmessage;
 import com.sooka.sponest.event.centereventtreportmessage.service.ICentereventTReportmessageService;
+import com.sooka.sponest.monitor.api.domain.FireEventVO;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 10 - 0
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/domain/CentereventTEventcatalogue.java

@@ -198,6 +198,8 @@ public class CentereventTEventcatalogue extends BaseBusinessEntity {
 
     private String isExamine;// 是否审核
 
+    private String isPush;// 是否推送
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date gdTime;// 归档时间
 
@@ -431,6 +433,14 @@ public class CentereventTEventcatalogue extends BaseBusinessEntity {
         this.isExamine = isExamine;
     }
 
+    public String getIsPush() {
+        return isPush;
+    }
+
+    public void setIsPush(String isPush) {
+        this.isPush = isPush;
+    }
+
     public void setStatusFlag(String statusFlag) {
         this.statusFlag = statusFlag;
     }

+ 0 - 87
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/domain/FireEventVO.java

@@ -1,87 +0,0 @@
-package com.sooka.sponest.event.centereventteventcatalogue.domain;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import java.util.Date;
-import java.util.List;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class FireEventVO {
-
-    /**
-     * 事件名称
-     */
-    @NotBlank(message = "事件名称不能为空")
-    private String eventName;
-
-    /**
-     * 事件小类( 101森林火情、102秸秆禁烧、103建筑物火情、1002消防占道、510水压监测异常、1001电瓶车进电梯)
-     */
-    @NotBlank(message = "事件类型不能为空")
-    private String eventType;
-
-    /**
-     * 事件大类
-     */
-    private String eventSupType;
-
-    /**
-     * 事件描述
-     */
-    @NotBlank(message = "事件描述不能为空")
-    private String eventDescription;
-
-    /**
-     * 事件上报人
-     */
-    @NotBlank(message = "事件上报人不能为空")
-    private String eventReporter;
-
-    /**
-     * 事件上报时间
-     */
-    @NotNull(message = "事件上报时间不能为空")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date eventReportTime;
-
-    /**
-     * 事件地理位置
-     */
-    @NotBlank(message = "事件地理位置不能为空")
-    private String eventLocation;
-
-    /**
-     * 事件坐标(经度)
-     */
-    @NotBlank(message = "事件坐标(经度)不能为空")
-    @Pattern(regexp = "^(\\-|\\+)?(((\\d|[1-9]\\d|1[0-7]\\d|0{1,3})\\.\\d{0,15})|(\\d|[1-9]\\d|1[0-7]\\d|0{1,3})|180\\.0{0,6}|180)$", message = "事件坐标(经度)取值范围只能在正负180之间,小数点后最多保留15位")
-    private String eventLongitude;
-
-    /**
-     * 事件坐标(纬度)
-     */
-    @NotBlank(message = "事件坐标(纬度)不能为空")
-    @Pattern(regexp = "^(\\-|\\+)?([0-8]?\\d{1}\\.\\d{0,15}|90\\.0{0,6}|[0-8]?\\d{1}|90)$", message = "事件坐标(经度)取值范围只能在正负180之间,小数点后最多保留15位")
-    private String eventLatitude;
-
-    /**
-     * 事件图片-原路径
-     */
-    @NotEmpty(message = "事件图片不能为空")
-    private List<String> eventPicture;
-
-    /**
-     * 事件图片-转换路径
-     */
-    @NotEmpty(message = "事件图片不能为空")
-    private List<String> pictureUrlList;
-}

+ 1 - 1
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/AlarmEventService.java

@@ -2,12 +2,12 @@ package com.sooka.sponest.event.centereventteventcatalogue.service;
 
 import com.dahuatech.icc.exception.ClientException;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.DaHuaEventBO;
-import com.sooka.sponest.event.centereventteventcatalogue.domain.FireEventVO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.dahua.DaHuaFireEventVO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.dahua.DaHuaOtherEventVO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.haikang.EventsVo;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.haikang.HaiKangEventVo;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.sensor.SensorEventVo;
+import com.sooka.sponest.monitor.api.domain.FireEventVO;
 
 public interface AlarmEventService {
 

+ 1 - 1
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/AlarmEventServiceImpl.java

@@ -13,7 +13,6 @@ import com.sooka.sponest.event.centereventtdeptevent.domain.CentereventDeptEvent
 import com.sooka.sponest.event.centereventtdeptevent.service.ICentereventDeptEventService;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.DaHuaEventBO;
-import com.sooka.sponest.event.centereventteventcatalogue.domain.FireEventVO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.dahua.DaHuaFireEventVO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.dahua.DaHuaOtherEventVO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.dahua.PictureVO;
@@ -32,6 +31,7 @@ import com.sooka.sponest.event.utils.RemoteApiUtil;
 import com.sooka.sponest.monitor.api.RemoteMonitorService;
 import com.sooka.sponest.monitor.api.domain.CenterdataTAidevicedept;
 import com.sooka.sponest.monitor.api.domain.CenterdataTCamera;
+import com.sooka.sponest.monitor.api.domain.FireEventVO;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 3 - 1
src/main/resources/mapper/centereventteventcatalogue/CentereventTEventcatalogueMapper.xml

@@ -35,10 +35,11 @@
         <result property="address" column="address"/>
         <result property="escalation" column="escalation"/>
         <result property="isExamine" column="is_examine"/>
+        <result property="isPush" column="is_push"/>
     </resultMap>
 
     <sql id="selectCentereventTEventcatalogueVo">
-        select id, event_code, event_type, event_type_xl, event_name, event_description, report_source, longitude, latitude, reportor,report_time, is_urged, event_status, event_status_value, create_by, create_name, create_time, update_by, update_name, update_time, data_status, dept_id, dept_name, IFNULL(version, 0) version, urge_count, address, escalation, is_examine from centerevent_t_eventcatalogue
+        select id, event_code, event_type, event_type_xl, event_name, event_description, report_source, longitude, latitude, reportor,report_time, is_urged, event_status, event_status_value, create_by, create_name, create_time, update_by, update_name, update_time, data_status, dept_id, dept_name, IFNULL(version, 0) version, urge_count, address, escalation, is_examine, is_push from centerevent_t_eventcatalogue
     </sql>
 
     <select id="selectCentereventTEventcatalogueListByPc" parameterType="CentereventTEventcatalogue"
@@ -266,6 +267,7 @@
             <if test="address != null ">address = #{address},</if>
             <if test="escalation != null ">escalation = #{escalation},</if>
             <if test="isExamine != null ">is_examine = #{isExamine},</if>
+            <if test="isPush != null ">is_push = #{isPush},</if>
             <if test="gdTime != null ">gd_time = #{gdTime},</if>
         </trim>
         where id = #{id}