Ver Fonte

修复GK309打卡包中保留信息回复错误bug

vinson há 5 anos atrás
pai
commit
40f3739554

+ 4 - 17
src/main/java/com/tidecloud/dataacceptance/service/impl/GK309GpsServerHandler.java

@@ -67,20 +67,8 @@ public class GK309GpsServerHandler extends HexBinaryAcceptanceHandlerAdapter {
     private static final byte SIGN_IN = 0B00000100; //上班打卡
     private static final byte SIGN_OUT = 0B00001000; // 下班打卡
 
-//    @Autowired
-    private DeviceMsgClient deviceMsgClient = new DeviceMsgClient() {
-    @Override
-    public void acceptDeviceMsg(DeviceMsgDto deviceMsgDto) {
-        logger.info(StringUtil.convert2String(deviceMsgDto));
-
-    }
-
-    @Override
-    public void acceptDeviceMsgParam(String s, String s1, Integer integer, String s2, Long aLong) {
-        logger.info("111");
-
-    }
-};
+    @Autowired
+    private DeviceMsgClient deviceMsgClient;
 
     @Override
     protected void handle(ByteBuf in, Channel channel) throws Exception {
@@ -151,9 +139,8 @@ public class GK309GpsServerHandler extends HexBinaryAcceptanceHandlerAdapter {
                 in.readBytes(dataBytes);
 
                 in.skipBytes(1);
-                short terminalReservedWord = in.readShort();
-                byte[] reservedWorkBytes = short2Bytes(terminalReservedWord);
-
+                byte[] reservedWorkBytes = new byte[2];
+                in.readBytes(reservedWorkBytes);
 
                 // 根据文档查看上下班标示
                 ByteBuf byteBuf = null;