Commit 6ba82e0f authored by 盖献康's avatar 盖献康

bug - 71024

parent f7bd4985
package com.ruoyi.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 检验报告PDF VO类
......@@ -170,4 +174,18 @@ public class InspectionReportPdfVO {
*/
private String samplePhotos;
/**
* 任务开始时间
*/
private String taskBeginTime;
/**
* 任务结束时间
*/
private String taskEndTime;
/**
* 检验时间和地点
*/
private String inspectionTimeAndLocation;
}
......@@ -86,7 +86,7 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
// 设置具体字体格式的编码, 不设置的话中文可能不会显示
BaseFont bf = BaseFont.createFont("/fonts/STSong.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
fields.addSubstitutionFont(bf);
// 测试数据
// 获取真实的数据
InspectionReportPdfVO inspectionReportPdfVO = requireData(taskId);
// 渲染数据
renderData(fields, inspectionReportPdfVO, ps);
......@@ -353,6 +353,10 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
*/
private InspectionReportPdfVO requireData(Long taskId) {
InspectionReportPdfVO inspectionReport = taskMapper.selectInspectionReportData(taskId);
inspectionReport.setInspectionTimeAndLocation(" 检验于"
+ inspectionReport.getTaskBeginTime() + "至"
+ inspectionReport.getTaskEndTime() + "在"
+ inspectionReport.getInspectionCenterName() + "进行");
inspectionReport.setInspectionItem(getInspectionItemByTaskItem(inspectionReport.getInspectionItem()));
return inspectionReport;
}
......
......@@ -307,11 +307,13 @@
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,
GROUP_CONCAT(s.sample_name) AS sampleName,
t.product_model AS typeSpecification,
DATE_FORMAT(t.task_begin_time, '%Y年%m月%d日') AS taskBeginTime,
DATE_FORMAT(t.task_end_time, '%Y年%m月%d日') AS taskEndTime,
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(s.sample_sender) AS sampleSender,
GROUP_CONCAT(distinct DATE_FORMAT(s.delivery_date, '%Y-%m-%d')) AS sampleDeliveryDate,
count(s.id) AS sampleQuantity,
CONVERT(sum(s.number_of_samples), UNSIGNED) AS sampleSum,
......@@ -323,10 +325,11 @@
t.task_list AS inspectionItem,
DATE_FORMAT(t.create_time, '%Y-%m-%d') AS productionDate,
GROUP_CONCAT(distinct s.trademark) AS brandImage,
GROUP_CONCAT(distinct s.sample_photos) AS samplePhotos,
GROUP_CONCAT(s.sample_photos) AS samplePhotos,
d.address AS inspectionCenterAddress,
d.phone AS inspectionCenterTelephone,
d.postcode AS inspectionCenterPostcode
d.postcode AS inspectionCenterPostcode,
d.dept_name AS inspectionCenterName
from
t_task t
left join t_task_sample_relation tsr on t.id = tsr.task_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment