Commit 43aba8c7 authored by caotao's avatar caotao

1.数据固化完成后根据网关发送消息。

parent 55d059f7
......@@ -32,7 +32,7 @@ import java.net.InetAddress;
@EnableScheduling
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})
@MapperScan({"com.yeejoin.amos.boot.module.das.mapper.msyql","com.yeejoin.amos.boot.module.das.mapper.tdengineanalysis","com.yeejoin.amos.boot.module.das.mapper.tdengineiot"})
@ComponentScan({"springfox.documentation.schema", "com.yeejoin.amos.boot.module.das","com.yeejoin.amos.boot.module.das.service.impl"})
@ComponentScan({"springfox.documentation.schema", "com.yeejoin.amos.boot.module.das","com.yeejoin.amos.boot.module.das.service.impl","org.typroject.tyboot.component"})
public class AmosJxiopDasApplication {
......
......@@ -18,7 +18,6 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import java.util.*;
import java.util.stream.Collectors;
......@@ -29,12 +28,12 @@ import java.util.stream.Collectors;
@Service
public class DasServiceImpl implements DasService {
private final FrontGatewayDevicePointsMapper frontGatewayDevicePointsMapper;
// private final EmqKeeper emqKeeper;
private final EmqKeeper emqKeeper;
private final IndicatorDataMapper indicatorDataMapper;
private final TdengineIotDataMapper tdengineIotDataMapper;
private final List<String> booleans = Arrays.asList("true", "false");
@Scheduled(cron = "0 */3 * * * ?")
@Scheduled(cron = "0 */10 * * * ?")
@Override
public void dataSolidification() {
Long startTime = System.currentTimeMillis();
......@@ -87,10 +86,11 @@ public class DasServiceImpl implements DasService {
HashMap<String, String> syncFlag = new HashMap<>();
syncFlag.put("gateway_id", gatewayId);
syncFlag.put("sync_flag", "success");
// emqKeeper.getMqttClient().publish("sync_esdata_to_tdengine_notice", JSON.toJSONString(syncFlag).getBytes(), 0, false);
log.info("同步ES数据至发发送消息给业务发送通知成功!");
emqKeeper.getMqttClient().publish("sync_esdata_to_tdengine_notice", JSON.toJSONString(syncFlag).getBytes(), 0, false);
log.info("同步物联监盘数据至发发送消息给业务发送通知成功!");
} catch (Exception exception) {
log.info("同步ES数据至发发送消息给业务发送通知失败!");
exception.printStackTrace();
log.info("同步物联监盘数据至发发送消息给业务发送通知失败!");
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment