Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fc11dd32
authored
Sep 22, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
07d9b697
7e16cf35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderChildrenInfoUserLoginWechatServiceImpl.java
server-service/src/main/java/com/makeit/utils/DeviceCacheUtil.java
server-web/src/main/java/com/makeit/mqtt/MqttPushClient.java
server-service/src/main/java/com/makeit/service/wechat/impl/PlatElderChildrenInfoUserLoginWechatServiceImpl.java
View file @
fc11dd32
...
...
@@ -41,6 +41,8 @@ public class PlatElderChildrenInfoUserLoginWechatServiceImpl implements PlatElde
childrenInfo
.
setPhone
(
userInfo
.
getPhoneNumber
());
childrenInfo
.
setAvatar
(
userInfo
.
getAvatarUrl
());
platElderChildrenInfoService
.
saveOrUpdate
(
childrenInfo
);
WechatUserInfo
wechatUserVo
=
BeanDtoVoUtils
.
convert
(
childrenInfo
,
WechatUserInfo
.
class
);
FileUtil
.
convert
(
Arrays
.
asList
(
wechatUserVo
),
WechatUserInfo:
:
getAvatar
,
(
u
,
f
)
->
{
...
...
server-service/src/main/java/com/makeit/utils/DeviceCacheUtil.java
View file @
fc11dd32
...
...
@@ -5,6 +5,7 @@ import com.makeit.entity.platform.device.PlatDevice;
import
com.makeit.entity.saas.PlatTenant
;
import
com.makeit.enums.redis.RedisConst
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnoreUtil
;
import
com.makeit.module.iot.enums.DeviceState
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.saas.PlatTenantService
;
...
...
@@ -26,12 +27,15 @@ public class DeviceCacheUtil implements ApplicationRunner {
@Autowired
private
PlatTenantService
platTenantService
;
public
List
<
PlatDevice
>
getAll
()
{
List
<
PlatDevice
>
list
=
platDeviceService
.
list
(
new
LambdaQueryWrapper
<
PlatDevice
>().
eq
(
PlatDevice:
:
getStatus
,
DeviceState
.
online
.
getValue
()));
list
.
stream
().
forEach
(
vo
->
{
put
(
vo
);
return
TenantIdIgnoreUtil
.
execute
(()->{
List
<
PlatDevice
>
list
=
platDeviceService
.
list
(
new
LambdaQueryWrapper
<
PlatDevice
>().
eq
(
PlatDevice:
:
getStatus
,
DeviceState
.
online
.
getValue
()));
list
.
stream
().
forEach
(
vo
->
{
put
(
vo
);
});
return
list
;
});
return
list
;
}
public
void
put
(
PlatDevice
platDevice
)
{
...
...
server-web/src/main/java/com/makeit/mqtt/MqttPushClient.java
View file @
fc11dd32
...
...
@@ -37,6 +37,7 @@ public class MqttPushClient {
* @param keepalive
*/
public
void
connect
(
String
host
,
String
clientId
,
String
username
,
String
password
,
int
timeout
,
int
keepalive
)
{
MqttClient
client
;
try
{
client
=
new
MqttClient
(
host
,
clientId
,
new
MemoryPersistence
());
...
...
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