|
|
@@ -172,20 +172,27 @@ public class TblDzbcPathSchedulingServiceImpl implements ITblDzbcPathSchedulingS
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
+
|
|
|
+ RedisUtils.deleteKeys("dzbc_path_scheduling*");
|
|
|
+
|
|
|
TblDzbcPathSchedulingBo bo = new TblDzbcPathSchedulingBo();
|
|
|
bo.getParams().put("mdate", DateUtil.today());
|
|
|
LambdaQueryWrapper<TblDzbcPathScheduling> lqw = buildQueryWrapper(bo);
|
|
|
List<TblDzbcPathSchedulingVo> list = baseMapper.selectVoList(lqw);
|
|
|
Map<String,Map<String,TblDzbcPathSchedulingVo> > map = new HashMap<>();
|
|
|
- for (TblDzbcPathSchedulingVo tblDzbcPathSchedulingVo : list) {
|
|
|
- if(tblDzbcPathSchedulingVo.getMdate()!=null){
|
|
|
- if(map.containsKey(DateUtil.formatDate(tblDzbcPathSchedulingVo.getMdate()))){
|
|
|
- map.get(DateUtil.formatDate(tblDzbcPathSchedulingVo.getMdate())).put(tblDzbcPathSchedulingVo.getId().toString(),tblDzbcPathSchedulingVo);
|
|
|
- }else{
|
|
|
- map.put(DateUtil.formatDate(tblDzbcPathSchedulingVo.getMdate()),Map.of(tblDzbcPathSchedulingVo.getId().toString(),tblDzbcPathSchedulingVo));
|
|
|
+
|
|
|
+ for (TblDzbcPathSchedulingVo tblDzbcPathSchedulingVo : list) {
|
|
|
+ if(tblDzbcPathSchedulingVo.getMdate()!=null){
|
|
|
+ if(map.containsKey(DateUtil.formatDate(tblDzbcPathSchedulingVo.getMdate()))){
|
|
|
+ map.get(DateUtil.formatDate(tblDzbcPathSchedulingVo.getMdate())).put(tblDzbcPathSchedulingVo.getId().toString(),tblDzbcPathSchedulingVo);
|
|
|
+ }else{
|
|
|
+ Map<String,TblDzbcPathSchedulingVo> tempm = new HashMap<>();
|
|
|
+ tempm.put(tblDzbcPathSchedulingVo.getId().toString(),tblDzbcPathSchedulingVo);
|
|
|
+ map.put(DateUtil.formatDate(tblDzbcPathSchedulingVo.getMdate()), tempm);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
map.keySet().forEach(key ->{
|
|
|
RedisUtils.setCacheMap(StrUtil.format("dzbc_path_scheduling|{}", key), map.get(key));
|
|
|
RedisUtils.expire(StrUtil.format("dzbc_path_scheduling|{}", key), DateUtil.offset(DateUtil.parseDate(key), DateField.HOUR_OF_DAY, 24).getTime() - DateUtil.current());
|