|
|
@ -1,12 +1,13 @@ |
|
|
package com.hxhq.business.utils.pdf.template.sp; |
|
|
|
|
|
|
|
|
package com.hxhq.business.utils.pdf.template; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
import com.hxhq.business.domain.*; |
|
|
import com.hxhq.business.domain.*; |
|
|
import com.hxhq.business.dto.mjy.DetailDto; |
|
|
|
|
|
|
|
|
import com.hxhq.business.utils.TemplateUtil; |
|
|
import com.hxhq.business.utils.pdf.PdfBaseUtil; |
|
|
import com.hxhq.business.utils.pdf.PdfBaseUtil; |
|
|
|
|
|
import com.hxhq.business.utils.pdf.PdfExportUtil; |
|
|
import com.hxhq.common.core.utils.StringUtils; |
|
|
import com.hxhq.common.core.utils.StringUtils; |
|
|
import com.hxhq.common.security.utils.SecurityUtils; |
|
|
import com.hxhq.common.security.utils.SecurityUtils; |
|
|
import com.hxhq.system.api.model.LoginUser; |
|
|
import com.hxhq.system.api.model.LoginUser; |
|
|
@ -19,17 +20,17 @@ import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
import java.io.FileOutputStream; |
|
|
import java.io.FileOutputStream; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 色谱001 |
|
|
|
|
|
|
|
|
* 色谱-生物样品分析溶液配制表 |
|
|
* |
|
|
* |
|
|
* @author tanfei |
|
|
* @author tanfei |
|
|
*/ |
|
|
*/ |
|
|
public class Sp001 { |
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(Sp001.class.getName()); |
|
|
|
|
|
|
|
|
public class SP001 { |
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(SP001.class.getName()); |
|
|
|
|
|
public String language = "zh"; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 导出 |
|
|
* 导出 |
|
|
@ -37,69 +38,69 @@ public class Sp001 { |
|
|
* @param studyFormFill |
|
|
* @param studyFormFill |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
public String exportDetail(StudyFormFill studyFormFill, List<StudyFormFillQmxx> studyFormFillQmxxList, List<StudyFormFillJcgj> studyFormFillJcgjList, String localFilePath) { |
|
|
|
|
|
|
|
|
public String exportDetail(StudyFormFill studyFormFill,Template template, List<StudyFormFillQmxx> studyFormFillQmxxList, List<StudyFormFillJcgj> studyFormFillJcgjList, String lang, String localFilePath) { |
|
|
|
|
|
language = lang; |
|
|
Document document = null; |
|
|
Document document = null; |
|
|
FileOutputStream fos = null; |
|
|
FileOutputStream fos = null; |
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
String filePath = PdfBaseUtil.getFilePath(localFilePath); |
|
|
String filePath = PdfBaseUtil.getFilePath(localFilePath); |
|
|
try { |
|
|
try { |
|
|
String sign = "华西海圻"; |
|
|
|
|
|
|
|
|
String sign = "hxhq"; |
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
if (loginUser != null) { |
|
|
if (loginUser != null) { |
|
|
sign = loginUser.getSysUser().getNickName(); |
|
|
sign = loginUser.getSysUser().getNickName(); |
|
|
} |
|
|
} |
|
|
document = PdfBaseUtil.init(document, fos, filePath, sign + sdf.format(new Date()), studyFormFill.getBdmc()); |
|
|
|
|
|
|
|
|
document = PdfBaseUtil.init(document, fos, filePath, sign +PdfExportUtil.parseDateToStr(new Date()), "en".equals(language)?template.getShowSn():template.getName()); |
|
|
// 基本信息 |
|
|
// 基本信息 |
|
|
|
|
|
|
|
|
JSONObject bdnr = JSONObject.parseObject(studyFormFill.getBdnr()); |
|
|
JSONObject bdnr = JSONObject.parseObject(studyFormFill.getBdnr()); |
|
|
PdfBaseUtil.addUnderlinedTitle(document, "试验基本信息", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("试验基本信息"), 10, true); |
|
|
Map<String, String> formData1 = new LinkedHashMap<>(); |
|
|
Map<String, String> formData1 = new LinkedHashMap<>(); |
|
|
formData1.put("试验名称", studyFormFill.getStudyMc()); |
|
|
|
|
|
formData1.put("试验编号", studyFormFill.getStudySn()); |
|
|
|
|
|
formData1.put("方法编号", bdnr.getString("methodCode")); |
|
|
|
|
|
formData1.put("版本号", bdnr.getString("methodCode")); |
|
|
|
|
|
|
|
|
formData1.put(getName("试验名称"), studyFormFill.getStudyMc()); |
|
|
|
|
|
formData1.put(getName("试验编号"), studyFormFill.getStudySn()); |
|
|
|
|
|
formData1.put(getName("方法编号"), bdnr.getString("methodCode")); |
|
|
|
|
|
formData1.put(getName("版本号"), bdnr.getString("methodCode")); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData1, 2); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData1, 2); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, "试验配置条件", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("试验配置条件"), 10, true); |
|
|
Map<String, String> formData2 = new LinkedHashMap<>(); |
|
|
Map<String, String> formData2 = new LinkedHashMap<>(); |
|
|
formData2.put("预填", bdnr.getString("pre") + (StringUtils.isNoneBlank(bdnr.getString("preOther")) ? bdnr.getString("preOther") : "")); |
|
|
|
|
|
formData2.put("实际", bdnr.getString("act") + (StringUtils.isNoneBlank(bdnr.getString("actOther")) ? bdnr.getString("actOther") : "")); |
|
|
|
|
|
|
|
|
formData2.put(getName("预填"), bdnr.getString("pre") + (StringUtils.isNoneBlank(bdnr.getString("preOther")) ? bdnr.getString("preOther") : "")); |
|
|
|
|
|
formData2.put(getName("实际"), bdnr.getString("act") + (StringUtils.isNoneBlank(bdnr.getString("actOther")) ? bdnr.getString("actOther") : "")); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData2, 2); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData2, 2); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, "配置时间", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("配置时间"), 10, true); |
|
|
Map<String, String> formData3 = new LinkedHashMap<>(); |
|
|
Map<String, String> formData3 = new LinkedHashMap<>(); |
|
|
formData3.put("开始时间", studyFormFill.getStartDate() != null ? sdf.format(studyFormFill.getStartDate()) : ""); |
|
|
|
|
|
formData3.put("结束时间", studyFormFill.getEndDate() != null ? sdf.format(studyFormFill.getEndDate()) : ""); |
|
|
|
|
|
|
|
|
formData3.put(getName("开始时间"), studyFormFill.getStartDate() != null ? PdfExportUtil.parseDateToStr(studyFormFill.getStartDate()) : ""); |
|
|
|
|
|
formData3.put(getName("结束时间"), studyFormFill.getEndDate() != null ? PdfExportUtil.parseDateToStr(studyFormFill.getEndDate()) : ""); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData3, 2); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData3, 2); |
|
|
|
|
|
|
|
|
// 签名信息 |
|
|
// 签名信息 |
|
|
PdfBaseUtil.addUnderlinedTitle(document, "试验试剂信息", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("试验试剂信息"), 10, true); |
|
|
addResource(document, studyFormFill.getResource()); |
|
|
addResource(document, studyFormFill.getResource()); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, "仪器使用信息", 10, true); |
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, "存储条件", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("仪器使用信息"), 10, true); |
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("存储条件"), 10, true); |
|
|
Map<String, String> formData4 = new LinkedHashMap<>(); |
|
|
Map<String, String> formData4 = new LinkedHashMap<>(); |
|
|
formData4.put("存储条件",bdnr.getString("storageCondition")+ (StringUtils.isNoneBlank(bdnr.getString("storageConditionOther")) ? bdnr.getString("storageConditionOther") : "")); |
|
|
|
|
|
|
|
|
formData4.put(getName("存储条件"), bdnr.getString("storageCondition") + (StringUtils.isNoneBlank(bdnr.getString("storageConditionOther")) ? bdnr.getString("storageConditionOther") : "")); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData4, 1); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData4, 1); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, "操作步骤", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("操作步骤"), 10, true); |
|
|
Map<String, String> formData5 = new LinkedHashMap<>(); |
|
|
Map<String, String> formData5 = new LinkedHashMap<>(); |
|
|
formData5.put("目标溶液名称", bdnr.getString("targetName")); |
|
|
|
|
|
formData5.put("目标溶液编号", bdnr.getString("targetCode")+bdnr.getString("targetCodeSn")); |
|
|
|
|
|
formData5.put("目标溶液预计浓度", bdnr.getString("targetPreConcentration")+bdnr.getString("targetPreConcentrationUnit")); |
|
|
|
|
|
formData5.put("目标溶液实际浓度", bdnr.getString("targetActConcentration")+bdnr.getString("targetPreConcentrationUnit")); |
|
|
|
|
|
formData5.put("目标溶液预计体积", bdnr.getString("targetPreVolume")+bdnr.getString("targetPreVolumeUnit")); |
|
|
|
|
|
formData5.put("目标溶液实际体积", bdnr.getString("targetActVolume")+bdnr.getString("targetActVolumeUnit")); |
|
|
|
|
|
formData5.put("有效周期", bdnr.getString("effectivePeriod")+bdnr.getString("effectivePeriodUnit")); |
|
|
|
|
|
formData5.put("失效日", bdnr.getString("sxrq")); |
|
|
|
|
|
|
|
|
formData5.put(getName("目标溶液名称"), bdnr.getString("targetName")); |
|
|
|
|
|
formData5.put(getName("目标溶液编号"), bdnr.getString("targetCode") + bdnr.getString("targetCodeSn")); |
|
|
|
|
|
formData5.put(getName("目标溶液预计浓度"), bdnr.getString("targetPreConcentration") + bdnr.getString("targetPreConcentrationUnit")); |
|
|
|
|
|
formData5.put(getName("目标溶液实际浓度"), bdnr.getString("targetActConcentration") + bdnr.getString("targetPreConcentrationUnit")); |
|
|
|
|
|
formData5.put(getName("目标溶液预计体积"), bdnr.getString("targetPreVolume") + bdnr.getString("targetPreVolumeUnit")); |
|
|
|
|
|
formData5.put(getName("目标溶液实际体积"), bdnr.getString("targetActVolume") + bdnr.getString("targetActVolumeUnit")); |
|
|
|
|
|
formData5.put(getName("有效周期"), bdnr.getString("effectivePeriod") + bdnr.getString("effectivePeriodUnit")); |
|
|
|
|
|
formData5.put(getName("失效日"), bdnr.getString("sxrq")); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData5, 2); |
|
|
PdfBaseUtil.addFormTableColumns(document, formData5, 2); |
|
|
PdfBaseUtil.addUnderlinedTitle(document, "备注"+(StringUtils.isNoneBlank(bdnr.getString("remark")) ? ":"+bdnr.getString("remark") : ""), 10, false); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("备注") + ":" +(StringUtils.isNoneBlank(bdnr.getString("remark")) ? bdnr.getString("remark") : ""), 10, false); |
|
|
|
|
|
|
|
|
// 签名信息 |
|
|
// 签名信息 |
|
|
PdfBaseUtil.addUnderlinedTitle(document, "签名信息", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("签名信息"), 10, true); |
|
|
addQmxx(document, studyFormFillQmxxList); |
|
|
addQmxx(document, studyFormFillQmxxList); |
|
|
//稽查轨迹 |
|
|
//稽查轨迹 |
|
|
PdfBaseUtil.addUnderlinedTitle(document, "稽查轨迹", 10, true); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹"), 10, true); |
|
|
addJcgj(document, studyFormFillJcgjList); |
|
|
addJcgj(document, studyFormFillJcgjList); |
|
|
logger.info("生成成功:{}", filePath); |
|
|
logger.info("生成成功:{}", filePath); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -131,8 +132,7 @@ public class Sp001 { |
|
|
public void addResource(Document document, String resource) throws IOException, DocumentException { |
|
|
public void addResource(Document document, String resource) throws IOException, DocumentException { |
|
|
// [{"mc":"布洛芬","bh":"BLF260115-0014","ph":"","nd":"18ng/mL","source":"ELN配制","ndz":18,"nddw":"ng/mL","kc":1190,"kcdw":"3","syl":"4","syldw":"3","yxzq":360,"yxzqdw":"days"}] |
|
|
// [{"mc":"布洛芬","bh":"BLF260115-0014","ph":"","nd":"18ng/mL","source":"ELN配制","ndz":18,"nddw":"ng/mL","kc":1190,"kcdw":"3","syl":"4","syldw":"3","yxzq":360,"yxzqdw":"days"}] |
|
|
if (StringUtils.isNoneBlank(resource)) { |
|
|
if (StringUtils.isNoneBlank(resource)) { |
|
|
JSONArray jsonArray=JSONArray.parseArray(resource); |
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
|
JSONArray jsonArray = JSONArray.parseArray(resource); |
|
|
// 9. 表头 |
|
|
// 9. 表头 |
|
|
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); |
|
|
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); |
|
|
Font headerFont = new Font(bfChinese, 10, Font.NORMAL); |
|
|
Font headerFont = new Font(bfChinese, 10, Font.NORMAL); |
|
|
@ -140,7 +140,7 @@ public class Sp001 { |
|
|
// 8. 创建表格 |
|
|
// 8. 创建表格 |
|
|
PdfPTable table = new PdfPTable(6); |
|
|
PdfPTable table = new PdfPTable(6); |
|
|
table.setWidthPercentage(100); |
|
|
table.setWidthPercentage(100); |
|
|
String[] headers = {"试剂名称", "编号", "批号", "浓度/含量/纯度","来源","失效日"}; |
|
|
|
|
|
|
|
|
String[] headers = {getName("试剂名称"), getName("编号"), getName("批号"), getName("浓度/含量/纯度"), getName("来源"), getName("失效日")}; |
|
|
for (String header : headers) { |
|
|
for (String header : headers) { |
|
|
PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); |
|
|
PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); |
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
|
|
@ -162,7 +162,7 @@ public class Sp001 { |
|
|
table.addCell(PdfBaseUtil.createCell(obj.getString("ph"), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(obj.getString("ph"), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(obj.getString("nd"), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(obj.getString("nd"), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(obj.getString("source"), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(obj.getString("source"), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(obj.getString("sxrq"))?obj.getString("sxrq"):"", contentFont)); |
|
|
|
|
|
|
|
|
table.addCell(PdfBaseUtil.createCell(StringUtils.isNoneBlank(obj.getString("sxrq")) ? obj.getString("sxrq") : "", contentFont)); |
|
|
rowNum++; |
|
|
rowNum++; |
|
|
} |
|
|
} |
|
|
document.add(table); |
|
|
document.add(table); |
|
|
@ -180,7 +180,6 @@ public class Sp001 { |
|
|
* @throws DocumentException |
|
|
* @throws DocumentException |
|
|
*/ |
|
|
*/ |
|
|
public void addQmxx(Document document, List<StudyFormFillQmxx> studyFormFillQmxxList) throws IOException, DocumentException { |
|
|
public void addQmxx(Document document, List<StudyFormFillQmxx> studyFormFillQmxxList) throws IOException, DocumentException { |
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
// 9. 表头 |
|
|
// 9. 表头 |
|
|
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); |
|
|
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); |
|
|
Font headerFont = new Font(bfChinese, 10, Font.NORMAL); |
|
|
Font headerFont = new Font(bfChinese, 10, Font.NORMAL); |
|
|
@ -188,7 +187,7 @@ public class Sp001 { |
|
|
// 8. 创建表格 |
|
|
// 8. 创建表格 |
|
|
PdfPTable table = new PdfPTable(4); |
|
|
PdfPTable table = new PdfPTable(4); |
|
|
table.setWidthPercentage(100); |
|
|
table.setWidthPercentage(100); |
|
|
String[] headers = {"签名人", "签名意义", "签名时间", "备注原因"}; |
|
|
|
|
|
|
|
|
String[] headers = {getName("签名人"), getName("签名意义"), getName("签名时间"), getName("备注原因")}; |
|
|
for (String header : headers) { |
|
|
for (String header : headers) { |
|
|
PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); |
|
|
PdfPCell cell = new PdfPCell(new Phrase(header, headerFont)); |
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
|
|
@ -206,7 +205,7 @@ public class Sp001 { |
|
|
} |
|
|
} |
|
|
table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getQmrMc(), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getQmrMc(), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getQmyy(), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getQmyy(), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(sdf.format(studyFormFillQmxx.getCreateTime()), contentFont)); |
|
|
|
|
|
|
|
|
table.addCell(PdfBaseUtil.createCell(PdfExportUtil.parseDateToStr(studyFormFillQmxx.getCreateTime()), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getRemark(), contentFont)); |
|
|
table.addCell(PdfBaseUtil.createCell(studyFormFillQmxx.getRemark(), contentFont)); |
|
|
rowNum++; |
|
|
rowNum++; |
|
|
} |
|
|
} |
|
|
@ -222,27 +221,38 @@ public class Sp001 { |
|
|
* @throws DocumentException |
|
|
* @throws DocumentException |
|
|
*/ |
|
|
*/ |
|
|
public void addJcgj(Document document, List<StudyFormFillJcgj> studyFormFillJcgjList) throws IOException, DocumentException { |
|
|
public void addJcgj(Document document, List<StudyFormFillJcgj> studyFormFillJcgjList) throws IOException, DocumentException { |
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
for (StudyFormFillJcgj jcgj : studyFormFillJcgjList) { |
|
|
for (StudyFormFillJcgj jcgj : studyFormFillJcgjList) { |
|
|
PdfBaseUtil.addUnderlinedTitle(document, sdf.format(jcgj.getCreateTime()) + " " + jcgj.getJcmc(), 10, false); |
|
|
|
|
|
|
|
|
PdfBaseUtil.addUnderlinedTitle(document, PdfExportUtil.parseDateToStr(jcgj.getCreateTime()) + " " + jcgj.getJcmc(), 10, false); |
|
|
StringJoiner result = new StringJoiner(", "); |
|
|
StringJoiner result = new StringJoiner(", "); |
|
|
if (StringUtils.isNoneBlank(jcgj.getJcnr())) { |
|
|
if (StringUtils.isNoneBlank(jcgj.getJcnr())) { |
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); |
|
|
JsonNode jsonArray = mapper.readTree(jcgj.getJcnr()); |
|
|
for (JsonNode node : jsonArray) { |
|
|
for (JsonNode node : jsonArray) { |
|
|
String name = node.get("name").asText(); |
|
|
|
|
|
String value =node.get("value")!=null? node.get("value").asText():""; |
|
|
|
|
|
result.add(name + ":" + value); |
|
|
|
|
|
|
|
|
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())) { |
|
|
if (StringUtils.isNoneBlank(jcgj.getRemark())) { |
|
|
result.add("备注:" + jcgj.getRemark()); |
|
|
|
|
|
|
|
|
result.add(getName("备注") + ":" + jcgj.getRemark()); |
|
|
} |
|
|
} |
|
|
if (StringUtils.isNoneBlank(jcgj.getRemark())) { |
|
|
if (StringUtils.isNoneBlank(jcgj.getRemark())) { |
|
|
result.add("签名人:" + jcgj.getQmrMc()); |
|
|
|
|
|
|
|
|
result.add(getName("签名人") + ":" + jcgj.getQmrMc()); |
|
|
} |
|
|
} |
|
|
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); |
|
|
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 获取名称 |
|
|
|
|
|
* |
|
|
|
|
|
* @param name |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
public String getName(String name) { |
|
|
|
|
|
return "en".equals(language) ? TemplateUtil.getEn(name) : name; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |