Commit 322d3cd5 by yangyang

伴随验证调整提交(标准)

parent fbf4d987
......@@ -76,7 +76,7 @@ public class SkTrailController extends ApiController {
@PostMapping("getGjxsd")
@ApiOperation(value = "公共_轨迹相似度")
//@OperLog(message = "公共_轨迹相似度", operation = OperationType.QUERY)
@OperLog(message = "公共_轨迹相似度", operation = OperationType.QUERY)
public MapRestResult getGjxsd(@RequestBody SkTrailXsdParam skTrailXsdParam){
LCSS lcss = new LCSS();
return MapRestResult.build(200, "轨迹相似度",1 ,lcss.lcs(skTrailXsdParam.getListOne(), skTrailXsdParam.getListTwo(),skTrailXsdParam.getRadius(),skTrailXsdParam.getMinutes()));
......
......@@ -15,6 +15,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@RequestMapping("skbs")
......@@ -142,6 +143,9 @@ public class SkbsController {
* list2为所有数据的集合,将集合按轨迹开始时间排序
* */
Collections.sort(paramList, Comparator.comparing(TogetherEntity::getTimestamp));
// 根据ObjectValue去重
List<TogetherEntity> resultListDistinct = resultList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()
-> new TreeSet<>(Comparator.comparing(TogetherEntity :: getObjectValue))), ArrayList::new));
for (int i = 1; i < paramList.size(); i++) {
TogetherEntity a = paramList.get(i - 1);
......@@ -153,7 +157,7 @@ public class SkbsController {
BeanUtils.copyProperties(a, t);
BeanUtils.copyProperties(a1, t1);
if (!t.getObjectValue().equals(t1.getObjectValue())) {
if ((!t.getObjectType().equals(t1.getObjectType())&&t.getObjectValue().equals(t1.getObjectValue()))||!t.getObjectValue().equals(t1.getObjectValue())) {
long timeIterval = t1.getTimestamp() - t.getTimestamp();
double s = getDistance(t.getJ(), t.getW(), t1.getJ(), t1.getW());
if (s < requestParams.getRadius() && timeIterval < timeItervalMinutes) {
......@@ -172,8 +176,7 @@ public class SkbsController {
resultList.add(t1);
}
}
}
}
resultList.stream().sorted(Comparator.comparing(TogetherEntity::getTimestamp));
return resultList;
......
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