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
ee79a584
authored
Sep 08, 2023
by
李小龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
整理代码
parent
f0dd9772
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
11 deletions
server-common/src/main/java/com/makeit/module/admin/dto/plat/PlatMenuDTOVO.java
server-common/src/main/java/com/makeit/module/iot/mqtt/PushCallback.java
server-module/src/main/java/com/makeit/module/controller/device/PlatDeviceController.java
server-service/src/main/java/com/makeit/entity/saas/PlatMenu.java
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
server-service/src/main/java/com/makeit/service/saas/impl/PlatMenuServiceImpl.java
server-service/src/main/java/com/makeit/task/IotSyncTask.java
server-common/src/main/java/com/makeit/module/admin/dto/plat/PlatMenuDTOVO.java
View file @
ee79a584
...
@@ -43,7 +43,7 @@ public class PlatMenuDTOVO extends BaseIdDTO {
...
@@ -43,7 +43,7 @@ public class PlatMenuDTOVO extends BaseIdDTO {
@NotBlank
(
message
=
"类型不能为空"
)
@NotBlank
(
message
=
"类型不能为空"
)
@Pattern
(
regexp
=
"1|2|3"
,
message
=
"类型可选值 1目录 2菜单 3按钮"
)
@Pattern
(
regexp
=
"1|2|3"
,
message
=
"类型可选值 1目录 2菜单 3按钮"
)
@ApiModelProperty
(
value
=
"类型 1目录 2菜单 3按钮"
)
@ApiModelProperty
(
value
=
"类型 1目录 2菜单 3按钮"
)
private
String
resourceType
;
private
String
category
;
@ApiModelProperty
(
value
=
"前端路径"
)
@ApiModelProperty
(
value
=
"前端路径"
)
private
String
requestPath
;
private
String
requestPath
;
...
...
server-common/src/main/java/com/makeit/module/iot/mqtt/PushCallback.java
View file @
ee79a584
...
@@ -33,8 +33,8 @@ public class PushCallback implements MqttCallback {
...
@@ -33,8 +33,8 @@ public class PushCallback implements MqttCallback {
// 收到消息并设置返回字符串格式
// 收到消息并设置返回字符串格式
String
payload
=
new
String
(
message
.
getPayload
(),
"UTF-8"
);
String
payload
=
new
String
(
message
.
getPayload
(),
"UTF-8"
);
logger
.
info
(
"接收消息主题:{}, 接收消息QoS:{}"
,
topic
,
message
.
getQos
());
//
logger.info("接收消息主题:{}, 接收消息QoS:{}", topic, message.getQos());
logger
.
info
(
"接收消息内容:payload格式:{}"
,
payload
);
//
logger.info("接收消息内容:payload格式:{}", payload);
// 解析数据
// 解析数据
DeviceInfo
device
=
JSON
.
parseObject
(
payload
,
DeviceInfo
.
class
);
DeviceInfo
device
=
JSON
.
parseObject
(
payload
,
DeviceInfo
.
class
);
...
...
server-module/src/main/java/com/makeit/module/controller/device/PlatDeviceController.java
View file @
ee79a584
...
@@ -8,7 +8,10 @@ import com.makeit.common.response.ApiResponseEntity;
...
@@ -8,7 +8,10 @@ import com.makeit.common.response.ApiResponseEntity;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceEditDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.dto.platform.device.PlatDeviceQueryDTO
;
import
com.makeit.global.annotation.AuthIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.service.platform.device.PlatDeviceService
;
import
com.makeit.task.IotSyncTask
;
import
com.makeit.vo.platform.device.PlatDeviceListVO
;
import
com.makeit.vo.platform.device.PlatDeviceListVO
;
import
com.makeit.vo.platform.device.PlatDeviceViewVO
;
import
com.makeit.vo.platform.device.PlatDeviceViewVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -55,6 +58,18 @@ public class PlatDeviceController {
...
@@ -55,6 +58,18 @@ public class PlatDeviceController {
return
ApiResponseUtils
.
success
(
platDeviceService
.
view
(
baseIdDTO
.
getId
()));
return
ApiResponseUtils
.
success
(
platDeviceService
.
view
(
baseIdDTO
.
getId
()));
}
}
@Autowired
private
IotSyncTask
iotSyncTask
;
@ApiOperation
(
"详情"
)
@PostMapping
(
"iotSyncTask"
)
@AuthIgnore
@TenantIdIgnore
public
ApiResponseEntity
<
Void
>
iotSyncTask
(
@RequestBody
BaseIdDTO
baseIdDTO
)
{
iotSyncTask
.
syncEquipmentInfo
();
return
ApiResponseUtils
.
success
();
}
}
}
server-service/src/main/java/com/makeit/entity/saas/PlatMenu.java
View file @
ee79a584
...
@@ -45,7 +45,7 @@ public class PlatMenu extends BaseEntity {
...
@@ -45,7 +45,7 @@ public class PlatMenu extends BaseEntity {
/**
/**
* 类型 1目录 2菜单/功能 3按钮/应用
* 类型 1目录 2菜单/功能 3按钮/应用
*/
*/
private
String
resourceType
;
private
String
category
;
/**
/**
* 隐藏状态 0不隐藏 1隐藏
* 隐藏状态 0不隐藏 1隐藏
...
...
server-service/src/main/java/com/makeit/service/platform/auth/impl/PlatUserServiceImpl.java
View file @
ee79a584
...
@@ -418,11 +418,11 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
...
@@ -418,11 +418,11 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
String
button
=
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
();
String
button
=
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
();
menuList
.
forEach
(
e
->
{
menuList
.
forEach
(
e
->
{
if
(
menu
.
equals
(
e
.
get
ResourceType
())
||
button
.
equals
(
e
.
getResourceType
()))
{
if
(
menu
.
equals
(
e
.
get
Category
())
||
button
.
equals
(
e
.
getCategory
()))
{
buttonList
.
add
(
e
);
buttonList
.
add
(
e
);
}
}
if
(
catalogue
.
equals
(
e
.
get
ResourceType
())
||
menu
.
equals
(
e
.
getResourceType
())||
button
.
equals
(
e
.
getResourceType
()))
{
if
(
catalogue
.
equals
(
e
.
get
Category
())
||
menu
.
equals
(
e
.
getCategory
())||
button
.
equals
(
e
.
getCategory
()))
{
nonButtonList
.
add
(
e
);
nonButtonList
.
add
(
e
);
}
}
...
...
server-service/src/main/java/com/makeit/service/saas/impl/PlatMenuServiceImpl.java
View file @
ee79a584
...
@@ -177,13 +177,13 @@ implements PlatMenuService {
...
@@ -177,13 +177,13 @@ implements PlatMenuService {
List
<
PlatMenu
>
exitList
=
list
(
new
QueryWrapper
<
PlatMenu
>().
lambda
()
List
<
PlatMenu
>
exitList
=
list
(
new
QueryWrapper
<
PlatMenu
>().
lambda
()
.
isNotNull
(
PlatMenu:
:
getCode
)
.
isNotNull
(
PlatMenu:
:
getCode
)
.
in
(
PlatMenu:
:
get
ResourceType
,
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
(),
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
())
.
in
(
PlatMenu:
:
get
Category
,
SysEnum
.
MenuTypeEnum
.
MENU
.
getValue
(),
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
())
);
);
Map
<
String
,
PlatMenu
>
exitCodeMap
=
StreamUtil
.
toMapDep
(
exitList
,
PlatMenu:
:
getCode
);
Map
<
String
,
PlatMenu
>
exitCodeMap
=
StreamUtil
.
toMapDep
(
exitList
,
PlatMenu:
:
getCode
);
//查询数据库中已存在的权限
//查询数据库中已存在的权限
List
<
PlatMenu
>
exitButtonList
=
StreamUtil
.
filter
(
exitList
,
e
->
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
().
equals
(
e
.
get
ResourceType
()));
List
<
PlatMenu
>
exitButtonList
=
StreamUtil
.
filter
(
exitList
,
e
->
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
().
equals
(
e
.
get
Category
()));
Map
<
String
,
PlatMenu
>
exitButtonCodeMap
=
StreamUtil
.
toMap
(
exitButtonList
,
PlatMenu:
:
getCode
);
Map
<
String
,
PlatMenu
>
exitButtonCodeMap
=
StreamUtil
.
toMap
(
exitButtonList
,
PlatMenu:
:
getCode
);
//加载项目中的权限
//加载项目中的权限
...
@@ -292,7 +292,7 @@ implements PlatMenuService {
...
@@ -292,7 +292,7 @@ implements PlatMenuService {
button
.
setCode
(
e
);
button
.
setCode
(
e
);
button
.
setSort
(
0
);
button
.
setSort
(
0
);
button
.
setStatus
(
CommonEnum
.
YES
.
getValue
());
button
.
setStatus
(
CommonEnum
.
YES
.
getValue
());
button
.
set
ResourceType
(
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
());
button
.
set
Category
(
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
());
button
.
setHiddenStatus
(
CommonEnum
.
NO
.
getValue
());
button
.
setHiddenStatus
(
CommonEnum
.
NO
.
getValue
());
button
.
setCacheStatus
(
CommonEnum
.
NO
.
getValue
());
button
.
setCacheStatus
(
CommonEnum
.
NO
.
getValue
());
...
@@ -329,7 +329,7 @@ implements PlatMenuService {
...
@@ -329,7 +329,7 @@ implements PlatMenuService {
button
.
setParentId
(
TreeConst
.
TOP_LEVEL
);
button
.
setParentId
(
TreeConst
.
TOP_LEVEL
);
button
.
setSort
(
0
);
button
.
setSort
(
0
);
button
.
setStatus
(
CommonEnum
.
YES
.
getValue
());
button
.
setStatus
(
CommonEnum
.
YES
.
getValue
());
button
.
set
ResourceType
(
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
());
button
.
set
Category
(
SysEnum
.
MenuTypeEnum
.
BUTTON
.
getValue
());
button
.
setHiddenStatus
(
CommonEnum
.
NO
.
getValue
());
button
.
setHiddenStatus
(
CommonEnum
.
NO
.
getValue
());
button
.
setCacheStatus
(
CommonEnum
.
NO
.
getValue
());
button
.
setCacheStatus
(
CommonEnum
.
NO
.
getValue
());
...
...
server-service/src/main/java/com/makeit/task/IotSyncTask.java
View file @
ee79a584
...
@@ -43,7 +43,6 @@ public class IotSyncTask {
...
@@ -43,7 +43,6 @@ public class IotSyncTask {
* 新增和更新平台端设备表
* 新增和更新平台端设备表
*/
*/
@Scheduled
(
cron
=
"0 0 */1 * * ?"
)
@Scheduled
(
cron
=
"0 0 */1 * * ?"
)
// @Scheduled(cron = "0 */1 * * * ?")
@TenantIdIgnore
@TenantIdIgnore
public
void
syncEquipmentInfo
()
{
public
void
syncEquipmentInfo
()
{
log
.
info
(
"开始执行同步设备信息接口"
);
log
.
info
(
"开始执行同步设备信息接口"
);
...
...
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