From 74c08a504d55ae137004cb44e0145010f62f9585 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期五, 25 八月 2023 14:47:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RongCloudTask.java | 11 +-
ard-work/src/main/java/com/ruoyi/device/hiksdk/util/hikSdkUtil/LoginResultCallBack.java | 10 +
ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeService.java | 4
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java | 1
ard-work/src/main/java/com/ruoyi/test/ReadAccessDatabase.java | 3
ard-work/src/main/java/com/ruoyi/dispatch/service/impl/ArdDispatchPoliceServiceImpl.java | 15 ++
ruoyi-admin/src/main/java/com/ruoyi/web/controller/authorize/AuthorizationController.java | 18 +-
ard-work/src/main/java/com/ruoyi/utils/websocket/util/WebSocketUtils.java | 2
ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeServiceImpl.java | 34 ++++++
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java | 2
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 56 ++++++----
ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java | 13 +-
ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml | 63 +++++++-----
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueManager.java | 20 ++-
ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPoliceUser.java | 13 +-
ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPolice.java | 23 +++-
16 files changed, 182 insertions(+), 106 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 0529d64..385f1d5 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
@@ -49,6 +49,7 @@
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -679,7 +680,6 @@
log.info("鐩告満:" + cameraId + "鏈紑鍚姤璀﹀紩瀵煎姛鑳�");
return;
}
-
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
GuideTask guideTask = new GuideTask();
//鐩告満ID
@@ -737,35 +737,45 @@
*/
private String getNearbyCamera(double[] targetPosition) {
String minDistanceCameraId = "";
- //鑾峰彇鎵�鏈夊ぇ鍏夌數
- List<ArdCameras> ardCamerasList = ardCamerasMapper.selectArdCamerasList(new ArdCameras("1"));
- //缁熻鎵�鏈夊ぇ鍏夌數鍙鑼冨洿鍐呬笌鎶ヨ鐐圭殑璺濈
- Map<String, Double> distanceMap = new HashMap<>();
- Map<String, Integer> guideMap = new HashMap<>();
- for (ArdCameras camera : ardCamerasList) {
- double[] camPosition = new double[]{camera.getLongitude(), camera.getLatitude()};
- double distance = GisTool.getDistance(targetPosition, camPosition);
- if (distance != 0.0 && distance <= camera.getCamMaxVisibleDistance()) {
- distanceMap.put(camera.getId(), distance);
- if (StringUtils.isNull(camera.getCamAlarmGuideEnable())) {
- camera.setCamAlarmGuideEnable(0);
+ try {
+ //鑾峰彇鎵�鏈夊ぇ鍏夌數
+ List<ArdCameras> ardCamerasList = ardCamerasMapper.selectArdCamerasList(new ArdCameras("1"));
+ //缁熻鎵�鏈夊ぇ鍏夌數鍙鑼冨洿鍐呬笌鎶ヨ鐐圭殑璺濈
+ Map<String, Double> distanceMap = new HashMap<>();
+ Map<String, Integer> guideMap = new HashMap<>();
+ for (ArdCameras camera : ardCamerasList) {
+ if (camera.getCamMaxVisibleDistance() == null) {
+ continue;
}
- guideMap.put(camera.getId(), camera.getCamAlarmGuideEnable());
+ double[] camPosition = new double[]{camera.getLongitude(), camera.getLatitude()};
+ double distance = GisTool.getDistance(targetPosition, camPosition);
+ if (distance != 0.0 && distance <= camera.getCamMaxVisibleDistance()) {
+ distanceMap.put(camera.getId(), distance);
+ if (StringUtils.isNull(camera.getCamAlarmGuideEnable())) {
+ camera.setCamAlarmGuideEnable(0);
+ }
+ guideMap.put(camera.getId(), camera.getCamAlarmGuideEnable());
+ }
+ }
+ if (distanceMap.size() > 0) {
+ log.debug("灏濊瘯鏌ユ壘鏈�杩戝厜鐢�");
+ //鑾峰彇璺濈瀛楀吀涓渶杩戠殑涓�涓浉鏈篒D
+ minDistanceCameraId = ArdTool.getKeyByMinValue(distanceMap);
+ log.debug("鏌ユ壘鍒版渶杩戝厜鐢�:" + minDistanceCameraId);
+ if (guideMap.get(minDistanceCameraId).equals(0)) {
+ log.debug("璇ュ厜鐢垫湭寮�鍚姤璀﹀紩瀵�");
+ return " ";
+ }
}
}
- if (distanceMap.size() > 0) {
- log.debug("灏濊瘯鏌ユ壘鏈�杩戝厜鐢�");
- //鑾峰彇璺濈瀛楀吀涓渶杩戠殑涓�涓浉鏈篒D
- minDistanceCameraId = ArdTool.getKeyByMinValue(distanceMap);
- log.debug("鏌ユ壘鍒版渶杩戝厜鐢�:" + minDistanceCameraId);
- if (guideMap.get(minDistanceCameraId).equals(0)) {
- log.debug("璇ュ厜鐢垫湭寮�鍚姤璀﹀紩瀵�");
- return " ";
- }
+ catch (Exception ex)
+ {
+ log.error("鑾峰彇闄勮繎寮�鍚姤璀﹀紩瀵煎姛鑳藉厜鐢靛紓甯�:"+ex.getMessage());
}
return minDistanceCameraId;
}
+
/**
* 闆疯揪寮曞鍏ラ槦
*/
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueManager.java b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueManager.java
index 21c8772..0497e66 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueManager.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueManager.java
@@ -58,21 +58,27 @@
public void addTaskToQueue(String cameraId, GuideTask task) {
/*閫氳繃鐩告満ID鑾峰彇寮曞闃熷垪锛屽苟灏嗗紩瀵间换鍔″姞鍏ラ槦鍒�*/
PriorityBlockingQueue<GuideTask> guideTaskQueue = GuidePriorityQueue.cameraQueueMap.get(cameraId);
- if(StringUtils.isNull(guideTaskQueue))
- {
+ if (StringUtils.isNull(guideTaskQueue)) {
log.info("鐩告満鏈櫥褰�,娌℃湁闃熷垪,鏃犳硶鍏ラ槦寮曞");
return;
}
- log.debug("鏂颁换鍔″叆闃�:"+task.getAlarmId());
+ log.debug("鏂颁换鍔″叆闃�:" + task.getAlarmId());
guideTaskQueue.add(task);
/*鑾峰彇璇ョ浉鏈虹殑褰撳墠鎵ц绾跨▼*/
TaskThread currentTaskThread = threadMap.get(cameraId);
//濡傛灉闃熷垪褰撳墠绾跨▼姝e湪杩愯锛岃嫢鍏ラ槦浠诲姟浼樺厛绾уぇ浜庡綋鍓嶄换鍔′紭鍏堢骇锛屽垯缁堟褰撳墠绾跨▼
- if (currentTaskThread != null && task.getPriority() > currentTaskThread.getCurrentTask().getPriority()) {
- currentTaskThread.getThread().interrupt();
+ if (currentTaskThread != null){
+ if (task.getPriority() > currentTaskThread.getCurrentTask().getPriority()) {
+ currentTaskThread.getThread().interrupt();
+ }
+ if (!currentTaskThread.getThread().isAlive()) {
+ Thread newThread = createThread(cameraId, guideTaskQueue);
+ threadMap.put(cameraId, new TaskThread(newThread, task));
+ newThread.start();
+ }
}
//濡傛灉闃熷垪褰撳墠娌℃湁绾跨▼姝e湪杩愯锛屽垯鍚姩鏂扮嚎绋�
- if (currentTaskThread == null || !currentTaskThread.getThread().isAlive()) {
+ else {
Thread newThread = createThread(cameraId, guideTaskQueue);
threadMap.put(cameraId, new TaskThread(newThread, task));
newThread.start();
@@ -90,7 +96,7 @@
while (!Thread.currentThread().isInterrupted()) {
try {
GuideTask task = queue.take();
- log.debug("鍙栧嚭闃熷垪鏁版嵁:"+task.getAlarmId());
+ log.debug("鍙栧嚭闃熷垪鏁版嵁:" + task.getAlarmId());
taskExecutor.processTask(task);
// 鏇存柊绾跨▼鐨勫綋鍓嶄换鍔�
TaskThread currentTaskThread = threadMap.get(queueName);
diff --git a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
index 771c21f..4ed6415 100644
--- a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
@@ -2,6 +2,7 @@
import com.ruoyi.common.annotation.SdkOperate;
import com.ruoyi.common.utils.file.FileUtils;
+import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.device.camera.domain.CameraCmd;
import com.ruoyi.device.camera.service.IArdCamerasService;
@@ -1151,11 +1152,10 @@
//瀛樺偍鍒癿inio
String BucketName = "pic";
String ObjectName = "capture/" + IdUtils.simpleUUID() + ".jpeg";
- String ContentType = "image/JPEG";
InputStream input = new ByteArrayInputStream(array);
String url = "";
try {
- boolean b = minioUtil.uploadObject(BucketName, ObjectName, input, input.available(), ContentType);
+ boolean b = minioUtil.uploadObject(BucketName, ObjectName, input, input.available(), MimeTypeUtils.IMAGE_JPEG);
if (b) {
url = minioUtil.getBucketObjectUrl(BucketName, ObjectName);
log.debug("涓婁紶鏂囦欢鎴愬姛!" + url);
@@ -1336,14 +1336,11 @@
log.debug("褰曞儚鍋滄");
//瀛樺叆minio
String BucketName = cmd.getRecordBucketName();
- String ObjectName = cmd.getRecordObjectName();
- String ContentType = "video/MP4";
+ String ObjectName = cmd.getRecordObjectName()+".mp4";
FileInputStream stream = new FileInputStream(path);
- String time = new SimpleDateFormat("yyyyMMdd").format(new Date());
- String recordName = cameraId + "/" + time + "/" + ObjectName + ".mp4";
- boolean b = minioUtil.uploadObject(BucketName, recordName, stream, stream.available(), ContentType);
+ boolean b = minioUtil.uploadObject(BucketName, ObjectName, stream, stream.available(), "video/MP4");
if (b) {
- url = endpoint + "/" + BucketName + "/" + recordName;
+ url = minioUtil.getBucketObjectUrl(BucketName, ObjectName);
log.debug("涓婁紶鏂囦欢鎴愬姛!" + url);
}
return url;
diff --git a/ard-work/src/main/java/com/ruoyi/device/hiksdk/util/hikSdkUtil/LoginResultCallBack.java b/ard-work/src/main/java/com/ruoyi/device/hiksdk/util/hikSdkUtil/LoginResultCallBack.java
index bbe9c52..d879397 100644
--- a/ard-work/src/main/java/com/ruoyi/device/hiksdk/util/hikSdkUtil/LoginResultCallBack.java
+++ b/ard-work/src/main/java/com/ruoyi/device/hiksdk/util/hikSdkUtil/LoginResultCallBack.java
@@ -59,9 +59,13 @@
}
}
//鍒涘缓寮曞闃熷垪
- Comparator<GuideTask> comparator = GuidePriorityQueue.getComparator();
- PriorityBlockingQueue<GuideTask> priorityQueue = new PriorityBlockingQueue<>(1000, comparator);
- GuidePriorityQueue.cameraQueueMap.put(camera.getId(), priorityQueue);
+ if(!GuidePriorityQueue.cameraQueueMap.containsKey(camera.getId()))
+ {
+ Comparator<GuideTask> comparator = GuidePriorityQueue.getComparator();
+ PriorityBlockingQueue<GuideTask> priorityQueue = new PriorityBlockingQueue<>(1000, comparator);
+ GuidePriorityQueue.cameraQueueMap.put(camera.getId(), priorityQueue);
+ }
+
} else {
log.debug(camera.getIp() + ":" + camera.getPort() + "鐧诲綍澶辫触");
camera.setChanNum(0);
diff --git a/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPolice.java b/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPolice.java
index 64d3dab..b338450 100644
--- a/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPolice.java
+++ b/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPolice.java
@@ -2,6 +2,7 @@
import java.util.List;
+import com.ruoyi.common.core.domain.entity.SysUser;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -25,6 +26,10 @@
@Excel(name = "娲捐鍚嶇О")
private String name;
+ /** 鎻忚堪 */
+ @Excel(name = "鎻忚堪")
+ private String text;
+
/** 缁忓害 */
@Excel(name = "缁忓害")
private Double longitude;
@@ -42,7 +47,7 @@
private String userId;
/** 娲捐鍏宠仈鐢ㄦ埛淇℃伅 */
- private List<String> ardDispatchPoliceUserList;
+ private List<SysUser> sysUserList;
public void setId(String id)
{
@@ -99,11 +104,19 @@
return userId;
}
- public List<String> getArdDispatchPoliceUserList() {
- return ardDispatchPoliceUserList;
+ public List<SysUser> getSysUserList() {
+ return sysUserList;
}
- public void setArdDispatchPoliceUserList(List<String> ardDispatchPoliceUserList) {
- this.ardDispatchPoliceUserList = ardDispatchPoliceUserList;
+ public void setSysUserList(List<SysUser> sysUserList) {
+ this.sysUserList = sysUserList;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
}
}
diff --git a/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPoliceUser.java b/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPoliceUser.java
index 71c5a87..041e61e 100644
--- a/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPoliceUser.java
+++ b/ard-work/src/main/java/com/ruoyi/dispatch/domain/ArdDispatchPoliceUser.java
@@ -11,7 +11,7 @@
* @author ard
* @date 2023-08-21
*/
-public class ArdDispatchPoliceUser extends BaseEntity
+public class ArdDispatchPoliceUser
{
private static final long serialVersionUID = 1L;
@@ -22,6 +22,8 @@
/** 鍏宠仈鐢ㄦ埛ID */
@Excel(name = "鍏宠仈鐢ㄦ埛ID")
private String userId;
+
+
public void setDispatchId(String dispatchId)
{
@@ -42,11 +44,6 @@
return userId;
}
- @Override
- public String toString() {
- return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
- .append("dispatchId", getDispatchId())
- .append("userId", getUserId())
- .toString();
- }
+
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/dispatch/service/impl/ArdDispatchPoliceServiceImpl.java b/ard-work/src/main/java/com/ruoyi/dispatch/service/impl/ArdDispatchPoliceServiceImpl.java
index 92a99ff..b6df112 100644
--- a/ard-work/src/main/java/com/ruoyi/dispatch/service/impl/ArdDispatchPoliceServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/dispatch/service/impl/ArdDispatchPoliceServiceImpl.java
@@ -2,6 +2,7 @@
import java.util.List;
+import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
@@ -119,15 +120,21 @@
*
* @param ardDispatchPolice 娲捐绠$悊瀵硅薄
*/
+ /**
+ * 鏂板娲捐鍏宠仈鐢ㄦ埛淇℃伅
+ *
+ * @param ardDispatchPolice 娲捐绠$悊瀵硅薄
+ */
public void insertArdDispatchPoliceUser(ArdDispatchPolice ardDispatchPolice) {
- List<String> ardDispatchPoliceUserList = ardDispatchPolice.getArdDispatchPoliceUserList();
+ List<SysUser> sysUserList = ardDispatchPolice.getSysUserList();
String id = ardDispatchPolice.getId();
- if (StringUtils.isNotNull(ardDispatchPoliceUserList)) {
+ if (StringUtils.isNotNull(sysUserList)) {
List<ArdDispatchPoliceUser> list = new ArrayList<ArdDispatchPoliceUser>();
- for (String userId : ardDispatchPoliceUserList) {
+ for (SysUser user :sysUserList)
+ {
ArdDispatchPoliceUser ardDispatchPoliceUser=new ArdDispatchPoliceUser();
- ardDispatchPoliceUser.setUserId(userId);
ardDispatchPoliceUser.setDispatchId(id);
+ ardDispatchPoliceUser.setUserId(user.getUserId());
list.add(ardDispatchPoliceUser);
}
if (list.size() > 0) {
diff --git a/ard-work/src/main/java/com/ruoyi/test/ReadAccessDatabase.java b/ard-work/src/main/java/com/ruoyi/test/ReadAccessDatabase.java
index 2d48af9..4a93637 100644
--- a/ard-work/src/main/java/com/ruoyi/test/ReadAccessDatabase.java
+++ b/ard-work/src/main/java/com/ruoyi/test/ReadAccessDatabase.java
@@ -10,6 +10,8 @@
import com.ruoyi.common.utils.ConfigUtils;
import com.ruoyi.common.utils.DictUtils;
+import com.ruoyi.common.utils.file.ImageUtils;
+import com.sun.imageio.plugins.common.ImageUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@@ -25,6 +27,7 @@
public class ReadAccessDatabase {
public static void main(String[] args) {
+
// 澶氫釜鏁版嵁搴撴枃浠惰矾寰�
String[] dbPaths = {
"D:\\Workspaces\\ard\\瀹夌憺杈惧伐浣滆祫鏂橽\mdb\\閬撹矾涓績绾�.mdb"
diff --git a/ard-work/src/main/java/com/ruoyi/utils/websocket/util/WebSocketUtils.java b/ard-work/src/main/java/com/ruoyi/utils/websocket/util/WebSocketUtils.java
index 7fc9943..5a2b3e6 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/websocket/util/WebSocketUtils.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/websocket/util/WebSocketUtils.java
@@ -13,7 +13,7 @@
/**
* @ClassName WebSocketUtils
- * @Description:
+ * @Description: websocket宸ュ叿绫�
* @Author 鍒樿嫃涔�
* @Date 2023/1/27 7:46
* @Version 1.0
diff --git a/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml b/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml
index 7056376..90d8a53 100644
--- a/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml
+++ b/ard-work/src/main/resources/mapper/dispatch/ArdDispatchPoliceMapper.xml
@@ -7,6 +7,7 @@
<resultMap type="ArdDispatchPolice" id="ArdDispatchPoliceResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
+ <result property="text" column="text"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<result property="deptId" column="dept_id"/>
@@ -15,38 +16,39 @@
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
- <!-- 瀛愭煡璇紝鍏宠仈 ard_dispatch_police_user 琛� -->
- <collection property="ardDispatchPoliceUserList" ofType="java.lang.String" select="getUserIdsByMainTableId"
- column="id"/>
- </resultMap>
- <select id="getUserIdsByMainTableId" resultType="java.lang.String">
- SELECT user_id
- FROM ard_dispatch_police_user
- WHERE dispatch_id = #{id}
- </select>
- <resultMap id="ArdDispatchPoliceArdDispatchPoliceUserResult" type="ArdDispatchPolice"
- extends="ArdDispatchPoliceResult">
- <collection property="ardDispatchPoliceUserList" notNullColumn="sub_dispatch_id" javaType="java.util.List"
- resultMap="ArdDispatchPoliceUserResult"/>
+ <collection property="sysUserList" javaType="java.util.List" resultMap="SysUserListResult"/>
</resultMap>
- <resultMap type="ArdDispatchPoliceUser" id="ArdDispatchPoliceUserResult">
- <result property="dispatchId" column="sub_dispatch_id"/>
+ <resultMap id="ArdDispatchPoliceArdDispatchPoliceUserResult" type="ArdDispatchPolice"
+ extends="ArdDispatchPoliceResult">
+ <collection property="sysUserList" notNullColumn="sub_dispatch_id" javaType="java.util.List"
+ resultMap="SysUserListResult"/>
+ </resultMap>
+
+ <resultMap type="SysUser" id="SysUserListResult">
<result property="userId" column="sub_user_id"/>
+ <result property="nickName" column="sub_nick_name"/>
+ <result property="deptId" column="sub_dept_id"/>
</resultMap>
<sql id="selectArdDispatchPoliceVo">
- SELECT ID,
- NAME,
- longitude,
- latitude,
- dept_id,
- user_id,
- create_by,
- create_time,
- update_by,
- update_time
- FROM ard_dispatch_police
+ SELECT adp.ID,
+ adp.NAME,
+ adp.text,
+ adp.longitude,
+ adp.latitude,
+ adp.dept_id,
+ adp.user_id,
+ adp.create_by,
+ adp.create_time,
+ adp.update_by,
+ adp.update_time,
+ u.user_id as sub_user_id,
+ u.nick_name as sub_nick_name,
+ u.dept_id as sub_dept_id
+ FROM ard_dispatch_police adp
+ left join ard_dispatch_police_user b on b.dispatch_id = adp.id
+ left join sys_user u on b.user_id = u.user_id
</sql>
<select id="selectArdDispatchPoliceList" parameterType="ArdDispatchPolice" resultMap="ArdDispatchPoliceResult">
@@ -64,6 +66,7 @@
resultMap="ArdDispatchPoliceArdDispatchPoliceUserResult">
select a.id,
a.name,
+ a.text,
a.longitude,
a.latitude,
a.dept_id,
@@ -72,8 +75,9 @@
a.create_time,
a.update_by,
a.update_time,
- b.dispatch_id as sub_dispatch_id,
- b.user_id as sub_user_id
+ b.user_id as sub_user_id,
+ b.nick_name as sub_nick_name,
+ b.dept_id as sub_dept_id
from ard_dispatch_police a
left join ard_dispatch_police_user b on b.dispatch_id = a.id
where a.id = #{id}
@@ -84,6 +88,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null">name,</if>
+ <if test="text != null">text,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="deptId != null">dept_id,</if>
@@ -96,6 +101,7 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
+ <if test="text != null">#{text},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="deptId != null">#{deptId},</if>
@@ -111,6 +117,7 @@
update ard_dispatch_police
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
+ <if test="text != null">text = #{text},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/authorize/AuthorizationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/authorize/AuthorizationController.java
index 41f593f..d2a8e8e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/authorize/AuthorizationController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/authorize/AuthorizationController.java
@@ -18,11 +18,11 @@
@Resource
AuthorizeService authorizeService;
//鐢熸垚涓存椂鎺堟潈鍙湁涓�澶�
-// @PostMapping("/makeTempLicense")
-// public JSONObject makeTempLicense() {
-// JSONObject jsonObject = authorizeService.makeTempLicense();
-// return jsonObject;
-// }
+ @PostMapping("/makeTempLicense")
+ public JSONObject makeTempLicense() {
+ JSONObject jsonObject = authorizeService.makeTempLicense();
+ return jsonObject;
+ }
//鑾峰彇鏈哄櫒鐮�
@ApiOperation("鑾峰彇鏈哄櫒鐮�")
@PostMapping("/getMachineCode")
@@ -45,16 +45,16 @@
return data;
}
- //鑾峰彇鎺堟潈
+ //鍔犲瘑
@PostMapping(value = "/getLicense")
public String getLicense(@RequestBody String data) {
- String EncryptedStr = authorizeService.getLicense(data);
+ String EncryptedStr = authorizeService.encryption(data);
return EncryptedStr;
}
- //瑙f瀽鎺堟潈
+ //瑙e瘑
@PostMapping(value = "/parsLicense")
public String parsLicense(@RequestBody String data) {
- String DecryptStr = authorizeService.parsLicense(data);
+ String DecryptStr = authorizeService.decryption(data);
return DecryptStr;
}
}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
index f968f1a..7b654af 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
@@ -16,6 +16,8 @@
public static final String IMAGE_BMP = "image/bmp";
public static final String IMAGE_GIF = "image/gif";
+
+ public static final String Video_MP4 = "video/mp4";
public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java
index 63b03da..6529aa8 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java
@@ -5,6 +5,7 @@
import java.util.List;
import java.util.Properties;
import com.ruoyi.common.utils.Arith;
+import com.ruoyi.common.utils.file.ImageUtils;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.web.domain.server.Cpu;
import com.ruoyi.framework.web.domain.server.Jvm;
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RongCloudTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RongCloudTask.java
index ded475e..a009f10 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RongCloudTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RongCloudTask.java
@@ -28,24 +28,23 @@
ISysUserService sysUserService;
@Resource
RongCloudService rongCloudService;
+
/**
* 瀹氭椂鑾峰彇app鐢ㄦ埛鍦ㄧ嚎鐘舵��
* 鍒樿嫃涔�
* 2023/8/9 9:17:48
*/
public void getAppUserOnlineStateTask() {
-
try {
List<SysUser> SysUserList = sysUserService.selectAllAppUserList(new SysUser());
if (SysUserList.size() > 0) {
for (SysUser sysUser : SysUserList) {
+ Boolean appOnlineState = sysUser.getAppOnlineState().equals("1");
Boolean online = rongCloudService.checkOnline(sysUser.getUserId());
- if (online) {
- sysUser.setAppOnlineState("1");
- } else {
- sysUser.setAppOnlineState("0");
+ if (!appOnlineState.equals(online)) {
+ sysUser.setAppOnlineState(online ? "1" : "0");
+ sysUserService.updateUserProfile(sysUser);
}
- sysUserService.updateUserProfile(sysUser);
}
}
} catch (Exception ex) {
diff --git a/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeService.java b/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeService.java
index 54c2347..024174b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeService.java
@@ -10,6 +10,6 @@
JSONObject getMachineCode();//鑾峰彇鏈哄櫒鐮�
JSONObject uploadLicense(MultipartFile file);//涓婁紶鎺堟潈鏂囦欢
- String getLicense(String data);//鍔犲瘑
- String parsLicense(String data);//瑙e瘑
+ String encryption(String data);//鍔犲瘑
+ String decryption(String data);//瑙e瘑
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeServiceImpl.java
index ace1807..653aa26 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/authorize/service/AuthorizeServiceImpl.java
@@ -95,6 +95,11 @@
return null;
}
+ /**
+ * 楠岃瘉鎺堟潈
+ *
+ * @return JSONObject
+ */
@Override
public JSONObject verifyAuthorization() {
try {
@@ -145,6 +150,11 @@
}
}
+ /**
+ * 鍒朵綔涓存椂鎺堟潈
+ *
+ * @return JSONObject
+ */
@Override
public JSONObject makeTempLicense() {
String savedDir = System.getProperty("user.dir") + "\\ardLicense";
@@ -155,6 +165,11 @@
return data;
}
+ /**
+ * 鑾峰彇鏈哄櫒鐮�
+ *
+ * @return JSONObject
+ */
@Override
public JSONObject getMachineCode() {
try {
@@ -171,6 +186,11 @@
}
}
+ /**
+ * 涓婁紶鎺堟潈鏂囦欢
+ *
+ * @return JSONObject
+ */
@Override
public JSONObject uploadLicense(MultipartFile file) {
try {
@@ -196,8 +216,13 @@
}
}
+ /**
+ * 鍔犲瘑鎺堟潈鏁版嵁
+ *
+ * @return JSONObject
+ */
@Override
- public String getLicense(String data) {
+ public String encryption(String data) {
String codeString = "";
try {
if (data != "") {
@@ -216,8 +241,13 @@
}
}
+ /**
+ * 瑙e瘑鎺堟潈鏁版嵁
+ *
+ * @return JSONObject
+ */
@Override
- public String parsLicense(String data) {
+ public String decryption(String data) {
String codeString = "";
try {
if (data != "") {
--
Gitblit v1.9.3