diff --git a/pom.xml b/pom.xml
index 49455f2..3558a4b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,6 +25,7 @@
fastjson
1.2.72
+
com.baomidou
mybatis-plus-boot-starter
@@ -41,6 +42,11 @@
lombok
true
+
+ com.google.guava
+ guava
+ 21.0
+
org.springframework.boot
spring-boot-starter-test
diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java
index 5816014..41ed5bf 100644
--- a/src/main/java/com/hisense/monitormanage/controller/Controller.java
+++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java
@@ -6,11 +6,14 @@ import com.hisense.monitormanage.dto.ScenicCameraDto;
import com.hisense.monitormanage.entity.*;
import com.hisense.monitormanage.mapper.*;
import com.hisense.monitormanage.service.MonitorService;
+import com.hisense.monitormanage.service.SedimentTrailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import java.lang.reflect.Method;
import java.time.Clock;
import java.time.LocalDateTime;
import java.util.HashMap;
@@ -33,6 +36,9 @@ public class Controller {
@Autowired
private MonitorService monitorService;
+ @Autowired
+ private SedimentTrailService sedimentTrailService;
+
@Autowired
private CameraChannelMapper cameraChannelMapper;
@@ -213,58 +219,6 @@ public class Controller {
return monitorService.suggest(map);
}
- //根据用户已输入的文字请求匹配的地址信息
- //singleLine:用户输入的文字性地名地址信息,必填
- //maxSuggestions:最大建议数量,0~10,默认2
- //magicKey:地名地址唯一ID,Suggest操作返回的JSON数组中包含的magicKey
- //outSR:坐标系信息,包含"wkid"属性,是表示空间参考的ID,示例:{ "wkid":4490 }
- @RequestMapping("geocode")
- public Result geocode(
- @RequestParam(value="singleLine") String singleLine,
- @RequestParam(value = "maxSuggestions",required = false,defaultValue = "2") Integer maxSuggestions,
- @RequestParam(value = "magicKey",required = false,defaultValue = "") String magicKey,
- @RequestParam(value = "outSR",required = false,defaultValue = "") String outSR
- ){
- Map map = new HashMap<>();
- map.put("SingleLine",singleLine);
- map.put("maxSuggestions",maxSuggestions);
- map.put("magicKey",magicKey);
- map.put("outSR",outSR);
- return monitorService.geocode(map);
- }
-
- //根据用户已输入的坐标请求附近的地址信息
- //location:坐标,必填,请注意编码,示例:{"x":120.40632244540544,"y":36.08136665300961,"spatialReference":{"wkid":4490,"latestWkid":4490}}
- @RequestMapping("reverseGeocode")
- public Result reverseGeocode(
- @RequestParam(value="location") String location
- ){
- Map map = new HashMap<>();
- map.put("location",location);
- return monitorService.reverseGeocode(map);
- }
-
- //查询视频点播巡检结果,只取异常的
- @RequestMapping("listChannelPlayStates")
- public Result listChannelPlayStates(
- @RequestParam(value="page",required = false,defaultValue = "1") Integer page,
- @RequestParam(value="pageSize",required = false,defaultValue = "20") String pageSize
- ){
- Map condition = new HashMap<>();
- LocalDateTime localDateTime = LocalDateTime.now(Clock.systemUTC());
-
- LocalDateTime startTime = localDateTime.minusDays(7);
- condition.put("checkStatus",0);
- condition.put("startTime",startTime.toString());
- condition.put("endTime",localDateTime.toString());
-
- Map map = new HashMap<>();
- map.put("condition",condition);
- map.put("page",page);
- map.put("pageSize",pageSize);
- monitorService.listChannelPlayStates(map);
- return null;
- }
//道路统计数据与排名
@RequestMapping("roadData")
@@ -313,7 +267,23 @@ public class Controller {
return monitorService.resCatalogApplyHJWSRoad();
}
+ //获取渣土车轨迹并保存到t_trail_sediment
+ @RequestMapping(value = "saveResCatalogApplyZTYS")
+ public boolean resCatalogApplyZTYS(){
+ return sedimentTrailService.batchSaveSedimentTrail();
+ }
-
+ //根据输入的经纬度和查询的半径(米)时间查询范围内的渣土车轨迹信息
+ @RequestMapping(value = "listSedimentTrailByPoints")
+ public List listSedimentTrailByPoints(
+ @RequestParam(value="longitude") double longitude,
+ @RequestParam(value="latitude") double latitude,
+ @RequestParam(value="raidus") Integer raidus,
+ @RequestParam(value="start") String start,
+ @RequestParam(value = "end") String end
+ ){
+ System.out.println("listSedimentTrailByPoints......");
+ return sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end);
+ }
}
diff --git a/src/main/java/com/hisense/monitormanage/entity/SedimentTrail.java b/src/main/java/com/hisense/monitormanage/entity/SedimentTrail.java
new file mode 100644
index 0000000..ba6474f
--- /dev/null
+++ b/src/main/java/com/hisense/monitormanage/entity/SedimentTrail.java
@@ -0,0 +1,41 @@
+package com.hisense.monitormanage.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author admin
+ * @version 1.0.0
+ * @ClassName SedimentTrail.java
+ * @Description 渣土车轨迹
+ * @createTime 2022年05月09日 13:47:00
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("t_trail_sediment")
+public class SedimentTrail{
+ @TableId
+ private Integer id;
+ private double speed;
+ private String simCardNum;
+ private LocalDateTime uploadtime;
+ private double coordinateX;
+ private double coordinateY;
+ private double longitude;
+ private double latitude;
+ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+ private LocalDateTime recordTime;
+ private double angle;
+ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+ private LocalDateTime updateTime;
+ private String status;
+ private double fuel;
+}
diff --git a/src/main/java/com/hisense/monitormanage/mapper/SedimentTrailMapper.java b/src/main/java/com/hisense/monitormanage/mapper/SedimentTrailMapper.java
new file mode 100644
index 0000000..4ad2e8f
--- /dev/null
+++ b/src/main/java/com/hisense/monitormanage/mapper/SedimentTrailMapper.java
@@ -0,0 +1,18 @@
+package com.hisense.monitormanage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hisense.monitormanage.entity.SedimentTrail;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author admin
+ * @version 1.0.0
+ * @ClassName sedimentTrailMapper.java
+ * @Description TODO
+ * @createTime 2022年05月09日 13:59:00
+ */
+public interface SedimentTrailMapper extends BaseMapper {
+ public void batchaSave(List