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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
54 deletions
+64
-54
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
+60
-48
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,8 +114,14 @@ public class TogetherScheduledService {
r
.
setXXZJBH
(
KeyUtil
.
getUniqueKey
(
"TT"
));
r
.
setDjsj
(
new
Date
());
}
taskResultRepository
.
save
(
taskResults
);
getAndSaveRydetail
(
taskResults
);
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
){
...
...
@@ -124,57 +132,61 @@ public class TogetherScheduledService {
/**
* 拿取到伴随的结果后 使用第四个接口调取关联数据
*/
public
void
getAndSaveRydetail
(
List
<
TogetherTaskResult
>
resultsList
)
throws
Exception
{
if
(
resultsList
!=
null
&&
!
resultsList
.
isEmpty
())
{
for
(
TogetherTaskResult
result
:
resultsList
)
{
String
objType
=
result
.
getObjectType
();
String
objValue
=
result
.
getObjectValue
();
String
objName
=
result
.
getObjectTypeName
();
if
(
objValue
!=
null
&&
!
""
.
equals
(
objValue
))
{
//MAC地址、用户名、淘宝旺旺号不去调取关联数据,其它类型都使用第四个接口调取
if
(!
Arrays
.
asList
(
"4329"
,
"4342"
,
"45282"
).
contains
(
objType
))
{
JSONObject
jsonObj
=
iphoneTrackService
.
getObjectRelationAll
(
objValue
);
//使用网安第三个接口调取关联数据
if
(
jsonObj
!=
null
&&
!
jsonObj
.
isEmpty
())
{
//说明根节点是身份证号
RegionalTaskResultDetail
detail
=
new
RegionalTaskResultDetail
();
detail
.
setTaskResultId
(
result
.
getXXZJBH
());
detail
.
setXXZJBH
(
KeyUtil
.
getUniqueKey
(
"EDZ"
));
detail
.
setObjectType
(
objType
);
detail
.
setObjectValue
(
objValue
);
detail
.
setObjectTypeName
(
objName
);
String
objType2
=
jsonObj
.
getString
(
"objType"
);
String
objValue2
=
jsonObj
.
getString
(
"objValue"
);
if
(
"1"
.
equals
(
objType2
)
&&
!
objValue2
.
isEmpty
()){
detail
.
setZjlxCode
(
"004"
);
detail
.
setZjlx
(
"身份证号"
);
detail
.
setZjhm
(
objValue2
);
detail
=
getEdzxxForSfzh
(
detail
);
//获取二代证信息
//根据身份证判断是否存在 如果存在更新 不存在新增
RegionalTaskResultDetail
param
=
new
RegionalTaskResultDetail
();
param
.
setObjectType
(
objType
);
param
.
setObjectValue
(
objValue
);
boolean
isExist
=
togetherService
.
togetherDetailIsExist
(
param
);
if
(!
isExist
)
{
togetherService
.
saveTogetherDetail
(
detail
);
}
else
{
togetherService
.
updateTogetherDetail
(
detail
);
}
}
else
if
(
Arrays
.
asList
(
"20"
,
"4394"
,
"3996"
,
"6003"
).
contains
(
objType2
)){
//手机号码
detail
.
setSjhm
(
objValue2
);
RegionalTaskResultDetail
param
=
new
RegionalTaskResultDetail
();
param
.
setObjectType
(
objType
);
param
.
setObjectValue
(
objValue
);
boolean
isExist
=
togetherService
.
togetherDetailIsExist
(
param
);
if
(!
isExist
)
{
togetherService
.
saveTogetherDetail
(
detail
);
}
else
{
togetherService
.
updateTogetherDetail
(
detail
);
public
void
getAndSaveRydetail
(
List
<
TogetherTaskResult
>
resultsList
){
try
{
if
(
resultsList
!=
null
&&
!
resultsList
.
isEmpty
())
{
for
(
TogetherTaskResult
result
:
resultsList
)
{
String
objType
=
result
.
getObjectType
();
String
objValue
=
result
.
getObjectValue
();
String
objName
=
result
.
getObjectTypeName
();
if
(
objValue
!=
null
&&
!
""
.
equals
(
objValue
))
{
//MAC地址、用户名、淘宝旺旺号不去调取关联数据,其它类型都使用第四个接口调取
if
(!
Arrays
.
asList
(
"4329"
,
"4342"
,
"45282"
).
contains
(
objType
))
{
JSONObject
jsonObj
=
iphoneTrackService
.
getObjectRelationAll
(
objValue
);
//使用网安第三个接口调取关联数据
if
(
jsonObj
!=
null
&&
!
jsonObj
.
isEmpty
())
{
//说明根节点是身份证号
RegionalTaskResultDetail
detail
=
new
RegionalTaskResultDetail
();
detail
.
setTaskResultId
(
result
.
getXXZJBH
());
detail
.
setXXZJBH
(
KeyUtil
.
getUniqueKey
(
"EDZ"
));
detail
.
setObjectType
(
objType
);
detail
.
setObjectValue
(
objValue
);
detail
.
setObjectTypeName
(
objName
);
String
objType2
=
jsonObj
.
getString
(
"objType"
);
String
objValue2
=
jsonObj
.
getString
(
"objValue"
);
if
(
"1"
.
equals
(
objType2
)
&&
!
objValue2
.
isEmpty
()){
detail
.
setZjlxCode
(
"004"
);
detail
.
setZjlx
(
"身份证号"
);
detail
.
setZjhm
(
objValue2
);
detail
=
getEdzxxForSfzh
(
detail
);
//获取二代证信息
//根据身份证判断是否存在 如果存在更新 不存在新增
RegionalTaskResultDetail
param
=
new
RegionalTaskResultDetail
();
param
.
setObjectType
(
objType
);
param
.
setObjectValue
(
objValue
);
boolean
isExist
=
togetherService
.
togetherDetailIsExist
(
param
);
if
(!
isExist
)
{
togetherService
.
saveTogetherDetail
(
detail
);
}
else
{
togetherService
.
updateTogetherDetail
(
detail
);
}
}
else
if
(
Arrays
.
asList
(
"20"
,
"4394"
,
"3996"
,
"6003"
).
contains
(
objType2
)){
//手机号码
detail
.
setSjhm
(
objValue2
);
RegionalTaskResultDetail
param
=
new
RegionalTaskResultDetail
();
param
.
setObjectType
(
objType
);
param
.
setObjectValue
(
objValue
);
boolean
isExist
=
togetherService
.
togetherDetailIsExist
(
param
);
if
(!
isExist
)
{
togetherService
.
saveTogetherDetail
(
detail
);
}
else
{
togetherService
.
updateTogetherDetail
(
detail
);
}
}
}
}
}
}
}
}
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