ソースを参照

修改到docker外运行环境

tags/v1.0.0^2
林万龙 4年前
コミット
aa9533018a
1個のファイルの変更17行の追加7行の削除
  1. +17
    -7
      src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java

+ 17
- 7
src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java ファイルの表示

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.io.InputStream;
import java.time.LocalDateTime;

@@ -42,6 +43,8 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
private static String AST_POS_CMD_BYTE = "504f53";
private static String AST_EPH_CMD_BYTE = "455048";

@Autowired
private PositionConfig positionConfig;
@Autowired
private IDipperAstTimeAsyncTaskService dipperTimeAsyncTaskService;

@@ -51,10 +54,17 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
@Autowired
private IDipperDataAsyncTaskService dipperDataAsyncTaskService;

@Autowired
private NettyServerConfig nettyServerConfig;
@Autowired
private PositionConfig positionConfig;
private static NettyServerHandler nettyServerHandler;

@PostConstruct
public void init() {
nettyServerHandler = this;
nettyServerHandler.positionConfig = this.positionConfig;
nettyServerHandler.dipperTimeAsyncTaskService = this.dipperTimeAsyncTaskService;
nettyServerHandler.dipperAstPosAsyncTaskService = this.dipperAstPosAsyncTaskService;
nettyServerHandler.dipperDataAsyncTaskService = this.dipperDataAsyncTaskService;
}

/**
* 客户端连接会触发
*/
@@ -124,7 +134,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
// if (dipperTimeAsyncTaskService == null) {
// dipperTimeAsyncTaskService = new DipperAstTimeAsyncTaskServiceImpl();
// }
channelAns = dipperTimeAsyncTaskService.pushAstTime();
channelAns = nettyServerHandler.dipperTimeAsyncTaskService.pushAstTime();
}

// 发送SDBP-AST-POS获取辅助位置信息
@@ -146,7 +156,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
// if (dipperAstPosAsyncTaskService == null) {
// dipperAstPosAsyncTaskService = new DipperAstPosAsyncTaskServiceImpl();
// }
channelAns = dipperAstPosAsyncTaskService.pushAstPos(ipAddress);
channelAns = nettyServerHandler.dipperAstPosAsyncTaskService.pushAstPos(ipAddress);
// (ipAddress,
// "/csv/provinceLonAlt.csv",
// "湖北省",
@@ -161,7 +171,7 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
// if (dipperDataAsyncTaskService == null) {
// dipperDataAsyncTaskService = new DipperDataAsyncTaskServiceImpl();
// }
channelAns = dipperDataAsyncTaskService.getAstEPH();
channelAns = nettyServerHandler.dipperDataAsyncTaskService.getAstEPH();
}

log.info(channelAns);


読み込み中…
キャンセル
保存