|
|
@@ -10,6 +10,7 @@ import com.xunmei.file.vo.ItextPdfTableVo;
|
|
|
import com.xunmei.system.api.domain.AccessDataVo;
|
|
|
import com.xunmei.system.api.domain.CheckDataVo;
|
|
|
import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
|
|
|
+import com.xunmei.system.api.vo.QuestionPdfVo;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
@@ -200,9 +201,24 @@ public class PdfUtil {
|
|
|
|
|
|
|
|
|
public static void dealResumptionBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_CENTER, 6, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_CENTER, 0, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "登记人", Element.ALIGN_CENTER, 0, 0);
|
|
|
+ // 第一行
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "单位名称", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_MIDDLE, 3, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.get("dateStr").toString(), Element.ALIGN_MIDDLE, 3, 0);
|
|
|
+ // 第二行
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.get("submiterNames").toString(), Element.ALIGN_MIDDLE, 8, 0);
|
|
|
+ // 第三行
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_MIDDLE, 6, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table,"检查情况", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+
|
|
|
+
|
|
|
+// PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_CENTER, 1, 0);
|
|
|
+// PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_CENTER, 5, 0);
|
|
|
+// PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_CENTER, 0, 0);
|
|
|
+// PdfUtil.createPDFCell(tableFont, table, "登记人", Element.ALIGN_CENTER, 0, 0);
|
|
|
|
|
|
List<String> names = new ArrayList<>();
|
|
|
names.add("营业前");
|
|
|
@@ -216,31 +232,53 @@ public class PdfUtil {
|
|
|
continue;
|
|
|
}
|
|
|
//不同的执行时刻
|
|
|
- PdfUtil.createPDFCell(tableFont, table, getLineStr(s), PdfPCell.ALIGN_MIDDLE, 0, lists.size());
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, getLineStr(s), PdfPCell.ALIGN_MIDDLE, 2, lists.size());
|
|
|
int o = 1;
|
|
|
for (LinkedHashMap<String, Object> listVo : lists) {
|
|
|
// 检查内容
|
|
|
String rowContent = o + "、" + listVo.get("pointName");
|
|
|
- PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 5, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 6, 0);
|
|
|
// 检查情况
|
|
|
- PdfUtil.createPDFCell(tableFont, table, ((Integer) listVo.get("resValue")) == 0 ? "√" : "×", Element.ALIGN_CENTER, 0, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, ((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
// 检查人
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
|
|
|
+ //PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
|
|
|
o++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 10, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+
|
|
|
+ final List<LinkedHashMap> questionPdfVoList = (List<LinkedHashMap>)data.get("questions");
|
|
|
+ if (ObjectUtil.isEmpty(questionPdfVoList)) {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "1", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_LEFT, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ document.add(table);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ int questionIndex=1;
|
|
|
+ for (int i = 0; i < questionPdfVoList.size(); i++) {
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionIndex++), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionPdfVoList.get(i).get("checkContent")), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionPdfVoList.get(i).get("questionDesc")), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ }
|
|
|
+
|
|
|
// 备注数据
|
|
|
- PdfUtil.createPDFCell(tableFont, table, getLineStr("备注"), PdfPCell.ALIGN_MIDDLE, 0, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get("remark").toString(), Element.ALIGN_LEFT, 7, 0);
|
|
|
+// PdfUtil.createPDFCell(tableFont, table, getLineStr("备注"), PdfPCell.ALIGN_MIDDLE, 0, 0);
|
|
|
+// PdfUtil.createPDFCell(tableFont, table, data.get("remark").toString(), Element.ALIGN_LEFT, 7, 0);
|
|
|
|
|
|
document.add(table);
|
|
|
|
|
|
- Paragraph foot = new Paragraph(" 注:检查情况正常打“√”;发现问题打“×”,并在备注中具体说明。", tableFont);
|
|
|
+// Paragraph foot = new Paragraph(" 注:检查情况正常打“√”;发现问题打“×”,并在备注中具体说明。", tableFont);
|
|
|
// Paragraph foot = new Paragraph(" 注:检查情况正常打“√”;发现问题打“×”,并在备注中具体说明。", new Font(fs, 8, Font.NORMAL));
|
|
|
- foot.setAlignment(Paragraph.ALIGN_LEFT);
|
|
|
+// foot.setAlignment(Paragraph.ALIGN_LEFT);
|
|
|
//在后方加入16个空格
|
|
|
- document.add(foot);
|
|
|
+// document.add(foot);
|
|
|
|
|
|
|
|
|
}
|