提交 394317ef authored 作者: wangqiang's avatar wangqiang

客户端更新

上级 64a28c8f
......@@ -16,6 +16,8 @@ import com.priusis.controller.ProgramController;
import com.priusis.controller.RemoteControlController;
import com.priusis.monitor.mqtt.*;
import com.priusis.utils.MacAddrUtil;
import com.priusis.utils.ParseUrlUtil;
import com.priusis.utils.ProcessExtensionsApqUtil;
import com.priusis.utils.SysConfigUtil;
import io.netty.buffer.ByteBuf;
import io.netty.channel.nio.NioEventLoopGroup;
......@@ -403,7 +405,18 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
programController.addProgram2Platform();
return;
}
if ("remote_rtc".equals(mqttRpcDataMessage.getMethod())) {
log.info("收到语音通话请求");
try {
String apqExePath = ParseUrlUtil.parseAbsolutePath("apq.exe", "../../../tools/install-package/client/x64/client-soft", "../client-soft");
ProcessExtensionsApqUtil.apq_CreateProcessAsUser(apqExePath);
SysConfigUtil.saveProperty("control.request", "2");
} catch (Exception e) {
log.error("语音通话请求异常", e);
SysConfigUtil.saveProperty("control.request", "0");
}
return;
}
persistentFileService.flushRpcDataToFile(mqttRpcDataMessage);
} catch (Exception e) {
......
......@@ -47,7 +47,7 @@ public class RemoteControlController {
@Value(value = "${apq.iot-gateway}")
private String gateway;
@Value(value = "${apq.url.device_info}")
@Value(value = "${apq.url.device_info_g}")
private String deviceInfoUrl;
@Value(value = "${apq.url.send-control-req}")
......@@ -77,7 +77,7 @@ public class RemoteControlController {
controlRequest = "0";
}
if (StrUtil.equals(controlRequest, "-1") || StrUtil.equals(controlRequest, "1")) {
if (StrUtil.equals(controlRequest, "-1") || StrUtil.equals(controlRequest, "1") || StrUtil.equals(controlRequest, "2")) {
SysConfigUtil.saveProperty("control.request", "0");
}
SysConfigUtil.saveProperty("control.request.time", System.currentTimeMillis() + "");
......
......@@ -46,7 +46,7 @@ apq:
productId: 210
tenantId: 156
url:
# device_info: /facility/facility/getByMacAddress?macAddress={}
device_info_g: /facility/facility/getByMacAddress?macAddress={}
voiceCall: /facility/facility/voiceCall
device_info: /facility/facility/pcAdd
install: /ops/install/getClientList?macAddress={}&pageNum={}&pageSize={}
......
......@@ -104,7 +104,7 @@ public class ApqAntivirusJob {
if (!StrUtil.isBlank(logDataStr) && !logDataStr.contains(antivirusDoService.antivirusProcess.rightStr())) {
log.info("存在病毒查杀接口扫描告警: logData:{}", logDataSb);
// 上报病毒查杀监控数据
List<String> mapSoftRequest = new ArrayList<>();
// List<String> mapSoftRequest = new ArrayList<>();
// 上报病毒查杀异常
Map eventMapRequest = new HashMap();
Map mapRequest = new HashMap();
......@@ -113,10 +113,8 @@ public class ApqAntivirusJob {
eventMapRequest.put("methodName", "antivirus_info"); // BlackList WriteList
eventMapRequest.put("params", mapRequest);
for (String mapSoftRequestData : mapSoftRequest) {
Map map = restTemplate.postForObject("http://localhost:8765/uplink_event/oc-client", eventMapRequest, Map.class);
log.info("存在病毒查杀接口扫描告警,上报告警事件: mapData:{}, ret:{}", mapRequest, map);
}
Map map = restTemplate.postForObject("http://localhost:8765/uplink_event/oc-client", eventMapRequest, Map.class);
log.info("存在病毒查杀接口扫描告警,上报告警事件: mapData:{}, ret:{}", mapRequest, map);
}
......
......@@ -12,7 +12,7 @@ public class ParseUrlUtil {
* @param relatePath 相对路径 /qr/dat/
* @return
*/
static String parseAbsolutePath(String relatePath, String defaultPath) {
public static String parseAbsolutePath(String relatePath, String defaultPath) {
String path = defaultPath + relatePath;
if (Platform.isWindows()) {
......@@ -50,4 +50,54 @@ public class ParseUrlUtil {
return path;
}
/**
* @param relatePath 相对路径 /qr/dat/
* @return
*/
public static String parseAbsolutePath(String target, String relatePath, String jarPath) {
String path = "";
if (Platform.isWindows()) {
try {
path = ParseUrlUtil.class.getResource("/").getPath();
if (path.contains("BOOT-INF")) {
path = System.getProperty("user.dir") + File.separator + jarPath + File.separator + target;
} else {
path = path + relatePath + File.separator + target;
}
} catch (Exception e) {
log.error("usr decode", e.getMessage());
return "";
}
path = path.replaceAll("%20", " ");//排除中文空格
path = path.replaceAll("/", "\\\\");//排除中文空格
try {
path = java.net.URLDecoder.decode(path, "utf-8"); //解决路径包含中文的情况
} catch (UnsupportedEncodingException e) {
log.error("UnsupportedEncoding", e);
}
log.info("解析到PATH为:{}", path);
}
//if (Platform.isLinux()) {
// try {
// ApplicationHome h = new ApplicationHome(IHwPortController.class);
// File jarF = h.getSource();
// path = jarF.getParentFile().toString() + relatePath;
// } catch (Exception e) {
// path = "/app/smart-property/qr/dll";
// }
//}
return path;
}
public static void main(String[] args) {
String path = ParseUrlUtil.parseAbsolutePath("apq.exe", "../../../tools/install-package/client/x64/client-soft", "../client-soft");
System.out.println(path);
if (!new File(path).exists()) {
System.out.println("===============");
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论