From 8ad9561f36bda4ccc8a3547d9157af706397c136 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期二, 24 十月 2023 16:29:17 +0800
Subject: [PATCH] 清淤接口
---
ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java | 12 +++
ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java | 13 +++
ard-work/src/main/java/com/ruoyi/sy/domain/ArdWallWarming.java | 13 +++
ard-work/src/main/java/com/ruoyi/sy/mapper/ArdAccessNumMapper.java | 10 ++
ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java | 29 +++++--
ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java | 104 +++++++++++++++----------
ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java | 26 ++++++
ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java | 4
8 files changed, 160 insertions(+), 51 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java b/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java
index 2e34462..af41116 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/controller/OilWallController.java
@@ -3,15 +3,10 @@
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.common.utils.uuid.UUID;
-import com.ruoyi.sy.domain.ArdAccessFence;
-import com.ruoyi.sy.domain.ArdOilWall;
+import com.ruoyi.sy.domain.*;
+import com.ruoyi.sy.mapper.ArdAccessNumMapper;
import com.ruoyi.sy.param.OilWallParam;
-import com.ruoyi.sy.service.ArdAccessFenceService;
-import com.ruoyi.sy.service.ArdOilWallService;
-import com.ruoyi.sy.domain.ArdSyCar;
-import com.ruoyi.sy.domain.ArdSyUser;
-import com.ruoyi.sy.service.IArdSyCarService;
-import com.ruoyi.sy.service.IArdSyUserService;
+import com.ruoyi.sy.service.*;
import com.ruoyi.sy.service.impl.ArdAccessFenceServiceImpl;
import com.ruoyi.sy.service.impl.ArdOilWallServiceImpl;
import com.ruoyi.system.service.ISysConfigService;
@@ -49,6 +44,9 @@
@Autowired
private ArdAccessFenceService ardAccessFenceService;
+
+ @Autowired
+ private ArdAccessNumService ardAccessNumService;
@PostMapping("/add")
@ApiOperation("娣诲姞鐢靛瓙鍥存爮")
@@ -108,6 +106,21 @@
return Results.succeed(ardAccessFenceService.all());
}
+ @GetMapping("/rollTime")
+ @ApiOperation("鏌ヨ鏃堕棿姝ラ暱")
+ public Results rollTime(){
+ return Results.succeed(ardAccessNumService.queryNum());
+ }
+ @GetMapping("/updTime")
+ @ApiOperation("淇濆瓨鏃堕棿姝ラ暱")
+ public Results updTime(@RequestBody ArdAccessNum ardAccessNum){
+ return Results.succeed(ardAccessNumService.add(ardAccessNum));
+ }
+// @GetMapping("/addCar")
+// @ApiOperation("鎵嬪姩娣诲姞杞﹁締")
+// public Results addCar(@RequestBody ArdAccessNum ardAccessNum){
+// return Results.succeed();
+// }
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java
index 6f0e30a..bb14e25 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessFence.java
@@ -14,8 +14,10 @@
private String deptName;
private String lng;
private String lat;
- private String intoShipment;
+ private String intoShipmentId;
private String intoShipmentTime;
private String intoUnloadId;
private String intoUnloadTime;
+ private String outShipmentId;
+ private String outShipmentTime;
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java
new file mode 100644
index 0000000..71d8a81
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdAccessNum.java
@@ -0,0 +1,13 @@
+package com.ruoyi.sy.domain;
+
+import lombok.Data;
+
+/**
+ * @author Administrator
+ */
+@Data
+public class ArdAccessNum {
+ private String id;
+ private String name;
+ private String num;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/domain/ArdWallWarming.java b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdWallWarming.java
new file mode 100644
index 0000000..957dbe9
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/sy/domain/ArdWallWarming.java
@@ -0,0 +1,13 @@
+package com.ruoyi.sy.domain;
+
+import lombok.Data;
+
+@Data
+public class ArdWallWarming {
+ private String id;
+ private String accessId;
+ private String lng;
+ private String lat;
+ private String time;
+ private String sustain;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
index 04f03c5..7fd9962 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
@@ -86,13 +86,6 @@
String time = (String) gpsMap.get("result");//瀹氫綅鏃堕棿
String deptNum = (String) result.get("deptId");//鑾峰彇閮ㄩ棬ID
String deptName = (String) result.get("deptName");//鑾峰彇閮ㄩ棬鍚嶇О
-// String carId = "13";
-// String lng = "124.74695492384757";
-// String lat = "46.09510768522894";
-// String carName = "榛慐21397";//鑾峰彇杞︾墝鍙�
-// String time = "20231019161815";//瀹氫綅鏃堕棿
-// String deptNum = "100";//鑾峰彇閮ㄩ棬ID
-// String deptName = "鍘傜骇";//鑾峰彇閮ㄩ棬鍚嶇О
//瀹氫箟2缁寸┖闂�
Point2D.Double point = new Point2D.Double(Double.parseDouble(lng), Double.parseDouble(lat));
List<Point2D.Double> pts = new ArrayList<Point2D.Double>();
@@ -100,7 +93,7 @@
ArdAccessFence ardAccessFence = ((ArdAccessFenceServiceImpl)SpringUtils.getBean("ArdAccessFenceServiceImpl")).queryAccess(carId);
//濡傛灉娌℃湁璇存槑杞﹁締鏈繘鍏ヨ娌圭偣锛岄渶瑕佸尮閰嶆墍鏈夎娌圭偣鍥存爮
if(ardAccessFence==null){
- //鍖归厤鍏ㄩ儴瑁呮补鐐瑰洿鏍�
+ //杞﹁締鏈繘鍏ヨ娌圭偣
List<ArdOilWall> ardOilWalls = ((ArdOilWallServiceImpl)SpringUtils.getBean("ArdOilWallServiceImpl")).accessAll();
for (int i = 0; i < ardOilWalls.size(); i++) {
pts.clear();
@@ -110,14 +103,14 @@
pts.add(new Point2D.Double(Double.parseDouble(coord[j]), Double.parseDouble(coord[j+1])));
}
if(GeoTools.IsPtInPoly(point, pts)){
- //杩涘叆浜嗗洿鏍忓叆搴�
+ //杩涘叆瑁呮补鐐瑰叆搴�
ArdAccessFence ardAccessFence1 = new ArdAccessFence();
ardAccessFence1.setId(String.valueOf(UUID.randomUUID()));
ardAccessFence1.setCarId(carId);
ardAccessFence1.setCarName(carName);
ardAccessFence1.setDeptId(deptNum);
ardAccessFence1.setDeptName(deptName);
- ardAccessFence1.setIntoShipment("杩涘叆瑁呮补鐐�");
+ ardAccessFence1.setIntoShipmentId(ardOilWall.getId());
ardAccessFence1.setIntoShipmentTime(time);
ardAccessFence1.setLng(lng);
ardAccessFence1.setLat(lat);
@@ -126,47 +119,74 @@
}
}
}else {
- String unload = ardAccessFence.getIntoUnloadId();
- //濡傛灉unload涓虹┖锛屽垽鏂槸鍚﹁繘鍏ュ嵏娌圭偣
- if(unload==null){
- //鏌ヨ鍏ㄩ儴鍗告补鐐�
- List<ArdOilWall> ardOilWalls = ((ArdOilWallServiceImpl) SpringUtils.getBean("ArdOilWallServiceImpl")).uploadAll();
- for (int i = 0; i < ardOilWalls.size(); i++) {
- pts.clear();
- ArdOilWall ardOilWall = ardOilWalls.get(i);
- String[] coord = ardOilWall.getCoord().split(",");
- for (int j = 0; j < coord.length; j = j + 3) {
- pts.add(new Point2D.Double(Double.parseDouble(coord[j]), Double.parseDouble(coord[j + 1])));
- }
- if (GeoTools.IsPtInPoly(point, pts)) {
- //杩涘叆鍗告补鐐�,瀛樺叆鍗告补鐐瑰洿鏍廔D
- ardAccessFence.setIntoUnloadId(ardOilWall.getId());
- ardAccessFence.setIntoUnloadTime(time);
- break;
- }
- }
- ardAccessFence.setLng(lng);
- ardAccessFence.setLat(lat);
- ((ArdAccessFenceServiceImpl)SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence);
- }else {
- //濡傛灉unload鏈夊�硷紝鍒欑户缁垽鏂槸鍚﹀嚭浜嗗嵏娌圭偣锛屽尮閰嶅嵏娌圭偣鐨勫敮涓�ID
- ArdOilWall ardOilWall = ((ArdOilWallServiceImpl) SpringUtils.getBean("ArdOilWallServiceImpl")).one(unload);
+ String out = ardAccessFence.getOutShipmentId();
+ if(out == null){
+ //杞﹁締鏈紑鍑鸿娌圭偣
+ String into = ardAccessFence.getIntoShipmentId();
+ ArdOilWall ardOilWall = ((ArdOilWallServiceImpl) SpringUtils.getBean("ArdOilWallServiceImpl")).one(into);
pts.clear();
String[] coord = ardOilWall.getCoord().split(",");
for (int j = 0; j < coord.length; j = j + 3) {
pts.add(new Point2D.Double(Double.parseDouble(coord[j]), Double.parseDouble(coord[j + 1])));
}
if (!GeoTools.IsPtInPoly(point, pts)) {
- //寮�鍑轰簡鍗告补鐐瑰洿鏍忥紝鍒犻櫎璇ユ潯杞﹁締鏁版嵁
- ((ArdAccessFenceServiceImpl) SpringUtils.getBean("ArdAccessFenceServiceImpl")).delAccess(carId);
+ //杞﹁締寮�鍑鸿娌圭偣
+ ardAccessFence.setOutShipmentId(into);
+ ardAccessFence.setOutShipmentTime(time);
+ }
+ ardAccessFence.setLng(lng);
+ ardAccessFence.setLat(lat);
+ ((ArdAccessFenceServiceImpl)SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence);
+ }else {
+ //杞﹁締宸茬粡寮�鍑鸿娌圭偣锛屽垽鏂槸鍚﹁繘鍏ュ嵏娌圭偣
+ String unload = ardAccessFence.getIntoUnloadId();
+ //濡傛灉unload涓虹┖锛屽垽鏂槸鍚﹁繘鍏ュ嵏娌圭偣
+ if (unload == null) {
+ //杞﹁締鏈繘鍏ュ嵏娌圭偣
+ List<ArdOilWall> ardOilWalls = ((ArdOilWallServiceImpl) SpringUtils.getBean("ArdOilWallServiceImpl")).uploadAll();
+ //鏄惁鍦ㄨ矾涓�
+ Boolean isRoad = true;
+ for (int i = 0; i < ardOilWalls.size(); i++) {
+ pts.clear();
+ ArdOilWall ardOilWall = ardOilWalls.get(i);
+ String[] coord = ardOilWall.getCoord().split(",");
+ for (int j = 0; j < coord.length; j = j + 3) {
+ pts.add(new Point2D.Double(Double.parseDouble(coord[j]), Double.parseDouble(coord[j + 1])));
+ }
+ if (GeoTools.IsPtInPoly(point, pts)) {
+ //杩涘叆鍗告补鐐�,瀛樺叆鍗告补鐐瑰洿鏍廔D
+ ardAccessFence.setIntoUnloadId(ardOilWall.getId());
+ ardAccessFence.setIntoUnloadTime(time);
+ ardAccessFence.setLng(lng);
+ ardAccessFence.setLat(lat);
+ ((ArdAccessFenceServiceImpl) SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence);
+ //宸茬粡杩涘叆鍗告补鐐癸紝涓嶅湪璺笂涓嶉渶瑕佸仠杞︽姤璀�
+ isRoad = false;
+ break;
+ }
+ }
+ if(isRoad){
+ //濡傛灉鍦ㄨ矾涓婇渶瑕佽褰曟瘡娆″潗鏍囦笌涓婃鏄惁鐩稿悓锛屽鏋滀竴鏍锋洿鏂板仠鐣欐椂闂�
+ }
}else {
- //鏈紑鍑哄嵏娌圭偣锛屾洿鏂扮粡绾害淇濆瓨
- ardAccessFence.setLng(lng);
- ardAccessFence.setLat(lat);
- ((ArdAccessFenceServiceImpl)SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence);
+ //杞﹁締宸茬粡杩涘叆鍗告补鐐癸紝鍒ゆ柇鏄惁宸茬粡寮�鍑哄嵏娌圭偣
+ ArdOilWall ardOilWall = ((ArdOilWallServiceImpl) SpringUtils.getBean("ArdOilWallServiceImpl")).one(unload);
+ pts.clear();
+ String[] coord = ardOilWall.getCoord().split(",");
+ for (int j = 0; j < coord.length; j = j + 3) {
+ pts.add(new Point2D.Double(Double.parseDouble(coord[j]), Double.parseDouble(coord[j + 1])));
+ }
+ if (!GeoTools.IsPtInPoly(point, pts)) {
+ //寮�鍑轰簡鍗告补鐐瑰洿鏍忥紝鍒犻櫎璇ユ潯杞﹁締鏁版嵁
+ ((ArdAccessFenceServiceImpl) SpringUtils.getBean("ArdAccessFenceServiceImpl")).delAccess(carId);
+ }else {
+ //鏈紑鍑哄嵏娌圭偣锛屾洿鏂扮粡绾害淇濆瓨
+ ardAccessFence.setLng(lng);
+ ardAccessFence.setLat(lat);
+ ((ArdAccessFenceServiceImpl)SpringUtils.getBean("ArdAccessFenceServiceImpl")).updAccess(ardAccessFence);
+ }
}
}
-
}
//娓呮筏鍏ユ爮缁撴潫------------
diff --git a/ard-work/src/main/java/com/ruoyi/sy/mapper/ArdAccessNumMapper.java b/ard-work/src/main/java/com/ruoyi/sy/mapper/ArdAccessNumMapper.java
new file mode 100644
index 0000000..6633f15
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/sy/mapper/ArdAccessNumMapper.java
@@ -0,0 +1,10 @@
+package com.ruoyi.sy.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.sy.domain.ArdAccessNum;
+
+/**
+ * @author Administrator
+ */
+public interface ArdAccessNumMapper extends BaseMapper<ArdAccessNum> {
+}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java b/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java
new file mode 100644
index 0000000..316b89f
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/ArdAccessNumService.java
@@ -0,0 +1,12 @@
+package com.ruoyi.sy.service;
+
+import com.ruoyi.sy.domain.ArdAccessNum;
+
+import java.util.List;
+
+public interface ArdAccessNumService {
+
+ List<ArdAccessNum> queryNum();
+
+ int add(ArdAccessNum ardAccessNum);
+}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java
new file mode 100644
index 0000000..d799a92
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/sy/service/impl/ArdAccessNumServiceImpl.java
@@ -0,0 +1,26 @@
+package com.ruoyi.sy.service.impl;
+
+import com.ruoyi.sy.domain.ArdAccessNum;
+import com.ruoyi.sy.mapper.ArdAccessNumMapper;
+import com.ruoyi.sy.service.ArdAccessNumService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ArdAccessNumServiceImpl implements ArdAccessNumService {
+
+ @Autowired
+ private ArdAccessNumMapper ardAccessNumMapper;
+
+ @Override
+ public List<ArdAccessNum> queryNum() {
+ return ardAccessNumMapper.selectList(null);
+ }
+
+ @Override
+ public int add(ArdAccessNum ardAccessNum) {
+ return ardAccessNumMapper.insert(ardAccessNum);
+ }
+}
--
Gitblit v1.9.3