Commit 77c106a2 by caojingji

修改伴随任务线程中的bug问题

parent a6cb577a
......@@ -58,7 +58,7 @@ public class TogetherScheduledService {
* @Author: cao peng
* @date: 2018/8/22 0022-16:35
*/
@Scheduled(initialDelay = 180000,fixedDelay = 180000) //项目启动后延迟三分钟秒执行,每次执行完后三分钟后再次执行
@Scheduled(initialDelay = 120000,fixedDelay = 120000) //项目启动后延迟三分钟秒执行,每次执行完后三分钟后再次执行
public void queryTaskResult(){
System.out.println("=============TogetherTask Start Running================");
System.out.println("Thread Name:=======" + Thread.currentThread().getName());
......@@ -87,7 +87,6 @@ public class TogetherScheduledService {
String info_url = TOGETHER_INFO_URL + "&taskId=" + task.getTaskId();
String taskInfoResult = HttpUtil.getWaData(info_url);
//String taskInfoResult = "{\"items\":[{\"count\":75,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460013088311061\"},{\"count\":70,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460029233464484\"},{\"count\":65,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460013022609934\"},{\"count\":63,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460013312607010\"},{\"count\":57,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460018669002987\"},{\"count\":53,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460008397079525\"},{\"count\":53,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460020523597601\"},{\"count\":53,\"objectType\":4394,\"objectTypeName\":\"电话号码\",\"objectValue\":\"460003164872839\"}],\"taskId\":\"98f6bcd4621d373cade4e832627b4f6-540-xzxt-api-3-1536231954767\"}";
taskInfoResult = HttpUtil.getWaData(info_url);
getAndSaveInfo(taskInfoResult,task);
}
if(!state.equals(task.getState())){
......@@ -113,14 +112,8 @@ public class TogetherScheduledService {
r.setXXZJBH(KeyUtil.getUniqueKey("TT"));
r.setDjsj(new Date());
}
TogetherTaskResult param = new TogetherTaskResult();
param.setTaskId(task.getTaskId());
Example<TogetherTaskResult> example = Example.of(param);
List<TogetherTaskResult> results = taskResultRepository.findAll(example);
if(results == null || results.isEmpty()){
taskResultRepository.save(taskResults);
getAndSaveRydetail(taskResults);
}
taskResultRepository.save(taskResults);
getAndSaveRydetail(taskResults);
}
}
}catch (Exception e){
......
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