| | |
| | | import com.ard.utils.udp.NettyUdpServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | **/ |
| | | @Service |
| | | @Slf4j(topic = "tube") |
| | | @Order(3) |
| | | public class TubeAlarmService { |
| | | @Resource |
| | | NettyUdpServer nettyUdpServer; |
| | |
| | | return; |
| | | } |
| | | nettyUdpServer.init(udpPort); |
| | | log.info("UDP服务已启动"); |
| | | log.info("管线泄露UDP服务已启动"); |
| | | } |
| | | |
| | | |
| | | @Async("alarm") |
| | | public void alarmHandler(String message) { |
| | |
| | | String start = messages[0]; |
| | | String host = messages[1]; |
| | | String tubeId = messages[2]; |
| | | String alarmTime = DateUtils.convertDate(messages[3]); |
| | | String alarmTime = DateUtils.convertDate(messages[3], "yyyy/M/d H:m:s"); |
| | | String position = messages[4]; |
| | | String type = messages[5]; |
| | | String watcher = messages[6]; |
| | |
| | | log.error("tube报警数据推送异常:" + ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |