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
c30d73ef
Commit
c30d73ef
authored
Aug 03, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解析网安返回数据工具修改,返回结果排序方法修改。
parent
7bc7b0ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
29 deletions
+24
-29
src/main/java/com/founder/interservice/tracktraveltogether/controller/TrackTogetherContoller.java
+6
-2
src/main/java/com/founder/interservice/tracktraveltogether/service/impl/TrackTogetherServiceImpl.java
+17
-26
src/main/java/com/founder/interservice/util/WaBigDataParseUtil.java
+1
-1
No files found.
src/main/java/com/founder/interservice/tracktraveltogether/controller/TrackTogetherContoller.java
View file @
c30d73ef
...
...
@@ -575,9 +575,12 @@ public class TrackTogetherContoller {
Date
jssj
=
endTime
.
contains
(
" "
)
?
DateUtil
.
convertStringToDateTime
(
endTime
)
:
DateUtil
.
convertStringToDate
(
endTime
);
trackParam
.
setEndTime
(
jssj
);
trackParam
.
setDjsj
(
new
Date
());
String
IMSI
=
translateToIMSI
(
trackParam
.
getObjectValue
(),
trackParam
.
getObjectType
());
String
objectValue
=
trackParam
.
getObjectValue
();
String
IMSI
=
translateToIMSI
(
objectValue
,
trackParam
.
getObjectType
());
if
(
StringUtils
.
isEmpty
(
IMSI
)){
throw
new
InterServiceException
(
ResultEnum
.
TASK_SEND_ERROR
);
}
else
{
trackParam
.
setObjectValue
(
IMSI
);
}
taskId
=
trackTogetherService
.
sendTrackTogetherTask
(
trackParam
);
//发送任务 并且得到任务编号
if
(!
StringUtil
.
ckeckEmpty
(
taskId
)
&&
!
taskId
.
startsWith
(
"R"
)
&&
!
"null"
.
equals
(
taskId
)){
...
...
@@ -585,6 +588,7 @@ public class TrackTogetherContoller {
}
else
{
throw
new
InterServiceException
(
ResultEnum
.
TASK_SEND_ERROR
);
}
trackParam
.
setObjectValue
(
objectValue
);
trackParam
.
setProgress
(
"0"
);
trackParam
.
setState
(
"QUEUEING"
);
trackParam
.
setFsrJh
(
fsrjh
);
...
...
@@ -619,7 +623,7 @@ public class TrackTogetherContoller {
return
trackTogetherService
.
tjhmTogether
(
entity
);
}
p
rivate
String
translateToIMSI
(
String
num
,
String
type
){
p
ublic
String
translateToIMSI
(
String
num
,
String
type
){
String
imsi
=
""
;
if
(
"4314"
.
equals
(
type
)){
imsi
=
num
;
...
...
src/main/java/com/founder/interservice/tracktraveltogether/service/impl/TrackTogetherServiceImpl.java
View file @
c30d73ef
package
com
.
founder
.
interservice
.
tracktraveltogether
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.founder.interservice.VO.ResultMap
;
import
com.founder.interservice.exception.InterServiceException
;
import
com.founder.interservice.enums.ResultEnum
;
...
...
@@ -545,36 +546,26 @@ public class TrackTogetherServiceImpl implements TrackTogetherService {
}
if
(!
allIMSI
.
isEmpty
()){
try
{
allIMSI
.
sort
(
new
Comparator
<
Map
<
String
,
String
>>()
{
@Override
public
int
compare
(
Map
<
String
,
String
>
o1
,
Map
<
String
,
String
>
o2
)
{
if
(
o1
==
null
&&
o2
==
null
){
return
0
;
}
else
if
(
o1
==
null
&&
o2
!=
null
){
return
1
;
}
else
if
(
o1
!=
null
&&
o2
==
null
){
return
-
1
;
}
else
{
String
time1
=
o1
.
get
(
"time"
);
String
time2
=
o2
.
get
(
"time"
);
if
(
StringUtils
.
isEmpty
(
time1
)
&&
StringUtils
.
isEmpty
(
time2
)){
return
0
;
}
else
if
(
StringUtils
.
isEmpty
(
time1
)
&&
!
StringUtils
.
isEmpty
(
time2
)){
return
1
;
}
else
if
(!
StringUtils
.
isEmpty
(
time1
)
&&
StringUtils
.
isEmpty
(
time2
)){
return
-
1
;
}
else
{
Long
time1L
=
Long
.
parseLong
(
time1
);
Long
time2L
=
Long
.
parseLong
(
time2
);
return
time1L
-
time1L
>
0
?-
1
:
1
;
}
}
List
<
Long
>
timeList
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
imsiM:
allIMSI
){
String
time
=
imsiM
.
get
(
"time"
);
Long
timeL
=
Long
.
parseLong
(
time
);
timeList
.
add
(
timeL
);
}
int
index
=
0
;
Long
time0
=
timeList
.
get
(
0
);
for
(
int
i
=
0
;
i
<
timeList
.
size
();
i
++){
Long
time
=
timeList
.
get
(
i
);
if
(
time
>
time0
){
time0
=
time
;
index
=
i
;
}
});
}
imsi
=
allIMSI
.
get
(
index
).
get
(
"IMSI"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
imsi
=
allIMSI
.
get
(
0
).
get
(
"IMSI"
);
}
imsi
=
allIMSI
.
get
(
0
).
get
(
"IMSI"
);
}
return
imsi
;
}
...
...
src/main/java/com/founder/interservice/util/WaBigDataParseUtil.java
View file @
c30d73ef
...
...
@@ -135,7 +135,7 @@ public class WaBigDataParseUtil {
List
<
Relation
>
result
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
jsonResult
)&&
jsonResult
.
startsWith
(
"{"
)){
JSONObject
jsonObject
=
JSON
.
parseObject
(
jsonResult
);
if
(
jsonObject
!=
null
&&
"OK"
.
equals
(
jsonObject
.
getString
(
"status"
)))
{
if
(
jsonObject
!=
null
&&
"OK"
.
equals
(
jsonObject
.
getString
(
"status"
)
.
toUpperCase
()
))
{
JSONArray
data
=
jsonObject
.
getJSONArray
(
"results"
);
if
(
data
!=
null
&&
!
data
.
isEmpty
())
{
Iterator
iterator
=
data
.
iterator
();
...
...
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