liding
3 天以前 7f9e375391e30fd3c367cb5a080a609a6e25e524
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.zbkj.admin.service.impl;
 
import com.alibaba.fastjson.JSONObject;
import com.zbkj.admin.service.EbVehicleInfoService;
import com.zbkj.common.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
 
 
@Service
public class DataService {
 
    @Autowired
    private EbVehicleInfoService ebVehicleInfoService;
 
    @Autowired
    private RedisUtil redisUtil;
    @Scheduled(fixedDelay = 1000 * 60L)
    public void refreshData() {
        if (redisUtil.exists("screen-data")) {
            redisUtil.set("screen-data", JSONObject.toJSONString(ebVehicleInfoService.screen("建立连接返回数据")));
        }
    }
}