From 700e079156d633305b5e03c3a4e54b78a49add51 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期四, 21 九月 2023 09:29:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml | 6 +
ard-work/src/main/java/com/ruoyi/utils/minio/MinioUtil.java | 50 ++++++++--
ruoyi-common/src/main/java/com/ruoyi/common/utils/ConfigUtils.java | 1
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java | 14 ++
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarMoveMapper.java | 2
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java | 12 ++
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java | 3
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml | 6 +
ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java | 3
ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml | 6 +
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 159 +++++++++++++++++++++++++------
ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java | 4
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java | 13 ++
13 files changed, 232 insertions(+), 47 deletions(-)
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 d984130..253e48c 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
@@ -33,7 +33,9 @@
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
import com.ruoyi.common.constant.CacheConstants;
+import com.ruoyi.common.core.domain.entity.SysConfig;
import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.ConfigUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.StringUtils;
@@ -389,20 +391,20 @@
// 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());
+ //浠庢暟鎹簱鑾峰彇
+ 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()
@@ -987,13 +989,13 @@
break;
case "radar":
//region 澶勭悊闆疯揪鎶ヨ
+ String mergeTime = ConfigUtils.getConfigValue("radarMergeTime");
+ Integer radarMergeTime= mergeTime==null||"".equals(mergeTime)?10:Integer.valueOf(mergeTime);
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<>();
for (ArdAlarmRadar ardAlarmRadar : ardAlarmRadars) {
String uuid = IdUtils.simpleUUID();
+ String radarId = radarAlarmData.getRadarId();
String alarmpointName = ardAlarmRadar.getName();//鍏磋叮鐐瑰悕绉�
Double longitude = ardAlarmRadar.getLongitude();
Double latitude = ardAlarmRadar.getLatitude();
@@ -1009,9 +1011,31 @@
ardAlarmRadarMove.setAlarmType("杩愬姩鐩爣妫�娴�");
ardAlarmRadarMove.setLongitude(longitude);
ardAlarmRadarMove.setLatitude(latitude);
- //鍏ュ簱
- ardAlarmRadarMoveMapper.insertArdAlarmRadarMove(ardAlarmRadarMove);
- ardAlarmRadarMoves.add(ardAlarmRadarMove);
+ ardAlarmRadarMove.setUpdateTime(radarAlarmData.getAlarmTime());
+ ardAlarmRadarMove.setRadarId(radarId);
+ //鑾峰彇褰撳墠鍏磋叮鐐瑰綋鍓嶉浄杈剧殑涓婁竴鏉℃暟鎹�
+ ArdAlarmRadarMove lastMoveData = ardAlarmRadarMoveMapper.selectArdAlarmRadarLastData(ardAlarmRadarMove.getName());
+ if (lastMoveData == null) {
+ //鍏ュ簱
+ ardAlarmRadarMoveMapper.insertArdAlarmRadarMove(ardAlarmRadarMove);
+ radarMoveGuide(ardAlarmRadarMove);//寮曞
+ } else {
+ //鍚﹀垯姣斿鏇存柊鏃堕棿
+ Date lastUpdateTime = lastMoveData.getUpdateTime();
+ Date alarmTime = ardAlarmRadarMove.getAlarmTime();
+ long secDatePoor = DateUtils.getSecDatePoor(alarmTime,lastUpdateTime);
+ if (secDatePoor <= radarMergeTime) {
+ //灏忎簬10绉掔殑鏂版暟鎹紝鏇存柊涓婁竴鏉�
+ ArdAlarmRadarMove updateData = new ArdAlarmRadarMove();
+ updateData.setId(lastMoveData.getId());
+ updateData.setUpdateTime(alarmTime);
+ ardAlarmRadarMoveMapper.updateArdAlarmRadarMove(updateData);
+ } else {
+ //瓒呰繃10绉掔殑鏁版嵁,鍏ュ簱
+ ardAlarmRadarMoveMapper.insertArdAlarmRadarMove(ardAlarmRadarMove);
+ radarMoveGuide(ardAlarmRadarMove);//寮曞
+ }
+ }
//鍏ョ紦瀛�
//String key = "radar_alarm:" + DateUtils.getDate();
//if (redisCache.hasKey(key)) {
@@ -1031,34 +1055,74 @@
ardAlarmRadarFire.setAlarmType("鐑簮妫�娴�");
ardAlarmRadarFire.setLongitude(longitude);
ardAlarmRadarFire.setLatitude(latitude);
- //鍏ュ簱
- ardAlarmRadarFireMapper.insertArdAlarmRadarFire(ardAlarmRadarFire);
- ardAlarmRadarFires.add(ardAlarmRadarFire);
+ ardAlarmRadarFire.setRadarId(radarId);
+ ardAlarmRadarFire.setUpdateTime(radarAlarmData.getAlarmTime());
+ //
+ ArdAlarmRadarFire lastFireData = ardAlarmRadarFireMapper.selectArdAlarmRadarLastData(ardAlarmRadarFire.getName());
+ if (lastFireData == null) {
+ //鍏ュ簱
+ ardAlarmRadarFireMapper.insertArdAlarmRadarFire(ardAlarmRadarFire);
+ radarFireGuide(ardAlarmRadarFire);//寮曞
+ } else {
+ //鍚﹀垯姣斿鏇存柊鏃堕棿
+ Date lastUpdateTime = lastFireData.getUpdateTime();
+ Date alarmTime = ardAlarmRadarFire.getAlarmTime();
+ long secDatePoor = DateUtils.getSecDatePoor(alarmTime,lastUpdateTime);
+ if (secDatePoor <= radarMergeTime) {
+ //灏忎簬10绉掔殑鏂版暟鎹紝鏇存柊涓婁竴鏉�
+ ArdAlarmRadarFire updateData = new ArdAlarmRadarFire();
+ updateData.setId(lastFireData.getId());
+ updateData.setUpdateTime(alarmTime);
+ ardAlarmRadarFireMapper.updateArdAlarmRadarFire(updateData);
+ } else {
+ //瓒呰繃10绉掔殑鏁版嵁,鍏ュ簱
+ ardAlarmRadarFireMapper.insertArdAlarmRadarFire(ardAlarmRadarFire);
+ radarFireGuide(ardAlarmRadarFire);//寮曞
+ }
+ }
break;
case "闆疯揪鎶芥补鏈哄仠鏈�":
ArdAlarmRadarPump ardAlarmRadarPump = new ArdAlarmRadarPump();
+ ardAlarmRadarPump.setRadarId(radarId);
ardAlarmRadarPump.setId(uuid);
ardAlarmRadarPump.setTargetId(targetId);
ardAlarmRadarPump.setAlarmTime(radarAlarmData.getAlarmTime());
ardAlarmRadarPump.setCreateTime(new Date());
ardAlarmRadarPump.setName(ardAlarmRadar.getName() + "(" + radarAlarmData.getRadarName() + ")");
ardAlarmRadarPump.setAlarmType("闆疯揪鎶芥补鏈哄仠鏈�");
+ ardAlarmRadarPump.setUpdateTime(radarAlarmData.getAlarmTime());
ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName);
if (StringUtils.isNotNull(ardAlarmpointsWell)) {
ardAlarmRadarPump.setLongitude(ardAlarmpointsWell.getLongitude());
ardAlarmRadarPump.setLatitude(ardAlarmpointsWell.getLatitude());
}
- //鍏ュ簱
- ardAlarmRadarPumpMapper.insertArdAlarmRadarPump(ardAlarmRadarPump);
- ardAlarmRadarPumps.add(ardAlarmRadarPump);
-
+ //
+ ArdAlarmRadarPump lastPumpData = ardAlarmRadarPumpMapper.selectArdAlarmRadarLastData(ardAlarmRadarPump.getName());
+ if (lastPumpData == null) {
+ //鍏ュ簱
+ ardAlarmRadarPumpMapper.insertArdAlarmRadarPump(ardAlarmRadarPump);
+ radarPumpGuide(ardAlarmRadarPump);//寮曞
+ } else {
+ //鍚﹀垯姣斿鏇存柊鏃堕棿
+ Date lastUpdateTime = lastPumpData.getUpdateTime();
+ Date alarmTime = ardAlarmRadarPump.getAlarmTime();
+ long secDatePoor = DateUtils.getSecDatePoor(alarmTime,lastUpdateTime);
+ if (secDatePoor <= radarMergeTime) {
+ //灏忎簬10绉掔殑鏂版暟鎹紝鏇存柊涓婁竴鏉�
+ ArdAlarmRadarPump updateData = new ArdAlarmRadarPump();
+ updateData.setId(lastPumpData.getId());
+ updateData.setUpdateTime(alarmTime);
+ ardAlarmRadarPumpMapper.updateArdAlarmRadarPump(updateData);
+ } else {
+ //瓒呰繃10绉掔殑鏁版嵁,鍏ュ簱
+ ardAlarmRadarPumpMapper.insertArdAlarmRadarPump(ardAlarmRadarPump);
+ radarPumpGuide(ardAlarmRadarPump);//寮曞
+ }
+ }
break;
}
}
- radarMoveGuide(ardAlarmRadarMoves, radarAlarmData);
- radarFireGuide(ardAlarmRadarFires, radarAlarmData);
- radarPumpGuide(ardAlarmRadarPumps, radarAlarmData);
//endregion
break;
case "external":
@@ -1134,7 +1198,7 @@
ArdAlarmDigitization3 ardAlarmDigitization3 = JSONObject.parseObject(message, ArdAlarmDigitization3.class);
//鑾峰彇缁忕含搴�
ArdAlarmpointsWell Well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(ardAlarmDigitization3.getWellNo());
- if(Well!=null) {
+ if (Well != null) {
ardAlarmDigitization3.setLongitude(Well.getLongitude());
ardAlarmDigitization3.setLatitude(Well.getLatitude());
ardAlarmDigitization3.setAltitude(Well.getAltitude());
@@ -1276,8 +1340,7 @@
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);
@@ -1304,6 +1367,7 @@
log.debug("鏈幏鍙栧埌鎶ヨ鐐瑰叧鑱旂殑鍏夌數");
}
}
+
//闆疯揪绉诲姩寮曞
private void radarMoveGuide(List<ArdAlarmRadarMove> ardAlarmRadarMoves, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
@@ -1357,6 +1421,16 @@
}
//endregion
}
+ private void radarMoveGuide(ArdAlarmRadarMove ardAlarmRadarMove) {
+ if (StringUtils.isNull(ardAlarmRadarMove.getLongitude()) || StringUtils.isNull(ardAlarmRadarMove.getLatitude())) {
+ log.debug("鍧愭爣涓虹┖涓嶅紩瀵�");
+ return;
+ }
+ double[] coordinate = new double[]{ardAlarmRadarMove.getLongitude(), ardAlarmRadarMove.getLatitude()};//鎶ヨ鍧愭爣
+ //寮曞鍏ラ槦
+ radarGuideToQueue(ardAlarmRadarMove.getId(), ardAlarmRadarMove.getRadarId(), ardAlarmRadarMove.getName(), ardAlarmRadarMove.getAlarmType(), ardAlarmRadarMove.getCreateTime(), coordinate);//鏇存柊
+ }
+
//闆疯揪闃茬伀寮曞
private void radarFireGuide(List<ArdAlarmRadarFire> ardAlarmRadarFires, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
@@ -1409,6 +1483,15 @@
}
//endregion
}
+ private void radarFireGuide(ArdAlarmRadarFire ardAlarmRadarFire) {
+ if (StringUtils.isNull(ardAlarmRadarFire.getLongitude()) || StringUtils.isNull(ardAlarmRadarFire.getLatitude())) {
+ log.debug("鍧愭爣涓虹┖涓嶅紩瀵�");
+ return;
+ }
+ double[] coordinate = new double[]{ardAlarmRadarFire.getLongitude(), ardAlarmRadarFire.getLatitude()};//鎶ヨ鍧愭爣
+ //寮曞鍏ラ槦
+ radarGuideToQueue(ardAlarmRadarFire.getId(), ardAlarmRadarFire.getRadarId(), ardAlarmRadarFire.getName(), ardAlarmRadarFire.getAlarmType(), ardAlarmRadarFire.getCreateTime(), coordinate);//鏇存柊
+ }
//闆疯揪鎶芥补鏈哄仠鏈哄紩瀵�
private void radarPumpGuide(List<ArdAlarmRadarPump> ardAlarmRadarPumps, RadarAlarmData radarAlarmData) {
//鎸夊叴瓒g偣鍘婚噸,鐒跺悗鎸夊紩瀵奸�昏緫杩涜寮曞鍏ラ槦
@@ -1461,4 +1544,14 @@
}
//endregion
}
+ private void radarPumpGuide(ArdAlarmRadarPump ardAlarmRadarPump) {
+ if (StringUtils.isNull(ardAlarmRadarPump.getLongitude()) || StringUtils.isNull(ardAlarmRadarPump.getLatitude())) {
+ //鍧愭爣涓虹┖涓嶅紩瀵�
+ log.debug("鍧愭爣涓虹┖涓嶅紩瀵�");
+ return;
+ }
+ double[] coordinate = new double[]{ardAlarmRadarPump.getLongitude(), ardAlarmRadarPump.getLatitude()};//鎶ヨ鍧愭爣
+ //寮曞鍏ラ槦
+ radarGuideToQueue(ardAlarmRadarPump.getId(), ardAlarmRadarPump.getRadarId(), ardAlarmRadarPump.getName(), ardAlarmRadarPump.getAlarmType(), ardAlarmRadarPump.getCreateTime(), coordinate);//鏇存柊
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java
index e2119f2..b362c6c 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java
@@ -77,6 +77,19 @@
*/
private Integer count;
+ /**
+ * 闆疯揪ID
+ */
+ private String radarId;
+
+ public String getRadarId() {
+ return radarId;
+ }
+
+ public void setRadarId(String radarId) {
+ this.radarId = radarId;
+ }
+
public Integer getTotal() {
return total;
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java
index 25d65fd..1efb263 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java
@@ -68,7 +68,6 @@
@Excel(name = "寮曞鏍囪")
private Integer guideFlag;
-
/**
* 鎶ヨ鎬绘暟
*/
@@ -77,6 +76,19 @@
* 鏈鎶ヨ鏁伴噺
*/
private Integer count;
+ /**
+ * 闆疯揪ID
+ */
+ private String RadarId;
+
+
+ public String getRadarId() {
+ return RadarId;
+ }
+
+ public void setRadarId(String radarId) {
+ RadarId = radarId;
+ }
public Integer getTotal() {
return total;
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java
index dcc155c..8c39be3 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java
@@ -77,6 +77,18 @@
* 鏈鎶ヨ鏁伴噺
*/
private Integer count;
+ /**
+ * 闆疯揪ID
+ */
+ private String radarId;
+
+ public String getRadarId() {
+ return radarId;
+ }
+
+ public void setRadarId(String radarId) {
+ this.radarId = radarId;
+ }
public Integer getTotal() {
return total;
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java
index b7c3d56..0f6eac8 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarFireMapper.java
@@ -4,6 +4,7 @@
import com.ruoyi.alarm.radar.domain.ArdAlarmRadar;
import com.ruoyi.alarm.radar.domain.ArdAlarmRadarFire;
+import com.ruoyi.alarm.radar.domain.ArdAlarmRadarMove;
import org.apache.ibatis.annotations.Param;
/**
@@ -67,4 +68,6 @@
List<ArdAlarmRadarFire> selectListAllByCommand(@Param("refreshTime") String refreshTime);
public int updateViewTimeByCondition(@Param("name")String name,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+
+ ArdAlarmRadarFire selectArdAlarmRadarLastData(String name);
}
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 6cd0d81..f51cb6f 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
@@ -62,8 +62,10 @@
*/
public int deleteArdAlarmRadarMoveByIds(String[] ids);
+
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);
+ ArdAlarmRadarMove selectArdAlarmRadarLastData(String name);
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java
index 44c99c5..0da3e8b 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/mapper/ArdAlarmRadarPumpMapper.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.ruoyi.alarm.radar.domain.ArdAlarmRadar;
+import com.ruoyi.alarm.radar.domain.ArdAlarmRadarFire;
import com.ruoyi.alarm.radar.domain.ArdAlarmRadarPump;
import org.apache.ibatis.annotations.Param;
@@ -67,4 +68,6 @@
List<ArdAlarmRadarPump> selectListAllByCommand(@Param("refreshTime") String refreshTime);
public int updateViewTimeByCondition(@Param("name")String name,@Param("alarmTime") String alarmTime,@Param("viewTime") String viewTime);
+
+ ArdAlarmRadarPump selectArdAlarmRadarLastData(String name);
}
diff --git a/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java b/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
index 2471f51..71aa270 100644
--- a/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaServiceImpl.java
@@ -54,7 +54,7 @@
@Override
public void run(ApplicationArguments args) {
try {
- log.info("寮�濮嬪姞杞芥祦濯掍綋鍒楄〃");
+ log.debug("寮�濮嬪姞杞芥祦濯掍綋鍒楄〃");
List<StreamInfo> paths = paths();
for (StreamInfo path : paths) {
mediaClient.removePath(path.getName());
@@ -76,7 +76,7 @@
@PostConstruct
public void initMediaMtx() {
if (mediamtxEnabled) {
- log.info("鍒濆鍖栧惎鍔╩ediaMTX");
+ log.debug("鍒濆鍖栧惎鍔╩ediaMTX");
if (Platform.isWindows()) {
String exePath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "mediamtx" + File.separator + "mediamtx.exe";
String ymlPath = System.getProperty("user.dir") + File.separator + "lib" + File.separator + "mediamtx" + File.separator + "mediamtx.yml";
diff --git a/ard-work/src/main/java/com/ruoyi/utils/minio/MinioUtil.java b/ard-work/src/main/java/com/ruoyi/utils/minio/MinioUtil.java
index 62b93d6..d485c96 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/minio/MinioUtil.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/minio/MinioUtil.java
@@ -3,6 +3,7 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import io.minio.*;
+import io.minio.errors.MinioException;
import io.minio.http.Method;
import io.minio.messages.*;
import lombok.extern.slf4j.Slf4j;
@@ -10,7 +11,10 @@
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
import java.io.InputStream;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
@@ -79,17 +83,33 @@
}
/**
- * 鍒涘缓妗�,骞惰缃《绛栫暐涓哄叕鍏�
+ * 鍒涘缓妗�
*/
public static boolean createBucket(String bucket) {
try {
if (StringUtils.isEmpty(bucket)) {
return false;
}
- /*鍒涘缓妗�*/
+ //鍒涘缓妗�
MakeBucketArgs makeBucketArgs = MakeBucketArgs.builder().bucket(bucket).build();
minioClient.makeBucket(makeBucketArgs);
- /*璁剧疆绛栫暐*/
+ setBucketPolicy(bucket);//璁剧疆妗剁瓥鐣�
+ setBucketNotificationToMqtt(bucket);//璁剧疆妗堕�氱煡鍒癕QTT
+ return true;
+ } catch (Exception ex) {
+ log.error("minio鍒涘缓妗跺紓甯革細", ex.getMessage());
+ return false;
+ }
+ }
+
+ /**
+ * 璁剧疆妗剁瓥鐣�
+ * 鍒樿嫃涔�
+ * 2023/9/20 10:01:39
+ */
+ public static boolean setBucketPolicy(String bucket) {
+ try {
+ //璁剧疆绛栫暐
String sb = "{\"Version\":\"2012-10-17\"," +
"\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":" +
"{\"AWS\":[\"*\"]},\"Action\":[\"s3:ListBucket\",\"s3:ListBucketMultipartUploads\"," +
@@ -100,30 +120,40 @@
.bucket(bucket)
.config(sb)
.build();
- /*璁剧疆閫氱煡mqtt*/
- //璁剧疆mqtt涓婚
+ minioClient.setBucketPolicy(setBucketPolicyArgs);
+ return true;
+ } catch (Exception ex) {
+ log.error("璁剧疆妗剁瓥鐣ュ紓甯�:" + ex.getMessage());
+ return false;
+ }
+ }
+
+ /**
+ * 璁剧疆妗堕�氱煡鍒癕QTT
+ * 鍒樿嫃涔�
+ * 2023/9/20 9:59:40
+ */
+ public static boolean setBucketNotificationToMqtt(String bucket) {
+ try {
+ //璁剧疆閫氱煡mqtt
NotificationConfiguration config = new NotificationConfiguration();
List<QueueConfiguration> queueConfigurations = new ArrayList<>();
QueueConfiguration queueConfiguration = new QueueConfiguration();
queueConfiguration.setQueue("arn:minio:sqs::_:mqtt");
-
//璁剧疆浜嬩欢
List<EventType> events = new ArrayList<>();
events.add(EventType.OBJECT_REMOVED_ANY);
events.add(EventType.OBJECT_CREATED_ANY);
queueConfiguration.setEvents(events);
-
queueConfigurations.add(queueConfiguration);
config.setQueueConfigurationList(queueConfigurations);
SetBucketNotificationArgs setBucketNotificationArgs = SetBucketNotificationArgs.builder()
.bucket(bucket)
.config(config).build();
- minioClient.setBucketPolicy(setBucketPolicyArgs);
minioClient.setBucketNotification(setBucketNotificationArgs);
-
return true;
} catch (Exception ex) {
- log.error("minio鍒涘缓妗跺紓甯革細", ex.getMessage());
+ log.error("璁剧疆妗堕�氱煡寮傚父:" + ex.getMessage());
return false;
}
}
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
index db6f87f..af96e1d 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarFireMapper.xml
@@ -68,6 +68,7 @@
<if test="viewTime != null">view_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
+ <if test="updateTime != null">update_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="guideFlag != null">guide_flag,</if>
@@ -84,6 +85,7 @@
<if test="viewTime != null">#{viewTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
+ <if test="updateTime != null">#{updateTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="guideFlag != null">#{guideFlag},</if>
@@ -103,6 +105,7 @@
<if test="viewTime != null">view_time = #{viewTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="guideFlag != null">guide_flag = #{guideFlag},</if>
@@ -156,4 +159,7 @@
and alarm_time<=#{alarmTime}
and view_time is null
</update>
+ <select id="selectArdAlarmRadarLastData" parameterType="String" resultMap="ArdAlarmRadarFireResult">
+ select * from ard_alarm_radar_fire where name=#{name} order by update_time desc LIMIT 1
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
index 1648d93..37b0ceb 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarMoveMapper.xml
@@ -70,6 +70,7 @@
<if test="viewTime != null">view_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
+ <if test="updateTime != null">update_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="guideFlag != null">guide_flag,</if>
@@ -87,6 +88,7 @@
<if test="viewTime != null">#{viewTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
+ <if test="updateTime != null">#{updateTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="guideFlag != null">#{guideFlag},</if>
@@ -107,6 +109,7 @@
<if test="viewTime != null">view_time = #{viewTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="guideFlag != null">guide_flag = #{guideFlag},</if>
@@ -161,4 +164,7 @@
and alarm_time<=#{alarmTime}
and view_time is null
</update>
+ <select id="selectArdAlarmRadarLastData" parameterType="String" resultMap="ArdAlarmRadarMoveResult">
+ select * from ard_alarm_radar_move where name=#{name} order by update_time desc LIMIT 1
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml
index d69cdc7..f2b7d47 100644
--- a/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmRadarPumpMapper.xml
@@ -68,6 +68,7 @@
<if test="viewTime != null">view_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
+ <if test="updateTime != null">update_time,</if>
<if test="userId != null">user_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="guideFlag != null">guide_flag,</if>
@@ -84,6 +85,7 @@
<if test="viewTime != null">#{viewTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
+ <if test="updateTime != null">#{updateTime},</if>
<if test="userId != null">#{userId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="guideFlag != null">#{guideFlag},</if>
@@ -103,6 +105,7 @@
<if test="viewTime != null">view_time = #{viewTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="guideFlag != null">guide_flag = #{guideFlag},</if>
@@ -156,4 +159,7 @@
and alarm_time<=#{alarmTime}
and view_time is null
</update>
+ <select id="selectArdAlarmRadarLastData" parameterType="String" resultMap="ArdAlarmRadarPumpResult">
+ select * from ard_alarm_radar_pump where name=#{name} order by update_time desc LIMIT 1
+ </select>
</mapper>
\ No newline at end of file
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ConfigUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ConfigUtils.java
index 1df7a75..27e4006 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/ConfigUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ConfigUtils.java
@@ -18,7 +18,6 @@
/**
* 鏍规嵁閰嶇疆key鑾峰彇閰嶇疆value鍊�
*
- * @param key 閰嶇疆key
* @return configValue 閰嶇疆value鍊�
*/
public static String getConfigValue(String key) {
--
Gitblit v1.9.3