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
cf6a7b06
Commit
cf6a7b06
authored
Apr 18, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.91isoft.com:90/wangfei/vehicle-quality-review
into wangdingyi
parents
98b38be8
2e3b739d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
16 deletions
+77
-16
InspectionPersonnelVO.java
.../main/java/com/ruoyi/domain/vo/InspectionPersonnelVO.java
+30
-0
TaskMapper.java
...ity-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
+8
-0
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+21
-15
TaskMapper.xml
quality-review/src/main/resources/mapper/TaskMapper.xml
+16
-0
TestRecordsMapper.xml
...ty-review/src/main/resources/mapper/TestRecordsMapper.xml
+2
-1
No files found.
quality-review/src/main/java/com/ruoyi/domain/vo/InspectionPersonnelVO.java
0 → 100644
View file @
cf6a7b06
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 总任务 - 检验人员VO
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"检验人员VO"
)
public
class
InspectionPersonnelVO
{
@ApiModelProperty
(
"负责人"
)
private
String
principal
;
@ApiModelProperty
(
"检验人员"
)
private
String
inspectionPersonnel
;
@ApiModelProperty
(
"检验日期"
)
private
String
inspectionDate
;
}
quality-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
View file @
cf6a7b06
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.domain.TaskUserRelation
;
import
com.ruoyi.domain.TaskUserRelation
;
import
com.ruoyi.domain.vo.EnterpriseFilePdfVO
;
import
com.ruoyi.domain.vo.EnterpriseFilePdfVO
;
import
com.ruoyi.domain.vo.InspectionPersonnelVO
;
import
com.ruoyi.domain.vo.InspectionReportPdfVO
;
import
com.ruoyi.domain.vo.InspectionReportPdfVO
;
import
com.ruoyi.domain.vo.TestConclusionVO
;
import
com.ruoyi.domain.vo.TestConclusionVO
;
import
com.ruoyi.web.request.TaskFindFinishRequest
;
import
com.ruoyi.web.request.TaskFindFinishRequest
;
...
@@ -74,4 +75,11 @@ public interface TaskMapper extends BaseMapper<Task> {
...
@@ -74,4 +75,11 @@ public interface TaskMapper extends BaseMapper<Task> {
* @return
* @return
*/
*/
TestConclusionVO
selectTestConclusion
(
Long
taskId
);
TestConclusionVO
selectTestConclusion
(
Long
taskId
);
/**
* 通过总任务ID查询当前任务的小组成员
* @param taskId
* @return
*/
InspectionPersonnelVO
selectInspectionPersonnelById
(
Long
taskId
);
}
}
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
View file @
cf6a7b06
...
@@ -277,13 +277,15 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
...
@@ -277,13 +277,15 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
List
<
TestRecords
>
recordsList
=
testRecordsMapper
.
selectListByGeneralTaskId
(
taskId
);
List
<
TestRecords
>
recordsList
=
testRecordsMapper
.
selectListByGeneralTaskId
(
taskId
);
// 查询本任务对应的所有样品编号、样品照片
// 查询本任务对应的所有样品编号、样品照片
InspectionReportPdfVO
reportData
=
taskMapper
.
selectInspectionReportData
(
taskId
);
InspectionReportPdfVO
reportData
=
taskMapper
.
selectInspectionReportData
(
taskId
);
// 查询检验负责人
InspectionPersonnelVO
inspectionPersonnel
=
taskMapper
.
selectInspectionPersonnelById
(
taskId
);
// 创建临时文档
// 创建临时文档
String
templateName
=
temporaryDocument
(
sample
,
recordsList
,
reportData
);
String
templateName
=
temporaryDocument
(
sample
,
recordsList
,
reportData
,
inspectionPersonnel
);
PdfReader
pdfReader
=
new
PdfReader
(
minioUrl
()
+
templateName
);
PdfReader
pdfReader
=
new
PdfReader
(
minioUrl
()
+
templateName
);
totalNum
=
pdfReader
.
getNumberOfPages
()
-
1
;
totalNum
=
pdfReader
.
getNumberOfPages
()
-
1
;
// 真正文档
// 真正文档
String
currentName
=
temporaryDocument
(
sample
,
recordsList
,
reportData
);
String
currentName
=
temporaryDocument
(
sample
,
recordsList
,
reportData
,
inspectionPersonnel
);
// copy - 分割
// copy - 分割
Document
currentDoc
=
new
Document
();
Document
currentDoc
=
new
Document
();
ByteArrayOutputStream
arrayOutputStream
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
arrayOutputStream
=
new
ByteArrayOutputStream
();
...
@@ -306,11 +308,12 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
...
@@ -306,11 +308,12 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
* @param sample 样品信息
* @param sample 样品信息
* @param recordsList 定时任务接收数据List
* @param recordsList 定时任务接收数据List
* @param reportData
* @param reportData
* @param inspectionPersonnel 检验人员信息
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
@SneakyThrows
@SneakyThrows
private
String
temporaryDocument
(
Sample
sample
,
List
<
TestRecords
>
recordsList
,
InspectionReportPdfVO
reportData
)
throws
Exception
{
private
String
temporaryDocument
(
Sample
sample
,
List
<
TestRecords
>
recordsList
,
InspectionReportPdfVO
reportData
,
InspectionPersonnelVO
inspectionPersonnel
)
throws
Exception
{
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
...
@@ -331,9 +334,9 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
...
@@ -331,9 +334,9 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
// 3.仪器设备信息
// 3.仪器设备信息
instrumentInformationSection
(
document
);
instrumentInformationSection
(
document
);
// 第一页下方信息
// 第一页下方信息
bottomOfTheFirstPage
(
document
,
writer
);
bottomOfTheFirstPage
(
document
,
writer
,
reportData
,
inspectionPersonnel
);
// 4.检验结果(循环遍历用例)
// 4.检验结果(循环遍历用例)
testResultSection
(
document
,
recordsList
,
reportData
);
testResultSection
(
document
,
recordsList
,
reportData
,
inspectionPersonnel
);
// 5.附录
// 5.附录
document
.
setParagraph
(
"5.附录"
,
10
f
,
Element
.
ALIGN_LEFT
,
0
,
2
f
,
0
f
);
document
.
setParagraph
(
"5.附录"
,
10
f
,
Element
.
ALIGN_LEFT
,
0
,
2
f
,
0
f
);
// 样品照片
// 样品照片
...
@@ -445,20 +448,22 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
...
@@ -445,20 +448,22 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
* 车型试验原始记录 - 第一页下方固定内容
* 车型试验原始记录 - 第一页下方固定内容
* @param document
* @param document
* @param writer
* @param writer
* @param reportData
* @param inspectionPersonnel
*/
*/
private
void
bottomOfTheFirstPage
(
PdfBaseWriter
document
,
PdfWriter
writer
)
{
private
void
bottomOfTheFirstPage
(
PdfBaseWriter
document
,
PdfWriter
writer
,
InspectionReportPdfVO
reportData
,
InspectionPersonnelVO
inspectionPersonnel
)
{
PdfPTable
inspectorTable
=
new
PdfPTable
(
new
float
[]{
20
,
20
,
10
,
40
});
PdfPTable
inspectorTable
=
new
PdfPTable
(
new
float
[]{
12
,
28
,
10
,
40
});
inspectorTable
.
setWidthPercentage
(
100
);
inspectorTable
.
setWidthPercentage
(
100
);
inspectorTable
.
setTotalWidth
(
PageSize
.
A4
.
getWidth
()
-
80
);
inspectorTable
.
setTotalWidth
(
PageSize
.
A4
.
getWidth
()
-
80
);
document
.
writeNoBorderCell
(
"检验人员:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeNoBorderCell
(
"检验人员:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeNoBorderCell
(
""
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeNoBorderCell
(
inspectionPersonnel
.
getInspectionPersonnel
()
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeNoBorderCell
(
"检验日期:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeNoBorderCell
(
"检验日期:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeNoBorderCell
(
""
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeNoBorderCell
(
inspectionPersonnel
.
getInspectionDate
()
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
"检验负责人:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
"检验负责人:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
""
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
inspectionPersonnel
.
getPrincipal
()
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
"检验地点:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
"检验地点:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
"口
中汽研软件测评有限公司
口其他:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
document
.
writeBottomCell
(
"口
"
+
reportData
.
getInspectionCenterAddress
()
+
"
口其他:"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
inspectorTable
);
inspectorTable
.
writeSelectedRows
(
0
,
-
1
,
document
.
left
(),
document
.
bottom
()
+
6
0
,
writer
.
getDirectContent
());
inspectorTable
.
writeSelectedRows
(
0
,
-
1
,
document
.
left
(),
document
.
bottom
()
+
8
0
,
writer
.
getDirectContent
());
// 开启下一页
// 开启下一页
document
.
newPage
();
document
.
newPage
();
}
}
...
@@ -468,8 +473,9 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
...
@@ -468,8 +473,9 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
* @param document
* @param document
* @param recordsList
* @param recordsList
* @param reportData
* @param reportData
* @param inspectionPersonnel
*/
*/
private
void
testResultSection
(
PdfBaseWriter
document
,
List
<
TestRecords
>
recordsList
,
InspectionReportPdfVO
reportData
)
{
private
void
testResultSection
(
PdfBaseWriter
document
,
List
<
TestRecords
>
recordsList
,
InspectionReportPdfVO
reportData
,
InspectionPersonnelVO
inspectionPersonnel
)
{
document
.
setParagraph
(
"4.检验结果"
,
10
f
,
Element
.
ALIGN_LEFT
,
0
,
10
f
,
0
f
);
document
.
setParagraph
(
"4.检验结果"
,
10
f
,
Element
.
ALIGN_LEFT
,
0
,
10
f
,
0
f
);
// 获取数据 - 渲染
// 获取数据 - 渲染
if
(
CollUtil
.
isNotEmpty
(
recordsList
))
{
if
(
CollUtil
.
isNotEmpty
(
recordsList
))
{
...
@@ -480,13 +486,13 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
...
@@ -480,13 +486,13 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
PdfPTable
useCaseTable
=
new
PdfPTable
(
new
float
[]{
15
,
35
,
15
,
35
});
PdfPTable
useCaseTable
=
new
PdfPTable
(
new
float
[]{
15
,
35
,
15
,
35
});
useCaseTable
.
setWidthPercentage
(
100
);
useCaseTable
.
setWidthPercentage
(
100
);
document
.
writeCell
(
"测试编号"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"测试编号"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"xxxxxxx"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
record
.
getUsecaseNo
()
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"测试时间"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"测试时间"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
String
.
valueOf
(
record
.
getTestTime
()),
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
String
.
valueOf
(
record
.
getTestTime
()),
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"样品编号"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"样品编号"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
reportData
.
getSampleNumberSummary
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
reportData
.
getSampleNumberSummary
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"测试人员"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"测试人员"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
""
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
inspectionPersonnel
.
getInspectionPersonnel
()
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"简述"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"简述"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
record
.
getDescription
(),
Element
.
ALIGN_LEFT
,
3
,
1
,
useCaseTable
);
document
.
writeCell
(
record
.
getDescription
(),
Element
.
ALIGN_LEFT
,
3
,
1
,
useCaseTable
);
document
.
writeCell
(
"风险等级"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
document
.
writeCell
(
"风险等级"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
useCaseTable
);
...
...
quality-review/src/main/resources/mapper/TaskMapper.xml
View file @
cf6a7b06
...
@@ -407,5 +407,21 @@
...
@@ -407,5 +407,21 @@
t.id = #{taskId}
t.id = #{taskId}
</select>
</select>
<select
id=
"selectInspectionPersonnelById"
parameterType=
"java.lang.Long"
resultType=
"com.ruoyi.domain.vo.InspectionPersonnelVO"
>
select
su.nick_name AS principal,
GROUP_CONCAT(distinct u.nick_name) AS inspectionPersonnel,
DATE_FORMAT(mtt.task_begin_time, '%Y-%m-%d') AS inspectionDate
from
t_task t
left join t_task_user_relation tur on t.id = tur.task_id
left join sys_user u on tur.user_id = u.user_id
left join sys_user su on t.leader_id = su.user_id
left join t_model_test_task mtt on t.model_test_task_id = mtt.id
where
t.id = #{taskId}
group by t.id
</select>
</mapper>
</mapper>
quality-review/src/main/resources/mapper/TestRecordsMapper.xml
View file @
cf6a7b06
...
@@ -40,7 +40,8 @@
...
@@ -40,7 +40,8 @@
tr.test_method,
tr.test_method,
tr.test_result,
tr.test_result,
tr.remediation,
tr.remediation,
tr.test_details
tr.test_details,
tr.usecase_no
from
from
t_test_records tr
t_test_records tr
left join t_task t on tr.task_id = t.model_test_task_id
left join t_task t on tr.task_id = t.model_test_task_id
...
...
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