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
f9e59dc1
Commit
f9e59dc1
authored
Mar 21, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检验报告 - 活数据
parent
23ead691
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
38 deletions
+65
-38
InspectionReportPdfVO.java
.../main/java/com/ruoyi/domain/vo/InspectionReportPdfVO.java
+5
-0
TaskMapper.java
...ity-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
+8
-0
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+17
-37
TaskMapper.xml
quality-review/src/main/resources/mapper/TaskMapper.xml
+35
-1
receipt_template_02_27.pdf
...ew/src/main/resources/template/receipt_template_02_27.pdf
+0
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/vo/InspectionReportPdfVO.java
View file @
f9e59dc1
...
...
@@ -105,6 +105,11 @@ public class InspectionReportPdfVO {
*/
private
String
productionDate
;
/**
* 检验依据
*/
private
String
inspectionBasis
;
/**
* 检验项目
*/
...
...
quality-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
View file @
f9e59dc1
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.domain.vo.EnterpriseFilePdfVO
;
import
com.ruoyi.domain.vo.InspectionReportPdfVO
;
import
com.ruoyi.web.request.TaskFindFinishRequest
;
import
com.ruoyi.web.request.TaskFindPendingRequest
;
import
com.ruoyi.web.request.TaskFindRequest
;
...
...
@@ -42,4 +43,11 @@ public interface TaskMapper extends BaseMapper<Task> {
* @return
*/
EnterpriseFilePdfVO
selectEnterpriseFileData
(
@Param
(
"taskId"
)
Long
taskId
);
/**
* 通过总任务ID,获取检验报告数据
* @param taskId
* @return
*/
InspectionReportPdfVO
selectInspectionReportData
(
Long
taskId
);
}
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
View file @
f9e59dc1
...
...
@@ -86,7 +86,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
fields
.
addSubstitutionFont
(
bf
);
// 测试数据
InspectionReportPdfVO
inspectionReportPdfVO
=
requireData
();
InspectionReportPdfVO
inspectionReportPdfVO
=
requireData
(
taskId
);
// 渲染数据
renderData
(
fields
,
inspectionReportPdfVO
);
...
...
@@ -181,9 +181,18 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
* @return
*/
private
EnterpriseFilePdfVO
getEnterpriseFileData
(
Long
taskId
)
{
List
<
SysDictData
>
dictDataList
=
dictDataMapper
.
selectDictDataByType
(
"inspection_item"
);
EnterpriseFilePdfVO
enterpriseFileData
=
taskMapper
.
selectEnterpriseFileData
(
taskId
);
List
<
String
>
list
=
Arrays
.
asList
(
enterpriseFileData
.
getInspectionItem
().
split
(
","
));
enterpriseFileData
.
setInspectionItem
(
getInspectionItemByTaskItem
(
enterpriseFileData
.
getInspectionItem
()));
return
enterpriseFileData
;
}
/**
* 获取当前项目的检验项目
* @return
*/
private
String
getInspectionItemByTaskItem
(
String
inspectionItem
)
{
List
<
SysDictData
>
dictDataList
=
dictDataMapper
.
selectDictDataByType
(
"inspection_item"
);
List
<
String
>
list
=
Arrays
.
asList
(
inspectionItem
.
split
(
","
));
StringBuilder
taskItem
=
new
StringBuilder
();
for
(
String
item
:
list
)
{
Optional
<
SysDictData
>
first
=
dictDataList
.
stream
().
filter
(
data
->
data
.
getDictValue
().
equals
(
item
)).
findFirst
();
...
...
@@ -192,8 +201,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
taskItem
.
append
(
dictData
.
getDictLabel
()).
append
(
"、"
);
}
}
enterpriseFileData
.
setInspectionItem
(
taskItem
.
substring
(
0
,
taskItem
.
length
()
-
1
));
return
enterpriseFileData
;
return
taskItem
.
substring
(
0
,
taskItem
.
length
()
-
1
);
}
/**
...
...
@@ -234,38 +242,10 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
* 模拟数据
* @return
*/
private
InspectionReportPdfVO
requireData
()
{
InspectionReportPdfVO
inspectionReportPdfVO
=
InspectionReportPdfVO
.
builder
()
.
reportNumber
(
"报告编号"
)
.
productName
(
"产品名称"
)
.
productModel
(
"产品型号"
)
.
entrustedUnit
(
"委托单位"
)
.
inspectionCenterName
(
"检验中心名称"
)
.
inspectionCenterAddress
(
"检验中心地址"
)
.
inspectionCenterTelephone
(
"检验中心电话"
)
.
inspectionCenterPostcode
(
"检验中心邮编"
)
.
clientAddress
(
"委托单位地址"
)
.
entrustedUnitTelephone
(
"委托单位电话"
)
.
clientPostalCode
(
"委托单位邮编"
)
.
sampleName
(
"样品名称"
)
.
typeSpecification
(
"型号规格"
)
.
productionEnterprise
(
"生产企业"
)
.
sampleSender
(
"送养着"
)
.
sampleDeliveryDate
(
"送样日期"
)
.
sampleQuantity
(
"样品数量"
)
.
productionDate
(
"生产日期"
)
.
inspectionItem
(
"检验项目"
)
.
testConclusion
(
"检验结论"
)
.
issueDate
(
"签发日期"
)
.
remark
(
"备注"
)
.
taskNumber
(
"任务编号"
)
.
sampleSum
(
"样品数量"
)
.
vehicleType
(
"车辆类型"
)
.
vehicleModel
(
"车辆型号"
)
.
vehicleIdentificationNumber
(
"车辆识别码"
)
.
sampleNumberSummary
(
"样品编号汇总"
)
.
build
();
return
inspectionReportPdfVO
;
private
InspectionReportPdfVO
requireData
(
Long
taskId
)
{
InspectionReportPdfVO
inspectionReport
=
taskMapper
.
selectInspectionReportData
(
taskId
);
inspectionReport
.
setInspectionItem
(
getInspectionItemByTaskItem
(
inspectionReport
.
getInspectionItem
()));
return
inspectionReport
;
}
/**
...
...
quality-review/src/main/resources/mapper/TaskMapper.xml
View file @
f9e59dc1
...
...
@@ -285,7 +285,7 @@
<select
id=
"selectEnterpriseFileData"
resultType=
"com.ruoyi.domain.vo.EnterpriseFilePdfVO"
>
select
t.task_initiator_dept inspectionCenterName,
concat(s.standard_no, s.name) inspectionBasis,
concat(s.standard_no,
' ',
s.name) inspectionBasis,
t.task_list inspectionItem,
DATE_FORMAT(t.create_time, '%Y-%m-%d') createTime,
t.entrusted_unit clientName
...
...
@@ -295,5 +295,39 @@
where t.id = #{taskId}
</select>
<select
id=
"selectInspectionReportData"
resultType=
"com.ruoyi.domain.vo.InspectionReportPdfVO"
>
select
t.id AS reportNumber,
t.product_name AS productName,
t.product_model AS productModel,
t.entrusted_unit AS entrustedUnit,
t.entrusted_unit_address AS clientAddress,
t.entrusted_unit_phone AS entrustedUnitTelephone,
t.entrusted_unit_code AS clientPostalCode,
GROUP_CONCAT(distinct s.sample_name) AS sampleName,
t.product_model AS typeSpecification,
concat(st.standard_no, ' ', st.name) AS inspectionBasis,
GROUP_CONCAT(distinct ae.enterprise_name) AS productionEnterprise,
GROUP_CONCAT(distinct s.sample_sender) AS sampleSender,
GROUP_CONCAT(distinct DATE_FORMAT(s.delivery_date, '%Y-%m-%d')) AS sampleDeliveryDate,
count(s.id) AS sampleQuantity,
sum(s.number_of_samples) AS sampleSum,
GROUP_CONCAT(distinct DATE_FORMAT(s.manufacture_date, '%Y-%m-%d')) AS sampleDeliveryDate,
t.product_model AS vehicleType,
t.id AS taskNumber,
GROUP_CONCAT(distinct s.sample_number) AS sampleNumberSummary,
GROUP_CONCAT(distinct s.identification_code) AS vehicleIdentificationNumber,
t.task_list AS inspectionItem,
DATE_FORMAT(t.create_time, '%Y-%m-%d') AS productionDate
from
t_task t
left join t_task_sample_relation tsr on t.id = tsr.task_id
left join t_sample s on tsr.sample_id = s.id
left join t_automobile_enterprise ae on s.manufacturing_enterprise_id = ae.id
left join t_standard st on t.standard_id = st.id
where t.id = #{taskId}
group by t.id
</select>
</mapper>
quality-review/src/main/resources/template/receipt_template_02_27.pdf
View file @
f9e59dc1
No preview for this file type
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