Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王飞
vehicle-quality-review
Commits
c8d44fa5
Commit
c8d44fa5
authored
May 13, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangdingyi' into 'dev'
企业留档文件显示所有文件(包括未引用的文件) See merge request
!330
parents
7e312555
70b73f53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
10 deletions
+70
-10
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+7
-0
ReviewEnterpriseArchiveServiceImpl.java
...uoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
+63
-10
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
View file @
c8d44fa5
...
@@ -246,6 +246,13 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
...
@@ -246,6 +246,13 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
document
.
writeCell
(
item
.
getKeyPoint
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
item
.
getKeyPoint
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
});
});
}
}
if
(
view
.
getItems
().
size
()
==
0
)
{
document
.
writeCell
(
view
.
getFileName
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
" "
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
" "
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
" "
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
" "
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
}
}
}
document
.
addContent
(
table
);
document
.
addContent
(
table
);
// 最后结尾签字
// 最后结尾签字
...
...
quality-review/src/main/java/com/ruoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
View file @
c8d44fa5
...
@@ -21,10 +21,7 @@ import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest;
...
@@ -21,10 +21,7 @@ import com.ruoyi.web.request.ReviewEnterpriseArchiveGetInfoRequest;
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
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
/**
/**
* @author wangfei
* @author wangfei
...
@@ -57,18 +54,74 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
...
@@ -57,18 +54,74 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
List
<
ReviewEnterpriseArchiveViewVO
>
resultList
=
new
ArrayList
<>();
List
<
ReviewEnterpriseArchiveViewVO
>
resultList
=
new
ArrayList
<>();
resultList
.
addAll
(
// 原始数据originalList
buildReviewEnterpriseArchiveViewVO
(
archives
,
reviewEnterpriseArchiveMapper
.
findViewItemVOByTaskId
(
task
.
getSystemReviewTaskId
()))
List
<
ReviewEnterpriseArchiveViewVO
>
originalList
=
new
ArrayList
<>();
);
resultList
.
addAll
(
if
(
task
.
getSystemReviewTaskId
()
!=
null
)
{
buildReviewEnterpriseArchiveViewVO
(
archives
,
reviewEnterpriseArchiveMapper
.
findViewItemVOByTaskId
(
task
.
getCarReviewTaskId
()))
originalList
.
addAll
(
buildReviewEnterpriseArchiveViewVO
(
archives
,
reviewEnterpriseArchiveMapper
.
findViewItemVOByTaskId
(
task
.
getSystemReviewTaskId
()))
);
}
if
(
task
.
getCarReviewTaskId
()
!=
null
)
{
originalList
.
addAll
(
buildReviewEnterpriseArchiveViewVO
(
archives
,
reviewEnterpriseArchiveMapper
.
findViewItemVOByTaskId
(
task
.
getCarReviewTaskId
()))
);
}
// 创建一个映射,将文件名作为键,将具有相同文件名的对象列表作为值
Map
<
String
,
List
<
ReviewEnterpriseArchiveViewVO
>>
map
=
new
HashMap
<>();
);
// 遍历原始列表,将对象合并到相应的文件名键所对应的值列表中
for
(
ReviewEnterpriseArchiveViewVO
item
:
originalList
)
{
String
fileName
=
item
.
getFileName
();
if
(!
map
.
containsKey
(
fileName
))
{
map
.
put
(
fileName
,
new
ArrayList
<>());
}
map
.
get
(
fileName
).
add
(
item
);
}
// 遍历映射中的值列表,将对象合并到结果列表中
for
(
List
<
ReviewEnterpriseArchiveViewVO
>
itemList
:
map
.
values
())
{
// 如果有多个对象,合并它们
if
(
itemList
.
size
()
>
1
)
{
ReviewEnterpriseArchiveViewVO
mergedItem
=
mergeItems
(
itemList
);
resultList
.
add
(
mergedItem
);
}
else
{
resultList
.
addAll
(
itemList
);
}
}
return
resultList
;
return
resultList
;
}
}
/**
* 合并具有相同文件名的对象
* @param itemList
* @return
*/
private
static
ReviewEnterpriseArchiveViewVO
mergeItems
(
List
<
ReviewEnterpriseArchiveViewVO
>
itemList
)
{
// 创建一个新的 ReviewEnterpriseArchiveViewVO 对象来保存合并后的结果
ReviewEnterpriseArchiveViewVO
mergedItem
=
new
ReviewEnterpriseArchiveViewVO
();
// 由于这里 items 列表需要合并,因此需要创建一个新的列表来保存合并后的结果
List
<
ReviewEnterpriseArchiveViewItemVO
>
mergedItemList
=
new
ArrayList
<>();
// 遍历 itemList 列表,将所有的 items 合并到 mergedItemList 中
for
(
ReviewEnterpriseArchiveViewVO
item
:
itemList
)
{
mergedItemList
.
addAll
(
item
.
getItems
());
}
// 将合并后的 items 设置到 mergedItem 中
mergedItem
.
setItems
(
mergedItemList
);
// 对于其他属性,这里简单地选择第一个对象中的值作为合并后的结果
mergedItem
.
setId
(
itemList
.
get
(
0
).
getId
());
mergedItem
.
setFileName
(
itemList
.
get
(
0
).
getFileName
());
return
mergedItem
;
}
@Override
@Override
public
Long
addEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
public
Long
addEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
...
...
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