Browse Source

非nacos北斗辅助定位项目代码提交

develop
林万龙 3 years ago
parent
commit
c27b73b144
7 changed files with 3 additions and 25 deletions
  1. +0
    -1
      src/main/java/com/telpo/beidouast/entity/mongo/IPProvinceEntity.java
  2. +0
    -4
      src/main/java/com/telpo/beidouast/handler/NettyServerHandler.java
  3. +1
    -2
      src/main/java/com/telpo/beidouast/handler/ServerChannelInitializer.java
  4. +0
    -6
      src/main/java/com/telpo/beidouast/server/DipperPositionServer.java
  5. +1
    -2
      src/main/java/com/telpo/beidouast/service/IPProvinceService.java
  6. +1
    -8
      src/main/java/com/telpo/beidouast/service/impl/DipperAstPosAsyncTaskServiceImpl.java
  7. +0
    -2
      src/main/java/com/telpo/beidouast/service/impl/DipperAstTimeAsyncTaskServiceImpl.java

+ 0
- 1
src/main/java/com/telpo/beidouast/entity/mongo/IPProvinceEntity.java View File

@@ -1,6 +1,5 @@
package com.telpo.beidouast.entity.mongo; package com.telpo.beidouast.entity.mongo;


import com.telpo.beidouast.vo.IPProvinceVo;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString; import lombok.ToString;


+ 0
- 4
src/main/java/com/telpo/beidouast/handler/NettyServerHandler.java View File

@@ -1,6 +1,5 @@
package com.telpo.beidouast.handler; package com.telpo.beidouast.handler;


import com.telpo.beidouast.enums.DipperReturnValue;
import com.telpo.beidouast.service.IDipperAstPosAsyncTaskService; import com.telpo.beidouast.service.IDipperAstPosAsyncTaskService;
import com.telpo.beidouast.service.IDipperAstTimeAsyncTaskService; import com.telpo.beidouast.service.IDipperAstTimeAsyncTaskService;
import com.telpo.beidouast.service.IDipperDataAsyncTaskService; import com.telpo.beidouast.service.IDipperDataAsyncTaskService;
@@ -13,9 +12,6 @@ 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 java.io.InputStream;
import java.time.LocalDateTime;

/** /**
* @program: dipperposition * @program: dipperposition
* @description: Netty服务器处理句柄 * @description: Netty服务器处理句柄


+ 1
- 2
src/main/java/com/telpo/beidouast/handler/ServerChannelInitializer.java View File

@@ -1,7 +1,6 @@
package com.telpo.beidouast.handler; package com.telpo.beidouast.handler;


import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.string.StringDecoder; import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder; import io.netty.handler.codec.string.StringEncoder;
@@ -14,7 +13,7 @@ import io.netty.util.CharsetUtil;
**/ **/
public class ServerChannelInitializer extends ChannelInitializer<SocketChannel> { public class ServerChannelInitializer extends ChannelInitializer<SocketChannel> {
@Override @Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
protected void initChannel(SocketChannel socketChannel) {
//添加编解码 //添加编解码
socketChannel.pipeline().addLast("decoder", new StringDecoder(CharsetUtil.UTF_8)); socketChannel.pipeline().addLast("decoder", new StringDecoder(CharsetUtil.UTF_8));
socketChannel.pipeline().addLast("encoder", new StringEncoder(CharsetUtil.UTF_8)); socketChannel.pipeline().addLast("encoder", new StringEncoder(CharsetUtil.UTF_8));


+ 0
- 6
src/main/java/com/telpo/beidouast/server/DipperPositionServer.java View File

@@ -11,8 +11,6 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.ConfigurableEnvironment;


import java.net.InetSocketAddress;

/** /**
* @program: DipperPositionServer * @program: DipperPositionServer
* @description: 北斗定位 * @description: 北斗定位
@@ -23,16 +21,12 @@ import java.net.InetSocketAddress;
public class DipperPositionServer { public class DipperPositionServer {


// @Autowired PositionConfigInfo positionConfigInfo; // @Autowired PositionConfigInfo positionConfigInfo;
private String serverAddr;
private Integer serverPort;
private Integer timeAsycPort; private Integer timeAsycPort;
private Integer posAsycPort; private Integer posAsycPort;
private Integer starsAsycPort; private Integer starsAsycPort;


public DipperPositionServer(ConfigurableEnvironment environment) { public DipperPositionServer(ConfigurableEnvironment environment) {


this.serverAddr = environment.getProperty("position-server.serverAddr");
this.serverPort = Integer.parseInt(environment.getProperty("server.port"));
this.timeAsycPort = Integer.parseInt(environment.getProperty("position-server.timeAsycPort")); this.timeAsycPort = Integer.parseInt(environment.getProperty("position-server.timeAsycPort"));
this.posAsycPort = Integer.parseInt(environment.getProperty("position-server.posAsycPort")); this.posAsycPort = Integer.parseInt(environment.getProperty("position-server.posAsycPort"));
this.starsAsycPort = Integer.parseInt(environment.getProperty("position-server.starsAsycPort")); this.starsAsycPort = Integer.parseInt(environment.getProperty("position-server.starsAsycPort"));


+ 1
- 2
src/main/java/com/telpo/beidouast/service/IPProvinceService.java View File

@@ -1,7 +1,6 @@
package com.telpo.beidouast.service; package com.telpo.beidouast.service;


import com.telpo.dipperposition.entity.mongo.IPProvinceEntity;
import com.telpo.dipperposition.vo.IPProvinceVo;
import com.telpo.beidouast.entity.mongo.IPProvinceEntity;


/** /**
* @program: IPProvinceService * @program: IPProvinceService


+ 1
- 8
src/main/java/com/telpo/beidouast/service/impl/DipperAstPosAsyncTaskServiceImpl.java View File

@@ -1,24 +1,17 @@
package com.telpo.beidouast.service.impl; package com.telpo.beidouast.service.impl;


import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner;
import com.telpo.dipperposition.common.*;
import com.telpo.beidouast.common.*;
import com.telpo.beidouast.entity.mongo.IPProvinceEntity; import com.telpo.beidouast.entity.mongo.IPProvinceEntity;
import com.telpo.beidouast.mapper.IPProvinceMapper;
import com.telpo.beidouast.service.IDipperAstPosAsyncTaskService; import com.telpo.beidouast.service.IDipperAstPosAsyncTaskService;
import com.telpo.beidouast.service.IPProvinceService; import com.telpo.beidouast.service.IPProvinceService;
import com.telpo.beidouast.vo.IPProvinceVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;


import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;


/** /**


+ 0
- 2
src/main/java/com/telpo/beidouast/service/impl/DipperAstTimeAsyncTaskServiceImpl.java View File

@@ -1,10 +1,8 @@
package com.telpo.beidouast.service.impl; package com.telpo.beidouast.service.impl;


import com.telpo.beidouast.common.HexConvert; import com.telpo.beidouast.common.HexConvert;
import com.telpo.beidouast.common.SocketClient;
import com.telpo.beidouast.service.IDipperAstTimeAsyncTaskService; import com.telpo.beidouast.service.IDipperAstTimeAsyncTaskService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;




Loading…
Cancel
Save