From 6e54b432ab969eccb47b0aa388b95bf14e398790 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期四, 31 八月 2023 10:34:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml | 109 ++++++++
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java | 6
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWallUser.java | 2
ard-work/src/main/java/com/ruoyi/utils/gis/Point.java | 2
ard-work/src/main/java/com/ruoyi/alarm/wall/service/impl/ArdAlarmWallServiceImpl.java | 93 +++++++
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java | 12
ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java | 2
ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml | 2
ard-work/src/main/java/com/ruoyi/alarm/wall/domain/ArdAlarmWall.java | 151 +++++++++++
ard-work/src/main/java/com/ruoyi/alarm/wall/service/IArdAlarmWallService.java | 61 ++++
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java | 7
ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java | 4
ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java | 61 ++++
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWall.java | 8
ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java | 4
ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java | 96 ++++++
ard-work/src/main/java/com/ruoyi/alarm/wall/controller/ArdAlarmWallController.java | 104 ++++++++
ard-work/src/main/java/com/ruoyi/media/service/impl/MediaService.java | 8
18 files changed, 700 insertions(+), 32 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/wall/controller/ArdAlarmWallController.java b/ard-work/src/main/java/com/ruoyi/alarm/wall/controller/ArdAlarmWallController.java
new file mode 100644
index 0000000..9b75e9c
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/wall/controller/ArdAlarmWallController.java
@@ -0,0 +1,104 @@
+package com.ruoyi.alarm.wall.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.wall.domain.ArdAlarmWall;
+import com.ruoyi.alarm.wall.service.IArdAlarmWallService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 鐢靛瓙鍥存爮鎶ヨController
+ *
+ * @author ard
+ * @date 2023-08-31
+ */
+@RestController
+@RequestMapping("/alarm/wall")
+public class ArdAlarmWallController extends BaseController
+{
+ @Autowired
+ private IArdAlarmWallService ardAlarmWallService;
+
+ /**
+ * 鏌ヨ鐢靛瓙鍥存爮鎶ヨ鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:wall:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(ArdAlarmWall ardAlarmWall)
+ {
+ startPage();
+ List<ArdAlarmWall> list = ardAlarmWallService.selectArdAlarmWallList(ardAlarmWall);
+ return getDataTable(list);
+ }
+
+ /**
+ * 瀵煎嚭鐢靛瓙鍥存爮鎶ヨ鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:wall:export')")
+ @Log(title = "鐢靛瓙鍥存爮鎶ヨ", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, ArdAlarmWall ardAlarmWall)
+ {
+ List<ArdAlarmWall> list = ardAlarmWallService.selectArdAlarmWallList(ardAlarmWall);
+ ExcelUtil<ArdAlarmWall> util = new ExcelUtil<ArdAlarmWall>(ArdAlarmWall.class);
+ util.exportExcel(response, list, "鐢靛瓙鍥存爮鎶ヨ鏁版嵁");
+ }
+
+ /**
+ * 鑾峰彇鐢靛瓙鍥存爮鎶ヨ璇︾粏淇℃伅
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:wall:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") String id)
+ {
+ return success(ardAlarmWallService.selectArdAlarmWallById(id));
+ }
+
+ /**
+ * 鏂板鐢靛瓙鍥存爮鎶ヨ
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:wall:add')")
+ @Log(title = "鐢靛瓙鍥存爮鎶ヨ", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody ArdAlarmWall ardAlarmWall)
+ {
+ return toAjax(ardAlarmWallService.insertArdAlarmWall(ardAlarmWall));
+ }
+
+ /**
+ * 淇敼鐢靛瓙鍥存爮鎶ヨ
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:wall:edit')")
+ @Log(title = "鐢靛瓙鍥存爮鎶ヨ", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody ArdAlarmWall ardAlarmWall)
+ {
+ return toAjax(ardAlarmWallService.updateArdAlarmWall(ardAlarmWall));
+ }
+
+ /**
+ * 鍒犻櫎鐢靛瓙鍥存爮鎶ヨ
+ */
+ @PreAuthorize("@ss.hasPermi('alarm:wall:remove')")
+ @Log(title = "鐢靛瓙鍥存爮鎶ヨ", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable String[] ids)
+ {
+ return toAjax(ardAlarmWallService.deleteArdAlarmWallByIds(ids));
+ }
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/wall/domain/ArdAlarmWall.java b/ard-work/src/main/java/com/ruoyi/alarm/wall/domain/ArdAlarmWall.java
new file mode 100644
index 0000000..70fba5d
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/wall/domain/ArdAlarmWall.java
@@ -0,0 +1,151 @@
+package com.ruoyi.alarm.wall.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_wall
+ *
+ * @author ard
+ * @date 2023-08-31
+ */
+public class ArdAlarmWall extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ /** 鎶ヨ涓婚敭 */
+ private String id;
+
+ /** 鍥存爮ID */
+ @Excel(name = "鍥存爮ID")
+ private String wallId;
+
+ /** 鍥存爮鍚嶇О */
+ @Excel(name = "鍥存爮鍚嶇О")
+ private String wallName;
+ /** 鎶ヨ鐢ㄦ埛id */
+ @Excel(name = "鎶ヨ鐢ㄦ埛id")
+ private String userId;
+
+ /** 鎶ヨ绫诲瀷 */
+ @Excel(name = "鎶ヨ绫诲瀷")
+ private String alarmType;
+
+ /** 鎶ヨ鏃堕棿 */
+ @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 Double longitude;
+
+ /** 绾害 */
+ @Excel(name = "绾害")
+ private Double latitude;
+
+ /** 楂樺眰 */
+ @Excel(name = "楂樺眰")
+ private Double altitude;
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+ public void setUserId(String userId)
+ {
+ this.userId = userId;
+ }
+
+ public String getUserId()
+ {
+ return userId;
+ }
+ public void setAlarmType(String alarmType)
+ {
+ this.alarmType = alarmType;
+ }
+
+ public String getAlarmType()
+ {
+ return alarmType;
+ }
+ public void setAlarmTime(Date alarmTime)
+ {
+ this.alarmTime = alarmTime;
+ }
+
+ public Date getAlarmTime()
+ {
+ return alarmTime;
+ }
+ 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 String getWallId() {
+ return wallId;
+ }
+
+ public void setWallId(String wallId) {
+ this.wallId = wallId;
+ }
+
+ public String getWallName() {
+ return wallName;
+ }
+
+ public void setWallName(String wallName) {
+ this.wallName = wallName;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("userId", getUserId())
+ .append("alarmType", getAlarmType())
+ .append("alarmTime", getAlarmTime())
+ .append("longitude", getLongitude())
+ .append("latitude", getLatitude())
+ .append("altitude", getAltitude())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .toString();
+ }
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java b/ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java
new file mode 100644
index 0000000..53ac014
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/wall/mapper/ArdAlarmWallMapper.java
@@ -0,0 +1,61 @@
+package com.ruoyi.alarm.wall.mapper;
+
+import java.util.List;
+import com.ruoyi.alarm.wall.domain.ArdAlarmWall;
+
+/**
+ * 鐢靛瓙鍥存爮鎶ヨMapper鎺ュ彛
+ *
+ * @author ard
+ * @date 2023-08-31
+ */
+public interface ArdAlarmWallMapper
+{
+ /**
+ * 鏌ヨ鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param id 鐢靛瓙鍥存爮鎶ヨ涓婚敭
+ * @return 鐢靛瓙鍥存爮鎶ヨ
+ */
+ public ArdAlarmWall selectArdAlarmWallById(String id);
+
+ /**
+ * 鏌ヨ鐢靛瓙鍥存爮鎶ヨ鍒楄〃
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 鐢靛瓙鍥存爮鎶ヨ闆嗗悎
+ */
+ public List<ArdAlarmWall> selectArdAlarmWallList(ArdAlarmWall ardAlarmWall);
+
+ /**
+ * 鏂板鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 缁撴灉
+ */
+ public int insertArdAlarmWall(ArdAlarmWall ardAlarmWall);
+
+ /**
+ * 淇敼鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 缁撴灉
+ */
+ public int updateArdAlarmWall(ArdAlarmWall ardAlarmWall);
+
+ /**
+ * 鍒犻櫎鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param id 鐢靛瓙鍥存爮鎶ヨ涓婚敭
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmWallById(String id);
+
+ /**
+ * 鎵归噺鍒犻櫎鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmWallByIds(String[] ids);
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/wall/service/IArdAlarmWallService.java b/ard-work/src/main/java/com/ruoyi/alarm/wall/service/IArdAlarmWallService.java
new file mode 100644
index 0000000..761873d
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/wall/service/IArdAlarmWallService.java
@@ -0,0 +1,61 @@
+package com.ruoyi.alarm.wall.service;
+
+import java.util.List;
+import com.ruoyi.alarm.wall.domain.ArdAlarmWall;
+
+/**
+ * 鐢靛瓙鍥存爮鎶ヨService鎺ュ彛
+ *
+ * @author ard
+ * @date 2023-08-31
+ */
+public interface IArdAlarmWallService
+{
+ /**
+ * 鏌ヨ鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param id 鐢靛瓙鍥存爮鎶ヨ涓婚敭
+ * @return 鐢靛瓙鍥存爮鎶ヨ
+ */
+ public ArdAlarmWall selectArdAlarmWallById(String id);
+
+ /**
+ * 鏌ヨ鐢靛瓙鍥存爮鎶ヨ鍒楄〃
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 鐢靛瓙鍥存爮鎶ヨ闆嗗悎
+ */
+ public List<ArdAlarmWall> selectArdAlarmWallList(ArdAlarmWall ardAlarmWall);
+
+ /**
+ * 鏂板鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 缁撴灉
+ */
+ public int insertArdAlarmWall(ArdAlarmWall ardAlarmWall);
+
+ /**
+ * 淇敼鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 缁撴灉
+ */
+ public int updateArdAlarmWall(ArdAlarmWall ardAlarmWall);
+
+ /**
+ * 鎵归噺鍒犻櫎鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鐢靛瓙鍥存爮鎶ヨ涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmWallByIds(String[] ids);
+
+ /**
+ * 鍒犻櫎鐢靛瓙鍥存爮鎶ヨ淇℃伅
+ *
+ * @param id 鐢靛瓙鍥存爮鎶ヨ涓婚敭
+ * @return 缁撴灉
+ */
+ public int deleteArdAlarmWallById(String id);
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/wall/service/impl/ArdAlarmWallServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/wall/service/impl/ArdAlarmWallServiceImpl.java
new file mode 100644
index 0000000..b229904
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/wall/service/impl/ArdAlarmWallServiceImpl.java
@@ -0,0 +1,93 @@
+package com.ruoyi.alarm.wall.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import org.springframework.stereotype.Service;
+import com.ruoyi.alarm.wall.mapper.ArdAlarmWallMapper;
+import com.ruoyi.alarm.wall.domain.ArdAlarmWall;
+import com.ruoyi.alarm.wall.service.IArdAlarmWallService;
+import javax.annotation.Resource;
+
+/**
+ * 鐢靛瓙鍥存爮鎶ヨService涓氬姟灞傚鐞�
+ *
+ * @author ard
+ * @date 2023-08-31
+ */
+@Service
+public class ArdAlarmWallServiceImpl implements IArdAlarmWallService {
+ @Resource
+ private ArdAlarmWallMapper ardAlarmWallMapper;
+
+ /**
+ * 鏌ヨ鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param id 鐢靛瓙鍥存爮鎶ヨ涓婚敭
+ * @return 鐢靛瓙鍥存爮鎶ヨ
+ */
+ @Override
+ public ArdAlarmWall selectArdAlarmWallById(String id) {
+ return ardAlarmWallMapper.selectArdAlarmWallById(id);
+ }
+
+ /**
+ * 鏌ヨ鐢靛瓙鍥存爮鎶ヨ鍒楄〃
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 鐢靛瓙鍥存爮鎶ヨ
+ */
+ @Override
+ public List<ArdAlarmWall> selectArdAlarmWallList(ArdAlarmWall ardAlarmWall) {
+ return ardAlarmWallMapper.selectArdAlarmWallList(ardAlarmWall);
+ }
+
+ /**
+ * 鏂板鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertArdAlarmWall(ArdAlarmWall ardAlarmWall) {
+
+ ardAlarmWall.setCreateBy(SecurityUtils.getUsername());
+ ardAlarmWall.setCreateTime(DateUtils.getNowDate());
+ return ardAlarmWallMapper.insertArdAlarmWall(ardAlarmWall);
+ }
+
+ /**
+ * 淇敼鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ardAlarmWall 鐢靛瓙鍥存爮鎶ヨ
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateArdAlarmWall(ArdAlarmWall ardAlarmWall) {
+ ardAlarmWall.setUpdateBy(SecurityUtils.getUsername());
+ ardAlarmWall.setUpdateTime(DateUtils.getNowDate());
+ return ardAlarmWallMapper.updateArdAlarmWall(ardAlarmWall);
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎鐢靛瓙鍥存爮鎶ヨ
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鐢靛瓙鍥存爮鎶ヨ涓婚敭
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteArdAlarmWallByIds(String[] ids) {
+ return ardAlarmWallMapper.deleteArdAlarmWallByIds(ids);
+ }
+
+ /**
+ * 鍒犻櫎鐢靛瓙鍥存爮鎶ヨ淇℃伅
+ *
+ * @param id 鐢靛瓙鍥存爮鎶ヨ涓婚敭
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteArdAlarmWallById(String id) {
+ return ardAlarmWallMapper.deleteArdAlarmWallById(id);
+ }
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/controller/ArdWallController.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java
similarity index 95%
rename from ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/controller/ArdWallController.java
rename to ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java
index 07d9c27..c29951b 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/controller/ArdWallController.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/controller/ArdWallController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.alarmpoints.elecwall.controller;
+package com.ruoyi.alarmpoints.wall.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@@ -19,8 +19,8 @@
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.alarmpoints.elecwall.domain.ArdWall;
-import com.ruoyi.alarmpoints.elecwall.service.IArdWallService;
+import com.ruoyi.alarmpoints.wall.domain.ArdWall;
+import com.ruoyi.alarmpoints.wall.service.IArdWallService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/domain/ArdWall.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWall.java
similarity index 94%
rename from ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/domain/ArdWall.java
rename to ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWall.java
index 81cefa4..e1d6621 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/domain/ArdWall.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWall.java
@@ -1,4 +1,4 @@
-package com.ruoyi.alarmpoints.elecwall.domain;
+package com.ruoyi.alarmpoints.wall.domain;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -39,7 +39,7 @@
/** 鎵�灞為儴闂� */
@Excel(name = "鎵�灞為儴闂�")
- private Integer deptId;
+ private Long deptId;
/** 鎵�灞炵敤鎴� */
@Excel(name = "鎵�灞炵敤鎴�")
@@ -101,12 +101,12 @@
{
return color;
}
- public void setDeptId(Integer deptId)
+ public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
- public Integer getDeptId()
+ public Long getDeptId()
{
return deptId;
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/domain/ArdWallUser.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWallUser.java
similarity index 89%
rename from ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/domain/ArdWallUser.java
rename to ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWallUser.java
index eae4f4a..cd75483 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/domain/ArdWallUser.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/domain/ArdWallUser.java
@@ -1,4 +1,4 @@
-package com.ruoyi.alarmpoints.elecwall.domain;
+package com.ruoyi.alarmpoints.wall.domain;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/mapper/ArdWallMapper.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java
similarity index 89%
rename from ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/mapper/ArdWallMapper.java
rename to ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java
index 4ff3dd4..8b00b47 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/mapper/ArdWallMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/mapper/ArdWallMapper.java
@@ -1,9 +1,8 @@
-package com.ruoyi.alarmpoints.elecwall.mapper;
+package com.ruoyi.alarmpoints.wall.mapper;
import java.util.List;
-import com.ruoyi.alarmpoints.elecwall.domain.ArdWall;
-import com.ruoyi.alarmpoints.elecwall.domain.ArdWallUser;
-import com.ruoyi.dispatch.domain.ArdDispatchPoliceUser;
+import com.ruoyi.alarmpoints.wall.domain.ArdWall;
+import com.ruoyi.alarmpoints.wall.domain.ArdWallUser;
/**
* 鐢靛瓙鍥存爮绠$悊Mapper鎺ュ彛
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/service/IArdWallService.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java
similarity index 92%
rename from ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/service/IArdWallService.java
rename to ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java
index 7627035..9946aae 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/service/IArdWallService.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/IArdWallService.java
@@ -1,7 +1,7 @@
-package com.ruoyi.alarmpoints.elecwall.service;
+package com.ruoyi.alarmpoints.wall.service;
import java.util.List;
-import com.ruoyi.alarmpoints.elecwall.domain.ArdWall;
+import com.ruoyi.alarmpoints.wall.domain.ArdWall;
/**
* 鐢靛瓙鍥存爮绠$悊Service鎺ュ彛
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/service/impl/ArdWallServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java
similarity index 89%
rename from ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/service/impl/ArdWallServiceImpl.java
rename to ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java
index 4840e3c..826108b 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/elecwall/service/impl/ArdWallServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/wall/service/impl/ArdWallServiceImpl.java
@@ -1,20 +1,18 @@
-package com.ruoyi.alarmpoints.elecwall.service.impl;
+package com.ruoyi.alarmpoints.wall.service.impl;
import java.util.ArrayList;
import java.util.List;
-import com.ruoyi.alarmpoints.elecwall.domain.ArdWallUser;
+import com.ruoyi.alarmpoints.wall.domain.ArdWallUser;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
-import com.ruoyi.dispatch.domain.ArdDispatchPolice;
-import com.ruoyi.dispatch.domain.ArdDispatchPoliceUser;
import org.springframework.stereotype.Service;
-import com.ruoyi.alarmpoints.elecwall.mapper.ArdWallMapper;
-import com.ruoyi.alarmpoints.elecwall.domain.ArdWall;
-import com.ruoyi.alarmpoints.elecwall.service.IArdWallService;
+import com.ruoyi.alarmpoints.wall.mapper.ArdWallMapper;
+import com.ruoyi.alarmpoints.wall.domain.ArdWall;
+import com.ruoyi.alarmpoints.wall.service.IArdWallService;
import javax.annotation.Resource;
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java b/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
index 1fa38bd..594920e 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/controller/ArdAppPositionController.java
@@ -93,7 +93,7 @@
@PostMapping
public AjaxResult add(@RequestBody ArdAppPosition ardAppPosition)
{
- return toAjax(ardAppPositionService.insertArdAppPosition(ardAppPosition));
+ return AjaxResult.success(ardAppPositionService.insertArdAppPosition(ardAppPosition));
}
/**
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java b/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java
index 835646e..7e56881 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/service/IArdAppPositionService.java
@@ -1,6 +1,8 @@
package com.ruoyi.app.position.service;
import java.util.List;
+
+import com.ruoyi.alarm.wall.domain.ArdAlarmWall;
import com.ruoyi.app.position.domain.ArdAppPosition;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.scheduling.domian.SchedulingParam;
@@ -42,7 +44,7 @@
* @param ardAppPosition app浣嶇疆
* @return 缁撴灉
*/
- public int insertArdAppPosition(ArdAppPosition ardAppPosition);
+ public List<ArdAlarmWall> insertArdAppPosition(ArdAppPosition ardAppPosition);
/**
* 淇敼app浣嶇疆
diff --git a/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java b/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java
index c0143e5..db67b30 100644
--- a/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/app/position/service/impl/ArdAppPositionServiceImpl.java
@@ -1,9 +1,15 @@
package com.ruoyi.app.position.service.impl;
+import com.ruoyi.alarm.wall.domain.ArdAlarmWall;
+import com.ruoyi.alarm.wall.mapper.ArdAlarmWallMapper;
+import com.ruoyi.alarm.wall.service.IArdAlarmWallService;
+import com.ruoyi.alarmpoints.wall.domain.ArdWall;
+import com.ruoyi.alarmpoints.wall.mapper.ArdWallMapper;
import com.ruoyi.app.position.domain.ArdAppPosition;
import com.ruoyi.app.position.mapper.ArdAppPositionMapper;
import com.ruoyi.app.position.service.IArdAppPositionService;
import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
@@ -15,10 +21,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.stream.Collectors;
@@ -76,10 +79,11 @@
* @return 缁撴灉
*/
@Override
- public int insertArdAppPosition(ArdAppPosition ardAppPosition) {
+ public List<ArdAlarmWall> insertArdAppPosition(ArdAppPosition ardAppPosition) {
ardAppPosition.setId(IdUtils.simpleUUID());
ardAppPosition.setCreateTime(DateUtils.getNowDate());
- return ardAppPositionMapper.insertArdAppPosition(ardAppPosition);
+ ardAppPositionMapper.insertArdAppPosition(ardAppPosition);
+ return DetectionWallAlarm(ardAppPosition);
}
/**
@@ -170,6 +174,7 @@
}
return filteredList;
}
+
/**
* 鑾峰彇灏佹帶鍦堝唴鎵�鏈夊湪绾縜pp鐢ㄦ埛(澶氳竟褰�)
* 鍒樿嫃涔�
@@ -199,7 +204,7 @@
if (lon == null || lat == null) {
continue;
}
- Point point2D=new Point(lon,lat);
+ Point point2D = new Point(lon, lat);
boolean inPolygon = GisUtil.isInPolygon(point2D, partitionLocation);
if (inPolygon) {
Map<String, Object> params = new HashMap<>();
@@ -215,4 +220,81 @@
}
return filteredList;
}
+
+
+ @Resource
+ RedisCache redisCache;
+ @Resource
+ ArdWallMapper ardWallMapper;
+ @Resource
+ IArdAlarmWallService ardAlarmWallService;
+ Map<String, String> userLastAlarm = new HashMap<>();
+
+ /**
+ * 瀹炴椂浣嶇疆妫�娴嬪洿鏍忔姤璀�
+ * 鍒樿嫃涔�
+ * 2023/8/31 8:54:06
+ */
+ public List<ArdAlarmWall> DetectionWallAlarm(ArdAppPosition ardAppPosition) {
+ List<ArdAlarmWall> ardAlarmWalls=new ArrayList<>();
+ //鑾峰彇褰撳墠鐢ㄦ埛鐨勯儴闂�
+ String userId = ardAppPosition.getUserId();
+ SysUser sysUser = redisCache.getCacheObject("user_list:" + userId);
+ Long deptId = sysUser.getDeptId();
+ //鑾峰彇閮ㄩ棬涓嬬殑鎵�鏈夌數瀛愬洿鏍�
+ ArdWall ardWall = new ArdWall();
+ ardWall.setDeptId(deptId);
+ List<ArdWall> ardWalls = ardWallMapper.selectArdWallList(ardWall);
+ if (ardWalls.size() > 0) {
+ for (ArdWall wall : ardWalls) {
+ String wallPoi = wall.getWallPoi();
+ //澶勭悊澶氳竟褰㈢殑姣忎釜鐐圭殑缁忕含搴�
+ String[] parts = wallPoi.split(",");
+ List<Point> pointList = new ArrayList<>();
+ for (int i = 0; i < parts.length; i += 3) {
+ Point point = new Point();
+ point.setLongitude(Double.valueOf(parts[i]));
+ point.setLatitude(Double.valueOf(parts[i + 1]));
+ pointList.add(point);
+ }
+
+ //鍒ゆ柇褰撳墠鐢ㄦ埛浣嶇疆鏄惁鍦ㄥ洿鏍忓唴
+ Point userPoint=new Point();
+ userPoint.setLongitude(ardAppPosition.getLongitude());
+ userPoint.setLatitude(ardAppPosition.getLatitude());
+ boolean inPolygon = GisUtil.isInPolygon(userPoint, pointList);
+ if (inPolygon) {
+ String lastAlarmId = userLastAlarm.get(userId);
+ ArdAlarmWall ardAlarmWall = new ArdAlarmWall();
+ ardAlarmWall.setWallId(wall.getId());
+ ardAlarmWall.setWallName(wall.getWallName());
+ ardAlarmWall.setUserId(userId);
+ ardAlarmWall.setAlarmTime(new Date());
+ ardAlarmWall.setAlarmType(wall.getType());
+ ardAlarmWall.setLongitude(ardAppPosition.getLongitude());
+ ardAlarmWall.setLatitude(ardAppPosition.getLatitude());
+ ardAlarmWall.setAltitude(ardAppPosition.getAltitude());
+ if (lastAlarmId == null) {
+ String uuid = IdUtils.simpleUUID();
+ // 褰撳墠鐢ㄦ埛涓婁竴娆$姸鎬佹湭杩涘叆锛岀敓鎴愭姤璀�
+ ardAlarmWall.setId(uuid);
+ ardAlarmWallService.insertArdAlarmWall(ardAlarmWall);
+ //鏇存柊鏈�鍚庢姤璀d
+ userLastAlarm.put(userId, uuid);
+ } else {
+ // 涓婁竴娆$敤鎴风姸鎬佸凡杩涘叆锛屾洿鏂版渶鍚庢姤璀�
+ ardAlarmWall.setId(lastAlarmId);
+ ardAlarmWallService.updateArdAlarmWall(ardAlarmWall);
+ }
+ ardAlarmWalls.add(ardAlarmWall);
+ }
+ else
+ {
+ //绉婚櫎鏈�鍚庢姤璀d
+ userLastAlarm.remove(userId);
+ }
+ }
+ }
+ return ardAlarmWalls;
+ }
}
diff --git a/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaService.java b/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaService.java
index a122234..6647b49 100644
--- a/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaService.java
+++ b/ard-work/src/main/java/com/ruoyi/media/service/impl/MediaService.java
@@ -48,6 +48,9 @@
String processName = "mediamtx.exe";
+ static{
+
+ }
@PostConstruct
public void initMediaMtx() {
if (mediamtxEnabled) {
@@ -69,6 +72,11 @@
// CmdUtils.commandStart(command);
}
}
+ try {
+ Thread.sleep(2000); // 绛夊緟5绉�
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
List<StreamInfo> paths = paths();
for(StreamInfo path:paths)
{
diff --git a/ard-work/src/main/java/com/ruoyi/utils/gis/Point.java b/ard-work/src/main/java/com/ruoyi/utils/gis/Point.java
index 979cc55..fb3ac40 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/gis/Point.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/gis/Point.java
@@ -19,7 +19,7 @@
private static final long serialVersionUID = 1L;
private Double longitude;
private Double latitude;
-
+ private Double altitude;
@JsonCreator
public Point(@JsonProperty("longitude") Double longitude,@JsonProperty("latitude")Double latitude) {
this.longitude = longitude;
diff --git a/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml b/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
new file mode 100644
index 0000000..97fa3ee
--- /dev/null
+++ b/ard-work/src/main/resources/mapper/alarm/ArdAlarmWallMapper.xml
@@ -0,0 +1,109 @@
+<?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.wall.mapper.ArdAlarmWallMapper">
+
+ <resultMap type="ArdAlarmWall" id="ArdAlarmWallResult">
+ <result property="id" column="id" />
+ <result property="wallId" column="wall_id" />
+ <result property="wallName" column="wall_name" />
+ <result property="userId" column="user_id" />
+ <result property="alarmType" column="alarm_type" />
+ <result property="alarmTime" column="alarm_time" />
+ <result property="longitude" column="longitude" />
+ <result property="latitude" column="latitude" />
+ <result property="altitude" column="altitude" />
+ <result property="createBy" column="create_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateBy" column="update_by" />
+ <result property="updateTime" column="update_time" />
+ </resultMap>
+
+ <sql id="selectArdAlarmWallVo">
+ select id,wall_id,wall_name, user_id, alarm_type, alarm_time, longitude, latitude, altitude, create_by, create_time, update_by, update_time from ard_alarm_wall
+ </sql>
+
+ <select id="selectArdAlarmWallList" parameterType="ArdAlarmWall" resultMap="ArdAlarmWallResult">
+ <include refid="selectArdAlarmWallVo"/>
+ <where>
+ <if test="wallId != null and wallId != ''"> and wall_id = #{wallId}</if>
+ <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="longitude != null "> and longitude = #{longitude}</if>
+ <if test="latitude != null "> and latitude = #{latitude}</if>
+ <if test="altitude != null "> and altitude = #{altitude}</if>
+ </where>
+ </select>
+
+ <select id="selectArdAlarmWallById" parameterType="String" resultMap="ArdAlarmWallResult">
+ <include refid="selectArdAlarmWallVo"/>
+ where id = #{id}
+ </select>
+
+ <insert id="insertArdAlarmWall" parameterType="ArdAlarmWall">
+ insert into ard_alarm_wall
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">id,</if>
+ <if test="wallId != null">wall_id,</if>
+ <if test="wallName != null">wall_name,</if>
+ <if test="userId != null">user_id,</if>
+ <if test="alarmType != null">alarm_type,</if>
+ <if test="alarmTime != null">alarm_time,</if>
+ <if test="longitude != null">longitude,</if>
+ <if test="latitude != null">latitude,</if>
+ <if test="altitude != null">altitude,</if>
+ <if test="createBy != null">create_by,</if>
+ <if test="createTime != null">create_time,</if>
+ <if test="updateBy != null">update_by,</if>
+ <if test="updateTime != null">update_time,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">#{id},</if>
+ <if test="wallId != null">#{wallId},</if>
+ <if test="wallName != null">#{wallName},</if>
+ <if test="userId != null">#{userId},</if>
+ <if test="alarmType != null">#{alarmType},</if>
+ <if test="alarmTime != null">#{alarmTime},</if>
+ <if test="longitude != null">#{longitude},</if>
+ <if test="latitude != null">#{latitude},</if>
+ <if test="altitude != null">#{altitude},</if>
+ <if test="createBy != null">#{createBy},</if>
+ <if test="createTime != null">#{createTime},</if>
+ <if test="updateBy != null">#{updateBy},</if>
+ <if test="updateTime != null">#{updateTime},</if>
+ </trim>
+ </insert>
+
+ <update id="updateArdAlarmWall" parameterType="ArdAlarmWall">
+ update ard_alarm_wall
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="wallId != null">wall_id = #{wallId},</if>
+ <if test="wallName != null">wall_name = #{wallName},</if>
+ <if test="userId != null">user_id = #{userId},</if>
+ <if test="alarmType != null">alarm_type = #{alarmType},</if>
+ <if test="alarmTime != null">alarm_time = #{alarmTime},</if>
+ <if test="longitude != null">longitude = #{longitude},</if>
+ <if test="latitude != null">latitude = #{latitude},</if>
+ <if test="altitude != null">altitude = #{altitude},</if>
+ <if test="createBy != null">create_by = #{createBy},</if>
+ <if test="createTime != null">create_time = #{createTime},</if>
+ <if test="updateBy != null">update_by = #{updateBy},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <delete id="deleteArdAlarmWallById" parameterType="String">
+ delete from ard_alarm_wall where id = #{id}
+ </delete>
+
+ <delete id="deleteArdAlarmWallByIds" parameterType="String">
+ delete from ard_alarm_wall where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </delete>
+</mapper>
\ No newline at end of file
diff --git a/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml b/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml
index 53d55fe..da756a4 100644
--- a/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarmpoints/ArdWallMapper.xml
@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.alarmpoints.elecwall.mapper.ArdWallMapper">
+<mapper namespace="com.ruoyi.alarmpoints.wall.mapper.ArdWallMapper">
<resultMap type="ArdWall" id="ArdWallResult">
<result property="id" column="id" />
--
Gitblit v1.9.3