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
4ef7b8e9
authored
Dec 10, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:修复bug
parent
24845f57
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderServiceImpl.java
View file @
4ef7b8e9
package
com
.
makeit
.
service
.
platform
.
elder
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
...
@@ -419,9 +421,53 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
e
.
setBedName
(
l
.
getName
());
});
handleExcelData
(
list
,
dbList
);
ExcelUtil
.
export
(
response
,
"长者信息"
+
FileSuffixEnum
.
EXCEL
.
getSuffix
(),
"长者信息"
,
PlatElderExportVO
.
class
,
list
);
}
private
void
handleExcelData
(
List
<
PlatElderExportVO
>
list
,
List
<
PlatElder
>
dbList
)
{
if
(
CollUtil
.
isEmpty
(
list
)
||
CollUtil
.
isEmpty
(
dbList
))
{
return
;
}
Map
<
String
,
PlatElder
>
platElderMap
=
StreamUtil
.
toMap
(
dbList
,
PlatElder:
:
getId
);
list
.
forEach
(
e
->
{
PlatElder
platElder
=
platElderMap
.
get
(
e
.
getId
());
if
(
platElder
==
null
)
{
return
;
}
String
spacePath
=
platElder
.
getSpacePath
();
if
(
StrUtil
.
isBlank
(
spacePath
))
{
e
.
setStreetSpaceName
(
null
);
e
.
setBuildingSpaceName
(
null
);
e
.
setUnitSpaceName
(
null
);
e
.
setFloorSpaceName
(
null
);
e
.
setRoomName
(
null
);
e
.
setBedName
(
null
);
return
;
}
List
<
String
>
pathList
=
Arrays
.
asList
(
spacePath
.
split
(
","
));
if
(!
pathList
.
contains
(
e
.
getStreetSpaceId
()))
{
e
.
setStreetSpaceName
(
null
);
}
if
(!
pathList
.
contains
(
e
.
getBuildingSpaceId
()))
{
e
.
setBuildingSpaceName
(
null
);
}
if
(!
pathList
.
contains
(
e
.
getUnitSpaceId
()))
{
e
.
setUnitSpaceName
(
null
);
}
if
(!
pathList
.
contains
(
e
.
getFloorSpaceId
()))
{
e
.
setFloorSpaceName
(
null
);
}
if
(!
pathList
.
contains
(
e
.
getRoomId
()))
{
e
.
setRoomName
(
null
);
}
if
(!
pathList
.
contains
(
e
.
getBedId
()))
{
e
.
setBedName
(
null
);
}
});
}
@Override
public
void
exportTemplate
(
HttpServletResponse
response
)
{
ExcelUtil
.
exportTemplate
(
response
,
"长者信息导入模板"
+
FileSuffixEnum
.
EXCEL
.
getSuffix
(),
"长者信息"
,
PlatElderImportDTO
.
class
);
...
...
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