Commit 7e976f2b by YANGYANG

车辆徘徊 和 活动区域接口提交

parent eac80a6e
package com.founder.commonutils.carEntity;
/**
* Created by Founder on 2019/6/27.
* 轨迹疑似停留点实体表
*/
public class TrackYstldResultCountSort implements Comparable<TrackYstldResultCountSort>{
private String x;//经度
private String y;//纬度
private String tlsjStr;//停留时间差
private int tlsj;
private int count;//停留次数
private String address;//地址
private long kssj;//开始时间时间戳
public long getKssj() {
return kssj;
}
public void setKssj(long kssj) {
this.kssj = kssj;
}
public String getY() {
return y;
}
public void setY(String y) {
this.y = y;
}
public String getX() {
return x;
}
public void setX(String x) {
this.x = x;
}
public String getTlsjStr() {
return tlsjStr;
}
public void setTlsjStr(String tlsjStr) {
this.tlsjStr = tlsjStr;
}
public int getTlsj() {
return tlsj;
}
public void setTlsj(int tlsj) {
this.tlsj = tlsj;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public int compareTo(TrackYstldResultCountSort o) { //重写Comparable接口的compareTo方法,
return o.getCount()-this.getCount();// 根据次数降序排列,升序修改相减顺序即可
}
}
package com.founder.commonutils.util;
import com.founder.commonutils.carEntity.CarReceiving;
import com.founder.commonutils.peopleEntity.FaceSearchResult;
import java.text.DateFormat;
......@@ -55,6 +56,36 @@ public class DataUtil {
}
return lists;
}
//数据批量 方法
public static List<List<CarReceiving>> cpldata(List<CarReceiving> list, int limit) throws Exception {
long start = System.currentTimeMillis();
int size = list.size();
//特殊处理
if(limit==0){
limit=1;
}
long threadNum = size / limit;
int startnum = 0;
int endnum = 0;
List<List<CarReceiving>> lists = new ArrayList<>();
for (int i = 0; i < threadNum + 1; i++) {
startnum = i * limit;
endnum = ((i + 1) * limit);
if (startnum > list.size()) {
break;
}
if (endnum > list.size()) {
endnum = list.size();
}
if (startnum == endnum) {
break;
}
List<CarReceiving> pllist = list.subList(startnum, endnum); //从fromIndex(包含),到toIndex(不包含)
lists.add(pllist);
}
return lists;
}
/*public static List<List<CameraFaceResult>> plCameraFaceResult(List<CameraFaceResult> list, int limit) throws Exception {
long start = System.currentTimeMillis();
int size = list.size();
......
......@@ -61,6 +61,15 @@ public class CarController {
return result;
}
//区域徘徊 -结果展示(徘徊次数3次以上)
@OperLog(message = "车辆徘徊接口",operation = OperationType.QUERY)
@ApiOperation(value = "车辆徘徊接口")
@PostMapping("/carOneAreaInfoTrampResultThread")
public MapRestResult carOneAreaInfoTrampResultThread (@RequestBody AreaInfo areaInfo) throws Exception {
MapRestResult xzxtRestResult=carService.OneAreaInfoTrampResultThread(areaInfo);
return xzxtRestResult;
}
//轨迹疑似停留点
@ApiOperation(value = "轨迹疑似停留点")
@PostMapping("/getTrackYstld")
......@@ -74,6 +83,13 @@ public class CarController {
return carService.getTrackYsljd(track);
}
//轨迹疑似活动区域
@ApiOperation(value = "轨迹疑似活动区域")
@PostMapping("/getTrackYshdqy")
public MapRestResult getTrackYshdqy(@RequestBody TrackYsModelCondition track){
return carService.getTrackYshdqy(track);
}
@ApiOperation(value = "车碰撞结果获取")
@PostMapping("/getRegionalsResult")
public MapRestResult getRegionalsResult(@RequestBody TbStRegionalstaskresult tbStRegionalstaskresult) throws Exception {
......
......@@ -198,8 +198,9 @@
task_Object as taskObject,
to_char(djsj,'yyyy-mm-dd hh24:mi:ss') as djsj,
fsr_Xm as fsrXm,
carNum as carNum
FROM tb_st_regionals_task
carNum as carNum,
(select count(*) from tb_st_regionals_results r where t.task_id = r.task_id) as counts
FROM tb_st_regionals_task t
where 1=1
<if test="startTime != null and startTime != ''">and DJSJ <![CDATA[>=]]> TO_DATE(#{ startTime , jdbcType=VARCHAR },'yyyy-MM-dd')</if>
<if test="endTime != null and endTime != ''">and DJSJ <![CDATA[<]]> (TO_DATE(#{ endTime , jdbcType=VARCHAR },'yyyy-MM-dd')+1)</if>
......
......@@ -33,4 +33,7 @@ public interface CarService {
MapRestResult getRegionalsResultFl(TbStRegionalstaskresult tbStRegionalstaskresult) throws Exception;
MapRestResult getTrackYshdqy(TrackYsModelCondition track);
MapRestResult OneAreaInfoTrampResultThread (AreaInfo areaInfo) throws Exception;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment