|
@@ -27,6 +27,7 @@ import com.tmzn.devicelinkykc.service.DeviceControlerService;
|
|
|
import com.tmzn.devicelinkykc.service.DeviceStatusService;
|
|
import com.tmzn.devicelinkykc.service.DeviceStatusService;
|
|
|
import com.tmzn.devicelinkykc.service.OrderStatusService;
|
|
import com.tmzn.devicelinkykc.service.OrderStatusService;
|
|
|
import com.tmzn.devicelinkykc.socket.DeviceConnectionMsg;
|
|
import com.tmzn.devicelinkykc.socket.DeviceConnectionMsg;
|
|
|
|
|
+import com.tmzn.devicelinkykc.socket.SocketHandle;
|
|
|
import com.tmzn.devicelinkykc.transdata.entity.DeviceParam;
|
|
import com.tmzn.devicelinkykc.transdata.entity.DeviceParam;
|
|
|
import com.tmzn.devicelinkykc.msgparser.MessageParseMgr;
|
|
import com.tmzn.devicelinkykc.msgparser.MessageParseMgr;
|
|
|
import com.tmzn.devicelinkykc.util.Encrytion;
|
|
import com.tmzn.devicelinkykc.util.Encrytion;
|
|
@@ -43,8 +44,11 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
|
|
|
+import java.net.InetSocketAddress;
|
|
|
|
|
+import java.net.Socket;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -85,7 +89,8 @@ public class TestController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private OrderStatusService orderStatusService;
|
|
private OrderStatusService orderStatusService;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SocketHandle socketHandle;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TransMoney transMoney;
|
|
private TransMoney transMoney;
|
|
@@ -93,6 +98,29 @@ public class TestController {
|
|
|
public String testMsg() {
|
|
public String testMsg() {
|
|
|
try {
|
|
try {
|
|
|
|
|
|
|
|
|
|
+ //集测
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ socketHandle.addDeviceConnection("119.36.5.9", 30561,"1111", "222","333", "1.6",1);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// Socket socket = new Socket();
|
|
|
|
|
+// socket.connect(new InetSocketAddress("119.36.5.9", 30561), 5000);
|
|
|
|
|
+// socket.setKeepAlive(true);
|
|
|
|
|
+
|
|
|
|
|
+// DeviceConnectionMsg deviceConnectionMsg = new DeviceConnectionMsg(socket, deviceId,imei,deviceSn,ver,isDc);
|
|
|
|
|
+ //每个设备连接后开启监听接收消息
|
|
|
|
|
+ System.out.println("成功");
|
|
|
|
|
+ // ykcMsgHandle.startListening(deviceConnectionMsg);
|
|
|
|
|
+ //并将连接信息等保存再Map中
|
|
|
|
|
+ // deviceConnectionMsgMap.put(deviceId, deviceConnectionMsg);
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ // 连接失败,捕获IOException异常
|
|
|
|
|
+ log.info("{}-{}-{}连接失败: " + e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println(1111);
|
|
|
|
|
+
|
|
|
// realTimeStatusPushFrame.upStatusDevice(null,);
|
|
// realTimeStatusPushFrame.upStatusDevice(null,);
|
|
|
|
|
|
|
|
String pileCode = "51220002000016";
|
|
String pileCode = "51220002000016";
|