Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
f809de90
Commit
f809de90
authored
Mar 25, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改校验
parent
47457c03
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+4
-1
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
.../java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
+9
-9
device-manager/src/test/java/com/mortals/httpclient/system.http
...-manager/src/test/java/com/mortals/httpclient/system.http
+13
-0
No files found.
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
f809de90
...
...
@@ -605,7 +605,10 @@ public class DeviceApiController {
productVersionQuery
.
setProductId
(
deviceEntity
.
getProductId
());
productVersionQuery
.
setSiteId
(
deviceEntity
.
getSiteId
());
productVersionQuery
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"version"
,
OrderCol
.
DESCENDING
)));
ProductVersionEntity
productVersionEntity
=
productVersionService
.
find
(
productVersionQuery
).
stream
().
filter
(
item
->
StrUtil
.
endWith
(
item
.
getFilePath
(),
".apk"
,
true
)).
findFirst
().
orElseGet
(()
->
null
);
ProductVersionEntity
productVersionEntity
=
productVersionService
.
find
(
productVersionQuery
)
.
stream
()
// .filter(item -> StrUtil.endWith(item.getFilePath(), ".apk", true))
.
findFirst
().
orElseGet
(()
->
null
);
// ProductVersionEntity productVersionEntity = productVersionService.selectOne(productVersionQuery);
if
(
ObjectUtils
.
isEmpty
(
productVersionEntity
))
{
throw
new
AppException
(
DEVICE_VERSION_UNEXIST
,
DEVICE_VERSION_UNEXIST_CONTENT
);
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceStatTaskImpl.java
View file @
f809de90
...
...
@@ -71,9 +71,9 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
}*/
//获取所有在线设备
List
<
DeviceEntity
>
deviceList
=
deviceService
.
getCacheList
().
stream
().
filter
(
f
->
DeviceStatusEnum
.
在线
.
getValue
()==
f
.
getDeviceStatus
()).
collect
(
Collectors
.
toList
());
List
<
DeviceEntity
>
deviceList
=
deviceService
.
getCacheList
().
stream
().
filter
(
f
->
DeviceStatusEnum
.
在线
.
getValue
()
==
f
.
getDeviceStatus
()).
collect
(
Collectors
.
toList
());
// List<DeviceEntity> deviceList = deviceService.find(new DeviceQuery().deviceStatus(DeviceStatusEnum.在线.getValue()));
// List<DeviceEntity> deviceList = deviceService.find(new DeviceQuery().deviceStatus(DeviceStatusEnum.在线.getValue()));
//更新离线
List
<
DeviceEntity
>
deviceOfflineList
=
deviceList
.
parallelStream
().
map
(
item
->
{
if
(
ObjectUtils
.
isEmpty
(
item
.
getDeviceCode
()))
return
null
;
...
...
@@ -91,17 +91,17 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
if
(!
ObjectUtils
.
isEmpty
(
deviceOfflineList
))
{
log
.
info
(
"修正设备数量:size:{}"
,
deviceOfflineList
.
size
());
// deviceService.update(deviceOfflineList);
deviceOfflineList
.
forEach
(
deviceEntity
->
{
cacheService
.
lpush
(
RedisKey
.
KEY_DEVICE_UPDATE_QUEUE
,
deviceEntity
);
// deviceService.update(deviceOfflineList);
for
(
DeviceEntity
deviceEntity
:
deviceOfflineList
)
{
cacheService
.
lpush
(
RedisKey
.
KEY_DEVICE_UPDATE_QUEUE
,
deviceEntity
);
if
(
ObjectUtils
.
isEmpty
(
deviceEntity
.
getPlatformId
()))
continue
;
if
(
ObjectUtils
.
isEmpty
(
deviceEntity
.
getProductId
()))
continue
;
PlatformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
().
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
deviceEntity
.
getProductId
().
toString
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//通知第三方平台
deviceService
.
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceMethodEnum
.
OFFLINE
);
//保存业务消息为离线
//保存业务消息为离线
BizLogPdu
bizLogPdu
=
new
BizLogPdu
();
bizLogPdu
.
initAttrValue
();
//保存为产品名称
...
...
@@ -117,7 +117,7 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
messageProducer
.
syncBizSend
(
bizLogPdu
);
}
}
);
}
}
}
...
...
device-manager/src/test/java/com/mortals/httpclient/system.http
View file @
f809de90
...
...
@@ -84,6 +84,19 @@ Content-Type: application/json
{"affairCode":"abcd1234ddddd"}
###测试json提交
POST {{baseUrl}}/test/sendThirdParty
Content-Type: application/json
{}
###测试json提交
POST {{baseUrl}}/api/checkVersion
Content-Type: application/json
{"deviceCode":"8C-C5-8C-02-BC-5A"}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment