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
ebd707b8
authored
Sep 12, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat,设备状态枚举
parent
a8b90e59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
server-common/src/main/java/com/makeit/module/iot/vo/DeviceState.java
server-service/src/main/java/com/makeit/task/IotSyncTask.java
server-common/src/main/java/com/makeit/module/iot/vo/DeviceState.java
0 → 100644
View file @
ebd707b8
package
com
.
makeit
.
module
.
iot
.
vo
;
import
lombok.Data
;
@Data
public
class
DeviceState
{
private
String
text
;
private
String
value
;
}
server-service/src/main/java/com/makeit/task/IotSyncTask.java
View file @
ebd707b8
package
com
.
makeit
.
task
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.makeit.common.entity.BaseBusEntity
;
import
com.makeit.entity.platform.device.PlatDevice
;
...
...
@@ -8,6 +9,7 @@ import com.makeit.enums.CommonEnum;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.module.iot.service.IotOrgService
;
import
com.makeit.module.iot.vo.DeviceInstanceEntity
;
import
com.makeit.module.iot.vo.DeviceState
;
import
com.makeit.module.system.service.SysDictionaryCategoryService
;
import
com.makeit.module.system.vo.DictionaryVo
;
import
com.makeit.service.platform.device.PlatDeviceService
;
...
...
@@ -106,7 +108,8 @@ public class IotSyncTask {
platDevice
.
setRegistrationDate
(
registryTime
);
platDevice
.
setDescription
(
iotDevice
.
getDescribe
());
String
state
=
iotDevice
.
getState
();
platDevice
.
setStatus
(
state
);
DeviceState
deviceState
=
JSON
.
parseObject
(
state
,
DeviceState
.
class
);
platDevice
.
setStatus
(
deviceState
.
getValue
());
//todo 根据类型名称来匹配
platDevice
.
setCategory
(
dicNameIdMap
.
get
(
iotDevice
.
getProductName
()));
...
...
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