@ Override
Public void the run () {
Try {
System. The out. Println (" A -- -- -- -- -- ");
Code1 (startTime, endTime/2, SDF, timeMap);
}
The finally {
}
}
});
Thread C=new Thread (new Runnable () {
@ Override
Public void the run () {
Try {
System. The out. Println (" B -- -- -- -- -- ");
Code1 (endTime/2, endTime, SDF and timeMap);
} the finally {
}
}
});
A.s tart ();
C.s. tart ();
Code1:
Public void code1 (Long startTime, Long endTime, SimpleDateFormat SDF, Map
For (Long I=startTime + 1000; I & lt;=endTime; I +=1000) {
//every second to query
//to put on a second data in
String dateOld=SDF. The format (new Date (I - 1000));
String date2=SDF. The format (new Date (I));
//now put on for a second data in a
TimeMap. Put (date2, timeMap. Get (dateOld));
Map
//now put on for a second data in a
CarStateVos. PutAll (timeMap. Get (date2));
/* LambdaQueryWrapper
LambdaQ. Eq (CarStateCai: : getUpdateTime, new Date (I));
List
Map
The map. The put (" update_time ", new Date (I));
List
//whether the query data
//in this query without going to a in the
If (list1. The size () & gt; 0 {
For (CarStateCai CarStateCai: list1) {
If (carStateCai. GetCarNum ()!=null & amp; & !" ". The equals (carStateCai getCarNum ())) {
//read the information in the redis
The String value=https://bbs.csdn.net/topics/redisService.getValue (carStateCai getCarNum ());
CarStateDto carStateDto1=JSON. ParseObject (value, CarStateDto. Class);
CarStateVo CarStateVo=getCarStateVo (carStateDto1 carStateCai);
//if there will be overwritten
CarStateVos. Put (carStateVo. GetCarNum (), carStateVo);
}
}
String date1=SDF. The format (new Date (I));
System. The out. Println (date1 + "run");
TimeMap. Put (date1, carStateVos);
}
}
}