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
d285c2c7
Commit
d285c2c7
authored
Jun 14, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正redis 最大连接数
parent
cc680dc6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
34 deletions
+43
-34
device-manager-ui/admin/yarn.lock
device-manager-ui/admin/yarn.lock
+14
-4
device-manager/src/main/java/com/mortals/xhx/base/framework/config/MybatisConfiguration.java
...rtals/xhx/base/framework/config/MybatisConfiguration.java
+1
-0
device-manager/src/main/java/com/mortals/xhx/base/system/task/service/impl/TaskServiceImpl.java
...ls/xhx/base/system/task/service/impl/TaskServiceImpl.java
+8
-11
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceComsumersRegisterService.java
...on/applicationservice/DeviceComsumersRegisterService.java
+2
-2
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+12
-12
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+2
-0
device-manager/src/main/java/com/mortals/xhx/module/sitestat/web/SitestatController.java
...m/mortals/xhx/module/sitestat/web/SitestatController.java
+0
-1
device-manager/src/main/resources/bootstrap.yml
device-manager/src/main/resources/bootstrap.yml
+4
-4
No files found.
device-manager-ui/admin/yarn.lock
View file @
d285c2c7
...
...
@@ -1295,6 +1295,11 @@
resolved "https://registry.nlark.com/@soda/get-current-script/download/@soda/get-current-script-1.0.2.tgz"
integrity sha1-pTUV2yXYA4N0OBtzryC7Ty5QjYc=
"@tweenjs/tween.js@^18.6.4":
version "18.6.4"
resolved "https://registry.npmmirror.com/@tweenjs/tween.js/-/tween.js-18.6.4.tgz#40a3d0a93647124872dec8e0fd1bd5926695b6ca"
integrity sha512-lB9lMjuqjtuJrx7/kOkqQBtllspPIN+96OvTCeJ2j5FEzinoAXTdAMFnDAQT1KVPRlnYfBrqxtqP66vDM40xxQ==
"@types/glob@^7.1.1":
version "7.1.4"
resolved "https://registry.nlark.com/@types/glob/download/@types/glob-7.1.4.tgz"
...
...
@@ -9076,10 +9081,15 @@ thread-loader@^2.1.3:
loader-utils "^1.1.0"
neo-async "^2.6.0"
three@^0.152.2:
version "0.152.2"
resolved "https://registry.npmmirror.com/three/-/three-0.152.2.tgz#2ee0f2c504d31a4bc29b45495c12bded9fda7bfc"
integrity sha512-Ff9zIpSfkkqcBcpdiFo2f35vA9ZucO+N8TNacJOqaEE6DrB0eufItVMib8bK8Pcju/ZNT6a7blE1GhTpkdsILw==
three-css2drender@^1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/three-css2drender/-/three-css2drender-1.0.0.tgz#2065e64c9d117033c08bfdc957a78edfe4b6ed1b"
integrity sha512-redDCSBDvgxiJIm6EDT8WO5WJTVg5gUEy/vjtAgJa/zX4peEUnZ8K+mXo6v94EudbnuI5h48/hQo9NExf04ENg==
three@^0.149.0:
version "0.149.0"
resolved "https://registry.npmmirror.com/three/-/three-0.149.0.tgz#a9cf78b17d02f063ffe6dfca1e300eff2eab2927"
integrity sha512-tohpUxPDht0qExRLDTM8sjRLc5d9STURNrdnK3w9A+V4pxaTBfKWWT/IqtiLfg23Vfc3Z+ImNfvRw1/0CtxrkQ==
throttle-debounce@^1.0.1:
version "1.1.0"
...
...
device-manager/src/main/java/com/mortals/xhx/base/framework/config/MybatisConfiguration.java
View file @
d285c2c7
...
...
@@ -11,6 +11,7 @@ import org.springframework.context.annotation.Configuration;
import
javax.sql.DataSource
;
@Configuration
//@AutoConfigureAfter(DataSourceAutoConfiguration.class)
public
class
MybatisConfiguration
extends
AbstractMybatisConfiguration
{
...
...
device-manager/src/main/java/com/mortals/xhx/base/system/task/service/impl/TaskServiceImpl.java
View file @
d285c2c7
...
...
@@ -4,17 +4,7 @@
package
com.mortals.xhx.base.system.task.service.impl
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
cn.hutool.core.net.NetUtil
;
import
com.mortals.framework.ap.GlobalSysInfo
;
import
com.mortals.framework.common.code.ExcuteStatus
;
import
com.mortals.framework.common.code.TaskExcuteStrategy
;
...
...
@@ -30,6 +20,12 @@ import com.mortals.xhx.base.system.task.dao.TaskDao;
import
com.mortals.xhx.base.system.task.model.TaskEntity
;
import
com.mortals.xhx.base.system.task.model.TaskQuery
;
import
com.mortals.xhx.base.system.task.service.TaskService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* <p>
...
...
@@ -155,6 +151,7 @@ public class TaskServiceImpl extends AbstractCRUDServiceImpl<TaskDao, TaskEntity
public
void
start
()
throws
AppException
{
final
String
localIp
=
SystemUtil
.
getLocalHostIp
();
log
.
info
(
"任务执行线程启动...-->"
+
localIp
);
log
.
info
(
"other get Ip...-->"
+
NetUtil
.
getLocalhostStr
());
thread
=
new
Thread
(()
->
{
// 将本机上次执行而未完成的任务状态变更
try
{
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceComsumersRegisterService.java
View file @
d285c2c7
...
...
@@ -49,8 +49,8 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic
deviceService
.
find
(
new
DeviceEntity
())
.
stream
()
.
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
platformService
.
getCache
(
f
.
getPlatformId
().
toString
())))
.
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
productService
.
getCache
(
f
.
getProductId
().
toString
()))).
forEach
(
item
->
{
.
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
platformService
.
getCache
(
f
.
getPlatformId
()
==
null
?
"0"
:
f
.
getPlatformId
()
.
toString
())))
.
filter
(
f
->
!
ObjectUtils
.
isEmpty
(
productService
.
getCache
(
f
.
getProductId
()
==
null
?
"0"
:
f
.
getProductId
()
.
toString
()))).
forEach
(
item
->
{
String
uploadQueue
=
Constant
.
UPLOAD_TOPIC
+
item
.
getDeviceCode
();
String
downQueue
=
Constant
.
DOWN_TOPIC
+
item
.
getDeviceCode
();
messageProducer
.
queueAddAndBinds
(
QueueKey
.
DEFAULT_EXCHANGE
,
uploadQueue
,
uploadQueue
);
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
d285c2c7
...
...
@@ -210,8 +210,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceEntity
.
setDeviceStatus
(
DeviceStatusEnum
.
离线
.
getValue
());
deviceEntity
.
setEnabled
(
EnabledEnum
.
启用
.
getValue
());
this
.
update
(
deviceEntity
);
PlatformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
().
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
deviceEntity
.
getProductId
().
toString
());
PlatformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
()
==
null
?
"-1"
:
deviceEntity
.
getPlatformId
()
.
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
deviceEntity
.
getProductId
()
==
null
?
"-1"
:
deviceEntity
.
getProductId
()
.
toString
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//注册rabbmit相关队列与绑定
messageProducer
.
queueAddAndBinds
(
QueueKey
.
DEFAULT_EXCHANGE
,
Constant
.
UPLOAD_TOPIC
+
deviceCode
,
Constant
.
UPLOAD_TOPIC
+
deviceCode
);
...
...
@@ -292,8 +292,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceEntity
.
setUpdateTime
(
new
Date
());
deviceEntity
.
setUpdateUserId
(
getContextUserId
(
context
));
this
.
getDeviceDao
().
update
(
deviceEntity
);
P
roductEntity
productEntity
=
productService
.
getCache
(
deviceEntity
.
getProduct
Id
().
toString
());
P
latformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatform
Id
().
toString
());
P
latformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
()
==
null
?
"-1"
:
deviceEntity
.
getPlatform
Id
().
toString
());
P
roductEntity
productEntity
=
productService
.
getCache
(
deviceEntity
.
getProductId
()
==
null
?
"-1"
:
deviceEntity
.
getProduct
Id
().
toString
());
if
(
enabled
==
YesNoEnum
.
YES
.
getValue
())
{
this
.
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceMethodEnum
.
ENABLED
);
}
else
{
...
...
@@ -306,8 +306,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
DeviceEntity
deviceEntity
=
this
.
get
(
id
,
context
);
if
(
ObjectUtils
.
isEmpty
(
deviceEntity
))
throw
new
AppException
(
"当前设备不存在!"
);
PlatformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
().
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
deviceEntity
.
getProductId
().
toString
());
PlatformEntity
platformEntity
=
platformService
.
getCache
(
deviceEntity
.
getPlatformId
()
==
null
?
"-1"
:
deviceEntity
.
getPlatformId
()
.
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
deviceEntity
.
getProductId
()
==
null
?
"-1"
:
deviceEntity
.
getProductId
()
.
toString
());
String
exchangeName
=
platformEntity
.
getPlatformSn
()
+
Constant
.
EXCHANGE_SPLIT
+
productEntity
.
getProductCode
();
TopicPartitionInfo
topicPartitionInfo
=
new
TopicPartitionInfo
(
Constant
.
UPLOAD_TOPIC
+
deviceEntity
.
getDeviceCode
(),
null
,
exchangeName
);
...
...
@@ -326,8 +326,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override
protected
void
saveAfter
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
super
.
saveAfter
(
entity
,
context
);
PlatformEntity
platformEntity
=
platformService
.
getCache
(
entity
.
getPlatformId
().
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
entity
.
getProductId
().
toString
());
PlatformEntity
platformEntity
=
platformService
.
getCache
(
entity
.
getPlatformId
()
==
null
?
"-1"
:
entity
.
getPlatformId
()
.
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
entity
.
getProductId
()
==
null
?
"0"
:
entity
.
getProductId
()
.
toString
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//注册rabbmit相关队列与绑定 激活后才註冊綁定隊列
// registerRabbitQueue(entity, platformEntity, productEntity);
...
...
@@ -339,8 +339,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override
protected
void
updateAfter
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateAfter
(
entity
,
context
);
PlatformEntity
platformEntity
=
platformService
.
getCache
(
entity
.
getPlatformId
().
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
entity
.
getProductId
().
toString
());
PlatformEntity
platformEntity
=
platformService
.
getCache
(
entity
.
getPlatformId
()
==
null
?
"-1"
:
entity
.
getPlatformId
()
.
toString
());
ProductEntity
productEntity
=
productService
.
getCache
(
entity
.
getProductId
()
==
null
?
"0"
:
entity
.
getProductId
()
.
toString
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//新增设备通知第三方平台 激活后的设备才通知和更新
if
(
entity
.
getDeviceStatus
()
>
0
)
{
...
...
@@ -373,9 +373,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
ApiResp
<
String
>
resp
=
messageService
.
sendThirdParty
(
UrlBuilder
.
of
(
phpInUrl
).
addPath
(
thirdPartyPath
).
build
(),
deviceReq
);
log
.
info
(
"sendThirty resp ==>{}"
,
JSON
.
toJSONString
(
resp
));
if
(!
ObjectUtils
.
isEmpty
(
resp
)
&&
resp
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(!
ObjectUtils
.
isEmpty
(
resp
)
&&
resp
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
return
Rest
.
ok
(
"成功!"
);
}
else
{
}
else
{
return
Rest
.
fail
(
"发送失败"
);
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
d285c2c7
...
...
@@ -403,6 +403,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
@Override
protected
void
saveBefore
(
DeviceEntity
entity
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
super
.
saveBefore
(
entity
,
model
,
context
);
if
(
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
throw
new
AppException
(
"所属产品ID不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
entity
.
getPlatformId
()))
throw
new
AppException
(
"所属平台ID不能为空!"
);
//判断如果存在相同的
DeviceEntity
deviceEntity
=
this
.
service
.
selectOne
(
new
DeviceQuery
().
deviceCode
(
entity
.
getDeviceCode
()));
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
)){
...
...
device-manager/src/main/java/com/mortals/xhx/module/sitestat/web/SitestatController.java
View file @
d285c2c7
...
...
@@ -74,7 +74,6 @@ public class SitestatController extends BaseCRUDJsonBodyMappingController<Sitest
}
else
{
Rest
<
SitePdu
>
resp
=
siteFeign
.
info
(
entity
.
getSiteId
());
if
(
resp
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
entity
.
setLng
(
resp
.
getData
().
getLongitude
());
entity
.
setLat
(
resp
.
getData
().
getLatitude
());
entity
.
setAddress
(
resp
.
getData
().
getDetailAddress
());
...
...
device-manager/src/main/resources/bootstrap.yml
View file @
d285c2c7
...
...
@@ -28,10 +28,10 @@ spring:
database
:
@
profiles.redis.database@
timeout
:
30000
pool
:
max-idle
:
3
0
min-idle
:
0
max-active
:
1
00
max-wait
:
1
000
max-idle
:
10
0
min-idle
:
5
0
max-active
:
5
00
max-wait
:
5
000
# sentinel:
# master: mymaster
# nodes: @profiles.redis.sentinel@
...
...
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