|
@@ -6,6 +6,7 @@ import com.tmzn.devicelinkykc.frameMsg.FrameDataSplicing;
|
|
|
import com.tmzn.devicelinkykc.msgEnum.DeviceSendYkc;
|
|
import com.tmzn.devicelinkykc.msgEnum.DeviceSendYkc;
|
|
|
import com.tmzn.devicelinkykc.redis.RedisCache;
|
|
import com.tmzn.devicelinkykc.redis.RedisCache;
|
|
|
import com.tmzn.devicelinkykc.socket.DeviceConnectionMsg;
|
|
import com.tmzn.devicelinkykc.socket.DeviceConnectionMsg;
|
|
|
|
|
+import com.tmzn.devicelinkykc.socket.SocketHandle;
|
|
|
import com.tmzn.devicelinkykc.util.Encrytion;
|
|
import com.tmzn.devicelinkykc.util.Encrytion;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -26,6 +27,8 @@ import java.util.Date;
|
|
|
public class RealTimeStatusPushFrame {
|
|
public class RealTimeStatusPushFrame {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SocketHandle socketHandle;
|
|
|
|
|
|
|
|
public void deviceStatusPush(DeviceConnectionMsg deviceConnectionMsg, byte[] trans, String pileCode, byte guns, byte gunsStatus, byte gunsInsert, double voltage, double power, BigDecimal elec, BigDecimal money, int time) {
|
|
public void deviceStatusPush(DeviceConnectionMsg deviceConnectionMsg, byte[] trans, String pileCode, byte guns, byte gunsStatus, byte gunsInsert, double voltage, double power, BigDecimal elec, BigDecimal money, int time) {
|
|
|
byte[] encrypt = new byte[0];
|
|
byte[] encrypt = new byte[0];
|
|
@@ -46,8 +49,11 @@ public class RealTimeStatusPushFrame {
|
|
|
deviceConnectionMsg.getOutputStream().write(bytes,0,bytes.length);
|
|
deviceConnectionMsg.getOutputStream().write(bytes,0,bytes.length);
|
|
|
deviceConnectionMsg.getOutputStream().flush();
|
|
deviceConnectionMsg.getOutputStream().flush();
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
|
|
+
|
|
|
log.info("pileCode:" + pileCode + " ,realTimeStatus push frame Exception");
|
|
log.info("pileCode:" + pileCode + " ,realTimeStatus push frame Exception");
|
|
|
|
|
+ socketHandle.removeDeviceConnection(pileCode);
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
deviceConnectionMsg.incrementMessageCount();
|
|
deviceConnectionMsg.incrementMessageCount();
|
|
|
} else {
|
|
} else {
|