|
|
@ -89,7 +89,7 @@ public class ExportService implements IExportService { |
|
|
|
switch (param.getReport()) { |
|
|
|
case Constant.Ht.Report.PARENT_CODE_2: |
|
|
|
case Constant.Ht.Report.PARENT_CODE_3: |
|
|
|
writeParentCode2(content, detail.getScores()); |
|
|
|
writeParentCode2(param.getReport(), content, detail.getScores()); |
|
|
|
//添加初步印象和受试者合作评分
|
|
|
|
addScoreAndImpression(detail.getPatient().getInitialImpression(), content); |
|
|
|
//添加测评员和报告日期
|
|
|
@ -173,9 +173,9 @@ public class ExportService implements IExportService { |
|
|
|
List<PatientReportVo.ReportScore> scores = patientReportService.getReportScores(reportScore, param.getId()); |
|
|
|
//生成写入pdf数据
|
|
|
|
List<PdfUtil.Row> content = new ArrayList<>(); |
|
|
|
writeParentCode2(content, scores); |
|
|
|
writeParentCode2(param.getCode(),content, scores); |
|
|
|
//添加初步印象和受试者合作评分
|
|
|
|
addScoreAndImpression(reportPatient.getInitialImpression(), content); |
|
|
|
addScoreAndImpression("", content); |
|
|
|
//添加测评员和报告日期
|
|
|
|
initLast(content, 2); |
|
|
|
//表头
|
|
|
@ -183,7 +183,8 @@ public class ExportService implements IExportService { |
|
|
|
String title = String.join(" ", split); |
|
|
|
|
|
|
|
//生成pdf并返回路径
|
|
|
|
String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, title, Constant.Ht.Report.PARENT_NAME, new PdfUtil.Margin(), reportPatient.toPdfRow(), content); |
|
|
|
String subHead = CollectionUtil.isEmpty(scores) ? "" : "认知评估量表("+scores.get(0).getName() + ")报告单"; |
|
|
|
String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, title, subHead, new PdfUtil.Margin(), reportPatient.toPdfRow(), content); |
|
|
|
//TODO 将路径存入报告单关联信息表
|
|
|
|
// reportRelevance.setPdfUrl(path);
|
|
|
|
// reportRelevanceMapper.updateByPrimaryKeySelective(reportRelevance);
|
|
|
@ -239,7 +240,14 @@ public class ExportService implements IExportService { |
|
|
|
content.add(impression); |
|
|
|
} |
|
|
|
|
|
|
|
private void writeParentCode2(List<PdfUtil.Row> content, List<PatientReportVo.ReportScore> scores) { |
|
|
|
private void writeParentCode2(String code, List<PdfUtil.Row> content, List<PatientReportVo.ReportScore> scores) { |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(code) && Constant.Export.PURPOSE_MAP.containsKey(code)) { |
|
|
|
PdfUtil.Row purpose = new PdfUtil.Row(); |
|
|
|
purpose.addCell(new PdfUtil.Cell(Constant.Export.PURPOSE_MAP.get(code),4,1)); |
|
|
|
content.add(purpose); |
|
|
|
} |
|
|
|
|
|
|
|
PdfUtil.Row title = new PdfUtil.Row(); |
|
|
|
title.addCell(new PdfUtil.Cell("项目",2,1)); |
|
|
|
// title.addCell(new PdfUtil.Cell());
|
|
|
@ -250,12 +258,13 @@ public class ExportService implements IExportService { |
|
|
|
title.addCell(r); |
|
|
|
content.add(title); |
|
|
|
scores.forEach(reportScore -> { |
|
|
|
String name = StrUtil.isEmpty(reportScore.getDescription()) ? reportScore.getName() : reportScore.getDescription(); |
|
|
|
if (CollectionUtil.isEmpty(reportScore.getSubReport())) { |
|
|
|
PdfUtil.Row row = new PdfUtil.Row(); |
|
|
|
|
|
|
|
PdfUtil.Cell cellName = new PdfUtil.Cell(); |
|
|
|
cellName.setColSpan(2); |
|
|
|
cellName.setContent(reportScore.getName()); |
|
|
|
cellName.setContent(name); |
|
|
|
row.addCell(cellName); |
|
|
|
PdfUtil.Cell cellScore = new PdfUtil.Cell(); |
|
|
|
|
|
|
@ -275,7 +284,7 @@ public class ExportService implements IExportService { |
|
|
|
if (i == 0) { |
|
|
|
PdfUtil.Cell cellName = new PdfUtil.Cell(); |
|
|
|
cellName.setRowSpan(reportScore.getSubReport().size()); |
|
|
|
cellName.setContent(reportScore.getName()); |
|
|
|
cellName.setContent(name); |
|
|
|
row.addCell(cellName); |
|
|
|
} |
|
|
|
row.addCell(new PdfUtil.Cell(score.getName())); |
|
|
|