新增 netty整合mqtt协议,与车位相机通讯并保存通讯信息

This commit is contained in:
Lemon
2023-12-20 16:17:34 +08:00
parent 7015cb1234
commit 5fbce62752
16 changed files with 972 additions and 23 deletions

View File

@@ -47,6 +47,7 @@ import com.jsowell.common.util.id.SnowflakeIdWorker;
import com.jsowell.common.util.ip.AddressUtils;
import com.jsowell.netty.handler.HeartbeatRequestHandler;
import com.jsowell.netty.handler.TransactionRecordsRequestHandler;
import com.jsowell.netty.service.camera.impl.CameraBusinessServiceImpl;
import com.jsowell.netty.service.yunkuaichong.YKCBusinessService;
import com.jsowell.pile.domain.*;
import com.jsowell.pile.domain.ykcCommond.IssueQRCodeCommand;
@@ -85,6 +86,7 @@ import com.jsowell.wxpay.common.WeChatPayParameter;
import com.jsowell.wxpay.dto.AppletTemplateMessageSendDTO;
import com.jsowell.wxpay.response.WechatPayRefundRequest;
import com.jsowell.wxpay.service.WxAppletRemoteService;
import io.netty.channel.ChannelFuture;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Test;
@@ -220,6 +222,9 @@ public class SpringBootTestController {
@Autowired
private OrderPileOccupyService orderPileOccupyService;
@Autowired
private CameraBusinessServiceImpl cameraBusinessServiceImpl;
@Autowired
private LTYTService ltytService;
@@ -248,6 +253,23 @@ public class SpringBootTestController {
System.out.println(JSON.toJSONString(memberWalletVOS));
}
@Test
public void testMqttSendMsg() throws InterruptedException {
String channelId = "94dd42b6";
String topic = "/GroundlockStatus";
JSONObject jsonObject = new JSONObject();
jsonObject.put("sign","F4213AD90EBC72C678E03450E4E091EE");
jsonObject.put("sn","e27f089d-5fadf6c6");
jsonObject.put("timestamp","2021-07-01 12:00:01");
jsonObject.put("msg_id","GS2021070112000101");
jsonObject.put("msg_type","GroundlockStatus");
jsonObject.put("msg_data",null);
// ChannelFuture future = cameraBusinessServiceImpl.sendMsg(channelId, topic, jsonObject.toJSONString());
// System.out.println(future.toString());
}
@Test
public void queryPaymentByOrderNoTest() {
String orderNo = "C44903356969";