|
@@ -191,11 +191,11 @@ public class TbGateTerminalService extends ServiceImpl<TbGateTerminalMapper, TbG
|
|
|
Socket socket = new Socket();
|
|
|
socket.connect(new InetSocketAddress(tbGateTerminal.getIp(), myConfig.getGatePort()), 4000);
|
|
|
String result = ZKTecoUtils.sendAndGetResult(socket, GateCommandUtils.openCommand());
|
|
|
+ socket.close();
|
|
|
Integer code = JSONUtil.parseObj(result).getInt("state_code");
|
|
|
if (code == null || code != 200) {
|
|
|
throw new BusinessException("开闸失败");
|
|
|
}
|
|
|
- socket.close();
|
|
|
TbGateCommandLog log = new TbGateCommandLog();
|
|
|
String createBy = StpUserUtil.getAdminName();
|
|
|
createBy = StrUtil.isEmpty(createBy) ? "系统下发" : createBy;
|
|
@@ -252,6 +252,26 @@ public class TbGateTerminalService extends ServiceImpl<TbGateTerminalMapper, TbG
|
|
|
cacheResult(carNo, now, tbGateTerminal.getVenuesId(), tbGateTerminal.getId(), carVisitRecord.getId());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void playVoice(String ip, String msg){
|
|
|
+ log.info("播放语音========:{}", msg);
|
|
|
+ Socket socket = new Socket();
|
|
|
+ try {
|
|
|
+ socket.connect(new InetSocketAddress(ip, myConfig.getGatePort()), 4000);
|
|
|
+ String result = ZKTecoUtils.sendAndGetResult(socket, GateCommandUtils.openCommand());
|
|
|
+ log.info("播放语音=回复=======:{}", result);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }finally {
|
|
|
+ try {
|
|
|
+ socket.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 离场车辆 直接放行
|
|
|
*
|
|
@@ -268,6 +288,7 @@ public class TbGateTerminalService extends ServiceImpl<TbGateTerminalMapper, TbG
|
|
|
}
|
|
|
saveRecord(carNo, base64Image, tbGateTerminal, 2, 1);
|
|
|
try {
|
|
|
+ this.playVoice(tbGateTerminal.getIp(),"一路平安");
|
|
|
this.open(tbGateTerminal.getId());
|
|
|
} catch (Exception e) {
|
|
|
log.error("抬杆失败:{}", e.getMessage());
|