|
|
|
@ -6,6 +6,7 @@ import com.xydl.cac.repository.I2syncRecordRepository;
|
|
|
|
|
import com.xydl.cac.repository.NSensorRepository;
|
|
|
|
|
import com.xydl.cac.service.DataService;
|
|
|
|
|
import com.xydl.cac.service.I2syncService;
|
|
|
|
|
import com.xydl.cac.socket.WebSocketServer;
|
|
|
|
|
import com.xydl.cac.util.DateUtil;
|
|
|
|
|
import com.xydl.cac.util.DingTalkPushUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -34,6 +35,8 @@ public class I2syncTask {
|
|
|
|
|
BusiAdapter busiAdapter;
|
|
|
|
|
@Resource
|
|
|
|
|
DingTalkPushUtil dingTalkPushUtil;
|
|
|
|
|
@Resource
|
|
|
|
|
WebSocketServer webSocketServer;
|
|
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 60 * 1000, fixedDelay = 30 * 60 * 1000)
|
|
|
|
|
public void syncAll() {
|
|
|
|
@ -52,6 +55,7 @@ public class I2syncTask {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("I2syncTask.syncAll error.", e);
|
|
|
|
|
String str = "i2同步导出数据异常: " + e.getMessage();
|
|
|
|
|
webSocketServer.sendMessage(str);
|
|
|
|
|
dingTalkPushUtil.pushText(str);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -71,6 +75,7 @@ public class I2syncTask {
|
|
|
|
|
}
|
|
|
|
|
List<NSensor> list = sensorRepository.findByTypeId(config.getModevtypeId());
|
|
|
|
|
for (NSensor sensor : list) {
|
|
|
|
|
sensor.setTableName(config.getTableName());
|
|
|
|
|
this.syncOneSensor(sensor, fieldList, points);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|