|
|
|
@ -130,14 +130,15 @@ public class TemplateBaseUtil { |
|
|
|
|
|
|
|
/** |
|
|
|
* 签名信息 |
|
|
|
* |
|
|
|
* 填报表单 |
|
|
|
* @param document |
|
|
|
* @param studyFormFillQmxxList |
|
|
|
* @throws IOException |
|
|
|
* @throws DocumentException |
|
|
|
*/ |
|
|
|
public static void addQmxxFill(Document document, List<StudyFormFillQmxx> studyFormFillQmxxList, String lang) throws IOException, DocumentException { |
|
|
|
public static void addQmxxFill(Document document, List<StudyFormFillQmxx> studyFormFillQmxxList, String lang, JSONObject bdnr,JSONObject zdgxjl, JSONArray fhyjjl) throws IOException, DocumentException { |
|
|
|
language = lang; |
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("备注") + ":" +(StringUtils.isNoneBlank(bdnr.getString("remark")) ? bdnr.getString("remark") : "")+(getCheck("_remark",zdgxjl)+getFh("_remark",fhyjjl)), 10, false); |
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("签名信息"), 10, true); |
|
|
|
// 9. 表头 |
|
|
|
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); |
|
|
|
@ -174,7 +175,7 @@ public class TemplateBaseUtil { |
|
|
|
|
|
|
|
/** |
|
|
|
* 稽查轨迹 |
|
|
|
* |
|
|
|
* 填报表单 |
|
|
|
* @param document |
|
|
|
* @param studyFormFillJcgjList |
|
|
|
* @throws IOException |
|
|
|
@ -229,7 +230,7 @@ public class TemplateBaseUtil { |
|
|
|
|
|
|
|
/** |
|
|
|
* 签名信息 |
|
|
|
* |
|
|
|
* 计划表单 |
|
|
|
* @param document |
|
|
|
* @param studyFormPlanQmxxList |
|
|
|
* @throws IOException |
|
|
|
@ -273,7 +274,7 @@ public class TemplateBaseUtil { |
|
|
|
|
|
|
|
/** |
|
|
|
* 稽查轨迹 |
|
|
|
* |
|
|
|
* 计划表单 |
|
|
|
* @param document |
|
|
|
* @param studyFormPlanJcgjList |
|
|
|
* @throws IOException |
|
|
|
@ -326,6 +327,105 @@ public class TemplateBaseUtil { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 签名信息 |
|
|
|
* 申请表单 |
|
|
|
* @param document |
|
|
|
* @param studyFormApplyQmxxList |
|
|
|
* @throws IOException |
|
|
|
* @throws DocumentException |
|
|
|
*/ |
|
|
|
public static void addQmxxApply(Document document, List<StudyFormApplyQmxx> studyFormApplyQmxxList, String lang) throws IOException, DocumentException { |
|
|
|
language = lang; |
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("签名信息"), 10, true); |
|
|
|
// 9. 表头 |
|
|
|
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); |
|
|
|
Font headerFont = new Font(bfChinese, 10, Font.NORMAL); |
|
|
|
Font contentFont = new Font(bfChinese, 10, Font.NORMAL); |
|
|
|
// 8. 创建表格 |
|
|
|
PdfPTable table = new PdfPTable(4); |
|
|
|
table.setWidthPercentage(100); |
|
|
|
String[] headers = {getName("签名人"), getName("签名意义"), getName("签名时间"), getName("备注原因")}; |
|
|
|
for (String header : headers) { |
|
|
|
PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); |
|
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
|
|
|
cell.setPadding(8); |
|
|
|
table.addCell(cell); |
|
|
|
} |
|
|
|
if (studyFormApplyQmxxList.size() > 0) { |
|
|
|
int rowNum = 0; |
|
|
|
for (StudyFormApplyQmxx studyFormApplyQmxx : studyFormApplyQmxxList) { |
|
|
|
// 交替行颜色 |
|
|
|
if (rowNum % 2 == 0) { |
|
|
|
table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); |
|
|
|
} else { |
|
|
|
table.getDefaultCell().setBackgroundColor(BaseColor.WHITE); |
|
|
|
} |
|
|
|
table.addCell(PdfBaseUtil.createCell(studyFormApplyQmxx.getQmrMc(), contentFont)); |
|
|
|
table.addCell(PdfBaseUtil.createCell("en".equals(language) ? studyFormApplyQmxx.getQmyyEn() : studyFormApplyQmxx.getQmyy(), contentFont)); |
|
|
|
table.addCell(PdfBaseUtil.createCell(PdfExportUtil.parseDateToStr(studyFormApplyQmxx.getCreateTime()), contentFont)); |
|
|
|
table.addCell(PdfBaseUtil.createCell(studyFormApplyQmxx.getRemark(), contentFont)); |
|
|
|
rowNum++; |
|
|
|
} |
|
|
|
} |
|
|
|
document.add(table); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 稽查轨迹 |
|
|
|
* 申请表单 |
|
|
|
* @param document |
|
|
|
* @param studyFormApplyJcgjList |
|
|
|
* @throws IOException |
|
|
|
* @throws DocumentException |
|
|
|
*/ |
|
|
|
public static void addJcgjApply(Document document, List<StudyFormApplyJcgj> studyFormApplyJcgjList, Integer jcgjlx, String lang) throws IOException, DocumentException { |
|
|
|
language = lang; |
|
|
|
Integer jcgjlxMark = 999; |
|
|
|
if (!jcgjlx.equals(jcgjlxMark)) { |
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹"), 10, true); |
|
|
|
for (StudyFormApplyJcgj jcgj : studyFormApplyJcgjList) { |
|
|
|
StringJoiner result = new StringJoiner(", "); |
|
|
|
if ("en".equals(lang)) { |
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime()) + " " + jcgj.getJcmcEn(), 10, false); |
|
|
|
if (StringUtils.isNoneBlank(jcgj.getJcnrEn())) { |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
JsonNode jsonArray = mapper.readTree(jcgj.getJcnrEn()); |
|
|
|
for (JsonNode node : jsonArray) { |
|
|
|
if (node.get("name") != null) { |
|
|
|
String name = node.get("name").asText(); |
|
|
|
String value = node.get("value") != null ? node.get("value").asText() : ""; |
|
|
|
result.add(name + ":" + value); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime()) + " " + jcgj.getJcmc(), 10, false); |
|
|
|
if (StringUtils.isNoneBlank(jcgj.getJcnr())) { |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); |
|
|
|
for (JsonNode node : jsonArray) { |
|
|
|
if (node.get("name") != null) { |
|
|
|
String name = node.get("name").asText(); |
|
|
|
String value = node.get("value") != null ? node.get("value").asText() : ""; |
|
|
|
result.add(name + ":" + value); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNoneBlank(jcgj.getRemark())) { |
|
|
|
result.add(getName("备注") + ":" + jcgj.getRemark()); |
|
|
|
} |
|
|
|
if (StringUtils.isNoneBlank(jcgj.getQmrMc())) { |
|
|
|
result.add(getName("签名人") + ":" + jcgj.getQmrMc()); |
|
|
|
} |
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 获取名称 |
|
|
|
* |
|
|
|
* @param name |
|
|
|
|