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
29ff6d88
Commit
29ff6d88
authored
Jun 17, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正redis 最大连接数
parent
c9ef8c1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
5 deletions
+14
-5
common-lib/src/main/java/com/mortals/xhx/common/keys/RedisCacheKeys.java
...main/java/com/mortals/xhx/common/keys/RedisCacheKeys.java
+2
-2
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceTotalStatTaskImpl.java
.../com/mortals/xhx/daemon/task/DeviceTotalStatTaskImpl.java
+2
-2
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceStatController.java
...m/mortals/xhx/module/device/web/DeviceStatController.java
+9
-0
No files found.
common-lib/src/main/java/com/mortals/xhx/common/keys/RedisCacheKeys.java
View file @
29ff6d88
...
...
@@ -14,8 +14,8 @@ public final class RedisCacheKeys {
return
"params:file:upload"
;
}
public
static
String
get
CoopsDistributed
LockKey
()
{
return
"
coops:distributed
:lock"
;
public
static
String
get
DeviceStat
LockKey
()
{
return
"
device:stat
:lock"
;
}
}
device-manager/src/main/java/com/mortals/xhx/daemon/task/DeviceTotalStatTaskImpl.java
View file @
29ff6d88
...
...
@@ -43,7 +43,7 @@ public class DeviceTotalStatTaskImpl implements ITaskExcuteService {
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
log
.
info
(
"设备统计任务,生成当天统计数据"
);
log
.
info
(
"设备统计任务,生成当天统计数据
开始
"
);
if
(
platFormType
.
equalsIgnoreCase
(
PlatformTypeEnum
.
CLOUD
.
getValue
()))
{
//统计所有站点
SitePdu
sitePdu
=
new
SitePdu
();
...
...
@@ -57,10 +57,10 @@ public class DeviceTotalStatTaskImpl implements ITaskExcuteService {
//判断如果当前节点无设备 则不统计
deviceStatService
.
deviceStat
(
siteEntity
.
getId
(),
null
);
}
}
log
.
info
(
"设备统计任务,生成当天统计数据结束"
);
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
29ff6d88
...
...
@@ -296,7 +296,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
model
.
put
(
"totalCount"
,
deviceEntityList
.
size
());
model
.
put
(
"onlineCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getDeviceStatus
()
==
DeviceStatusEnum
.
在线
.
getValue
()).
count
());
model
.
put
(
"offlineCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getDeviceStatus
()
==
DeviceStatusEnum
.
离线
.
getValue
()).
count
());
model
.
put
(
"stopCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
get
DeviceStatus
()
!=
DeviceStatusEnum
.
未激活
.
getValue
()
&&
f
.
get
Enabled
()
==
YesNoEnum
.
NO
.
getValue
()).
count
());
model
.
put
(
"stopCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getEnabled
()
==
YesNoEnum
.
NO
.
getValue
()).
count
());
model
.
put
(
"unActiveCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getDeviceStatus
()
==
DeviceStatusEnum
.
未激活
.
getValue
()).
count
());
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceStatController.java
View file @
29ff6d88
...
...
@@ -4,9 +4,11 @@ import cn.hutool.core.date.DateUtil;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.common.code.DaySelectEnum
;
import
com.mortals.xhx.common.keys.RedisCacheKeys
;
import
com.mortals.xhx.module.device.model.DeviceQuery
;
import
com.mortals.xhx.module.device.model.DeviceStatEntity
;
import
com.mortals.xhx.module.device.model.DeviceStatQuery
;
...
...
@@ -35,6 +37,8 @@ public class DeviceStatController extends BaseCRUDJsonBodyMappingController<Devi
@Autowired
private
DeviceService
deviceService
;
@Autowired
private
ICacheService
cacheService
;
public
DeviceStatController
()
{
...
...
@@ -84,6 +88,11 @@ public class DeviceStatController extends BaseCRUDJsonBodyMappingController<Devi
try
{
if
(
ObjectUtils
.
isEmpty
(
deviceQuery
)
||
ObjectUtils
.
isEmpty
(
deviceQuery
.
getSiteId
()))
throw
new
AppException
(
"请求站点Id不能为空!"
);
boolean
bool
=
cacheService
.
setnx
(
RedisCacheKeys
.
getDeviceStatLockKey
()
+
deviceQuery
.
getSiteId
(),
deviceQuery
.
getSiteId
(),
300L
);
if
(!
bool
)
{
throw
new
AppException
(
"同步统计设备中,请稍后再统计!"
);
}
//刷新成功,返回列
this
.
service
.
deviceStat
(
deviceQuery
.
getSiteId
(),
getContext
());
DeviceStatQuery
deviceStatQuery
=
new
DeviceStatQuery
();
...
...
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