Commit fa890e86 by yanru

多区域碰撞分析-发送任务、时空伴随-任务发送触发重庆智侦平台中任务返回结果保存线程

parent c2aedeb2
......@@ -10,12 +10,10 @@ import com.founder.interservice.tracktraveltogether.model.TrackTogetherTask;
import com.founder.interservice.tracktraveltogether.service.TrackTogetherService;
import com.founder.interservice.user.controller.UserContoller;
import com.founder.interservice.user.model.User;
import com.founder.interservice.util.DateUtil;
import com.founder.interservice.util.KeyUtil;
import com.founder.interservice.util.ResultVOUtil;
import com.founder.interservice.util.StringUtil;
import com.founder.interservice.util.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -23,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 新版获取网安数据接口提供类
......@@ -39,6 +39,8 @@ public class PushWaDataController {
private DzgzService dzgzService;
@Autowired
private TrackTogetherService trackTogetherService;
@Value("${cqzz-platform.url}")
private String cqzzPlatformUrl;
/**
* 获取对象时间段内的轨迹
......@@ -144,6 +146,25 @@ public class PushWaDataController {
try{
String result = pushWaDataService.sendTogetherTask(taskCaseId,taskName,username,startTime,endTime,objectType,objectValue);
saveTogetherTask(result,taskCaseId,taskName,username,startTime,endTime,objectType,objectValue,fsrSfzh);
if (!StringUtils.isEmpty(result) && result.contains("{")) {
JSONObject resultObject = JSONObject.parseObject(result);
if (null != resultObject && resultObject.containsKey("data") && null != resultObject.get("data")) {
Object taskIdObj = resultObject.get("data");
if (null != taskIdObj && "" != taskIdObj) {
String taskId = taskIdObj.toString();
Map header=new HashMap();
header.put("Accept-Encoding","gzip, deflate, br");
header.put("Accept-Language","zh-CN,zh;q=0.9");
header.put("Authorization","Basic YWRtaW46YWRtaW4=");
header.put("Connection","keep-alive");
header.put("Content-Type","application/json");
Map paramMap=new HashMap();
paramMap.put("taskId",taskId);
String url=cqzzPlatformUrl+"/runTogetherThread";
HttpClient.doPost(url,header,paramMap);
}
}
}
resultVO = ResultVOUtil.success(JSONObject.parseObject(result));
}catch (InterServiceException e){
e.printStackTrace();
......
......@@ -15,6 +15,7 @@ import com.founder.interservice.regionalanalysis.model.RegionalsTask;
import com.founder.interservice.regionalanalysis.service.RegionalAnalysisService;
import com.founder.interservice.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
......@@ -34,6 +35,8 @@ public class ProtoController {
private ProtoService protoService;
@Autowired
private RegionalAnalysisService regionalAnalysisService;
@Value("${cqzz-platform.url}")
private String cqzzPlatformUrl;
/**
* 获取关联关系接口
......@@ -285,6 +288,26 @@ public class ProtoController {
//String result="{ "success":true, "message":null, "data":"774120bff0fea8ba6dfb6c1c6b20ec84-562-A01-xjzd-fangzheng-6-1558439147664", "errCode":null }";
saveRegionalsTask(param, result);
resultVO = ResultVOUtil.success(result);
if (!StringUtils.isEmpty(result) && result.contains("{")) {
JSONObject resultObject = JSONObject.parseObject(result);
if (null != resultObject && resultObject.containsKey("data") && null != resultObject.get("data")) {
Object taskIdObj = resultObject.get("data");
if (null != taskIdObj && "" != taskIdObj) {
String taskId = taskIdObj.toString();
Map header=new HashMap();
header.put("Accept-Encoding","gzip, deflate, br");
header.put("Accept-Language","zh-CN,zh;q=0.9");
header.put("Authorization","Basic YWRtaW46YWRtaW4=");
header.put("Connection","keep-alive");
header.put("Content-Type","application/json");
Map paramMap=new HashMap();
paramMap.put("taskId",taskId);
String url=cqzzPlatformUrl+"/runRegionalThread";
HttpClient.doPost(url,header,paramMap);
}
}
}
} catch (InterServiceException e) {
resultVO = ResultVOUtil.error(e.getCode(), e.getMessage(), null);
}
......@@ -336,7 +359,9 @@ public class ProtoController {
regional.setStartTime(new Date(object.getLong("startTime")));
regional.setEndTime(new Date(object.getLong("endTime")));
regional.setRadius(object.getString("radius"));
regional.setCenterPoint(object.getJSONObject("centerPoint").toJSONString());
if(null!=object.getJSONObject("centerPoint")){
regional.setCenterPoint(object.getJSONObject("centerPoint").toJSONString());
}
regionalList.add(regional);
}
}
......
......@@ -75,7 +75,9 @@ abutment_config:
userCardId: 510902198504188878
userDept: 510996440000
url: http://10.64.1.116:8585/node
#重庆智侦平台线上部署地址
cqzz-platform:
url: http://77.1.24.51:8050
# 系统变量
xdhbigdata:
xdhserviceParam:
......
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