Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bigdatainterservice
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
曹鹏
bigdatainterservice
Commits
9cd5bde4
Commit
9cd5bde4
authored
Mar 22, 2019
by
caojingji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加线程调取轨迹数据添加数据库中
parent
40b2aaaa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
src/main/java/com/founder/interservice/controller/GetTrackTest.java
+1
-3
src/main/java/com/founder/interservice/service/impl/IphoneTrackServiceImpl.java
+1
-1
src/main/java/com/founder/interservice/tracktraveltogether/service/impl/TogetherScheduledService.java
+14
-2
src/main/resources/trackDate.properties
+2
-2
No files found.
src/main/java/com/founder/interservice/controller/GetTrackTest.java
View file @
9cd5bde4
...
...
@@ -5,16 +5,13 @@ import com.alibaba.fastjson.JSONObject;
import
com.founder.interservice.service.IphoneTrackService
;
import
com.founder.interservice.util.DateUtil
;
import
com.founder.interservice.util.PropertieUtil
;
import
org.apache.http.client.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
@Component
...
...
@@ -72,6 +69,7 @@ public class GetTrackTest {
String
jssjNew
=
DateUtil
.
convertDateToString
(
calendar2
.
getTime
());
PropertieUtil
.
writeProperties
(
"trackDate.properties"
,
"kssj"
,
kssjNew
);
PropertieUtil
.
writeProperties
(
"trackDate.properties"
,
"jssj"
,
jssjNew
);
PropertieUtil
.
writeProperties
(
"trackDate.properties"
,
"sjhms"
,
sjhmStr
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
...
...
src/main/java/com/founder/interservice/service/impl/IphoneTrackServiceImpl.java
View file @
9cd5bde4
...
...
@@ -268,8 +268,8 @@ public class IphoneTrackServiceImpl implements IphoneTrackService {
List
<
Track
>
tracks
=
data
.
subList
(
start
,
end
);
//从fromIndex(包含),到toIndex(不包含)
List
<
Track
>
paramTracks
=
new
ArrayList
<
Track
>();
for
(
Track
track
:
tracks
)
{
Track
pTrack
=
new
Track
();
track
.
setId
(
track
.
getAddress
()+
track
.
getJ
()+
track
.
getW
());
Track
pTrack
=
new
Track
();
pTrack
.
setAddress
(
track
.
getAddress
());
pTrack
.
setObjectvalue
(
track
.
getObjectvalue
());
pTrack
.
setTimestamp
(
track
.
getTimestamp
());
...
...
src/main/java/com/founder/interservice/tracktraveltogether/service/impl/TogetherScheduledService.java
View file @
9cd5bde4
...
...
@@ -3,7 +3,6 @@ package com.founder.interservice.tracktraveltogether.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.founder.interservice.model.AutoTbStRy
;
import
com.founder.interservice.regionalanalysis.model.RegionalTaskResult
;
import
com.founder.interservice.regionalanalysis.model.RegionalTaskResultDetail
;
import
com.founder.interservice.service.IphoneTrackService
;
import
com.founder.interservice.tracktraveltogether.model.TogetherTaskResult
;
...
...
@@ -19,6 +18,8 @@ import org.springframework.data.jpa.domain.Specification;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.persistence.criteria.*
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -32,6 +33,7 @@ import java.util.List;
* @CreateDate: 2018-08-22 16:46
* @Version: 1.0
*/
@Transactional
@Component
@Async
public
class
TogetherScheduledService
{
...
...
@@ -112,10 +114,16 @@ public class TogetherScheduledService {
r
.
setXXZJBH
(
KeyUtil
.
getUniqueKey
(
"TT"
));
r
.
setDjsj
(
new
Date
());
}
TogetherTaskResult
param
=
new
TogetherTaskResult
();
param
.
setTaskId
(
task
.
getTaskId
());
Example
<
TogetherTaskResult
>
example
=
Example
.
of
(
param
);
List
<
TogetherTaskResult
>
results
=
taskResultRepository
.
findAll
(
example
);
if
(
results
==
null
||
results
.
isEmpty
()){
taskResultRepository
.
save
(
taskResults
);
getAndSaveRydetail
(
taskResults
);
}
}
}
}
catch
(
Exception
e
){
throw
new
RuntimeException
(
e
);
}
...
...
@@ -124,7 +132,8 @@ public class TogetherScheduledService {
/**
* 拿取到伴随的结果后 使用第四个接口调取关联数据
*/
public
void
getAndSaveRydetail
(
List
<
TogetherTaskResult
>
resultsList
)
throws
Exception
{
public
void
getAndSaveRydetail
(
List
<
TogetherTaskResult
>
resultsList
){
try
{
if
(
resultsList
!=
null
&&
!
resultsList
.
isEmpty
())
{
for
(
TogetherTaskResult
result
:
resultsList
)
{
String
objType
=
result
.
getObjectType
();
...
...
@@ -176,6 +185,9 @@ public class TogetherScheduledService {
}
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
/**
...
...
src/main/resources/trackDate.properties
View file @
9cd5bde4
kssj
=
2019-02-01
jssj
=
2019-02-05
sjhms
=
15129457465,15129457465,15129457465
\ No newline at end of file
sjhms
=
864552034163647
\ No newline at end of file
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