|
@@ -20,6 +20,7 @@ import io.netty.channel.ChannelInboundHandlerAdapter; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
import java.io.InputStream; |
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
@@ -31,6 +32,7 @@ import java.time.LocalDateTime; |
|
|
* @create: 2021-01-13 13:56 |
|
|
* @create: 2021-01-13 13:56 |
|
|
**/ |
|
|
**/ |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
|
|
|
@Component |
|
|
public class NettyServerHandler extends ChannelInboundHandlerAdapter { |
|
|
public class NettyServerHandler extends ChannelInboundHandlerAdapter { |
|
|
|
|
|
|
|
|
private static String AST_TIME_CMD = "TIME"; |
|
|
private static String AST_TIME_CMD = "TIME"; |
|
@@ -40,11 +42,11 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { |
|
|
private static String AST_POS_CMD_BYTE = "504f53"; |
|
|
private static String AST_POS_CMD_BYTE = "504f53"; |
|
|
private static String AST_EPH_CMD_BYTE = "455048"; |
|
|
private static String AST_EPH_CMD_BYTE = "455048"; |
|
|
|
|
|
|
|
|
private DipperAstTimeAsyncTaskController dipperTimeAsyncTaskController = new DipperAstTimeAsyncTaskController(); |
|
|
|
|
|
|
|
|
private IDipperAstTimeAsyncTaskService dipperTimeAsyncTaskService; |
|
|
|
|
|
|
|
|
private DipperAstPosAsyncTaskController dipperAstPosAsyncTaskController = new DipperAstPosAsyncTaskController(); |
|
|
|
|
|
|
|
|
private IDipperAstPosAsyncTaskService dipperAstPosAsyncTaskService; |
|
|
|
|
|
|
|
|
private DipperDataAsyncTaskController dipperDataAsyncTaskController = new DipperDataAsyncTaskController(); |
|
|
|
|
|
|
|
|
private IDipperDataAsyncTaskService dipperDataAsyncTaskService; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private NettyServerConfig nettyServerConfig; |
|
|
private NettyServerConfig nettyServerConfig; |
|
@@ -119,7 +121,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { |
|
|
// if (dipperTimeAsyncTaskService == null) { |
|
|
// if (dipperTimeAsyncTaskService == null) { |
|
|
// dipperTimeAsyncTaskService = new DipperAstTimeAsyncTaskServiceImpl(); |
|
|
// dipperTimeAsyncTaskService = new DipperAstTimeAsyncTaskServiceImpl(); |
|
|
// } |
|
|
// } |
|
|
channelAns = dipperTimeAsyncTaskController.pushAstTime(); |
|
|
|
|
|
|
|
|
channelAns = dipperTimeAsyncTaskService.pushAstTime(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 发送SDBP-AST-POS获取辅助位置信息 |
|
|
// 发送SDBP-AST-POS获取辅助位置信息 |
|
@@ -141,7 +143,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { |
|
|
// if (dipperAstPosAsyncTaskService == null) { |
|
|
// if (dipperAstPosAsyncTaskService == null) { |
|
|
// dipperAstPosAsyncTaskService = new DipperAstPosAsyncTaskServiceImpl(); |
|
|
// dipperAstPosAsyncTaskService = new DipperAstPosAsyncTaskServiceImpl(); |
|
|
// } |
|
|
// } |
|
|
channelAns = dipperAstPosAsyncTaskController.pushAstPos(ipAddress); |
|
|
|
|
|
|
|
|
channelAns = dipperAstPosAsyncTaskService.pushAstPos(ipAddress); |
|
|
// (ipAddress, |
|
|
// (ipAddress, |
|
|
// "/csv/provinceLonAlt.csv", |
|
|
// "/csv/provinceLonAlt.csv", |
|
|
// "湖北省", |
|
|
// "湖北省", |
|
@@ -156,7 +158,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { |
|
|
// if (dipperDataAsyncTaskService == null) { |
|
|
// if (dipperDataAsyncTaskService == null) { |
|
|
// dipperDataAsyncTaskService = new DipperDataAsyncTaskServiceImpl(); |
|
|
// dipperDataAsyncTaskService = new DipperDataAsyncTaskServiceImpl(); |
|
|
// } |
|
|
// } |
|
|
// channelAns = dipperDataAsyncTaskController.getAstEPH(); |
|
|
|
|
|
|
|
|
channelAns = dipperDataAsyncTaskService.getAstEPH(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
log.info(channelAns); |
|
|
log.info(channelAns); |
|
|