1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

小程序扫码门禁端显示详情

This commit is contained in:
2023-04-25 01:41:23 +08:00
parent b68fde365f
commit 65563f5b75
13 changed files with 192 additions and 12 deletions

View File

@@ -61,6 +61,13 @@ public class AccessLogController {
return Res.error("参数错误");
}
// 推送到门禁端
JSONObject websocketData = new JSONObject();
websocketData.put("gateId", gateId);
websocketData.put("action", "onopen");
String websocketJSON = websocketData.toString();
WebSocketServer.sendAllMessage(websocketJSON);
AccessLog accessLog = new AccessLog();
accessLog.setId(null);
accessLog.setType(type);

View File

@@ -58,6 +58,14 @@ public class GateController {
Long gateId = Long.valueOf(id);
Gate gate = gateService.getGateById(gateId);
GateVO gateVO = GateVO.convertFrom(gate);
// 推送到门禁端
JSONObject websocketData = new JSONObject();
websocketData.put("gateId", id);
websocketData.put("action", "onscan");
String websocketJSON = websocketData.toString();
WebSocketServer.sendAllMessage(websocketJSON);
return Res.success(gateVO);
}