Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
map-parent
Commits
411a0652
Commit
411a0652
authored
Dec 14, 2022
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
伴随验证提交(重庆)
parent
1311b19e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
service/publicapi/src/main/java/com/founder/publicapi/controller/SkModelService/SkbsController.java
+8
-5
No files found.
service/publicapi/src/main/java/com/founder/publicapi/controller/SkModelService/SkbsController.java
View file @
411a0652
...
...
@@ -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"
)
...
...
@@ -132,9 +133,9 @@ public class SkbsController {
/**
* @param paramList 所有轨迹的集合
* @param paramList 所有轨迹的集合
* @param requestParams 请求传进来的参数,需要其中的 radius
* */
* */
public
List
getSkbsfx
(
TogetherEntity
requestParams
,
List
<
TogetherEntity
>
paramList
){
List
<
TogetherEntity
>
resultList
=
new
ArrayList
<>();
long
timeItervalMinutes
=
requestParams
.
getMinutes
()
*
60
*
1000
;
...
...
@@ -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,7 +176,6 @@ public class SkbsController {
resultList
.
add
(
t1
);
}
}
}
resultList
.
stream
().
sorted
(
Comparator
.
comparing
(
TogetherEntity:
:
getTimestamp
));
...
...
@@ -208,7 +211,7 @@ public class SkbsController {
@Builder
@AllArgsConstructor
@NoArgsConstructor
static
class
SkbsParam
{
static
class
SkbsParam
{
private
TogetherEntity
requestParams
;
private
List
<
SkTrail
>
list
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment