Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
haikang-client
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
杨立
haikang-client
Commits
394317ef
提交
394317ef
authored
3月 10, 2022
作者:
wangqiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
客户端更新
上级
64a28c8f
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
69 行增加
和
8 行删除
+69
-8
MqttServiceImpl.java
...java/com/priusis/client/service/core/MqttServiceImpl.java
+14
-1
RemoteControlController.java
.../java/com/priusis/controller/RemoteControlController.java
+2
-2
application.yml
apq-pc-client/src/main/resources/application.yml
+1
-1
ApqAntivirusJob.java
...common/src/main/java/com/priusis/job/ApqAntivirusJob.java
+1
-3
ParseUrlUtil.java
...-common/src/main/java/com/priusis/utils/ParseUrlUtil.java
+51
-1
app.asar
...install-package/client/x32/client-soft/resources/app.asar
+0
-0
没有找到文件。
apq-pc-client/src/main/java/com/priusis/client/service/core/MqttServiceImpl.java
浏览文件 @
394317ef
...
...
@@ -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
)
{
...
...
apq-pc-client/src/main/java/com/priusis/controller/RemoteControlController.java
浏览文件 @
394317ef
...
...
@@ -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
()
+
""
);
...
...
apq-pc-client/src/main/resources/application.yml
浏览文件 @
394317ef
...
...
@@ -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={}
...
...
apq-pc-common/src/main/java/com/priusis/job/ApqAntivirusJob.java
浏览文件 @
394317ef
...
...
@@ -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
);
}
}
...
...
apq-pc-common/src/main/java/com/priusis/utils/ParseUrlUtil.java
浏览文件 @
394317ef
...
...
@@ -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
(
"==============="
);
}
}
}
tools/install-package/client/x32/client-soft/resources/app.asar
浏览文件 @
394317ef
No preview for this file type
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论