feat: 合并生产服务器前优化
This commit is contained in:
parent
9d41de8d70
commit
6e46ea4338
@ -19,4 +19,8 @@ public interface RtkrcvClient {
|
|||||||
|
|
||||||
@GetMapping("/rtk/gngga")
|
@GetMapping("/rtk/gngga")
|
||||||
java.util.Map<String,Object> gngga(@RequestParam("device_id") String deviceId);
|
java.util.Map<String,Object> gngga(@RequestParam("device_id") String deviceId);
|
||||||
|
|
||||||
|
@PostMapping("/device_ntrip_forward")
|
||||||
|
HttpResp deviceNtripForward(@RequestParam("deviceId") String deviceId,
|
||||||
|
@RequestParam("forward") Boolean forward);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -126,7 +126,6 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加NTRIP处理
|
// 添加NTRIP处理
|
||||||
|
|
||||||
if(deviceBs.getForwardToNtrip()) {
|
if(deviceBs.getForwardToNtrip()) {
|
||||||
byte[] srcdata = message.getSrcData();
|
byte[] srcdata = message.getSrcData();
|
||||||
String rtcm = ByteUtil.bytesToHexString(srcdata);
|
String rtcm = ByteUtil.bytesToHexString(srcdata);
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class RtkOutServer {
|
|||||||
Socket sock = serverSocket.accept();
|
Socket sock = serverSocket.accept();
|
||||||
handleClient(sock);
|
handleClient(sock);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if(running) { /* ignore transient errors */ }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,6 +172,20 @@ public class ApiController {
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/device_ntrip_forward")
|
||||||
|
public HttpResp deviceNtripForward(String deviceId, Boolean forward){
|
||||||
|
HttpResp resp = new HttpResp();
|
||||||
|
Device device = localDeviceService.findByDeviceId(deviceId);
|
||||||
|
if(device!=null){
|
||||||
|
device.setForwardToNtrip(Boolean.TRUE.equals(forward));
|
||||||
|
resp.setResponseMessage("succeed");
|
||||||
|
} else {
|
||||||
|
resp.setCode(HttpResp.HTTP_RSP_FAILED);
|
||||||
|
resp.setResponseMessage("device not found");
|
||||||
|
}
|
||||||
|
return resp;
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/warning_param_changed")
|
@PostMapping("/warning_param_changed")
|
||||||
public HttpResp warningParamChanged(){
|
public HttpResp warningParamChanged(){
|
||||||
warningService.refreshCfg();
|
warningService.refreshCfg();
|
||||||
|
|||||||
@ -20,6 +20,7 @@ public class RtkrcvProxyController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public HttpResult start(@RequestParam("device_id") String deviceId,
|
public HttpResult start(@RequestParam("device_id") String deviceId,
|
||||||
@RequestParam(value = "clear_log", required = false) Boolean clearLog){
|
@RequestParam(value = "clear_log", required = false) Boolean clearLog){
|
||||||
|
try{ rtkrcvClient.deviceNtripForward(deviceId, true); }catch(Exception ignore){}
|
||||||
String res = rtkrcvClient.start(deviceId, clearLog!=null && clearLog);
|
String res = rtkrcvClient.start(deviceId, clearLog!=null && clearLog);
|
||||||
rtkMonitorService.onStart(deviceId);
|
rtkMonitorService.onStart(deviceId);
|
||||||
if(res==null) return HttpResult.fail("start failed");
|
if(res==null) return HttpResult.fail("start failed");
|
||||||
@ -31,6 +32,7 @@ public class RtkrcvProxyController {
|
|||||||
public HttpResult stop(@RequestParam("device_id") String deviceId){
|
public HttpResult stop(@RequestParam("device_id") String deviceId){
|
||||||
String res = rtkrcvClient.stop(deviceId);
|
String res = rtkrcvClient.stop(deviceId);
|
||||||
rtkMonitorService.onStop(deviceId);
|
rtkMonitorService.onStop(deviceId);
|
||||||
|
try{ rtkrcvClient.deviceNtripForward(deviceId, false); }catch(Exception ignore){}
|
||||||
if(res==null) return HttpResult.fail("stop failed");
|
if(res==null) return HttpResult.fail("stop failed");
|
||||||
return HttpResult.success(res);
|
return HttpResult.success(res);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,6 +60,7 @@ public class RtkMonitorService {
|
|||||||
Integer cnt = e.getValue();
|
Integer cnt = e.getValue();
|
||||||
if(Boolean.TRUE.equals(running.get(dev)) && cnt != null && cnt >= 40){
|
if(Boolean.TRUE.equals(running.get(dev)) && cnt != null && cnt >= 40){
|
||||||
try { rtkrcvClient.stop(dev); } catch (Exception ignore) {}
|
try { rtkrcvClient.stop(dev); } catch (Exception ignore) {}
|
||||||
|
try { rtkrcvClient.deviceNtripForward(dev, false);} catch (Exception ignore) {}
|
||||||
running.remove(dev);
|
running.remove(dev);
|
||||||
try { writeTransaction(dev); } catch (Exception ignore) {}
|
try { writeTransaction(dev); } catch (Exception ignore) {}
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
<li>分组管理</li>
|
<li>分组管理</li>
|
||||||
<li>设备管理</li>
|
<li>设备管理</li>
|
||||||
<li>单设备定位</li>
|
<li>单设备定位</li>
|
||||||
<li>组设备定位</li>
|
<li style="display:none;">组设备定位</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="layui-tab-content">
|
<div class="layui-tab-content">
|
||||||
<div class="layui-tab-item layui-show">
|
<div class="layui-tab-item layui-show">
|
||||||
@ -167,7 +167,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-tab-item">
|
<div class="layui-tab-item" style="display:none;">
|
||||||
<div class="layui-row">
|
<div class="layui-row">
|
||||||
<div class="layui-col-md12">
|
<div class="layui-col-md12">
|
||||||
<form class="layui-form layui-form-pane" action="" id="rtk-group-form">
|
<form class="layui-form layui-form-pane" action="" id="rtk-group-form">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user