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
68a0488b
authored
Jan 02, 2024
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:绑定设备无属性时区域设置没保存
parent
83481083
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
68a0488b
...
@@ -463,16 +463,25 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -463,16 +463,25 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
List
<
PlatDeviceOther
>
platDeviceOtherList
=
platDeviceOtherService
.
list
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
List
<
PlatDeviceOther
>
platDeviceOtherList
=
platDeviceOtherService
.
list
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
dto
.
getOriDeviceId
()));
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
dto
.
getOriDeviceId
()));
PlatDeviceBaseAttrDTO
defaultAttr
=
getDefaultAttr
(
db
);
String
attribute
=
defaultAttr
!=
null
?
JSON
.
toJSONString
(
defaultAttr
)
:
null
;
for
(
PlatDeviceOther
platDeviceOther
:
platDeviceOtherList
)
{
for
(
PlatDeviceOther
platDeviceOther
:
platDeviceOtherList
)
{
BeanUtils
.
copyProperties
(
dto
,
platDeviceOther
,
"id"
);
BeanUtils
.
copyProperties
(
dto
,
platDeviceOther
,
"id"
);
platDeviceOther
.
setDeviceId
(
id
);
platDeviceOther
.
setDeviceId
(
id
);
platDeviceOther
.
setAttribute
(
getDefaultAttr
(
db
)
);
platDeviceOther
.
setAttribute
(
attribute
);
platDeviceOther
.
setOriDeviceId
(
db
.
getOriDeviceId
());
platDeviceOther
.
setOriDeviceId
(
db
.
getOriDeviceId
());
platDeviceOtherService
.
saveOrUpdate
(
platDeviceOther
);
platDeviceOtherService
.
saveOrUpdate
(
platDeviceOther
);
}
}
if
(
defaultAttr
!=
null
)
{
List
<
PlatDevice
>
platDeviceList
=
list
(
new
QueryWrapper
<
PlatDevice
>().
lambda
().
eq
(
PlatDevice:
:
getOriDeviceId
,
db
.
getOriDeviceId
()));
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
defaultAttr
.
getRadarMount
())
.
in
(
CollectionUtils
.
isNotEmpty
(
platDeviceList
),
PlatRegionSetting:
:
getDeviceId
,
StreamUtil
.
map
(
platDeviceList
,
BaseEntity:
:
getId
)));
}
}
}
private
String
getDefaultAttr
(
PlatDevice
platDevice
)
{
private
PlatDeviceBaseAttrDTO
getDefaultAttr
(
PlatDevice
platDevice
)
{
String
category
=
platDevice
.
getCategory
();
String
category
=
platDevice
.
getCategory
();
if
(!(
PlatDeviceEnum
.
CategoryEnum
.
FALL
.
getValue
().
equals
(
category
)
||
PlatDeviceEnum
.
CategoryEnum
.
SPACE
.
getValue
().
equals
(
category
)))
{
if
(!(
PlatDeviceEnum
.
CategoryEnum
.
FALL
.
getValue
().
equals
(
category
)
||
PlatDeviceEnum
.
CategoryEnum
.
SPACE
.
getValue
().
equals
(
category
)))
{
return
null
;
return
null
;
...
@@ -499,7 +508,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -499,7 +508,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceBaseAttrDTO
.
setRadarAngle
(
angle
);
platDeviceBaseAttrDTO
.
setRadarAngle
(
angle
);
platDeviceBaseAttrDTO
.
setRadarDelay
(
30
);
platDeviceBaseAttrDTO
.
setRadarDelay
(
30
);
}
}
return
JSON
.
toJSONString
(
platDeviceBaseAttrDTO
)
;
return
platDeviceBaseAttrDTO
;
}
}
@Override
@Override
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRegionSettingServiceImpl.java
View file @
68a0488b
...
@@ -78,11 +78,10 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
...
@@ -78,11 +78,10 @@ public class PlatRegionSettingServiceImpl extends ServiceImpl<PlatRegionSettingM
if
(
map
.
get
(
item
)!=
null
){
if
(
map
.
get
(
item
)!=
null
){
String
attribute
=
map
.
get
(
item
);
String
attribute
=
map
.
get
(
item
);
PlatDeviceAttrWechatDTO
deviceAttrWechatDTO
=
JsonUtil
.
toObj
(
attribute
,
PlatDeviceAttrWechatDTO
.
class
);
PlatDeviceAttrWechatDTO
deviceAttrWechatDTO
=
JsonUtil
.
toObj
(
attribute
,
PlatDeviceAttrWechatDTO
.
class
);
if
(
deviceAttrWechatDTO
==
null
||
deviceAttrWechatDTO
.
getRadarMount
()
==
null
)
{
if
(
deviceAttrWechatDTO
!=
null
)
{
continue
;
}
platRegionSetting
.
setInstallType
(
deviceAttrWechatDTO
.
getRadarMount
().
toString
());
platRegionSetting
.
setInstallType
(
deviceAttrWechatDTO
.
getRadarMount
().
toString
());
}
}
}
list
.
add
(
platRegionSetting
);
list
.
add
(
platRegionSetting
);
}
}
...
...
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