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
167a3dcf
authored
Oct 11, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
a1843621
ce5007a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
167a3dcf
...
@@ -107,7 +107,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -107,7 +107,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
//List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(records, PlatDeviceListVO.class);
//List<PlatDeviceListVO> voList = BeanDtoVoUtils.listVo(records, PlatDeviceListVO.class);
if
(
CollectionUtils
.
isEmpty
(
records
))
{
if
(
CollectionUtils
.
isEmpty
(
records
))
{
return
new
PageVO
<>();
return
new
PageVO
<>();
}
}
...
@@ -125,12 +125,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -125,12 +125,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
for
(
PlatDeviceListVO
record
:
records
)
{
for
(
PlatDeviceListVO
record
:
records
)
{
String
spaceParentPath
=
record
.
getSpaceParentPath
();
String
spaceParentPath
=
record
.
getSpaceParentPath
();
if
(
StringUtils
.
isNotBlank
(
spaceParentPath
))
{
if
(
StringUtils
.
isNotBlank
(
spaceParentPath
))
{
String
spaceNameJoin
=
Stream
.
of
(
spaceParentPath
.
split
(
","
)).
map
(
vo
->
spaceIdNameMap
.
get
(
vo
)).
collect
(
Collectors
.
joining
(
"-"
));
String
spaceNameJoin
=
Stream
.
of
(
spaceParentPath
.
split
(
","
)).
map
(
vo
->
spaceIdNameMap
.
get
(
vo
)).
collect
(
Collectors
.
joining
(
"-"
));
String
spaceName
=
spaceNameJoin
+
"-"
+
record
.
getSpaceName
()
+
"-"
+
record
.
getRoomName
();
String
spaceName
=
spaceNameJoin
+
"-"
+
record
.
getSpaceName
()
+
"-"
+
record
.
getRoomName
();
if
(
StringUtils
.
isNotBlank
(
record
.
getBedName
()))
{
if
(
StringUtils
.
isNotBlank
(
record
.
getBedName
()))
{
spaceName
=
spaceName
+
"-"
+
record
.
getBedName
();
spaceName
=
spaceName
+
"-"
+
record
.
getBedName
();
}
}
record
.
setSpaceName
(
spaceName
);
record
.
setSpaceName
(
spaceName
);
}
}
...
@@ -165,7 +165,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -165,7 +165,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
check
(
dto
);
check
(
dto
);
PlatDevice
db
=
getById
(
dto
.
getId
());
PlatDevice
db
=
getById
(
dto
.
getId
());
BeanUtils
.
copyProperties
(
dto
,
db
,
BaseBusEntity
.
Fields
.
tenantId
);
BeanUtils
.
copyProperties
(
dto
,
db
,
BaseBusEntity
.
Fields
.
tenantId
);
updateById
(
db
);
updateById
(
db
);
...
@@ -197,10 +197,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -197,10 +197,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
public
void
setup
(
PlatDeviceSetupDTO
dto
)
{
public
void
setup
(
PlatDeviceSetupDTO
dto
)
{
PlatDevice
db
=
getOne
(
new
QueryWrapper
<
PlatDevice
>().
lambda
()
PlatDevice
db
=
getOne
(
new
QueryWrapper
<
PlatDevice
>().
lambda
()
.
eq
(
PlatDevice:
:
getOriDeviceId
,
dto
.
getOriDeviceId
()));
.
eq
(
PlatDevice:
:
getOriDeviceId
,
dto
.
getOriDeviceId
()));
if
(
db
==
null
)
{
if
(
db
==
null
)
{
throw
new
RuntimeException
(
"设备不存在:"
+
db
.
getOriDeviceId
());
throw
new
RuntimeException
(
"设备不存在:"
+
db
.
getOriDeviceId
());
}
}
String
id
=
db
.
getId
();
String
id
=
null
;
if
(
db
!=
null
)
{
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
()));
...
@@ -213,15 +219,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -213,15 +219,16 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils
.
copyProperties
(
dto
,
db
);
BeanUtils
.
copyProperties
(
dto
,
db
);
db
.
setId
(
id
);
db
.
setId
(
id
);
saveOrUpdate
(
db
);
id
=
db
.
getId
();
deviceCacheUtil
.
put
(
db
);
BeanUtils
.
copyProperties
(
dto
,
other
);
BeanUtils
.
copyProperties
(
dto
,
other
);
other
.
setId
(
otherId
);
other
.
setId
(
otherId
);
other
.
setDeviceId
(
id
);
other
.
setDeviceId
(
id
);
other
.
setOriDeviceId
(
db
.
getOriDeviceId
());
other
.
setOriDeviceId
(
db
.
getOriDeviceId
());
updateById
(
db
);
deviceCacheUtil
.
put
(
db
);
platDeviceOtherService
.
saveOrUpdate
(
other
);
platDeviceOtherService
.
saveOrUpdate
(
other
);
...
@@ -255,8 +262,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -255,8 +262,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOtherService
.
saveOrUpdate
(
other
);
platDeviceOtherService
.
saveOrUpdate
(
other
);
if
(
StringUtils
.
isNotEmpty
(
other
.
getAttribute
()))
{
if
(
StringUtils
.
isNotEmpty
(
other
.
getAttribute
()))
{
PlatDeviceAttrWechatDTO
deviceAttrWechatDTO
=
JsonUtil
.
toObj
(
other
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
PlatDeviceAttrWechatDTO
deviceAttrWechatDTO
=
JsonUtil
.
toObj
(
other
.
getAttribute
(),
PlatDeviceAttrWechatDTO
.
class
);
//更新区域设置设备安装方式
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
.
set
(
PlatRegionSetting:
:
getInstallType
,
deviceAttrWechatDTO
.
getRadarMount
())
.
set
(
PlatRegionSetting:
:
getInstallType
,
deviceAttrWechatDTO
.
getRadarMount
())
...
@@ -273,10 +280,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -273,10 +280,10 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
Page
<
PlatDevice
>
devicePage
=
page
(
page
,
lambdaQueryWrapper
);
Page
<
PlatDevice
>
devicePage
=
page
(
page
,
lambdaQueryWrapper
);
List
<
PlatDevice
>
records
=
devicePage
.
getRecords
();
List
<
PlatDevice
>
records
=
devicePage
.
getRecords
();
List
<
PlatDeviceListVO
>
platDeviceListVOS
=
BeanDtoVoUtils
.
listVo
(
records
,
PlatDeviceListVO
.
class
);
List
<
PlatDeviceListVO
>
platDeviceListVOS
=
BeanDtoVoUtils
.
listVo
(
records
,
PlatDeviceListVO
.
class
);
JoinUtil
.
join
(
platDeviceListVOS
,
platTenantService
,
BaseTenantDTO:
:
getTenantId
,
BaseEntity:
:
getId
,(
d
,
o
)->
{
JoinUtil
.
join
(
platDeviceListVOS
,
platTenantService
,
BaseTenantDTO:
:
getTenantId
,
BaseEntity:
:
getId
,
(
d
,
o
)
->
{
d
.
setTenantName
(
o
.
getName
());
d
.
setTenantName
(
o
.
getName
());
});
});
return
PageUtil
.
toPageVO
(
platDeviceListVOS
,
devicePage
);
return
PageUtil
.
toPageVO
(
platDeviceListVOS
,
devicePage
);
}
}
@Override
@Override
...
@@ -294,7 +301,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -294,7 +301,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
BeanUtils
.
copyProperties
(
dto
,
db
);
BeanUtils
.
copyProperties
(
dto
,
db
);
db
.
setId
(
id
);
db
.
setId
(
id
);
BeanUtils
.
copyProperties
(
dto
,
other
,
BaseEntity
.
Fields
.
id
);
BeanUtils
.
copyProperties
(
dto
,
other
,
BaseEntity
.
Fields
.
id
);
other
.
setDeviceId
(
id
);
other
.
setDeviceId
(
id
);
updateById
(
db
);
updateById
(
db
);
...
@@ -339,7 +346,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -339,7 +346,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
@Override
@Override
public
void
editDeviceProperties
(
PlatDeviceAttrWechatDTO
dto
)
{
public
void
editDeviceProperties
(
PlatDeviceAttrWechatDTO
dto
)
{
devicePropertiesOperateService
.
deviceWrite
(
dto
.
getDeviceId
(),
dto
.
getRadarMount
(),
dto
.
getRadarMode
(),
dto
.
getRadarHight
());
devicePropertiesOperateService
.
deviceWrite
(
dto
.
getDeviceId
(),
dto
.
getRadarMount
(),
dto
.
getRadarMode
(),
dto
.
getRadarHight
());
//更新区域设置设备安装方式
//更新区域设置设备安装方式
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
platRegionSettingService
.
update
(
new
UpdateWrapper
<
PlatRegionSetting
>().
lambda
()
...
...
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