From 4b66cd48d9e0ca8288dae11f3a895367d30a7b8a Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期二, 19 九月 2023 10:05:49 +0800
Subject: [PATCH] 增加三场数字化报警
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml | 153 ++++++++++
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml | 8
ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml | 8
ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml | 8
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 85 +++++
ard-work/src/main/java/com/ruoyi/alarm/digitization3/domain/ArdAlarmDigitization3.java | 206 ++++++++++++++
ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java | 4
ard-work/src/main/java/com/ruoyi/alarm/digitization3/controller/ArdAlarmDigitization3Controller.java | 104 +++++++
ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/IArdAlarmDigitization3Service.java | 61 ++++
ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java | 68 ++++
ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/impl/ArdAlarmDigitization3ServiceImpl.java | 94 ++++++
11 files changed, 788 insertions(+), 11 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/digitization3/controller/ArdAlarmDigitization3Controller.java b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/controller/ArdAlarmDigitization3Controller.java
new file mode 100644
index 0000000..7821545
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/controller/ArdAlarmDigitization3Controller.java
@@ -0,0 +1,104 @@
+package com.ruoyi.alarm.digitization3.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.alarm.digitization3.domain.ArdAlarmDigitization3;
+import com.ruoyi.alarm.digitization3.service.IArdAlarmDigitization3Service;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 涓夊満鏁板瓧鍖栨姤璀ontroller
+ *
+ * @author ard
+ * @date 2023-09-19
+ */
+@RestController
+@RequestMapping("/alarm/digitization3")
+public class ArdAlarmDigitization3Controller extends BaseController
+{
+ @Autowired
+ private IArdAlarmDigitization3Service ardAlarmDigitization3Service;
+
+ /**
+ * 鏌ヨ涓夊満鏁板瓧鍖栨姤璀﹀垪琛�
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:digitization3:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(ArdAlarmDigitization3 ardAlarmDigitization3)
+ {
+ startPage();
+ List<ArdAlarmDigitization3> list = ardAlarmDigitization3Service.selectArdAlarmDigitization3List(ardAlarmDigitization3);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭涓夊満鏁板瓧鍖栨姤璀﹀垪琛�
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:digitization3:export')")
+ @Log(title = "涓夊満鏁板瓧鍖栨姤璀�", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, ArdAlarmDigitization3 ardAlarmDigitization3)
+ {
+ List<ArdAlarmDigitization3> list = ardAlarmDigitization3Service.selectArdAlarmDigitization3List(ardAlarmDigitization3);
+ ExcelUtil<ArdAlarmDigitization3> util = new ExcelUtil<ArdAlarmDigitization3>(ArdAlarmDigitization3.class);
+ util.exportExcel(response, list, "涓夊満鏁板瓧鍖栨姤璀︽暟鎹�");
+ }
+
+ /**
+ * 鑾峰彇涓夊満鏁板瓧鍖栨姤璀﹁缁嗕俊鎭�
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:digitization3:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") String id)
+ {
+ return success(ardAlarmDigitization3Service.selectArdAlarmDigitization3ById(id));
+ }
+
+ /**
+ * 鏂板涓夊満鏁板瓧鍖栨姤璀�
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:digitization3:add')")
+ @Log(title = "涓夊満鏁板瓧鍖栨姤璀�", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody ArdAlarmDigitization3 ardAlarmDigitization3)
+ {
+ return toAjax(ardAlarmDigitization3Service.insertArdAlarmDigitization3(ardAlarmDigitization3));
+ }
+
+ /**
+ * 淇敼涓夊満鏁板瓧鍖栨姤璀�
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:digitization3:edit')")
+ @Log(title = "涓夊満鏁板瓧鍖栨姤璀�", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody ArdAlarmDigitization3 ardAlarmDigitization3)
+ {
+ return toAjax(ardAlarmDigitization3Service.updateArdAlarmDigitization3(ardAlarmDigitization3));
+ }
+
+ /**
+ * 鍒犻櫎涓夊満鏁板瓧鍖栨姤璀�
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:digitization3:remove')")
+ @Log(title = "涓夊満鏁板瓧鍖栨姤璀�", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable String[] ids)
+ {
+ return toAjax(ardAlarmDigitization3Service.deleteArdAlarmDigitization3ByIds(ids));
+ }
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/digitization3/domain/ArdAlarmDigitization3.java b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/domain/ArdAlarmDigitization3.java
new file mode 100644
index 0000000..3f77001
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/domain/ArdAlarmDigitization3.java
@@ -0,0 +1,206 @@
+package com.ruoyi.alarm.digitization3.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 涓夊満鏁板瓧鍖栨姤璀﹀璞� ard_alarm_digitization3
+ *
+ * @author ard
+ * @date 2023-09-19
+ */
+public class ArdAlarmDigitization3 extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** ID */
+ private String id;
+
+ /** 椤圭洰鍚嶇О */
+ @Excel(name = "椤圭洰鍚嶇О")
+ private String xmmc;
+
+ /** 澶栭敭 */
+ @Excel(name = "澶栭敭")
+ private String fKey;
+
+ /** 瀛楁鍚嶇О */
+ @Excel(name = "瀛楁鍚嶇О")
+ private String fName;
+
+ /** 浜曞彿 */
+ @Excel(name = "浜曞彿")
+ private String wellNo;
+
+ /** 鎶ヨ鏃堕棿 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @Excel(name = "鎶ヨ鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+ private Date alarmTime;
+
+ /** 鎶ヨ鍐呭 */
+ @Excel(name = "鎶ヨ鍐呭")
+ private String alarmType;
+
+ /** 缁忓害 */
+ @Excel(name = "缁忓害")
+ private Double longitude;
+
+ /** 绾害 */
+ @Excel(name = "绾害")
+ private Double latitude;
+
+ /** 楂樺眰 */
+ @Excel(name = "楂樺眰")
+ private Double altitude;
+
+ /** 鏌ョ湅鏃堕棿 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @Excel(name = "鏌ョ湅鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+ private Date viewTime;
+ /**
+ * 鎶ヨ鎬绘暟
+ */
+ private Integer total;
+ /**
+ * 鏈鎶ヨ鏁伴噺
+ */
+ private Integer count;
+
+ public Integer getTotal() {
+ return total;
+ }
+
+ public void setTotal(Integer total) {
+ this.total = total;
+ }
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+ public void setXmmc(String xmmc)
+ {
+ this.xmmc = xmmc;
+ }
+
+ public String getXmmc()
+ {
+ return xmmc;
+ }
+ public void setfKey(String fKey)
+ {
+ this.fKey = fKey;
+ }
+
+ public String getfKey()
+ {
+ return fKey;
+ }
+ public void setfName(String fName)
+ {
+ this.fName = fName;
+ }
+
+ public String getfName()
+ {
+ return fName;
+ }
+ public void setWellNo(String wellNo)
+ {
+ this.wellNo = wellNo;
+ }
+
+ public String getWellNo()
+ {
+ return wellNo;
+ }
+ public void setAlarmTime(Date alarmTime)
+ {
+ this.alarmTime = alarmTime;
+ }
+
+ public Date getAlarmTime()
+ {
+ return alarmTime;
+ }
+ public void setAlarmType(String alarmType)
+ {
+ this.alarmType = alarmType;
+ }
+
+ public String getAlarmType()
+ {
+ return alarmType;
+ }
+ public void setLongitude(Double longitude)
+ {
+ this.longitude = longitude;
+ }
+
+ public Double getLongitude()
+ {
+ return longitude;
+ }
+ public void setLatitude(Double latitude)
+ {
+ this.latitude = latitude;
+ }
+
+ public Double getLatitude()
+ {
+ return latitude;
+ }
+ public void setAltitude(Double altitude)
+ {
+ this.altitude = altitude;
+ }
+
+ public Double getAltitude()
+ {
+ return altitude;
+ }
+ public void setViewTime(Date viewTime)
+ {
+ this.viewTime = viewTime;
+ }
+
+ public Date getViewTime()
+ {
+ return viewTime;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("xmmc", getXmmc())
+ .append("fKey", getfKey())
+ .append("fName", getfName())
+ .append("wellNo", getWellNo())
+ .append("alarmTime", getAlarmTime())
+ .append("alarmType", getAlarmType())
+ .append("longitude", getLongitude())
+ .append("latitude", getLatitude())
+ .append("altitude", getAltitude())
+ .append("createTime", getCreateTime())
+ .append("viewTime", getViewTime())
+ .toString();
+ }
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java
new file mode 100644
index 0000000..0df005a
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/mapper/ArdAlarmDigitization3Mapper.java
@@ -0,0 +1,68 @@
+package com.ruoyi.alarm.digitization3.mapper;
+
+import java.util.List;
+import com.ruoyi.alarm.digitization3.domain.ArdAlarmDigitization3;
+import com.ruoyi.alarm.tube.domain.ArdAlarmTube;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 涓夊満鏁板瓧鍖栨姤璀apper鎺ュ彛
+ *
+ * @author ard
+ * @date 2023-09-19
+ */
+public interface ArdAlarmDigitization3Mapper
+{
+ /**
+ * 鏌ヨ涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param id 涓夊満鏁板瓧鍖栨姤璀︿富閿�
+ * @return 涓夊満鏁板瓧鍖栨姤璀�
+ */
+ public ArdAlarmDigitization3 selectArdAlarmDigitization3ById(String id);
+
+ /**
+ * 鏌ヨ涓夊満鏁板瓧鍖栨姤璀﹀垪琛�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 涓夊満鏁板瓧鍖栨姤璀﹂泦鍚�
+ */
+ public List<ArdAlarmDigitization3> selectArdAlarmDigitization3List(ArdAlarmDigitization3 ardAlarmDigitization3);
+
+ /**
+ * 鏂板涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 缁撴灉
+ */
+ public int insertArdAlarmDigitization3(ArdAlarmDigitization3 ardAlarmDigitization3);
+
+ /**
+ * 淇敼涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 缁撴灉
+ */
+ public int updateArdAlarmDigitization3(ArdAlarmDigitization3 ardAlarmDigitization3);
+
+ /**
+ * 鍒犻櫎涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param id 涓夊満鏁板瓧鍖栨姤璀︿富閿�
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmDigitization3ById(String id);
+
+ /**
+ * 鎵归噺鍒犻櫎涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmDigitization3ByIds(String[] ids);
+
+
+ public List<ArdAlarmDigitization3> selectListAllByCommand(@Param("refreshTime")String refreshTime);
+ int selectCountByAlarmTime(@Param("refreshTime")String refreshTime);
+ public int updateViewTimeByWellNo(@Param("wellNo")String wellNo,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/IArdAlarmDigitization3Service.java b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/IArdAlarmDigitization3Service.java
new file mode 100644
index 0000000..58b4fee
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/IArdAlarmDigitization3Service.java
@@ -0,0 +1,61 @@
+package com.ruoyi.alarm.digitization3.service;
+
+import java.util.List;
+import com.ruoyi.alarm.digitization3.domain.ArdAlarmDigitization3;
+
+/**
+ * 涓夊満鏁板瓧鍖栨姤璀ervice鎺ュ彛
+ *
+ * @author ard
+ * @date 2023-09-19
+ */
+public interface IArdAlarmDigitization3Service
+{
+ /**
+ * 鏌ヨ涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param id 涓夊満鏁板瓧鍖栨姤璀︿富閿�
+ * @return 涓夊満鏁板瓧鍖栨姤璀�
+ */
+ public ArdAlarmDigitization3 selectArdAlarmDigitization3ById(String id);
+
+ /**
+ * 鏌ヨ涓夊満鏁板瓧鍖栨姤璀﹀垪琛�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 涓夊満鏁板瓧鍖栨姤璀﹂泦鍚�
+ */
+ public List<ArdAlarmDigitization3> selectArdAlarmDigitization3List(ArdAlarmDigitization3 ardAlarmDigitization3);
+
+ /**
+ * 鏂板涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 缁撴灉
+ */
+ public int insertArdAlarmDigitization3(ArdAlarmDigitization3 ardAlarmDigitization3);
+
+ /**
+ * 淇敼涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 缁撴灉
+ */
+ public int updateArdAlarmDigitization3(ArdAlarmDigitization3 ardAlarmDigitization3);
+
+ /**
+ * 鎵归噺鍒犻櫎涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑涓夊満鏁板瓧鍖栨姤璀︿富閿泦鍚�
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmDigitization3ByIds(String[] ids);
+
+ /**
+ * 鍒犻櫎涓夊満鏁板瓧鍖栨姤璀︿俊鎭�
+ *
+ * @param id 涓夊満鏁板瓧鍖栨姤璀︿富閿�
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmDigitization3ById(String id);
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/impl/ArdAlarmDigitization3ServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/impl/ArdAlarmDigitization3ServiceImpl.java
new file mode 100644
index 0000000..81fe0b9
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/digitization3/service/impl/ArdAlarmDigitization3ServiceImpl.java
@@ -0,0 +1,94 @@
+package com.ruoyi.alarm.digitization3.service.impl;
+
+import java.util.List;
+ import com.ruoyi.common.utils.DateUtils;
+
+import com.ruoyi.common.utils.uuid.IdUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.ArrayList;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.alarm.digitization3.mapper.ArdAlarmDigitization3Mapper;
+import com.ruoyi.alarm.digitization3.domain.ArdAlarmDigitization3;
+import com.ruoyi.alarm.digitization3.service.IArdAlarmDigitization3Service;
+
+/**
+ * 涓夊満鏁板瓧鍖栨姤璀ervice涓氬姟灞傚鐞�
+ *
+ * @author ard
+ * @date 2023-09-19
+ */
+@Service
+public class ArdAlarmDigitization3ServiceImpl implements IArdAlarmDigitization3Service {
+ @Autowired
+ private ArdAlarmDigitization3Mapper ardAlarmDigitization3Mapper;
+
+ /**
+ * 鏌ヨ涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param id 涓夊満鏁板瓧鍖栨姤璀︿富閿�
+ * @return 涓夊満鏁板瓧鍖栨姤璀�
+ */
+ @Override
+ public ArdAlarmDigitization3 selectArdAlarmDigitization3ById(String id) {
+ return ardAlarmDigitization3Mapper.selectArdAlarmDigitization3ById(id);
+ }
+
+ /**
+ * 鏌ヨ涓夊満鏁板瓧鍖栨姤璀﹀垪琛�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 涓夊満鏁板瓧鍖栨姤璀�
+ */
+ @Override
+ public List<ArdAlarmDigitization3> selectArdAlarmDigitization3List(ArdAlarmDigitization3 ardAlarmDigitization3) {
+ return ardAlarmDigitization3Mapper.selectArdAlarmDigitization3List(ardAlarmDigitization3);
+ }
+
+ /**
+ * 鏂板涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertArdAlarmDigitization3(ArdAlarmDigitization3 ardAlarmDigitization3) {
+ ardAlarmDigitization3.setId(IdUtils.simpleUUID());
+ ardAlarmDigitization3.setCreateTime(DateUtils.getNowDate());
+ return ardAlarmDigitization3Mapper.insertArdAlarmDigitization3(ardAlarmDigitization3);
+ }
+
+ /**
+ * 淇敼涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ardAlarmDigitization3 涓夊満鏁板瓧鍖栨姤璀�
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateArdAlarmDigitization3(ArdAlarmDigitization3 ardAlarmDigitization3) {
+ return ardAlarmDigitization3Mapper.updateArdAlarmDigitization3(ardAlarmDigitization3);
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎涓夊満鏁板瓧鍖栨姤璀�
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑涓夊満鏁板瓧鍖栨姤璀︿富閿�
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteArdAlarmDigitization3ByIds(String[] ids) {
+ return ardAlarmDigitization3Mapper.deleteArdAlarmDigitization3ByIds(ids);
+ }
+
+ /**
+ * 鍒犻櫎涓夊満鏁板瓧鍖栨姤璀︿俊鎭�
+ *
+ * @param id 涓夊満鏁板瓧鍖栨姤璀︿富閿�
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteArdAlarmDigitization3ById(String id) {
+ return ardAlarmDigitization3Mapper.deleteArdAlarmDigitization3ById(id);
+ }
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
index 70a9e07..d984130 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
@@ -7,6 +7,8 @@
import com.ruoyi.alarm.apponekey.mapper.ArdAlarmApponekeyMapper;
import com.ruoyi.alarm.camera.domain.ArdAlarmCamera;
import com.ruoyi.alarm.camera.mapper.ArdAlarmCameraMapper;
+import com.ruoyi.alarm.digitization3.domain.ArdAlarmDigitization3;
+import com.ruoyi.alarm.digitization3.mapper.ArdAlarmDigitization3Mapper;
import com.ruoyi.alarm.external.domain.ArdAlarmExternal;
import com.ruoyi.alarm.external.mapper.ArdAlarmExternalMapper;
import com.ruoyi.alarm.global.domain.GlobalAlarmCondition;
@@ -16,7 +18,6 @@
import com.ruoyi.alarm.global.service.IGlobalAlarmService;
import com.ruoyi.alarm.radar.domain.*;
import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarFireMapper;
-import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarMapper;
import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarMoveMapper;
import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarPumpMapper;
import com.ruoyi.alarm.steal.domain.ArdAlarmStealelec;
@@ -69,6 +70,8 @@
@Slf4j(topic = "mqtt")
public class GlobalAlarmServiceImpl implements IGlobalAlarmService {
//region 渚濊禆娉ㄥ叆
+ @Resource
+ private ArdAlarmDigitization3Mapper ardAlarmDigitization3Mapper;
@Resource
private ArdAlarmWallMapper ardAlarmWallMapper;
@Resource
@@ -148,6 +151,8 @@
countMap.put("1010", count1010);
int count1014 = ardAlarmTubeMapper.selectCountByAlarmTime(refreshTime);
countMap.put("1014", count1014);
+ int count1012 = ardAlarmDigitization3Mapper.selectCountByAlarmTime(refreshTime);
+ countMap.put("1012", count1012);
map.put("20000", countMap);
return map;
}
@@ -289,6 +294,22 @@
.setLatitude(ardAlarmWall.getLatitude())
.setCount(ardAlarmWall.getCount())
.setTotal(ardAlarmWall.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1012:
+ List<ArdAlarmDigitization3> ardAlarmDigitization3s = ardAlarmDigitization3Mapper.selectListAllByCommand(refreshTime);
+ return ardAlarmDigitization3s.stream()
+ .map(ardAlarmDigitization3 -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmDigitization3.getId())
+ .setName(ardAlarmDigitization3.getWellNo())
+ .setAlarmType(ardAlarmDigitization3.getAlarmType())
+ .setAlarmTime(ardAlarmDigitization3.getAlarmTime())
+ .setLongitude(ardAlarmDigitization3.getLongitude())
+ .setLatitude(ardAlarmDigitization3.getLatitude())
+ .setAltitude(ardAlarmDigitization3.getAltitude())
+ .setCount(ardAlarmDigitization3.getCount())
+ .setTotal(ardAlarmDigitization3.getTotal());
return globalAlarmData;
}).collect(Collectors.toList());
case 1014:
@@ -653,6 +674,24 @@
GlobalAlarmDataList.addAll(alarmData1010);
}
+ List<ArdAlarmDigitization3> ardAlarmDigitization3s = ardAlarmDigitization3Mapper.selectListAllByCommand(refreshTime);
+ List<GlobalAlarmData> alarmData1012 = ardAlarmDigitization3s.stream()
+ .map(ardAlarmDigitization3 -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmDigitization3.getId())
+ .setName(ardAlarmDigitization3.getWellNo())
+ .setAlarmTime(ardAlarmDigitization3.getAlarmTime())
+ .setLongitude(ardAlarmDigitization3.getLongitude())
+ .setLatitude(ardAlarmDigitization3.getLatitude())
+ .setAltitude(ardAlarmDigitization3.getAltitude())
+ .setCount(ardAlarmDigitization3.getCount())
+ .setTotal(ardAlarmDigitization3.getTotal())
+ .setAlarmType("1012");
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ if (alarmData1012.size() > 0) {
+ GlobalAlarmDataList.addAll(alarmData1012);
+ }
List<ArdAlarmTube> ardAlarmTubes = ardAlarmTubeMapper.selectListAllByCommand(refreshTime);
List<GlobalAlarmData> alarmData1014 = ardAlarmTubes.stream()
.map(ardAlarmTube -> {
@@ -747,6 +786,12 @@
aaw.setPageNum(pageNum);
aaw.setPageSize(pageSize);
return ardAlarmWallMapper.selectArdAlarmWallList(aaw);
+ case 1012:
+ ArdAlarmDigitization3 aad3 = new ArdAlarmDigitization3();
+ aad3.setParams(params);
+ aad3.setPageNum(pageNum);
+ aad3.setPageSize(pageSize);
+ return ardAlarmDigitization3Mapper.selectArdAlarmDigitization3List(aad3);
case 1014:
ArdAlarmTube aat = new ArdAlarmTube();
aat.setParams(params);
@@ -842,6 +887,14 @@
String alarmTime = fmtms.format(ardAlarmWall.getAlarmTime());
ardAlarmWallMapper.updateViewTimeByUserId(userId, alarmTime, DateUtils.getTime());
return ardAlarmWall;
+ }
+ case 1012:
+ ArdAlarmDigitization3 ardAlarmDigitization3 = ardAlarmDigitization3Mapper.selectArdAlarmDigitization3ById(condition.getId());
+ if (StringUtils.isNotNull(ardAlarmDigitization3)) {
+ String wellNo = ardAlarmDigitization3.getWellNo();
+ String alarmTime = fmtms.format(ardAlarmDigitization3.getAlarmTime());
+ ardAlarmDigitization3Mapper.updateViewTimeByWellNo(wellNo, alarmTime, DateUtils.getTime());
+ return ardAlarmDigitization3;
}
case 1014:
ArdAlarmTube ardAlarmTube = ardAlarmTubeMapper.selectArdAlarmTubeById(condition.getId());
@@ -1006,6 +1059,7 @@
radarMoveGuide(ardAlarmRadarMoves, radarAlarmData);
radarFireGuide(ardAlarmRadarFires, radarAlarmData);
radarPumpGuide(ardAlarmRadarPumps, radarAlarmData);
+ //endregion
break;
case "external":
//region 澶勭悊澶栬仈鎶ヨ
@@ -1072,6 +1126,23 @@
int aaak = ardAlarmApponekeyMapper.insertArdAlarmApponekey(ardAlarmApponekey);
if (aaak > 0) {
log.debug("apponekey鍏ュ簱鎴愬姛锛�" + ardAlarmApponekey);
+ }
+ //endregion
+ break;
+ case "digitization3":
+ //region 涓夊巶鏁板瓧鍖栨姤璀�
+ ArdAlarmDigitization3 ardAlarmDigitization3 = JSONObject.parseObject(message, ArdAlarmDigitization3.class);
+ //鑾峰彇缁忕含搴�
+ ArdAlarmpointsWell Well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(ardAlarmDigitization3.getWellNo());
+ if(Well!=null) {
+ ardAlarmDigitization3.setLongitude(Well.getLongitude());
+ ardAlarmDigitization3.setLatitude(Well.getLatitude());
+ ardAlarmDigitization3.setAltitude(Well.getAltitude());
+ }
+ ardAlarmDigitization3.setCreateTime(new Date());
+ int aad = ardAlarmDigitization3Mapper.insertArdAlarmDigitization3(ardAlarmDigitization3);
+ if (aad > 0) {
+ log.debug("digitization3鍏ュ簱鎴愬姛锛�" + ardAlarmDigitization3);
}
//endregion
break;
@@ -1205,9 +1276,8 @@
return minDistanceCameraId;
}
- /**
- * 闆疯揪寮曞鍏ラ槦
- */
+
+ //闆疯揪寮曞鍏ラ槦(鑾峰彇鐩告満)
private void radarGuideToQueue(String alarmId, String radarId, String name, String alarmType, Date createTime, double[] coordinate) {
int index = name.indexOf("(");
String alarmpointName = name.substring(0, index);
@@ -1234,8 +1304,7 @@
log.debug("鏈幏鍙栧埌鎶ヨ鐐瑰叧鑱旂殑鍏夌數");
}
}
-
-
+ //闆疯揪绉诲姩寮曞
private void radarMoveGuide(List<ArdAlarmRadarMove> ardAlarmRadarMoves, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
ardAlarmRadarMoves = ardAlarmRadarMoves.stream()
@@ -1288,7 +1357,7 @@
}
//endregion
}
-
+ //闆疯揪闃茬伀寮曞
private void radarFireGuide(List<ArdAlarmRadarFire> ardAlarmRadarFires, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
ardAlarmRadarFires = ardAlarmRadarFires.stream()
@@ -1340,7 +1409,7 @@
}
//endregion
}
-
+ //闆疯揪鎶芥补鏈哄仠鏈哄紩瀵�
private void radarPumpGuide(List<ArdAlarmRadarPump> ardAlarmRadarPumps, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
ardAlarmRadarPumps = ardAlarmRadarPumps.stream()
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
index ad6a795..2e7b366 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/ArdSyCarController.java
@@ -87,6 +87,10 @@
String ip = syURL.split(":")[1].replace("//", "");
List<ArdSyUser> ardSyUserList = iArdSyUserService.selectSyUser();
//杞﹁締瀹炴椂浣嶇疆绾跨▼
+ if(ardSyUserList.size()==0)
+ {
+ return;
+ }
PushClientImplPosition pushClientImplPosition = new PushClientImplPosition(ip,ardSyUserList.get(0).getUserId(),ardSyUserList.get(0).getPassword());
Thread pushClientImplPositionThread = new Thread(pushClientImplPosition);
pushClientImplPositionThread.start();
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
index 3f246dc..20ef5df 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml
@@ -31,7 +31,13 @@
<select id="selectArdAlarmAccessList" parameterType="ArdAlarmAccess" resultMap="ArdAlarmAccessResult">
<include refid="selectArdAlarmAccessVo"/>
- <where>
+ <where>
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+ AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
+ <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+ AND alarm_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
</where>
order by alarm_time desc
</select>
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
index c047dc5..8a00857 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml
@@ -22,7 +22,13 @@
<select id="selectArdAlarmApponekeyList" parameterType="ArdAlarmApponekey" resultMap="ArdAlarmApponekeyResult">
<include refid="selectArdAlarmApponekeyVo"/>
- <where>
+ <where>
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+ AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
+ <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+ AND alarm_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
</where>
order by create_time desc
</select>
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml
new file mode 100644
index 0000000..02e1c34
--- /dev/null
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml
@@ -0,0 +1,153 @@
+<?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.ruoyi.alarm.digitization3.mapper.ArdAlarmDigitization3Mapper">
+
+ <resultMap type="ArdAlarmDigitization3" id="ArdAlarmDigitization3Result">
+ <result property="id" column="id" />
+ <result property="xmmc" column="xmmc" />
+ <result property="fKey" column="f_key" />
+ <result property="fName" column="f_name" />
+ <result property="wellNo" column="well_no" />
+ <result property="alarmTime" column="alarm_time" />
+ <result property="alarmType" column="alarm_type" />
+ <result property="longitude" column="longitude" />
+ <result property="latitude" column="latitude" />
+ <result property="altitude" column="altitude" />
+ <result property="createTime" column="create_time" />
+ <result property="viewTime" column="view_time" />
+ </resultMap>
+
+ <sql id="selectArdAlarmDigitization3Vo">
+ select id, xmmc, f_key, f_name, well_no, alarm_time, alarm_type, longitude, latitude, altitude, create_time, view_time from ard_alarm_digitization3
+ </sql>
+
+ <select id="selectArdAlarmDigitization3List" parameterType="ArdAlarmDigitization3" resultMap="ArdAlarmDigitization3Result">
+ <include refid="selectArdAlarmDigitization3Vo"/>
+ <where>
+ <if test="xmmc != null and xmmc != ''"> and xmmc = #{xmmc}</if>
+ <if test="fKey != null and fKey != ''"> and f_key = #{fKey}</if>
+ <if test="fName != null and fName != ''"> and f_name like '%'||#{fName}||'%'</if>
+ <if test="wellNo != null and wellNo != ''"> and well_no = #{wellNo}</if>
+<!-- <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if>-->
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+ AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
+ <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+ AND alarm_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
+ <if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if>
+ <if test="longitude != null "> and longitude = #{longitude}</if>
+ <if test="latitude != null "> and latitude = #{latitude}</if>
+ <if test="altitude != null "> and altitude = #{altitude}</if>
+ <if test="viewTime != null "> and view_time = #{viewTime}</if>
+ </where>
+ </select>
+
+ <select id="selectArdAlarmDigitization3ById" parameterType="String" resultMap="ArdAlarmDigitization3Result">
+ <include refid="selectArdAlarmDigitization3Vo"/>
+ where id = #{id}
+ </select>
+
+ <insert id="insertArdAlarmDigitization3" parameterType="ArdAlarmDigitization3">
+ insert into ard_alarm_digitization3
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">id,</if>
+ <if test="xmmc != null">xmmc,</if>
+ <if test="fKey != null">f_key,</if>
+ <if test="fName != null">f_name,</if>
+ <if test="wellNo != null">well_no,</if>
+ <if test="alarmTime != null">alarm_time,</if>
+ <if test="alarmType != null">alarm_type,</if>
+ <if test="longitude != null">longitude,</if>
+ <if test="latitude != null">latitude,</if>
+ <if test="altitude != null">altitude,</if>
+ <if test="createTime != null">create_time,</if>
+ <if test="viewTime != null">view_time,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">#{id},</if>
+ <if test="xmmc != null">#{xmmc},</if>
+ <if test="fKey != null">#{fKey},</if>
+ <if test="fName != null">#{fName},</if>
+ <if test="wellNo != null">#{wellNo},</if>
+ <if test="alarmTime != null">#{alarmTime},</if>
+ <if test="alarmType != null">#{alarmType},</if>
+ <if test="longitude != null">#{longitude},</if>
+ <if test="latitude != null">#{latitude},</if>
+ <if test="altitude != null">#{altitude},</if>
+ <if test="createTime != null">#{createTime},</if>
+ <if test="viewTime != null">#{viewTime},</if>
+ </trim>
+ ON conflict(id) DO NOTHING;
+ </insert>
+
+ <update id="updateArdAlarmDigitization3" parameterType="ArdAlarmDigitization3">
+ update ard_alarm_digitization3
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="xmmc != null">xmmc = #{xmmc},</if>
+ <if test="fKey != null">f_key = #{fKey},</if>
+ <if test="fName != null">f_name = #{fName},</if>
+ <if test="wellNo != null">well_no = #{wellNo},</if>
+ <if test="alarmTime != null">alarm_time = #{alarmTime},</if>
+ <if test="alarmType != null">alarm_type = #{alarmType},</if>
+ <if test="longitude != null">longitude = #{longitude},</if>
+ <if test="latitude != null">latitude = #{latitude},</if>
+ <if test="altitude != null">altitude = #{altitude},</if>
+ <if test="createTime != null">create_time = #{createTime},</if>
+ <if test="viewTime != null">view_time = #{viewTime},</if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <delete id="deleteArdAlarmDigitization3ById" parameterType="String">
+ delete from ard_alarm_digitization3 where id = #{id}
+ </delete>
+
+ <delete id="deleteArdAlarmDigitization3ByIds" parameterType="String">
+ delete from ard_alarm_digitization3 where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </delete>
+ <select id="selectListAllByCommand" resultMap="ArdAlarmDigitization3Result">
+ SELECT T
+ .*
+ FROM
+ (
+ SELECT
+ aad.ID,
+ aad.well_no,
+ aad.alarm_type,
+ aad.alarm_time,
+ aad.longitude,
+ aad.latitude,
+ aad.altitude,
+ ROW_NUMBER () OVER ( PARTITION BY aad.well_no ORDER BY aad.alarm_time DESC ) AS rn,
+ COUNT ( CASE WHEN aad.view_time IS NULL THEN 1 END ) OVER ( PARTITION BY aad.well_no ) AS COUNT,
+ COUNT ( aad.alarm_time ) OVER ( PARTITION BY aad.well_no ) AS total
+ FROM
+ ard_alarm_digitization3 aad
+ WHERE
+ aad.alarm_time >= ( CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE )
+ ORDER BY
+ aad.alarm_time DESC
+ ) T
+ WHERE
+ T.rn = 1
+ </select>
+ <select id="selectCountByAlarmTime" resultType="Integer">
+ SELECT COUNT(DISTINCT aat.id)
+ FROM ard_alarm_digitization3 aat
+ WHERE aat.alarm_time >= CURRENT_TIMESTAMP - INTERVAL '%${refreshTime}%' MINUTE
+ and aat.view_time is null
+ </select>
+ <update id="updateViewTimeByWellNo" parameterType="String">
+ update ard_alarm_digitization3
+ set view_time=#{viewTime}
+ where well_no = #{wellNo}
+ and alarm_time <= #{alarmTime}
+ and view_time is null
+ </update>
+</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
index fb4859c..a35adc3 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
@@ -44,10 +44,16 @@
<if test="wallName != null and wallName != ''">and wall_name = #{wallName}</if>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
<if test="alarmType != null and alarmType != ''">and alarm_type = #{alarmType}</if>
- <if test="alarmTime != null ">and alarm_time = #{alarmTime}</if>
+<!-- <if test="alarmTime != null ">and alarm_time = #{alarmTime}</if>-->
<if test="longitude != null ">and longitude = #{longitude}</if>
<if test="latitude != null ">and latitude = #{latitude}</if>
<if test="altitude != null ">and altitude = #{altitude}</if>
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+ AND alarm_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
+ <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+ AND alarm_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss')
+ </if>
</where>
order by alarm_time desc
</select>
--
Gitblit v1.9.3