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
9852247d
authored
Nov 03, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:修复bug
parent
5248fa5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
9852247d
...
...
@@ -466,13 +466,23 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
batchEditProperties
(
PlatDeviceAttrDTO
dto
)
{
if
(
CollectionUtils
.
isEmpty
(
dto
.
getDeviceIdList
()))
{
return
;
}
Map
<
String
,
Object
>
map
=
getAttrMap
(
dto
);
List
<
String
>
resultList
=
Lists
.
newArrayList
();
for
(
String
deviceId
:
dto
.
getDeviceIdList
())
{
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
deviceId
)
.
last
(
"limit 1"
));
if
(
other
!=
null
)
{
other
.
setAttribute
(
JSON
.
toJSONString
(
map
));
platDeviceOtherService
.
updateById
(
other
);
}
String
result
=
devicePropertiesOperateService
.
deviceWriteAttr
(
deviceId
,
map
);
if
(
StringUtils
.
isNotEmpty
(
result
))
{
resultList
.
add
(
result
);
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderServiceImpl.java
View file @
9852247d
...
...
@@ -851,9 +851,35 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
}
List
<
PlatElderHealthInfo
>
healthInfoList
=
platElderHealthInfoService
.
list
(
new
QueryWrapper
<
PlatElderHealthInfo
>().
lambda
()
.
in
(
PlatElderHealthInfo:
:
getElderId
,
dto
.
getIdList
()));
for
(
PlatElderHealthInfo
elderHealthInfo
:
healthInfoList
)
{
BeanUtils
.
copyProperties
(
dto
,
elderHealthInfo
);
platElderHealthInfoService
.
saveOrUpdate
(
elderHealthInfo
);
if
(
CollectionUtils
.
isNotEmpty
(
healthInfoList
))
{
for
(
PlatElderHealthInfo
elderHealthInfo
:
healthInfoList
)
{
buildHealthInfo
(
dto
,
elderHealthInfo
);
platElderHealthInfoService
.
saveOrUpdate
(
elderHealthInfo
);
}
}
else
{
for
(
String
s
:
dto
.
getIdList
())
{
PlatElderHealthInfo
elderHealthInfo
=
new
PlatElderHealthInfo
();
buildHealthInfo
(
dto
,
elderHealthInfo
);
elderHealthInfo
.
setElderId
(
s
);
platElderHealthInfoService
.
saveOrUpdate
(
elderHealthInfo
);
}
}
}
private
static
void
buildHealthInfo
(
PlatElderBatchEditDTOVO
dto
,
PlatElderHealthInfo
elderHealthInfo
)
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getHeartRate
()))
{
elderHealthInfo
.
setHeartRate
(
dto
.
getHeartRate
());
}
if
(
StringUtils
.
isNotEmpty
(
dto
.
getHeartExceptionTime
()))
{
elderHealthInfo
.
setHeartExceptionTime
(
dto
.
getHeartExceptionTime
());
}
if
(
StringUtils
.
isNotEmpty
(
dto
.
getRespiratoryRate
()))
{
elderHealthInfo
.
setRespiratoryRate
(
dto
.
getRespiratoryRate
());
}
if
(
StringUtils
.
isNotEmpty
(
dto
.
getRespiratoryExceptionTime
()))
{
elderHealthInfo
.
setRespiratoryExceptionTime
(
dto
.
getRespiratoryExceptionTime
());
}
}
...
...
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