public Map getmanyMdatabystationanddate(@RequestBody Map<String,Object> params){
Timer timer = new Timer();
Map res =new HashMap<>();
timer.schedule(new TimerTask() {
@Override
public void run() {//这里相当于延迟30000ms执行此程序
flag = 1;
timer.cancel();//关闭线程
}
},30000);
Map map=mDataService.getmanyMdatabystationanddata(params);
System.out.println("flag:"+flag);
if(flag==0){
return map;
}else {
Map mapTimeout=new HashMap<>();
mapTimeout.put("queryFlag","timeout");
return mapTimeout;
}
}