From 065142057ba3983af899991085e37ac1ec502320 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期二, 19 九月 2023 14:06:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmAccessMapper.xml | 8
ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml | 8
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java | 14
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmCondition.java | 2
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java | 5
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java | 27 +
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 ++++
ard-work/src/main/resources/mapper/alarm/ArdAlarmDigitization3Mapper.xml | 153 +++++++
ard-work/src/main/java/com/ruoyi/alarm/global/controller/GlobalAlarmController.java | 8
ard-work/src/main/resources/mapper/alarm/ArdAlarmApponekeyMapper.xml | 8
ard-work/src/main/java/com/ruoyi/alarm/global/service/IGlobalAlarmService.java | 1
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 373 +++++++++++++++---
17 files changed, 1,076 insertions(+), 68 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/controller/GlobalAlarmController.java b/ard-work/src/main/java/com/ruoyi/alarm/global/controller/GlobalAlarmController.java
index 0b7e7a6..3ef2d72 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/controller/GlobalAlarmController.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/controller/GlobalAlarmController.java
@@ -87,4 +87,12 @@
Map<String, PriorityBlockingQueue<GuideTask>> cameraQueueMap = GuidePriorityQueue.cameraQueueMap;
return AjaxResult.success(cameraQueueMap);
}
+
+ @PostMapping("/ThermalMapList")
+ @ApiOperation(value = "鐑姏鍥炬帴鍙�",notes = "鎸夋姤璀﹀埛鏂版椂闂存寜鎶ヨ绫诲埆鑱氬悎鏌ヨ")
+ @ApiOperationSupport(includeParameters = {"command","refreshTime"},order = 1)
+ public AjaxResult selectThermalMap(@RequestBody GlobalAlarmCondition condition) {
+ List<GlobalAlarmData> result = globalAlarmService.selectThermalMap(condition);
+ return AjaxResult.success(result);
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmCondition.java b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmCondition.java
index 7747840..79cf543 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmCondition.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmCondition.java
@@ -24,4 +24,6 @@
String id;
Date beginTime;
Date endTime;
+ String refreshTime;
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/service/IGlobalAlarmService.java b/ard-work/src/main/java/com/ruoyi/alarm/global/service/IGlobalAlarmService.java
index c4b6d45..91ebeb1 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/service/IGlobalAlarmService.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/service/IGlobalAlarmService.java
@@ -20,4 +20,5 @@
public void receiveAlarm(String topic,String message);
public Map<String,Object> selectAlarmLogsCount();
Object selectAlarmList(Integer command, String beginTime, String endTime,Integer pageNum,Integer pageSize);
+ public List<GlobalAlarmData> selectThermalMap(GlobalAlarmCondition condition);
}
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 b6c55f2..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;
@@ -70,6 +71,8 @@
public class GlobalAlarmServiceImpl implements IGlobalAlarmService {
//region 渚濊禆娉ㄥ叆
@Resource
+ private ArdAlarmDigitization3Mapper ardAlarmDigitization3Mapper;
+ @Resource
private ArdAlarmWallMapper ardAlarmWallMapper;
@Resource
private ArdAlarmApponekeyMapper ardAlarmApponekeyMapper;
@@ -114,6 +117,7 @@
private Map<String, Integer> unGuideCountMapMove = new HashMap<>();
private Map<String, Integer> unGuideCountMapFire = new HashMap<>();
private Map<String, Integer> unGuideCountMapPump = new HashMap<>();
+
/**
* @鎻忚堪 鏌ヨ鎵�鏈夋姤璀︾殑褰撳墠鏁伴噺
* @鍙傛暟 []
@@ -147,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;
}
@@ -290,6 +296,197 @@
.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:
+ List<ArdAlarmTube> ardAlarmTubes = ardAlarmTubeMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmTubes.stream()
+ .map(ardAlarmTube -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmTube.getId())
+ .setName(ardAlarmTube.getTubeName())
+ .setAlarmTime(ardAlarmTube.getAlarmTime())
+ .setLongitude(ardAlarmTube.getLongitude())
+ .setLatitude(ardAlarmTube.getLatitude())
+ .setAltitude(ardAlarmTube.getAltitude())
+ .setCount(ardAlarmTube.getCount())
+ .setTotal(ardAlarmTube.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * 鑾峰彇鐑姏鍥炬暟鎹�
+ * 鍒樿嫃涔�
+ * 2023/9/16 8:38:54
+ */
+ @Override
+ public List<GlobalAlarmData> selectThermalMap(GlobalAlarmCondition condition) {
+ String refreshTime = condition.getRefreshTime();
+ switch (condition.getCommand()) {
+ case 1001:
+ List<ArdAlarmStealelec> ardAlarmStealelecs = ardAlarmStealelecMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmStealelecs.stream()
+ .map(ardAlarmStealelec -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmStealelec.getId())
+ .setName(ardAlarmStealelec.getDescribe())
+ .setAlarmTime(ardAlarmStealelec.getStartTime())
+ .setLongitude(ardAlarmStealelec.getLongitude())
+ .setLatitude(ardAlarmStealelec.getLatitude())
+ .setAltitude(ardAlarmStealelec.getAltitude())
+ .setCount(ardAlarmStealelec.getCount())
+ .setTotal(ardAlarmStealelec.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1002:
+ List<ArdAlarmCamera> ardAlarmCameras = ardAlarmCameraMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmCameras.stream()
+ .map(ardAlarmCamera -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmCamera.getId())
+ .setName(ardAlarmCamera.getCameraName())
+ .setAlarmTime(ardAlarmCamera.getAlarmTime())
+ .setLongitude(ardAlarmCamera.getLongitude())
+ .setLatitude(ardAlarmCamera.getLatitude())
+ .setCount(ardAlarmCamera.getCount())
+ .setTotal(ardAlarmCamera.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1003:
+ //浠庣紦瀛樿幏鍙栨暟鎹�
+ //String key = "radar_alarm:" + DateUtils.getDate();
+ //List<ArdAlarmRadarMove> ardAlarmRadarMoves = redisCache.getCacheList(key);
+ //Map<String, List<ArdAlarmRadarMove>> groupedData = ardAlarmRadarMoves.stream()
+ // .collect(Collectors.groupingBy(ArdAlarmRadarMove::getName));
+ //List<GlobalAlarmData> globalAlarmDataList = new ArrayList<>();
+ //for (String name : groupedData.keySet()) {
+ // List<ArdAlarmRadarMove> ardAlarmRadarMove = groupedData.get(name);
+ // GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ // .setId(ardAlarmRadarMove.get(0).getId())
+ // .setName(name)
+ // .setAlarmTime(ardAlarmRadarMove.get(0).getAlarmTime())
+ // .setLongitude(ardAlarmRadarMove.get(0).getLongitude())
+ // .setLatitude(ardAlarmRadarMove.get(0).getLatitude())
+ // .setTotal(ardAlarmRadarMove.size());
+ // globalAlarmDataList.add(globalAlarmData);
+ //}
+ //return globalAlarmDataList;
+ //浠庢暟鎹簱鑾峰彇
+ List<ArdAlarmRadarMove> ardAlarmRadarMoves = ardAlarmRadarMoveMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmRadarMoves.stream()
+ .map(ardAlarmRadarMove -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmRadarMove.getId())
+ .setName(ardAlarmRadarMove.getName())
+ .setAlarmTime(ardAlarmRadarMove.getAlarmTime())
+ .setLongitude(ardAlarmRadarMove.getLongitude())
+ .setLatitude(ardAlarmRadarMove.getLatitude())
+ .setCount(ardAlarmRadarMove.getCount())
+ .setTotal(ardAlarmRadarMove.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1004:
+ List<ArdAlarmRadarFire> ardAlarmRadarFires = ardAlarmRadarFireMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmRadarFires.stream()
+ .map(ardAlarmRadarFire -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmRadarFire.getId())
+ .setName(ardAlarmRadarFire.getName())
+ .setAlarmTime(ardAlarmRadarFire.getAlarmTime())
+ .setLongitude(ardAlarmRadarFire.getLongitude())
+ .setLatitude(ardAlarmRadarFire.getLatitude())
+ .setCount(ardAlarmRadarFire.getCount())
+ .setTotal(ardAlarmRadarFire.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1005:
+ List<ArdAlarmExternal> ardAlarmExternals = ardAlarmExternalMapper.selectListAllByCommand(refreshTime, "闃插尯鎶ヨ");
+ return ardAlarmExternals.stream()
+ .map(ardAlarmExternal -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmExternal.getId())
+ .setName(ardAlarmExternal.getAlarmName())
+ .setAlarmTime(ardAlarmExternal.getAlarmTime())
+ .setLongitude(ardAlarmExternal.getLongitude())
+ .setLatitude(ardAlarmExternal.getLatitude())
+ .setCount(ardAlarmExternal.getCount())
+ .setTotal(ardAlarmExternal.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1006:
+ List<ArdAlarmAccess> ardAlarmAccesses = ardAlarmAccessMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmAccesses.stream()
+ .map(ardAlarmAccess -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmAccess.getId())
+ .setName(ardAlarmAccess.getAcsName())
+ .setAlarmTime(ardAlarmAccess.getAlarmTime())
+ .setLongitude(ardAlarmAccess.getLongitude())
+ .setLatitude(ardAlarmAccess.getLatitude())
+ .setCount(ardAlarmAccess.getCount())
+ .setTotal(ardAlarmAccess.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1007:
+ List<ArdAlarmRadarPump> ardAlarmRadarPumps = ardAlarmRadarPumpMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmRadarPumps.stream()
+ .map(ardAlarmRadarPump -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmRadarPump.getId())
+ .setName(ardAlarmRadarPump.getName())
+ .setAlarmTime(ardAlarmRadarPump.getAlarmTime())
+ .setLongitude(ardAlarmRadarPump.getLongitude())
+ .setLatitude(ardAlarmRadarPump.getLatitude())
+ .setCount(ardAlarmRadarPump.getCount())
+ .setTotal(ardAlarmRadarPump.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1009:
+ List<ArdAlarmApponekey> ardAlarmApponekeys = ardAlarmApponekeyMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmApponekeys.stream()
+ .map(ardAlarmApponekey -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmApponekey.getId())
+ .setName(ardAlarmApponekey.getName())
+ .setAlarmTime(ardAlarmApponekey.getCreateTime())
+ .setLongitude(ardAlarmApponekey.getLongitude())
+ .setLatitude(ardAlarmApponekey.getLatitude())
+ .setCount(ardAlarmApponekey.getCount())
+ .setTotal(ardAlarmApponekey.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
+ case 1010:
+ List<ArdAlarmWall> ardAlarmWalls = ardAlarmWallMapper.selectListAllByCommand(refreshTime);
+ return ardAlarmWalls.stream()
+ .map(ardAlarmWall -> {
+ GlobalAlarmData globalAlarmData = new GlobalAlarmData()
+ .setId(ardAlarmWall.getId())
+ .setName(ardAlarmWall.getWallName())
+ .setAlarmTime(ardAlarmWall.getAlarmTime())
+ .setLongitude(ardAlarmWall.getLongitude())
+ .setLatitude(ardAlarmWall.getLatitude())
+ .setCount(ardAlarmWall.getCount())
+ .setTotal(ardAlarmWall.getTotal());
+ return globalAlarmData;
+ }).collect(Collectors.toList());
case 1014:
List<ArdAlarmTube> ardAlarmTubes = ardAlarmTubeMapper.selectListAllByCommand(refreshTime);
return ardAlarmTubes.stream()
@@ -329,12 +526,12 @@
.setAlarmType("1001");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1001.size()>0) {
+ if (alarmData1001.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1001);
}
List<ArdAlarmCamera> ardAlarmCameras = ardAlarmCameraMapper.selectListAllByCommand(refreshTime);
- List<GlobalAlarmData> alarmData1002= ardAlarmCameras.stream()
+ List<GlobalAlarmData> alarmData1002 = ardAlarmCameras.stream()
.map(ardAlarmCamera -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmCamera.getId())
@@ -347,12 +544,12 @@
.setAlarmType("1002");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1002.size()>0) {
+ if (alarmData1002.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1002);
}
List<ArdAlarmRadarMove> ardAlarmRadarMoves = ardAlarmRadarMoveMapper.selectListAllByCommand(refreshTime);
- List<GlobalAlarmData> alarmData1003= ardAlarmRadarMoves.stream()
+ List<GlobalAlarmData> alarmData1003 = ardAlarmRadarMoves.stream()
.map(ardAlarmRadarMove -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmRadarMove.getId())
@@ -365,12 +562,12 @@
.setAlarmType("1003");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1003.size()>0) {
+ if (alarmData1003.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1003);
}
List<ArdAlarmRadarFire> ardAlarmRadarFires = ardAlarmRadarFireMapper.selectListAllByCommand(refreshTime);
- List<GlobalAlarmData> alarmData1004= ardAlarmRadarFires.stream()
+ List<GlobalAlarmData> alarmData1004 = ardAlarmRadarFires.stream()
.map(ardAlarmRadarFire -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmRadarFire.getId())
@@ -383,12 +580,12 @@
.setAlarmType("1004");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1004.size()>0) {
+ if (alarmData1004.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1004);
}
List<ArdAlarmExternal> ardAlarmExternals = ardAlarmExternalMapper.selectListAllByCommand(refreshTime, "闃插尯鎶ヨ");
- List<GlobalAlarmData> alarmData1005= ardAlarmExternals.stream()
+ List<GlobalAlarmData> alarmData1005 = ardAlarmExternals.stream()
.map(ardAlarmExternal -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmExternal.getId())
@@ -401,12 +598,12 @@
.setAlarmType("1005");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1005.size()>0) {
+ if (alarmData1005.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1005);
}
List<ArdAlarmAccess> ardAlarmAccesses = ardAlarmAccessMapper.selectListAllByCommand(refreshTime);
- List<GlobalAlarmData> alarmData1006= ardAlarmAccesses.stream()
+ List<GlobalAlarmData> alarmData1006 = ardAlarmAccesses.stream()
.map(ardAlarmAccess -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmAccess.getId())
@@ -419,12 +616,12 @@
.setAlarmType("1006");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1006.size()>0) {
+ if (alarmData1006.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1006);
}
List<ArdAlarmRadarPump> ardAlarmRadarPumps = ardAlarmRadarPumpMapper.selectListAllByCommand(refreshTime);
- List<GlobalAlarmData> alarmData1007= ardAlarmRadarPumps.stream()
+ List<GlobalAlarmData> alarmData1007 = ardAlarmRadarPumps.stream()
.map(ardAlarmRadarPump -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmRadarPump.getId())
@@ -437,12 +634,12 @@
.setAlarmType("1007");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1007.size()>0) {
+ if (alarmData1007.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1007);
}
List<ArdAlarmApponekey> ardAlarmApponekeys = ardAlarmApponekeyMapper.selectListAllByCommand(refreshTime);
- List<GlobalAlarmData> alarmData1009= ardAlarmApponekeys.stream()
+ List<GlobalAlarmData> alarmData1009 = ardAlarmApponekeys.stream()
.map(ardAlarmApponekey -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmApponekey.getId())
@@ -455,12 +652,12 @@
.setAlarmType("1009");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1009.size()>0) {
+ if (alarmData1009.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1009);
}
List<ArdAlarmWall> ardAlarmWalls = ardAlarmWallMapper.selectListAllByCommand(refreshTime);
- List<GlobalAlarmData> alarmData1010= ardAlarmWalls.stream()
+ List<GlobalAlarmData> alarmData1010 = ardAlarmWalls.stream()
.map(ardAlarmWall -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmWall.getId())
@@ -473,12 +670,30 @@
.setAlarmType("1010");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1010.size()>0) {
+ if (alarmData1010.size() > 0) {
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()
+ List<GlobalAlarmData> alarmData1014 = ardAlarmTubes.stream()
.map(ardAlarmTube -> {
GlobalAlarmData globalAlarmData = new GlobalAlarmData()
.setId(ardAlarmTube.getId())
@@ -492,11 +707,11 @@
.setAlarmType("1014");
return globalAlarmData;
}).collect(Collectors.toList());
- if(alarmData1014.size()>0) {
+ if (alarmData1014.size() > 0) {
GlobalAlarmDataList.addAll(alarmData1014);
}
return GlobalAlarmDataList;
-}
+ }
/**
* @鎻忚堪 鍘嗗彶鎶ヨ鏌ヨ
@@ -571,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);
@@ -667,6 +888,14 @@
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());
if (StringUtils.isNotNull(ardAlarmTube)) {
@@ -760,18 +989,18 @@
//region 澶勭悊闆疯揪鎶ヨ
RadarAlarmData radarAlarmData = JSONObject.parseObject(message, RadarAlarmData.class);
List<ArdAlarmRadar> ardAlarmRadars = radarAlarmData.getArdAlarmRadars();
- List<ArdAlarmRadarMove>ardAlarmRadarMoves=new ArrayList<>();
- List<ArdAlarmRadarFire>ardAlarmRadarFires=new ArrayList<>();
- List<ArdAlarmRadarPump>ardAlarmRadarPumps=new ArrayList<>();
+ List<ArdAlarmRadarMove> ardAlarmRadarMoves = new ArrayList<>();
+ List<ArdAlarmRadarFire> ardAlarmRadarFires = new ArrayList<>();
+ List<ArdAlarmRadarPump> ardAlarmRadarPumps = new ArrayList<>();
for (ArdAlarmRadar ardAlarmRadar : ardAlarmRadars) {
String uuid = IdUtils.simpleUUID();
String alarmpointName = ardAlarmRadar.getName();//鍏磋叮鐐瑰悕绉�
Double longitude = ardAlarmRadar.getLongitude();
Double latitude = ardAlarmRadar.getLatitude();
- String targetId=ardAlarmRadar.getTargetId();
+ String targetId = ardAlarmRadar.getTargetId();
switch (ardAlarmRadar.getAlarmType()) {
case "杩愬姩鐩爣妫�娴�":
- ArdAlarmRadarMove ardAlarmRadarMove=new ArdAlarmRadarMove();
+ ArdAlarmRadarMove ardAlarmRadarMove = new ArdAlarmRadarMove();
ardAlarmRadarMove.setId(uuid);
ardAlarmRadarMove.setTargetId(targetId);
ardAlarmRadarMove.setAlarmTime(radarAlarmData.getAlarmTime());
@@ -783,10 +1012,17 @@
//鍏ュ簱
ardAlarmRadarMoveMapper.insertArdAlarmRadarMove(ardAlarmRadarMove);
ardAlarmRadarMoves.add(ardAlarmRadarMove);
-
+ //鍏ョ紦瀛�
+ //String key = "radar_alarm:" + DateUtils.getDate();
+ //if (redisCache.hasKey(key)) {
+ // redisCache.setCacheList(key, ardAlarmRadarMove, -1, TimeUnit.HOURS);
+ //} else {
+ // Integer expiryTimeInSeconds = DateUtils.getDayRemainingTime(ardAlarmRadarMove.getCreateTime());
+ // redisCache.setCacheList(key, ardAlarmRadarMove, expiryTimeInSeconds, TimeUnit.SECONDS);
+ //}
break;
case "鐑簮妫�娴�":
- ArdAlarmRadarFire ardAlarmRadarFire=new ArdAlarmRadarFire();
+ ArdAlarmRadarFire ardAlarmRadarFire = new ArdAlarmRadarFire();
ardAlarmRadarFire.setId(uuid);
ardAlarmRadarFire.setTargetId(targetId);
ardAlarmRadarFire.setAlarmTime(radarAlarmData.getAlarmTime());
@@ -801,7 +1037,7 @@
break;
case "闆疯揪鎶芥补鏈哄仠鏈�":
- ArdAlarmRadarPump ardAlarmRadarPump=new ArdAlarmRadarPump();
+ ArdAlarmRadarPump ardAlarmRadarPump = new ArdAlarmRadarPump();
ardAlarmRadarPump.setId(uuid);
ardAlarmRadarPump.setTargetId(targetId);
ardAlarmRadarPump.setAlarmTime(radarAlarmData.getAlarmTime());
@@ -820,9 +1056,10 @@
break;
}
}
- radarMoveGuide(ardAlarmRadarMoves,radarAlarmData);
- radarFireGuide(ardAlarmRadarFires,radarAlarmData);
- radarPumpGuide(ardAlarmRadarPumps,radarAlarmData);
+ radarMoveGuide(ardAlarmRadarMoves, radarAlarmData);
+ radarFireGuide(ardAlarmRadarFires, radarAlarmData);
+ radarPumpGuide(ardAlarmRadarPumps, radarAlarmData);
+ //endregion
break;
case "external":
//region 澶勭悊澶栬仈鎶ヨ
@@ -892,6 +1129,23 @@
}
//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;
}
} catch (Exception ex) {
log.error("鎺ユ敹鎶ヨ寮傚父:" + ex.getMessage());
@@ -919,13 +1173,20 @@
//鐩告満ID
guideTask.setCameraId(cameraId);
//鎶ヨ绫诲瀷
- String aType="";
- switch (alarmType)
- {
- case "杩愬姩鐩爣妫�娴�": aType="sys_radar_move";break;
- case "鐑簮妫�娴�": aType="sys_radar_fire";break;
- case "闆疯揪鎶芥补鏈哄仠鏈�": aType="sys_radar_pump";break;
- default: aType=alarmType;break;
+ String aType = "";
+ switch (alarmType) {
+ case "杩愬姩鐩爣妫�娴�":
+ aType = "sys_radar_move";
+ break;
+ case "鐑簮妫�娴�":
+ aType = "sys_radar_fire";
+ break;
+ case "闆疯揪鎶芥补鏈哄仠鏈�":
+ aType = "sys_radar_pump";
+ break;
+ default:
+ aType = alarmType;
+ break;
}
guideTask.setAlarmType(aType);
//閫氶亾(閫氳繃鏃ュ鏃堕棿鐮斿垽)
@@ -1016,10 +1277,8 @@
}
- /**
- * 闆疯揪寮曞鍏ラ槦
- */
- private void radarGuideToQueue(String alarmId,String radarId, String name, String alarmType, Date createTime, double[] coordinate) {
+ //闆疯揪寮曞鍏ラ槦(鑾峰彇鐩告満)
+ 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);
//鑾峰彇闆疯揪鎵�鍦ㄥ涓婄殑澶у厜鐢�
@@ -1028,9 +1287,7 @@
log.debug("鑾峰彇鍒伴浄杈惧涓婄殑鍏夌數:" + cameraIdWithTower);
//濡傛灉闆疯揪濉斾笂鏈夊厜鐢�
messagesEnqueued(cameraIdWithTower, alarmId, alarmType, createTime, 1, 1, coordinate);
- }
- else
- {
+ } else {
log.debug("鏈幏鍙栧埌闆疯揪濉斾笂鐨勫厜鐢�");
}
//鑾峰彇鎶ヨ鐐瑰叧鑱旂殑澶у厜鐢�
@@ -1043,20 +1300,16 @@
log.info("鑾峰彇鍒版姤璀︾偣鍏宠仈鐨勫厜鐢�:" + cameraId);
//濡傛灉鎶ヨ鐐瑰叧鑱斾簡鍏夌數
messagesEnqueued(cameraId, alarmId, alarmType, createTime, 1, 2, coordinate);
- }
- else
- {
+ } else {
log.debug("鏈幏鍙栧埌鎶ヨ鐐瑰叧鑱旂殑鍏夌數");
}
}
-
-
- private void radarMoveGuide(List<ArdAlarmRadarMove> ardAlarmRadarMoves,RadarAlarmData radarAlarmData)
- {
+ //闆疯揪绉诲姩寮曞
+ private void radarMoveGuide(List<ArdAlarmRadarMove> ardAlarmRadarMoves, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
ardAlarmRadarMoves = ardAlarmRadarMoves.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new java.util.TreeSet<>(java.util.Comparator.comparing(ArdAlarmRadarMove::getName))), ArrayList::new));
- if(ardAlarmRadarMoves.size()>0) {
+ if (ardAlarmRadarMoves.size() > 0) {
for (ArdAlarmRadarMove ardAlarmRadarMove : ardAlarmRadarMoves) {
//閬嶅巻鎶ヨ鏁版嵁杩涜寮曞
if (StringUtils.isNull(ardAlarmRadarMove.getLongitude()) || StringUtils.isNull(ardAlarmRadarMove.getLatitude())) {
@@ -1104,12 +1357,12 @@
}
//endregion
}
- private void radarFireGuide(List<ArdAlarmRadarFire> ardAlarmRadarFires,RadarAlarmData radarAlarmData)
- {
+ //闆疯揪闃茬伀寮曞
+ private void radarFireGuide(List<ArdAlarmRadarFire> ardAlarmRadarFires, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
ardAlarmRadarFires = ardAlarmRadarFires.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new java.util.TreeSet<>(java.util.Comparator.comparing(ArdAlarmRadarFire::getName))), ArrayList::new));
- if(ardAlarmRadarFires.size()>0) {
+ if (ardAlarmRadarFires.size() > 0) {
for (ArdAlarmRadarFire ardAlarmRadarFire : ardAlarmRadarFires) {
//閬嶅巻鎶ヨ鏁版嵁杩涜寮曞
if (StringUtils.isNull(ardAlarmRadarFire.getLongitude()) || StringUtils.isNull(ardAlarmRadarFire.getLatitude())) {
@@ -1156,12 +1409,12 @@
}
//endregion
}
- private void radarPumpGuide(List<ArdAlarmRadarPump> ardAlarmRadarPumps,RadarAlarmData radarAlarmData)
- {
+ //闆疯揪鎶芥补鏈哄仠鏈哄紩瀵�
+ private void radarPumpGuide(List<ArdAlarmRadarPump> ardAlarmRadarPumps, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
ardAlarmRadarPumps = ardAlarmRadarPumps.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new java.util.TreeSet<>(java.util.Comparator.comparing(ArdAlarmRadarPump::getName))), ArrayList::new));
- if(ardAlarmRadarPumps.size()>0) {
+ if (ardAlarmRadarPumps.size() > 0) {
for (ArdAlarmRadarPump ardAlarmRadarPump : ardAlarmRadarPumps) {
//閬嶅巻鎶ヨ鏁版嵁杩涜寮曞
if (StringUtils.isNull(ardAlarmRadarPump.getLongitude()) || StringUtils.isNull(ardAlarmRadarPump.getLatitude())) {
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java
index 60dbd8c..6cd0d81 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java
@@ -65,8 +65,5 @@
int selectCountByAlarmTime(@Param("refreshTime") String refreshTime);
List<ArdAlarmRadarMove> selectListAllByCommand(@Param("refreshTime") String refreshTime);
public int updateViewTimeByCondition(@Param("name")String name,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
- /**
- * 閫氳繃闆疯揪id鎵惧埌鍏宠仈濉斾笂鐨勫ぇ鍏夌數id
- */
- String getCameraByRadar(String radarId);
+
}
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>
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
index e035b3c..1d21301 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
@@ -138,6 +138,15 @@
return redisTemplate.opsForList().range(key, 0, -1);
}
+ public <T> void setCacheList(String key, T data, final Integer timeout, final TimeUnit timeUnit) {
+ // 灏嗘暟鎹彃鍏ist
+ redisTemplate.opsForList().leftPush(key, data);
+ // 璁剧疆杩囨湡鏃堕棿
+ if (timeout > 0) {
+ redisTemplate.expire(key,timeout, timeUnit);
+ }
+ }
+
/**
* 缂撳瓨Set
*
@@ -153,7 +162,23 @@
}
return setOperation;
}
-
+ /**
+ * 缂撳瓨Set
+ *
+ * @param key 缂撳瓨閿��
+ * @param data 缂撳瓨鐨勫��
+ * @param timeout 鏃堕棿
+ * @param timeUnit 鏃堕棿棰楃矑搴�
+ * @return 缂撳瓨鏁版嵁鐨勫璞�
+ */
+ public <T> void setCacheSet(String key, T data, final Integer timeout, final TimeUnit timeUnit) {
+ BoundSetOperations<String, String> setOperations = redisTemplate.boundSetOps(key);
+ setOperations.add(data.toString());
+ // 璁剧疆杩囨湡鏃堕棿
+ if (timeout > 0) {
+ setOperations.expire(timeout, timeUnit);
+ }
+ }
/**
* 鑾峰緱缂撳瓨鐨剆et
*
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
index 4a46064..3ff67fb 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
@@ -8,6 +8,7 @@
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
@@ -207,4 +208,17 @@
long sec = diff/ ns;
return sec;
}
+
+ /**
+ * 鑾峰彇涓�澶╀腑鍓╀綑鐨勬椂闂达紙绉掓暟锛�
+ */
+ public static Integer getDayRemainingTime(Date currentDate) {
+ LocalDateTime midnight = LocalDateTime.ofInstant(currentDate.toInstant(),
+ ZoneId.systemDefault()).plusDays(1).withHour(0).withMinute(0)
+ .withSecond(0).withNano(0);
+ LocalDateTime currentDateTime = LocalDateTime.ofInstant(currentDate.toInstant(),
+ ZoneId.systemDefault());
+ long seconds = ChronoUnit.SECONDS.between(currentDateTime, midnight);
+ return (int) seconds;
+ }
}
--
Gitblit v1.9.3