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/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java | 34 +++++++++++++++-------------------
1 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
index 83789ea..6cd7616 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdSyCarServiceImpl.java
@@ -17,25 +17,22 @@
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
-import com.ruoyi.utils.tools.Point;
+import com.ruoyi.utils.gis.GisUtil;
+import com.ruoyi.utils.gis.Point;
import com.ruoyi.scheduling.domian.SchedulingParam;
import com.ruoyi.sy.domain.ArdSyCarDay;
import com.ruoyi.sy.mapper.ArdSyCarDayMapper;
-import com.ruoyi.utils.tools.GisTool;
+import com.ruoyi.utils.minio.MinioUtil;
import com.ruoyi.utils.websocket.util.WebSocketUtils;
-import com.ruoyi.storage.minio.utils.MinioConfig;
-import com.ruoyi.storage.minio.utils.MinioUtils;
import com.ruoyi.sy.domain.ArdSyUser;
import com.ruoyi.sy.gps31.PositionContainer;
import com.ruoyi.sy.mapper.ArdSyUserMapper;
-import com.ruoyi.system.domain.SysConfig;
+import com.ruoyi.common.core.domain.entity.SysConfig;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.utils.forest.SYClient;
import com.ruoyi.utils.result.Results;
import io.minio.GetPresignedObjectUrlArgs;
-import io.minio.ListObjectsArgs;
-import io.minio.PutObjectArgs;
import io.minio.Result;
import io.minio.http.Method;
import io.minio.messages.Item;
@@ -82,8 +79,7 @@
RedisCache redisCache;
@Resource
private ArdSyCarDayMapper ardSyCarDayMapper;
- @Resource
- private MinioUtils minioUtil;
+
private Map<Integer, Map<String, String>> logInMap = new HashMap();
private Map<String, Timer> userCarTimerMap = new HashMap();
@@ -147,7 +143,7 @@
objectNames.add(ardSyCar.getCarPicture().split("/sycar/")[1]);
}
}
- minioUtil.removeObjects("sycar", objectNames);
+ MinioUtil.removeObjects("sycar", objectNames);
return ardSyCarMapper.deleteArdSyCarByIds(ids);
}
@@ -264,12 +260,12 @@
@Override
public List<Map<String, String>> getAllCarModel() {
- boolean exsit = minioUtil.exitsBucket("sycar");
+ boolean exsit = MinioUtil.exitsBucket("sycar");
if (exsit) {
List<Map<String, String>> listObjetcName = new ArrayList<>();
try {
// ListObjectsArgs listObjectsArgs = ListObjectsArgs.builder().prefix("carmodel/").bucket("sycar").build();
- Iterable<Result<Item>> myObjects = minioUtil.getObjectsByBucket("sycar","carmodel");
+ Iterable<Result<Item>> myObjects = MinioUtil.getObjectsByBucket("sycar","carmodel");
for (Result<Item> result : myObjects) {
Item item = result.get();
Map<String, String> map = new HashMap();
@@ -332,16 +328,16 @@
if (ardSyCarr.getCarPicture() != null || !ardSyCarr.getCarPicture().equals("")) {
String objectName = ardSyCarr.getCarPicture().split("/sycar/")[1];
objectNames.add(objectName);
- minioUtil.removeObjects("sycar", objectNames);
+ MinioUtil.removeObjects("sycar", objectNames);
}
}
//鍒ゆ柇鏂囦欢鏄惁涓虹┖
if (null == carPicture || 0 == carPicture.getSize()) {
return "";
}
- boolean exsit = minioUtil.exitsBucket("sycar");
+ boolean exsit = MinioUtil.exitsBucket("sycar");
if (!exsit) {
- boolean bucket = minioUtil.createBucket("sycar");
+ boolean bucket = MinioUtil.createBucket("sycar");
}
//鏂囦欢鍚�
String originalFilename = carPicture.getOriginalFilename();
@@ -358,7 +354,7 @@
// .contentType(carPicture.getContentType())
// .build();
// MinioConfig.getMinioClient().putObject(putObjectArgs);
- minioUtil.uploadObject("sycar",fileName,inputStream,carPicture.getSize(),carPicture.getContentType());
+ MinioUtil.uploadObject("sycar",fileName,inputStream,carPicture.getSize(),carPicture.getContentType());
inputStream.close();
/*鑾峰彇url*/
GetPresignedObjectUrlArgs getPresignedObjectUrlArgs = GetPresignedObjectUrlArgs
@@ -368,7 +364,7 @@
.method(Method.GET)
.build();
//String presignedObjectUrl = MinioConfig.getMinioClient().getPresignedObjectUrl(getPresignedObjectUrlArgs);
- String ObjectUrl = minioUtil.getBucketObjectUrl("sycar", fileName);
+ String ObjectUrl = MinioUtil.getBucketObjectUrl("sycar", fileName);
if (id != null && !id.equals("")) {//id涓洪潪蹇呰
ArdSyCar ardSyCar = new ArdSyCar();
ardSyCar.setId(id);
@@ -1086,7 +1082,7 @@
List<Map<String, Object>> carGPSMap = (List<Map<String, Object>>) carGPSTrack.get("list");
Double lng = Double.valueOf((String) carGPSMap.get(0).get("lng"));
Double lat = Double.valueOf((String) carGPSMap.get(0).get("lat"));
- double distance = GisTool.getDistance( new double[]{longitude,latitude}, new double[]{lng, lat});
+ double distance = GisUtil.getDistance( new double[]{longitude,latitude}, new double[]{lng, lat});
if (distance <= radius) {
carMap.put("longitude",lng);
carMap.put("latitude",lat);
@@ -1145,7 +1141,7 @@
Double lng = Double.valueOf((String) carGPSMap.get(0).get("lng"));
Double lat = Double.valueOf((String) carGPSMap.get(0).get("lat"));
Point point = new Point(lng,lat);
- boolean inPolygon = GisTool.isInPolygon(point, partitionLocation);
+ boolean inPolygon = GisUtil.isInPolygon(point, partitionLocation);
if (inPolygon) {
carMap.put("longitude", lng);
carMap.put("latitude", lat);
--
Gitblit v1.9.3