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
f87e3ee8
Commit
f87e3ee8
authored
May 30, 2019
by
chang_chao@founder.com.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多区域碰撞和区域搜索定时任务增加审批
parent
7b8ec251
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
28 deletions
+56
-28
src/main/java/com/founder/interservice/regionalanalysis/service/impl/RegionalsScheduledService.java
+33
-18
src/main/java/com/founder/interservice/tracktraveltogether/service/impl/TogetherScheduledService.java
+23
-10
No files found.
src/main/java/com/founder/interservice/regionalanalysis/service/impl/RegionalsScheduledService.java
View file @
f87e3ee8
...
...
@@ -10,7 +10,9 @@ import com.founder.interservice.service.PushWaDataService;
import
com.founder.interservice.tracktraveltogether.model.TogetherTaskResult
;
import
com.founder.interservice.util.KeyUtil
;
import
com.founder.interservice.util.StringUtil
;
import
com.founder.interservice.util.XdhSpUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Example
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
...
...
@@ -33,6 +35,10 @@ public class RegionalsScheduledService {
private
RegionalsTaskRepository
regionalsTaskRepository
;
@Autowired
private
RegionalsTaskResultRepository
regionalsTaskResultRepository
;
@Value
(
value
=
"${xdhbigdata.xdhserviceParam.bizCode}"
)
private
String
bizCode
;
@Value
(
value
=
"${xdhbigdata.xdhserviceParam.cjServiceId}"
)
private
String
cjServiceId
;
/**
*
* @Description: 查取任务结果的定时方法
...
...
@@ -66,27 +72,36 @@ public class RegionalsScheduledService {
if
(
regionalsTaskList
!=
null
&&
!
regionalsTaskList
.
isEmpty
()){
String
taskId
=
null
,
progress
=
null
,
state
=
null
,
result
=
null
;
Map
<
String
,
String
>
waRegionalsTaskMap
=
null
;
for
(
RegionalsTask
task:
regionalsTaskList
)
{
taskId
=
task
.
getTaskId
();
//查询比对结果状态
waRegionalsTaskMap
=
this
.
queryTaskStates
(
taskId
);
progress
=
waRegionalsTaskMap
.
get
(
"progress"
);
state
=
waRegionalsTaskMap
.
get
(
"state"
);
//progress="1";
//state="FINISHED";
if
((
"1"
.
equals
(
progress
)||
"1.0"
.
equals
(
progress
))
&&
"FINISHED"
.
equalsIgnoreCase
(
state
)){
String
taskInfoResult
=
pushWaDataService
.
getMultiRegionalTaskInfo
(
taskId
);
//String taskInfoResult="{ "success":true, "message":null, "data":[ { "objectValue":"460110893001057", "objectType":4314, "objectTypeName":"IMSI", "count":2, "regionList":[ "A1", "A2"] }, { "objectValue":"460110737112086", "objectType":4314, "objectTypeName":"IMSI", "count":2, "regionList":[ "A1", "A2"] }, { "objectValue":"460013052108912", "objectType":4314, "objectTypeName":"IMSI", "count":2, "regionList":[ "A1", "A2"] }], "errCode":null }";
//调取结果成功 然后将结果保存入库
if
(!
taskInfoResult
.
startsWith
(
"Rate"
)){
if
(
null
!=
taskInfoResult
&&
taskInfoResult
.
startsWith
(
"{"
)){
getAndSaveInfo
(
taskInfoResult
,
task
);
//updateTaskStates(taskId,progress,state);
XdhSpUtil
xdhSpUtil
=
new
XdhSpUtil
();
JSONObject
obj
=
xdhSpUtil
.
getSpResultUtil
(
task
.
getTaskCaseId
(),
task
.
getFsrIdentity
(),
task
.
getTaskName
(),
"多区域碰撞"
,
bizCode
,
cjServiceId
);
String
spzt
=
""
;
if
(
obj
!=
null
){
spzt
=
(
String
)
obj
.
get
(
"data"
);
if
(
"1"
.
equals
(
spzt
)){
//审批通过
taskId
=
task
.
getTaskId
();
//查询比对结果状态
waRegionalsTaskMap
=
this
.
queryTaskStates
(
taskId
);
progress
=
waRegionalsTaskMap
.
get
(
"progress"
);
state
=
waRegionalsTaskMap
.
get
(
"state"
);
//progress="1";
//state="FINISHED";
if
((
"1"
.
equals
(
progress
)||
"1.0"
.
equals
(
progress
))
&&
"FINISHED"
.
equalsIgnoreCase
(
state
)){
String
taskInfoResult
=
pushWaDataService
.
getMultiRegionalTaskInfo
(
taskId
);
//String taskInfoResult="{ "success":true, "message":null, "data":[ { "objectValue":"460110893001057", "objectType":4314, "objectTypeName":"IMSI", "count":2, "regionList":[ "A1", "A2"] }, { "objectValue":"460110737112086", "objectType":4314, "objectTypeName":"IMSI", "count":2, "regionList":[ "A1", "A2"] }, { "objectValue":"460013052108912", "objectType":4314, "objectTypeName":"IMSI", "count":2, "regionList":[ "A1", "A2"] }], "errCode":null }";
//调取结果成功 然后将结果保存入库
if
(!
taskInfoResult
.
startsWith
(
"Rate"
)){
if
(
null
!=
taskInfoResult
&&
taskInfoResult
.
startsWith
(
"{"
)){
getAndSaveInfo
(
taskInfoResult
,
task
);
//updateTaskStates(taskId,progress,state);
}
}
}
if
(!
task
.
getProgress
().
equals
(
progress
)
||
!
task
.
getState
().
equals
(
state
)){
updateTaskStates
(
task
.
getTaskId
(),
progress
,
state
);
//修改任务状态
}
}
}
if
(!
task
.
getProgress
().
equals
(
progress
)
||
!
task
.
getState
().
equals
(
state
)){
updateTaskStates
(
task
.
getTaskId
(),
progress
,
state
);
//修改任务状态
}
}
}
}
catch
(
Exception
e
){
...
...
src/main/java/com/founder/interservice/tracktraveltogether/service/impl/TogetherScheduledService.java
View file @
f87e3ee8
...
...
@@ -48,6 +48,10 @@ public class TogetherScheduledService {
private
TrackTogetherService
togetherService
;
//调取网安数据接口
@Autowired
private
PushWaDataService
pushWaDataService
;
@Value
(
value
=
"${xdhbigdata.xdhserviceParam.bizCode}"
)
private
String
bizCode
;
@Value
(
value
=
"${xdhbigdata.xdhserviceParam.cjServiceId}"
)
private
String
cjServiceId
;
/**
*
* @Description: 查取任务结果的定时方法
...
...
@@ -78,16 +82,25 @@ public class TogetherScheduledService {
});
if
(
taskList
!=
null
&&
!
taskList
.
isEmpty
()){
for
(
TrackTogetherTask
task:
taskList
)
{
Map
<
String
,
String
>
taskStatusMap
=
this
.
queryTaskStates
(
task
.
getTaskId
());
String
progress
=
taskStatusMap
.
get
(
"progress"
);
String
state
=
taskStatusMap
.
get
(
"state"
);
if
((
"1"
.
equals
(
progress
)||
"1.0"
.
equals
(
progress
))
&&
"FINISHED"
.
equalsIgnoreCase
(
state
)){
String
taskInfoResult
=
pushWaDataService
.
getTogetherTaskInfo
(
task
.
getTaskId
());
//String taskInfoResult="{ \"success\": true, \"message\": \"success\", \"data\": { \"taskId\": \"b4b147bc522828731f1a016bfa72c073-540-00-xjzd-fangzheng-6-1558149353717\", \"items\": [ { \"objectValue\": \"460026204648484\", \"objectType\": 4314, \"objectTypeName\": \"IMSI\", \"count\": 10}, { \"objectValue\": \"460027927395260\", \"objectType\": 4314, \"objectTypeName\": \"IMSI\", \"count\": 9}, { \"objectValue\": \"460008356061096\", \"objectType\": 4314, \"objectTypeName\": \"IMSI\", \"count\": 6} ]}, \"errCode\": null }";
getAndSaveInfo
(
taskInfoResult
);
}
if
(!
task
.
getProgress
().
equals
(
progress
)
||
!
task
.
getState
().
equals
(
state
)){
updateTaskStates
(
task
.
getTaskId
(),
progress
,
state
);
//修改任务状态
XdhSpUtil
xdhSpUtil
=
new
XdhSpUtil
();
JSONObject
obj
=
xdhSpUtil
.
getSpResultUtil
(
task
.
getTaskCaseId
(),
task
.
getFsrIdentity
(),
task
.
getTaskName
(),
"区域搜索"
,
bizCode
,
cjServiceId
);
String
spzt
=
""
;
if
(
obj
!=
null
){
spzt
=
(
String
)
obj
.
get
(
"data"
);
if
(
"1"
.
equals
(
spzt
)){
//审批通过
Map
<
String
,
String
>
taskStatusMap
=
this
.
queryTaskStates
(
task
.
getTaskId
());
String
progress
=
taskStatusMap
.
get
(
"progress"
);
String
state
=
taskStatusMap
.
get
(
"state"
);
if
((
"1"
.
equals
(
progress
)||
"1.0"
.
equals
(
progress
))
&&
"FINISHED"
.
equalsIgnoreCase
(
state
)){
String
taskInfoResult
=
pushWaDataService
.
getTogetherTaskInfo
(
task
.
getTaskId
());
//String taskInfoResult="{ \"success\": true, \"message\": \"success\", \"data\": { \"taskId\": \"b4b147bc522828731f1a016bfa72c073-540-00-xjzd-fangzheng-6-1558149353717\", \"items\": [ { \"objectValue\": \"460026204648484\", \"objectType\": 4314, \"objectTypeName\": \"IMSI\", \"count\": 10}, { \"objectValue\": \"460027927395260\", \"objectType\": 4314, \"objectTypeName\": \"IMSI\", \"count\": 9}, { \"objectValue\": \"460008356061096\", \"objectType\": 4314, \"objectTypeName\": \"IMSI\", \"count\": 6} ]}, \"errCode\": null }";
getAndSaveInfo
(
taskInfoResult
);
}
if
(!
task
.
getProgress
().
equals
(
progress
)
||
!
task
.
getState
().
equals
(
state
)){
updateTaskStates
(
task
.
getTaskId
(),
progress
,
state
);
//修改任务状态
}
}
}
}
}
...
...
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