|
|
@@ -13,7 +13,6 @@ 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.domain.SysDictData;
|
|
|
-import com.xunmei.system.api.vo.QuestionPdfVo;
|
|
|
import io.netty.util.internal.StringUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
@@ -209,7 +208,7 @@ public class PdfUtil {
|
|
|
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,ObjectUtil.isNotEmpty(data.get("submiterNames"))? data.get("dateStr").toString():"", Element.ALIGN_MIDDLE, 3, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isNotEmpty(data.get("submiterNames")) ? 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);
|
|
|
@@ -243,7 +242,7 @@ public class PdfUtil {
|
|
|
String rowContent = o + "、" + listVo.get("pointName");
|
|
|
PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 6, 0);
|
|
|
// 检查情况
|
|
|
- PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue"))? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue")) ? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
|
|
|
// 检查人
|
|
|
//PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
|
|
|
o++;
|
|
|
@@ -562,22 +561,53 @@ public class PdfUtil {
|
|
|
}
|
|
|
|
|
|
public static void dealAccessPBody(Document document, PdfPTable table, Font tableFont, Font tableTitleFont, List<AccessDataVo> data) throws DocumentException {
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 5, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "硬盘录像机", Element.ALIGN_MIDDLE, 8, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "通道名称", Element.ALIGN_MIDDLE, 9, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "检查项目", Element.ALIGN_MIDDLE, 8, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "存在问题", Element.ALIGN_MIDDLE, 16, 0);
|
|
|
- for (int i = 1; i <= data.size(); i++) {
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 5, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 8, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 9, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getProject(), Element.ALIGN_MIDDLE, 8, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 16, 0);
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "区域名称", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "调阅项目", Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "调阅情况", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ List<AccessDataVo> normalDataList = data.stream().filter(d -> ObjectUtil.equal(0, d.getStatus())).collect(Collectors.toList());
|
|
|
+ if (ObjectUtil.isNotEmpty(normalDataList)) {
|
|
|
+ for (int i = 1; i <= normalDataList.size(); i++) {
|
|
|
+ AccessDataVo accessDataVo = data.get(i - 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, accessDataVo.getAreaName(), Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, accessDataVo.getProject(), Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 19, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "区域名称", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "调阅项目", Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+ PdfUtil.createPDFCell(tableTitleFont, table, "存在问题", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+
|
|
|
+ List<AccessDataVo> exceptionDataList = data.stream().filter(d -> ObjectUtil.equal(0, d.getStatus())).collect(Collectors.toList());
|
|
|
+ if (ObjectUtil.isNotEmpty(exceptionDataList)) {
|
|
|
+ for (int i = 1; i <= exceptionDataList.size(); i++) {
|
|
|
+ AccessDataVo accessDataVo = data.get(i - 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, accessDataVo.getAreaName(), Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, accessDataVo.getProject(), Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, accessDataVo.getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+
|
|
|
}
|
|
|
- document.add(table);
|
|
|
}
|
|
|
|
|
|
- public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, SafeCheckTaskRegisterBookVo data) throws DocumentException {
|
|
|
+ public static void dealSafeCheckPBody(Document document, PdfPTable table, Font
|
|
|
+ tableFont, SafeCheckTaskRegisterBookVo data) throws Exception {
|
|
|
PdfUtil.createPDFCell(tableFont, table, "被查单位", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查日期", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
@@ -590,11 +620,30 @@ public class PdfUtil {
|
|
|
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "主查人", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "主查人签字", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
+ list.add(data.getSignImg());
|
|
|
+ dealEduImageCell(list, table, 1, 70, 40);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查工作情况", Element.ALIGN_MIDDLE, 14, 1);
|
|
|
+
|
|
|
+ List<CheckDataVo> normalDataList = data.getCheckDatas().stream().filter(d -> ObjectUtil.equal(Boolean.TRUE, d.getCheckStatus())).collect(Collectors.toList());
|
|
|
+ if (normalDataList.size() > 0) {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ for (CheckDataVo checkDataVo : normalDataList) {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(normalDataList.indexOf(checkDataVo) + 1), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, checkDataVo.getPointName(), Element.ALIGN_MIDDLE, 10, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_MIDDLE, 11, 1);
|
|
|
|
|
|
PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 14, 1);
|
|
|
|
|
|
@@ -603,9 +652,9 @@ public class PdfUtil {
|
|
|
PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
final Optional<CheckDataVo> optional = data.getCheckDatas().stream().filter(res -> ObjectUtil.isNotEmpty(res.getResRemark())).findAny();
|
|
|
if (!optional.isPresent()) {
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "无", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 6, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
document.add(table);
|
|
|
return;
|
|
|
}
|