Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yundong
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊学
yundong
Commits
c427ecab
Commit
c427ecab
authored
1 year ago
by
lvcunle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit 空值预处理
parent
4eae87e8
dev
No related merge requests found
Pipeline
#1026
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
yundong-third-domain/src/main/java/com/yundong/third/server/IssuesListDetailServer.java
...java/com/yundong/third/server/IssuesListDetailServer.java
+7
-5
yundong-third-domain/src/main/java/com/yundong/third/server/impl/IssuesListDetailServerImpl.java
...yundong/third/server/impl/IssuesListDetailServerImpl.java
+18
-11
No files found.
yundong-third-domain/src/main/java/com/yundong/third/server/IssuesListDetailServer.java
View file @
c427ecab
...
...
@@ -9,12 +9,14 @@ import java.io.File;
*/
public
interface
IssuesListDetailServer
{
/**
*
*
excel导入
* excel导入
*
* @param excel excel文件
* @param projectId 项目id
* @param userId 当前登录人id
* @param excel excel文件
* @param projectId 项目id
* @param userId 当前登录人id
* @param projectName 项目名称
* @param tenantId 租户id
* @return
*/
Result
<
String
>
importExcel
(
File
excel
,
String
projectId
,
String
userId
);
Result
<
String
>
importExcel
(
File
excel
,
String
projectId
,
String
userId
,
String
projectName
,
String
tenantId
);
}
This diff is collapsed.
Click to expand it.
yundong-third-domain/src/main/java/com/yundong/third/server/impl/IssuesListDetailServerImpl.java
View file @
c427ecab
...
...
@@ -12,7 +12,6 @@ import com.yundong.third.entity.IssuesListDetailExcel;
import
com.yundong.third.mapper.IssuesListDeatilMapper
;
import
com.yundong.third.server.IssuesListDetailServer
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -31,14 +30,16 @@ public class IssuesListDetailServerImpl implements IssuesListDetailServer {
/**
* excel导入
*
* @param excel excel文件
* @param projectId 项目id
* @param userId 当前登录人id
* @param excel excel文件
* @param projectId 项目id
* @param userId 当前登录人id
* @param projectName 项目名称
* @param tenantId 租户id
* @return
*/
@YdcGateway
(
name
=
"monitorCounter-issuesList"
,
url
=
"third/monitor/issuesListDetail/importExcel.json"
)
@Override
public
Result
<
String
>
importExcel
(
File
excel
,
String
projectId
,
String
userId
)
{
public
Result
<
String
>
importExcel
(
File
excel
,
String
projectId
,
String
userId
,
String
projectName
,
String
tenantId
)
{
if
(
excel
==
null
)
{
return
Result
.
fail
(
"文件不能为空"
);
}
...
...
@@ -50,19 +51,25 @@ public class IssuesListDetailServerImpl implements IssuesListDetailServer {
ExcelListener
excelListener
=
new
ExcelListener
();
EasyExcelFactory
.
read
(
excel
,
IssuesListDetailExcel
.
class
,
excelListener
).
excelType
(
ExcelTypeEnum
.
XLSX
).
sheet
().
doRead
();
List
<
IssuesListDetail
>
successData
=
excelListener
.
getSuccessData
();
if
(
successData
.
size
()
==
0
)
{
return
Result
.
success
(
"导入成功,条数:0条"
);
}
//查询
List
<
IssuesListDetail
>
issuesListDetails
=
issuesListDeatilMapper
.
selectList
(
new
LambdaQueryWrapper
<
IssuesListDetail
>()
.
eq
(
IssuesListDetail:
:
getIsDeleted
,
0
)
.
eq
(
IssuesListDetail:
:
getPROJECTID
,
projectId
));
String
projectName
=
issuesListDetails
.
get
(
NumberUtils
.
INTEGER_ZERO
).
getPROJECTNAME
();
String
tenantId
=
issuesListDetails
.
get
(
NumberUtils
.
INTEGER_ZERO
).
getTenantId
();
//过滤
List
<
IssuesListDetail
>
importDataList
=
successData
.
stream
()
.
filter
(
item1
->
issuesListDetails
.
stream
().
noneMatch
(
item2
->
item2
.
getDISCOVERYTIME
().
equals
(
item1
.
getDISCOVERYTIME
())
&&
item2
.
getDESCRIBETEXT
().
equals
(
item1
.
getDESCRIBETEXT
())))
.
collect
(
Collectors
.
toList
());
List
<
IssuesListDetail
>
importDataList
;
if
(
issuesListDetails
.
size
()
!=
0
)
{
importDataList
=
successData
.
stream
()
.
filter
(
item1
->
issuesListDetails
.
stream
().
noneMatch
(
item2
->
item2
.
getDISCOVERYTIME
().
equals
(
item1
.
getDISCOVERYTIME
())
&&
item2
.
getDESCRIBETEXT
().
equals
(
item1
.
getDESCRIBETEXT
())))
.
collect
(
Collectors
.
toList
());
}
else
{
importDataList
=
successData
;
}
//赋值导入
Date
date
=
new
Date
(
System
.
currentTimeMillis
());
...
...
This diff is collapsed.
Click to expand it.
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