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
0b8b1652
authored
Oct 25, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixbug:设备绑定问题
parent
f0f061f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 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/PlatRoomBedDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
0b8b1652
...
@@ -225,9 +225,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -225,9 +225,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
String
id
=
null
;
String
id
=
null
;
if
(
db
!=
null
)
{
id
=
db
.
getId
();
id
=
db
.
getId
();
}
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
PlatDeviceOther
other
=
platDeviceOtherService
.
getOne
(
new
QueryWrapper
<
PlatDeviceOther
>().
lambda
()
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
dto
.
getOriDeviceId
()));
.
eq
(
PlatDeviceOther:
:
getOriDeviceId
,
dto
.
getOriDeviceId
()));
...
@@ -241,7 +239,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -241,7 +239,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils
.
copyProperties
(
dto
,
db
);
BeanUtils
.
copyProperties
(
dto
,
db
);
db
.
setId
(
id
);
db
.
setId
(
id
);
db
.
setTenantId
(
tenantId
);
db
.
setTenantId
(
tenantId
);
db
.
setOrgId
(
dto
.
getOrgId
());
saveOrUpdate
(
db
);
saveOrUpdate
(
db
);
id
=
db
.
getId
();
id
=
db
.
getId
();
...
...
server-service/src/main/java/com/makeit/service/platform/space/impl/PlatRoomBedDeviceServiceImpl.java
View file @
0b8b1652
...
@@ -28,6 +28,7 @@ import com.makeit.utils.data.convert.PageUtil;
...
@@ -28,6 +28,7 @@ import com.makeit.utils.data.convert.PageUtil;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.data.convert.StreamUtil
;
import
com.makeit.utils.old.StringUtils
;
import
com.makeit.utils.old.StringUtils
;
import
jodd.util.StringUtil
;
import
jodd.util.StringUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -77,9 +78,19 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
...
@@ -77,9 +78,19 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
// 绑定床位不重复插入数据,直接绑定
// 绑定床位不重复插入数据,直接绑定
if
(
StringUtils
.
isNotEmpty
(
dto
.
getBedId
()))
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getBedId
()))
{
List
<
PlatRoomBedDevice
>
platRoomBedDeviceList
=
list
(
new
QueryWrapper
<
PlatRoomBedDevice
>().
lambda
().
in
(
PlatRoomBedDevice:
:
getDeviceId
,
listEquipmentIds
));
List
<
PlatRoomBedDevice
>
platRoomBedDeviceList
=
list
(
new
QueryWrapper
<
PlatRoomBedDevice
>().
lambda
().
in
(
PlatRoomBedDevice:
:
getDeviceId
,
listEquipmentIds
));
for
(
PlatRoomBedDevice
platRoomBedDevice
:
platRoomBedDeviceList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
platRoomBedDeviceList
))
{
platRoomBedDevice
.
setBedId
(
dto
.
getBedId
());
for
(
PlatRoomBedDevice
platRoomBedDevice
:
platRoomBedDeviceList
)
{
updateById
(
platRoomBedDevice
);
platRoomBedDevice
.
setBedId
(
dto
.
getBedId
());
updateById
(
platRoomBedDevice
);
}
}
else
{
for
(
String
listEquipmentId
:
listEquipmentIds
)
{
PlatRoomBedDevice
data
=
new
PlatRoomBedDevice
();
data
.
setDeviceId
(
listEquipmentId
);
data
.
setRoomId
(
dto
.
getRoomId
());
data
.
setBedId
(
dto
.
getBedId
());
save
(
data
);
}
}
}
return
;
return
;
}
}
...
...
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