Commit 43aba8c7 authored by caotao's avatar caotao

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

parent 55d059f7
...@@ -32,7 +32,7 @@ import java.net.InetAddress; ...@@ -32,7 +32,7 @@ import java.net.InetAddress;
@EnableScheduling @EnableScheduling
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class}) @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"}) @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 { public class AmosJxiopDasApplication {
......
...@@ -18,7 +18,6 @@ import org.springframework.scheduling.annotation.Scheduled; ...@@ -18,7 +18,6 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -29,12 +28,12 @@ import java.util.stream.Collectors; ...@@ -29,12 +28,12 @@ import java.util.stream.Collectors;
@Service @Service
public class DasServiceImpl implements DasService { public class DasServiceImpl implements DasService {
private final FrontGatewayDevicePointsMapper frontGatewayDevicePointsMapper; private final FrontGatewayDevicePointsMapper frontGatewayDevicePointsMapper;
// private final EmqKeeper emqKeeper; private final EmqKeeper emqKeeper;
private final IndicatorDataMapper indicatorDataMapper; private final IndicatorDataMapper indicatorDataMapper;
private final TdengineIotDataMapper tdengineIotDataMapper; private final TdengineIotDataMapper tdengineIotDataMapper;
private final List<String> booleans = Arrays.asList("true", "false"); private final List<String> booleans = Arrays.asList("true", "false");
@Scheduled(cron = "0 */3 * * * ?") @Scheduled(cron = "0 */10 * * * ?")
@Override @Override
public void dataSolidification() { public void dataSolidification() {
Long startTime = System.currentTimeMillis(); Long startTime = System.currentTimeMillis();
...@@ -87,10 +86,11 @@ public class DasServiceImpl implements DasService { ...@@ -87,10 +86,11 @@ public class DasServiceImpl implements DasService {
HashMap<String, String> syncFlag = new HashMap<>(); HashMap<String, String> syncFlag = new HashMap<>();
syncFlag.put("gateway_id", gatewayId); syncFlag.put("gateway_id", gatewayId);
syncFlag.put("sync_flag", "success"); syncFlag.put("sync_flag", "success");
// emqKeeper.getMqttClient().publish("sync_esdata_to_tdengine_notice", JSON.toJSONString(syncFlag).getBytes(), 0, false); emqKeeper.getMqttClient().publish("sync_esdata_to_tdengine_notice", JSON.toJSONString(syncFlag).getBytes(), 0, false);
log.info("同步ES数据至发发送消息给业务发送通知成功!"); log.info("同步物联监盘数据至发发送消息给业务发送通知成功!");
} catch (Exception exception) { } 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