Ver Fonte

数据异常添加和修改 增加查询返回 data-accept 无效引用和数据采集端

jianghouwei há 6 anos atrás
pai
commit
e3cd2304a8

+ 0 - 2
src/main/java/com/tidecloud/dataacceptance/service/HexBinaryAcceptanceHandlerAdapter.java

@@ -2,8 +2,6 @@ package com.tidecloud.dataacceptance.service;
 
 import javax.xml.bind.DatatypeConverter;
 
-import com.sun.scenario.effect.Reflection;
-import io.netty.util.ReferenceCountUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;

+ 11 - 0
src/main/java/com/tidecloud/dataacceptance/service/impl/GK309GpsServerHandler.java

@@ -1,5 +1,6 @@
 package com.tidecloud.dataacceptance.service.impl;
 
+import com.accept.client.DeviceMsgClient;
 import com.tidecloud.dataacceptance.codec.HeaderTailDelimiterFrameDecoder;
 import com.tidecloud.dataacceptance.common.CRCUtil;
 import com.tidecloud.dataacceptance.common.DateUtil;
@@ -21,6 +22,7 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
@@ -58,6 +60,9 @@ public class GK309GpsServerHandler extends HexBinaryAcceptanceHandlerAdapter {
 
     private static final Integer DATA_SIZE = 6;
 
+    @Autowired
+    private DeviceMsgClient deviceMsgClient;
+
     @Override
     protected void handle(ByteBuf in, Channel channel) throws Exception {
         if (in.isReadable()) {
@@ -103,11 +108,17 @@ public class GK309GpsServerHandler extends HexBinaryAcceptanceHandlerAdapter {
                 reply(channel, STATUS_MSG, "心跳包");
                 byte[] bytes = byteMerger(getOriginalData(in, deviceId), DateUtil.formatDate2String(new Date()).getBytes());
                 sendMsg2Kafka(bytes, deviceId, channel);// 心跳数据对接
+                deviceMsgClient.acceptDeviceMsgParam("kangkaisi",
+                        deviceId,2,
+                        DatatypeConverter.printHexBinary(bytes), System.currentTimeMillis());
             } else if (LOCATION_MSG == msgType) {
                 logger.info("GPS 定位包");
                 // resolveLocationMSG(in,deviceId);
                 byte[] bytes = byteMerger(getOriginalData(in, deviceId), DateUtil.formatDate2String(new Date()).getBytes());
                 sendMsg2Kafka(bytes, deviceId, channel);
+                deviceMsgClient.acceptDeviceMsgParam("kangkaisi",
+                        deviceId,2,
+                        DatatypeConverter.printHexBinary(bytes), System.currentTimeMillis());
             } else if (CORRECT_TIME_MSG == msgType) {
                 reply(channel, CORRECT_TIME_MSG, "校时包");
             } else {

+ 12 - 0
src/main/java/com/tidecloud/dataacceptance/service/impl/JSTGPServerHandler.java

@@ -1,5 +1,7 @@
 package com.tidecloud.dataacceptance.service.impl;
 
+import com.accept.client.DeviceMsgClient;
+import com.alibaba.fastjson.JSON;
 import com.tidecloud.dataacceptance.codec.MsgDecoder;
 import com.tidecloud.dataacceptance.common.Constants;
 import com.tidecloud.dataacceptance.common.DateUtil;
@@ -20,6 +22,7 @@ import io.netty.handler.timeout.IdleStateHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.data.redis.util.ByteUtils;
 import org.springframework.stereotype.Component;
@@ -42,6 +45,9 @@ public class JSTGPServerHandler extends HexBinaryAcceptanceHandlerAdapter {
 
 	private TerminalMsgProcessService msgProcessService = new TerminalMsgProcessService();
 
+	@Autowired
+	private DeviceMsgClient deviceMsgClient;
+
 	@Override
 	public void handle(ByteBuf dataByteBuf, Channel channel) throws Exception {
 
@@ -88,6 +94,9 @@ public class JSTGPServerHandler extends HexBinaryAcceptanceHandlerAdapter {
 				this.msgProcessService.processTerminalHeartBeatMsg(packageData);
 				manageChannel(packageData.getChannel(), header.getTerminalPhone());
 				logger.info("<<<<<[终端心跳],phone={},flowid={}", header.getTerminalPhone(), header.getFlowId());
+				deviceMsgClient.acceptDeviceMsgParam("jinshatian",
+						packageData.getDeviceId(),
+						1, JSON.toJSONString(packageData, true), System.currentTimeMillis());
 			} catch (Exception e) {
 				logger.error("<<<<<[终端心跳]处理错误,phone={},flowid={},err={}", header.getTerminalPhone(), header.getFlowId(),
 						e.getMessage());
@@ -137,6 +146,9 @@ public class JSTGPServerHandler extends HexBinaryAcceptanceHandlerAdapter {
 				LocationInfoUploadMsg locationInfoUploadMsg = this.decoder.toLocationInfoUploadMsg(packageData);
 				this.msgProcessService.processLocationInfoUploadMsg(locationInfoUploadMsg);
 				logger.info("<<<<<[位置信息],phone={},flowid={}", header.getTerminalPhone(), header.getFlowId());
+				deviceMsgClient.acceptDeviceMsgParam("jinshatian",
+						packageData.getDeviceId(),
+						2, JSON.toJSONString(packageData, true), System.currentTimeMillis());
 			} catch (Exception e) {
 				logger.error("<<<<<[位置信息]处理错误,phone={},flowid={},err={}", header.getTerminalPhone(), header.getFlowId(),
 						e.getMessage());

+ 209 - 198
src/main/java/com/tidecloud/dataacceptance/service/impl/WatchHenShengServerHandler.java

@@ -1,5 +1,6 @@
 package com.tidecloud.dataacceptance.service.impl;
 
+import com.accept.client.DeviceMsgClient;
 import com.tidecloud.dataacceptance.common.DateUtil;
 import com.tidecloud.dataacceptance.entity.Advice;
 import com.tidecloud.dataacceptance.service.HexBinaryAcceptanceHandlerAdapter;
@@ -16,6 +17,7 @@ import io.netty.handler.logging.LogLevel;
 import io.netty.handler.logging.LoggingHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
@@ -35,208 +37,217 @@ import java.util.concurrent.TimeUnit;
 @Component(WatchHenShengServerHandler.name)
 public class WatchHenShengServerHandler extends HexBinaryAcceptanceHandlerAdapter {
 
-	public static final String name = "WatchHenShengServerHandler";
-	private static final Logger logger = LoggerFactory.getLogger(WatchHenShengServerHandler.class);
-	private static ExecutorService executorService = Executors.newSingleThreadExecutor();
-
-	@Override
-	protected void handle(ByteBuf in, Channel channel) throws Exception {
-		byte[] req = new byte[in.readableBytes()];
-		in.readBytes(req);
-		String msg = new String(req, "UTF-8");
-		logger.info("传入数据:》》》》》》》》》" + msg);
-		Advice advice = setAdvice(msg);
-		if (advice == null) {
-			return;
-		}
-		switch (advice.getAdviceType()) {
-			case "INIT": // 初始化
-				String init = "INIT,1";
-				normalReply(advice, channel, init);
-				//setUpload(advice, channel);
-				break;
-			case "LK": // 连接
-				sendMsg2Kafka((msg + DateUtil.formatDate2String(new Date())).getBytes(), advice.getDeviceId(), channel);
-				normalReply(advice, channel, getLinkTime());
-				break;
-			case "UD": // 位置信息
-				sendMsg2Kafka(msg.getBytes(), advice.getDeviceId(), channel);
-				logger.info("位置数据上报[UD]:" + advice.toString());
-				normalReply(advice, channel, "UD");
-				break;
-			case "UD2": // 位置信息
-				logger.info("盲点补传数据:" + advice.toString());
-				sendMsg2Kafka(msg.getBytes(), advice.getDeviceId(), channel);
-				//normalReply(advice, channel, "UD2");
-				break;
-			case "UPLOAD": // 位置信息
-				logger.info("修改上报频率成功!");
-				break;
-			case "LGZONE": // 终端获取时间
-				logger.info("终端获取时间[LGZONE]:" + advice.toString());
-				normalReply(advice, channel, getlgZoneTime());
-				break;
-			default: // 其他
-				logger.info("client send data without handle type ...");
-				//normalReply(advice, channel, advice.getAdviceType());
-				break;
-		}
-	}
-
-	protected String getLinkTime() {
-		DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd,HH:mm:ss");
-		Date date = new Date();
-		TimeZone pst = TimeZone.getTimeZone("Etc/GMT+0");// 0时区
-		dateFormatter.setTimeZone(pst);
-		String lk_time = dateFormatter.format(date);
-		StringBuilder sb = new StringBuilder("LK,").append(lk_time);
-		return sb.toString();
-	}
+    public static final String name = "WatchHenShengServerHandler";
+    private static final Logger logger = LoggerFactory.getLogger(WatchHenShengServerHandler.class);
+    private static ExecutorService executorService = Executors.newSingleThreadExecutor();
+
+    @Autowired
+    private DeviceMsgClient deviceMsgClient;
+
+    @Override
+    protected void handle(ByteBuf in, Channel channel) throws Exception {
+        byte[] req = new byte[in.readableBytes()];
+        in.readBytes(req);
+        String msg = new String(req, "UTF-8");
+        logger.info("传入数据:》》》》》》》》》" + msg);
+        Advice advice = setAdvice(msg);
+        if (advice == null) {
+            return;
+        }
+        switch (advice.getAdviceType()) {
+            case "INIT": // 初始化
+                String init = "INIT,1";
+                normalReply(advice, channel, init);
+                //setUpload(advice, channel);
+                break;
+            case "LK": // 连接
+                sendMsg2Kafka((msg + DateUtil.formatDate2String(new Date())).getBytes(), advice.getDeviceId(), channel);
+                normalReply(advice, channel, getLinkTime());
+                deviceMsgClient.acceptDeviceMsgParam("hengsheng",
+                        advice.getDeviceId(),
+                        1, msg, System.currentTimeMillis());
+                break;
+            case "UD": // 位置信息
+                sendMsg2Kafka(msg.getBytes(), advice.getDeviceId(), channel);
+                logger.info("位置数据上报[UD]:" + advice.toString());
+                normalReply(advice, channel, "UD");
+                deviceMsgClient.acceptDeviceMsgParam("hengsheng",
+                        advice.getDeviceId(),
+                        2, msg, System.currentTimeMillis());
+                break;
+            case "UD2": // 位置信息
+                logger.info("盲点补传数据:" + advice.toString());
+                sendMsg2Kafka(msg.getBytes(), advice.getDeviceId(), channel);
+                //normalReply(advice, channel, "UD2");
+                break;
+            case "UPLOAD": // 位置信息
+                logger.info("修改上报频率成功!");
+                break;
+            case "LGZONE": // 终端获取时间
+                logger.info("终端获取时间[LGZONE]:" + advice.toString());
+                normalReply(advice, channel, getlgZoneTime());
+                break;
+            default: // 其他
+                logger.info("client send data without handle type ...");
+                //normalReply(advice, channel, advice.getAdviceType());
+                break;
+        }
+    }
+
+    protected String getLinkTime() {
+        DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd,HH:mm:ss");
+        Date date = new Date();
+        TimeZone pst = TimeZone.getTimeZone("Etc/GMT+0");// 0时区
+        dateFormatter.setTimeZone(pst);
+        String lk_time = dateFormatter.format(date);
+        StringBuilder sb = new StringBuilder("LK,").append(lk_time);
+        return sb.toString();
+    }
 
 //	public static void main(String[] args) {
 //	   getlgZoneTime();
 //	}
 
-	protected static String getlgZoneTime() {
-		DateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss,yyyy-MM-dd");
-		Date date = new Date();
-		String lk_time = dateFormatter.format(date);
-		StringBuilder sb = new StringBuilder("LGZONE,+8,").append(lk_time);
-		return sb.toString();
-	}
-
-	protected void printAcceptanceData(ByteBuf dataByteBuf, ChannelHandlerContext ctx) {
-		ByteBuf dataByteBufCopy = dataByteBuf.copy();
-		byte[] dataByteArray = new byte[dataByteBufCopy.readableBytes()];
-		dataByteBufCopy.readBytes(dataByteArray);
-		dataByteBufCopy.release();
-	}
-
-	/**
-	 * 设置终端 上报频率
-	 *
-	 * @param advice
-	 * @param channel
-	 */
-	protected void setUpload(Advice advice, Channel channel) {
-		String content = "UPLOAD,1";// 一分钟一次
-		Date loginTime = new Date();
-		executorService.execute(new Runnable() {
-			@Override
-			public void run() {
-				Date currentTime = new Date();
-				try {
-					Long secondsSinceLogin = (currentTime.getTime() - loginTime.getTime()) / 1000;
-					if (secondsSinceLogin < 5L) {
-						TimeUnit.SECONDS.sleep(5 - secondsSinceLogin);
-					}
-					normalReply(advice, channel, content);
-				} catch (InterruptedException e) {
-					logger.error(e.getMessage());
-				}
-			}
-		});
-	}
-
-	/**
-	 * 回复
-	 * [ZJ*YYYYYYYYYY*NNNN*LEN*INIT,接收结果,]
-	 *
-	 * @param advice
-	 * @param channel
-	 * @content 回复内容
-	 */
-	private void normalReply(Advice advice, Channel channel, String content) {
-		String factory = advice.getFacotry();
-		String deviceId = advice.getDeviceId();
-		StringBuilder replyCommand = new StringBuilder();
-		replyCommand.append("[");
-		replyCommand.append(factory).append("*");
-		replyCommand.append(deviceId).append("*");
-		replyCommand.append("0001").append("*");// 指令流水
-		replyCommand.append(numToHex16(content.length())).append("*");// 内容长度
-		replyCommand.append(content);// 指令内容标记
-		replyCommand.append("]");
-		String replyCommandStr = replyCommand.toString();
-		ByteBuf buffer = Unpooled.buffer(replyCommandStr.getBytes().length);
-		buffer.writeBytes(replyCommandStr.getBytes());
-		ChannelFuture channelFuture = channel.writeAndFlush(buffer);
-		channelFuture.addListener(future -> logger.info("Normal reply :" + replyCommandStr));
-	}
-
-	//使用1字节就可以表示b
-	public static String numToHex8(int b) {
-		return String.format("%02x", b);//2表示需要两个16进行数
-	}
-
-	//需要使用2字节表示b
-	public static String numToHex16(int b) {
-		return String.format("%04x", b);
-	}
-
-	public static String numToHex32(int b) {
-		return String.format("%08x", b);
-	}
-
-	/**
-	 * 解析 Advice 数据
-	 *
-	 * @param msg
-	 * @return
-	 */
-	private Advice setAdvice(String msg) {
-
-		Advice advice = new Advice();
-		if (msg != null) {
-			try {
-				//厂商标识	设备ID	指令流水号	内容长度	指令内容
-				String message = String.valueOf(msg);
-				int startIndex = message.indexOf("[");
-				int endIndex = message.indexOf("]");
-				String data = message.substring(startIndex + 1, endIndex);
-				String[] bodys = data.split("\\*");
-				advice.setFacotry(bodys[0]);// 厂商
-				advice.setDeviceId(bodys[1]);// 设备Id
+    protected static String getlgZoneTime() {
+        DateFormat dateFormatter = new SimpleDateFormat("HH:mm:ss,yyyy-MM-dd");
+        Date date = new Date();
+        String lk_time = dateFormatter.format(date);
+        StringBuilder sb = new StringBuilder("LGZONE,+8,").append(lk_time);
+        return sb.toString();
+    }
+
+    protected void printAcceptanceData(ByteBuf dataByteBuf, ChannelHandlerContext ctx) {
+        ByteBuf dataByteBufCopy = dataByteBuf.copy();
+        byte[] dataByteArray = new byte[dataByteBufCopy.readableBytes()];
+        dataByteBufCopy.readBytes(dataByteArray);
+        dataByteBufCopy.release();
+    }
+
+    /**
+     * 设置终端 上报频率
+     *
+     * @param advice
+     * @param channel
+     */
+    protected void setUpload(Advice advice, Channel channel) {
+        String content = "UPLOAD,1";// 一分钟一次
+        Date loginTime = new Date();
+        executorService.execute(new Runnable() {
+            @Override
+            public void run() {
+                Date currentTime = new Date();
+                try {
+                    Long secondsSinceLogin = (currentTime.getTime() - loginTime.getTime()) / 1000;
+                    if (secondsSinceLogin < 5L) {
+                        TimeUnit.SECONDS.sleep(5 - secondsSinceLogin);
+                    }
+                    normalReply(advice, channel, content);
+                } catch (InterruptedException e) {
+                    logger.error(e.getMessage());
+                }
+            }
+        });
+    }
+
+    /**
+     * 回复
+     * [ZJ*YYYYYYYYYY*NNNN*LEN*INIT,接收结果,]
+     *
+     * @param advice
+     * @param channel
+     * @content 回复内容
+     */
+    private void normalReply(Advice advice, Channel channel, String content) {
+        String factory = advice.getFacotry();
+        String deviceId = advice.getDeviceId();
+        StringBuilder replyCommand = new StringBuilder();
+        replyCommand.append("[");
+        replyCommand.append(factory).append("*");
+        replyCommand.append(deviceId).append("*");
+        replyCommand.append("0001").append("*");// 指令流水
+        replyCommand.append(numToHex16(content.length())).append("*");// 内容长度
+        replyCommand.append(content);// 指令内容标记
+        replyCommand.append("]");
+        String replyCommandStr = replyCommand.toString();
+        ByteBuf buffer = Unpooled.buffer(replyCommandStr.getBytes().length);
+        buffer.writeBytes(replyCommandStr.getBytes());
+        ChannelFuture channelFuture = channel.writeAndFlush(buffer);
+        channelFuture.addListener(future -> logger.info("Normal reply :" + replyCommandStr));
+    }
+
+    //使用1字节就可以表示b
+    public static String numToHex8(int b) {
+        return String.format("%02x", b);//2表示需要两个16进行数
+    }
+
+    //需要使用2字节表示b
+    public static String numToHex16(int b) {
+        return String.format("%04x", b);
+    }
+
+    public static String numToHex32(int b) {
+        return String.format("%08x", b);
+    }
+
+    /**
+     * 解析 Advice 数据
+     *
+     * @param msg
+     * @return
+     */
+    private Advice setAdvice(String msg) {
+
+        Advice advice = new Advice();
+        if (msg != null) {
+            try {
+                //厂商标识	设备ID	指令流水号	内容长度	指令内容
+                String message = String.valueOf(msg);
+                int startIndex = message.indexOf("[");
+                int endIndex = message.indexOf("]");
+                String data = message.substring(startIndex + 1, endIndex);
+                String[] bodys = data.split("\\*");
+                advice.setFacotry(bodys[0]);// 厂商
+                advice.setDeviceId(bodys[1]);// 设备Id
 //			advice.setAdviceSerial(bodys[2]);//指令流水
-				advice.setAdvicelength(bodys[3]);//指令长度
-				String[] contents = bodys[4].split(",");//获取内容
-				advice.setAdviceType(contents[0]);// 标记
-				return advice;
-			} catch (Exception e) {
-				logger.error(e.getMessage(), e);
-			}
-		}
-		return null;
-	}
-
-	@Override
-	public void startAcceptor() {
-		EventLoopGroup bossGroup = new NioEventLoopGroup();
-		EventLoopGroup workerGroup = new NioEventLoopGroup();
-		try {
-			ServerBootstrap b = new ServerBootstrap();
-			b.group(bossGroup, workerGroup)
-					.channel(NioServerSocketChannel.class)
-					.option(ChannelOption.SO_BACKLOG, 1024)
-					.handler(new LoggingHandler(LogLevel.INFO))
-					.childHandler(new ChannelInitializer<SocketChannel>() {
-						@Override
-						protected void initChannel(SocketChannel ch) {
-							ByteBuf delimiter = Unpooled.copiedBuffer("]".getBytes());
-							ch.pipeline().addLast(new DelimiterBasedFrameDecoder(65535, false, delimiter));
-							ch.pipeline().addLast(WatchHenShengServerHandler.this);
-						}
-					});
-			ChannelFuture f = b.bind(port).sync();
-			logger.info("start accept service for {}, bind address {}:{}", this.getPrefixName(), this.getIp(),
-					this.getPort());
-			f.channel().closeFuture().sync();
-		} catch (Exception ex) {
-			logger.warn(ex.getMessage(), ex);
-		} finally {
-			cleanRedisLinkData();
-			workerGroup.shutdownGracefully();
-			bossGroup.shutdownGracefully();
-		}
-	}
+                advice.setAdvicelength(bodys[3]);//指令长度
+                String[] contents = bodys[4].split(",");//获取内容
+                advice.setAdviceType(contents[0]);// 标记
+                return advice;
+            } catch (Exception e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void startAcceptor() {
+        EventLoopGroup bossGroup = new NioEventLoopGroup();
+        EventLoopGroup workerGroup = new NioEventLoopGroup();
+        try {
+            ServerBootstrap b = new ServerBootstrap();
+            b.group(bossGroup, workerGroup)
+                    .channel(NioServerSocketChannel.class)
+                    .option(ChannelOption.SO_BACKLOG, 1024)
+                    .handler(new LoggingHandler(LogLevel.INFO))
+                    .childHandler(new ChannelInitializer<SocketChannel>() {
+                        @Override
+                        protected void initChannel(SocketChannel ch) {
+                            ByteBuf delimiter = Unpooled.copiedBuffer("]".getBytes());
+                            ch.pipeline().addLast(new DelimiterBasedFrameDecoder(65535, false, delimiter));
+                            ch.pipeline().addLast(WatchHenShengServerHandler.this);
+                        }
+                    });
+            ChannelFuture f = b.bind(port).sync();
+            logger.info("start accept service for {}, bind address {}:{}", this.getPrefixName(), this.getIp(),
+                    this.getPort());
+            f.channel().closeFuture().sync();
+        } catch (Exception ex) {
+            logger.warn(ex.getMessage(), ex);
+        } finally {
+            cleanRedisLinkData();
+            workerGroup.shutdownGracefully();
+            bossGroup.shutdownGracefully();
+        }
+    }
 }

+ 6 - 0
src/main/java/com/tidecloud/dataacceptance/service/impl/WatchJWServerHandler.java

@@ -1,6 +1,7 @@
 package com.tidecloud.dataacceptance.service.impl;
 
 import com.accept.client.DeviceCronClient;
+import com.accept.client.DeviceMsgClient;
 import com.accept.client.VoiceMsgClient;
 import com.accept.model.VoiceMsgVo;
 import com.alibaba.fastjson.JSON;
@@ -84,6 +85,9 @@ public class WatchJWServerHandler extends HexBinaryAcceptanceHandlerAdapter {
     @Autowired
     private DeviceCronClient deviceCronClient;
 
+    @Autowired
+    private DeviceMsgClient deviceMsgClient;
+
     @Override
     protected void handle(ByteBuf in, Channel channel) throws Exception {
         //String msg = byteBufferToString(in.nioBuffer());TODO (注意)
@@ -136,12 +140,14 @@ public class WatchJWServerHandler extends HexBinaryAcceptanceHandlerAdapter {
                     sendMsg2Kafka((msg + deviceId + "," + DateUtil.formatDate2String(new Date())).getBytes(), deviceId, channel);// 心跳报文下发
                     logger.warn("心跳报文下发 msg+" + msg);
                     sendApthReplyToClient(deviceId, channel);
+                    deviceMsgClient.acceptDeviceMsgParam("jingwei",deviceId,1,msg,System.currentTimeMillis());
                     break;
                 case "AP01": // 位置信息
                     String gpsState = msg.substring(12, 13);
                     // 如果当前GPS 上报时间和当前服务器时间超过1小时直接断开连接重新连接
                     setSwitchMap(deviceId, gpsState, msg, channel);// 采集数据
                     normalReply(factory, channel, "BP01");
+                    deviceMsgClient.acceptDeviceMsgParam("jingwei",deviceId,2,msg,System.currentTimeMillis());
                     break;
                 case "AP33": // 设置模式回复
                     //IWAP33,080835,1#   IWAP33,080835,03#

+ 157 - 0
src/main/resources/test/application.yml

@@ -0,0 +1,157 @@
+spring:
+  application:
+    name: device-acceptance
+  kafka:
+    bootstrap-servers: 192.168.0.119:9092
+  profiles:
+    active: all
+  redis:
+    host: 10.25.48.128
+    password: tidecloudredis
+    timeout: 10000
+    port: 6379
+    max: 100
+    maxIdle: 10
+    minIdle: 3
+    maxWaitMills: 10000
+eureka:
+  client:
+    service-url:
+      defaultZone: http://192.168.0.110:12000/eureka
+  instance:
+    prefer-ip-address: true
+#    port: 16666
+#    localaddress: 10.27.118.76
+server:
+  port: ${random.int(16000,19999)}
+---
+spring:
+  profiles: all
+  application:
+    name: acceptance-product
+
+acceptance:
+ device:
+  deviceList:
+   -
+    name: watch
+    topic: device-watch
+    ip: 10.27.118.76
+    port: 7019
+    dataFileDir: /home/service/collector_watch/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.WatchServerHandler
+    enable: true
+
+   -
+    name: bingshui
+    topic: device-bingshui
+    ip: 10.27.118.76
+    port: 6001
+    dataFileDir: /home/service/collector_7510/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.BingShuiGpsServerHandler
+    enable: true
+
+   -
+    name: bsj
+    topic: device-bsj
+    ip: 10.25.19.87
+    port: 6717
+    dataFileDir: /home/service/collector_6707/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.BSJGpsServerHandler
+    enable: true
+
+   -
+    name: wangrui-bsj
+    topic: device-bsj
+    ip: 10.29.44.67
+    port: 7518
+    dataFileDir: /home/service/collector_6707/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.BSJGpsServerHandler
+    enable: false
+
+   -
+    name: yitong
+    topic: device-yitong
+    ip: 10.27.118.76
+    port: 7111
+    dataFileDir: /home/service/collector_yitong/rawdata-car/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.YiTongGpsServerHandler
+    enable: true
+   -
+    name: yuguang
+    topic: device-yuguang
+    ip: 10.27.118.76
+    port: 7510
+    dataFileDir: /home/service/collector_7510/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.YuGuangGpsServerHandler
+    enable: false
+
+   -
+    name: vorgea
+    topic: device-vorgea
+    ip: 10.27.118.76
+    port: 7511
+    dataFileDir: /home/service/collector_vorgea/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.VorgeaUR0401ServerHandler
+    enable: false
+
+   -
+    name: pinshen
+    topic: device-pinshen-water
+    ip: 10.25.19.87
+    port: 7521
+    dataFileDir: /home/service/collector_6727/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.PinShenData86ServerHandler
+    enable: true
+
+   -
+    name: deyijia_watch
+    topic: device-deyijia-watch
+    ip: 10.25.19.87
+    port: 7520
+    dataFileDir: /home/service/collector_6727/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.WatchDYJServerHandler
+    enable: false
+   -
+    name: kds_gp_gps
+    topic: device-kds-gps
+    ip: 10.25.19.87
+    port: 7519
+    dataFileDir: /home/service/collector_7519/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.GK309GpsServerHandler
+    enable: true
+   -
+    name: jingwei_watch
+    topic: device-jingwei-watch
+    ip: 10.25.19.87
+    port: 6000
+    dataFileDir: /home/service/collector_7518/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.WatchJWServerHandler
+    enable: true
+   -
+    name: hensheng_watch
+    topic: device-hensheng-watch
+    ip: 10.25.19.87
+    port: 7527
+    dataFileDir: /home/service/collector_7527/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.WatchHenShengServerHandler
+    enable: true
+   -
+    name: jinshatian_gps
+    topic: device-jinshatian-gps
+    ip: 10.25.19.87
+    port: 6002
+    dataFileDir: /home/service/collector_7527/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.JSTGPServerHandler
+    enable: true
+   -
+    name: tianxi_gps
+    topic: device-tianxi-gps
+    ip: 10.25.19.87
+    port: 6003
+    dataFileDir: /home/service/collector_7527/rawdata/
+    handlerClass: com.tidecloud.dataacceptance.service.impl.TianXiGPServerHandler
+    enable: true
+logging:
+  config:
+    classpath: logback.xml