时间回溯定时任务迁出

parent f341d09a
...@@ -37,6 +37,7 @@ public class SpatiotemporalBackTrackController { ...@@ -37,6 +37,7 @@ public class SpatiotemporalBackTrackController {
private String cjServiceId; private String cjServiceId;
@RequestMapping(value = "/sendSpatiotemporalBackTrackTask",method = {RequestMethod.GET,RequestMethod.POST}) @RequestMapping(value = "/sendSpatiotemporalBackTrackTask",method = {RequestMethod.GET,RequestMethod.POST})
@ResponseBody
public ResultVO sendSpatiotemporalBackTrackTask(String username,String paramStr,String asjbh,String taskName,String qybj,String centerPoint){ public ResultVO sendSpatiotemporalBackTrackTask(String username,String paramStr,String asjbh,String taskName,String qybj,String centerPoint){
ResultVO resultVO = null; ResultVO resultVO = null;
User user = null; User user = null;
......
...@@ -52,7 +52,7 @@ public class SpatiotemporalBackTrackScheduledService { ...@@ -52,7 +52,7 @@ public class SpatiotemporalBackTrackScheduledService {
* @return: * @return:
* @date: 2018/8/22 0022-16:35 * @date: 2018/8/22 0022-16:35
*/ */
@Scheduled(initialDelay = 60000,fixedDelay = 120000) //每次执行完后两分钟后再次执行 //每次执行完后两分钟后再次执行
public void queryTimeBackTrackResult(){ public void queryTimeBackTrackResult(){
System.out.println("=============SpatiotemporalBackTrack Start Running================"); System.out.println("=============SpatiotemporalBackTrack Start Running================");
System.out.println("=============SpatiotemporalBackTrack Start Running================"); System.out.println("=============SpatiotemporalBackTrack Start Running================");
...@@ -95,7 +95,7 @@ public class SpatiotemporalBackTrackScheduledService { ...@@ -95,7 +95,7 @@ public class SpatiotemporalBackTrackScheduledService {
* 2.开启新线程调取标识号的关联数据 * 2.开启新线程调取标识号的关联数据
* 3.调取标识号关联数据完成,然后更新任务 * 3.调取标识号关联数据完成,然后更新任务
*/ */
@Scheduled(initialDelay = 120000,fixedDelay = 120000) //项目启动后延迟两分钟执行,每次执行完后两分钟后再次执行 //项目启动后延迟两分钟执行,每次执行完后两分钟后再次执行
public void queryFinishTaskResult(){ public void queryFinishTaskResult(){
System.out.println("=============开始执行时空回溯调取关联数据定时任务================"); System.out.println("=============开始执行时空回溯调取关联数据定时任务================");
System.out.println("线程名称========== " + Thread.currentThread().getName()); System.out.println("线程名称========== " + Thread.currentThread().getName());
...@@ -334,7 +334,6 @@ public class SpatiotemporalBackTrackScheduledService { ...@@ -334,7 +334,6 @@ public class SpatiotemporalBackTrackScheduledService {
} }
//begin //begin
List<SpatiotemporalBackTrackResult> resultsList = data.subList(start, end); //从fromIndex(包含),到toIndex(不包含) List<SpatiotemporalBackTrackResult> resultsList = data.subList(start, end); //从fromIndex(包含),到toIndex(不包含)
try {
for (SpatiotemporalBackTrackResult result : resultsList) { for (SpatiotemporalBackTrackResult result : resultsList) {
String objType = result.getObjectType(); String objType = result.getObjectType();
String objValue = result.getObjectValue(); String objValue = result.getObjectValue();
...@@ -345,7 +344,12 @@ public class SpatiotemporalBackTrackScheduledService { ...@@ -345,7 +344,12 @@ public class SpatiotemporalBackTrackScheduledService {
JSONObject jsonObj = null; JSONObject jsonObj = null;
String relationAll = ""; String relationAll = "";
//获取对象关联关系 //获取对象关联关系
relationAll = pushWaDataService.pushRelationAll(DateUtil.getYYYYMMDDHHMM(), DateUtil.getYYYYMMDDHHMM(), "admin", objValue,3); try {
relationAll = pushWaDataService.pushRelationAll(DateUtil.getYYYYMMDDHHMM(), DateUtil.getYYYYMMDDHHMM(), "admin", objValue,3);
}catch(Exception e){
continue;
}
if(null != relationAll && relationAll.startsWith("{")){ if(null != relationAll && relationAll.startsWith("{")){
JSONObject json = JSONObject.parseObject(relationAll); JSONObject json = JSONObject.parseObject(relationAll);
jsonObj = json.getJSONObject("data"); jsonObj = json.getJSONObject("data");
...@@ -391,9 +395,6 @@ public class SpatiotemporalBackTrackScheduledService { ...@@ -391,9 +395,6 @@ public class SpatiotemporalBackTrackScheduledService {
} }
} }
} }
}catch(Exception e){
e.printStackTrace();
}
} }
} }
} }
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