多区域碰撞和区域搜索定时任务增加审批

parent 7b8ec251
......@@ -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){
......
......@@ -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); //修改任务状态
}
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment