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
9fca9967
Commit
9fca9967
authored
May 09, 2019
by
chang_chao@founder.com.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增脑图虚拟身份查询接口
parent
a7db0b57
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
118 additions
and
0 deletions
+118
-0
src/main/java/com/founder/interservice/controller/DataController.java
+118
-0
No files found.
src/main/java/com/founder/interservice/controller/DataController.java
View file @
9fca9967
...
@@ -27,6 +27,7 @@ import org.springframework.web.servlet.ModelAndView;
...
@@ -27,6 +27,7 @@ import org.springframework.web.servlet.ModelAndView;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
/**
/**
...
@@ -842,6 +843,96 @@ public class DataController {
...
@@ -842,6 +843,96 @@ public class DataController {
}
}
return
jsonObejct
;
return
jsonObejct
;
}
}
@RequestMapping
(
value
=
"/queryXnsfxx"
)
@ResponseBody
public
JSONObject
queryXnsfxx
(
String
objectValue
,
String
type
,
String
caseId
,
String
caseName
){
List
<
String
>
sjhmTypes
=
Arrays
.
asList
(
"20"
,
"4394"
,
"3996"
,
"6003"
);
//手机号码类别
List
<
String
>
memsTypes
=
Arrays
.
asList
(
"4314"
,
"4315"
);
//4315:IMEI;4314:IMSI
List
<
String
>
qqWeTypes
=
Arrays
.
asList
(
"558"
,
"4615"
);
//558:qq;4615:微信ID
List
<
String
>
cyzjTypes
=
Arrays
.
asList
(
"1"
);
JSONObject
jsonObejct
=
new
JSONObject
();
JSONObject
jsonObj
=
new
JSONObject
();
List
<
Relation
>
relationList
=
new
ArrayList
<>();
List
<
Relation
>
qqweList
=
new
ArrayList
<>();
try
{
if
(
type
.
equals
(
"sfzh"
)){
String
sfzhResult
=
pushWaDataService
.
pushRelations
(
caseId
,
caseName
,
""
,
objectValue
);
if
(
null
!=
sfzhResult
&&
sfzhResult
.
startsWith
(
"{"
)){
jsonObj
=
JSONObject
.
parseObject
(
sfzhResult
);
}
if
(
jsonObj
!=
null
){
String
dataList
=
jsonObj
.
getString
(
"data"
);
JSONArray
childrens
=
JSONObject
.
parseArray
(
dataList
);
if
(
childrens
!=
null
&&
childrens
.
size
()
>
0
){
for
(
int
i
=
0
;
i
<
childrens
.
size
();
i
++){
JSONObject
children
=
childrens
.
getJSONObject
(
i
);
if
(
sjhmTypes
.
contains
(
children
.
getString
(
"relativeType"
))
&&
cyzjTypes
.
contains
(
children
.
getString
(
"objectFromType"
))){
//关系
relationList
.
add
(
getRelationModel
(
children
));
}
}
relationList
=
removeJSonObject
(
relationList
);
}
}
}
else
if
(
type
.
equals
(
"sjhm"
))
{
String
sjhmResult
=
pushWaDataService
.
pushRelations
(
caseId
,
caseName
,
""
,
objectValue
);
if
(
null
!=
sjhmResult
&&
sjhmResult
.
startsWith
(
"{"
))
{
jsonObj
=
JSONObject
.
parseObject
(
sjhmResult
);
}
if
(
jsonObj
!=
null
)
{
String
dataList
=
jsonObj
.
getString
(
"data"
);
JSONArray
childrens
=
JSONObject
.
parseArray
(
dataList
);
if
(
childrens
!=
null
&&
childrens
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
childrens
.
size
();
i
++)
{
JSONObject
children
=
childrens
.
getJSONObject
(
i
);
if
(
memsTypes
.
contains
(
children
.
getString
(
"objectToType"
)))
{
relationList
.
add
(
getRelationModel
(
children
));
}
}
relationList
=
removeJSonObject
(
relationList
);
//根据imsi查询qq和微信ID
for
(
int
j
=
0
;
j
<
relationList
.
size
();
j
++){
Relation
re
=
relationList
.
get
(
j
);
if
(
"4314"
.
contains
(
re
.
getObjecttotype
())){
JSONObject
jobj
=
new
JSONObject
();
String
qqweResult
=
pushWaDataService
.
pushRelations
(
caseId
,
caseName
,
""
,
re
.
getObjecttovalue
());
if
(
qqweResult
!=
null
&&
qqweResult
.
startsWith
(
"{"
)){
jobj
=
JSONObject
.
parseObject
(
qqweResult
);
}
if
(
jobj
!=
null
){
String
qqweDataList
=
jobj
.
getString
(
"data"
);
JSONArray
qqweChildrens
=
JSONObject
.
parseArray
(
qqweDataList
);
if
(
qqweChildrens
!=
null
&&
qqweChildrens
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
qqweChildrens
.
size
();
i
++)
{
JSONObject
child
=
qqweChildrens
.
getJSONObject
(
i
);
if
(
qqWeTypes
.
contains
(
child
.
getString
(
"objectToType"
)))
{
qqweList
.
add
(
getRelationModel
(
child
));
}
}
}
}
}
}
//qq和微信ID去重
qqweList
=
removeJSonObject
(
qqweList
);
relationList
.
addAll
(
qqweList
);
}
}
}
if
(!
relationList
.
isEmpty
()
&&
relationList
!=
null
){
jsonObejct
.
put
(
"code"
,
ResultEnum
.
SUCCESS
.
getCode
());
jsonObejct
.
put
(
"message"
,
ResultEnum
.
SUCCESS
.
getMessage
());
}
else
{
jsonObejct
.
put
(
"code"
,
ResultEnum
.
SUCCESS
.
getCode
());
jsonObejct
.
put
(
"message"
,
"无数据"
);
}
jsonObejct
.
put
(
"dataList"
,
relationList
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
jsonObejct
.
put
(
"code"
,
ResultEnum
.
RESULT_ERROR
.
getCode
());
jsonObejct
.
put
(
"message"
,
ResultEnum
.
RESULT_ERROR
.
getMessage
());
}
return
jsonObejct
;
}
/**
/**
* 提取手机号码的关联信息
* 提取手机号码的关联信息
...
@@ -855,6 +946,33 @@ public class DataController {
...
@@ -855,6 +946,33 @@ public class DataController {
}
}
return
null
;
return
null
;
}
}
private
Relation
getRelationModel
(
JSONObject
jsonObject
){
Relation
relation
=
new
Relation
();
relation
.
setObjecttotype
(
jsonObject
.
getString
(
"objectToType"
));
relation
.
setObjecttotypename
(
jsonObject
.
getString
(
"objectToTypeName"
));
relation
.
setObjecttovalue
(
jsonObject
.
getString
(
"objectToValue"
));
relation
.
setObjectfromtype
(
jsonObject
.
getString
(
"objectFromType"
));
relation
.
setObjectfromvalue
(
jsonObject
.
getString
(
"objectFromValue"
));
relation
.
setObjectfromtypename
(
jsonObject
.
getString
(
"objectFromTypeName"
));
relation
.
setRelativetype
(
jsonObject
.
getString
(
"relativeType"
));
relation
.
setRelativetypename
(
jsonObject
.
getString
(
"relativeTypeName"
));
relation
.
setFirst_timestamp
(
getDate
(
jsonObject
.
getString
(
"first_timestamp"
)));
return
relation
;
}
private
String
getDate
(
String
sjc
){
if
(
sjc
!=
null
){
Date
date
=
new
Date
();
if
(
sjc
.
length
()
==
10
){
date
.
setTime
(
Long
.
parseLong
(
sjc
)*
1000
);
}
else
if
(
sjc
.
length
()
==
13
){
date
.
setTime
(
Long
.
parseLong
(
sjc
));
}
String
dateStr
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
date
);
return
dateStr
;
}
return
""
;
}
@Async
@Async
public
List
<
Relation
>
removeJSonObject
(
List
<
Relation
>
jsonObjects
){
public
List
<
Relation
>
removeJSonObject
(
List
<
Relation
>
jsonObjects
){
...
...
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