ソースを参照

监控调阅登记薄增加正常项内容

jingyuanchao 1 年間 前
コミット
07cc532583

+ 0 - 2
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/CheckDataVo.java

@@ -28,7 +28,5 @@ public class CheckDataVo {
     private String resRemark;
 
     private String orderNum;
-
-    private String checkTime;
 }
 

+ 7 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java

@@ -133,4 +133,11 @@ public class TMonitoringRetrievalPlanController extends BaseController {
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tMonitoringRetrievalPlanService.deleteTMonitoringRetrievalPlanByIds(ids));
     }
+
+    @ApiOperation(value = "根据任务id生成pdf")
+    @GetMapping(value = "/buildPdf/{id}")
+    public AjaxResult buildPdf(@PathVariable("id") Long id) {
+        tMonitoringRetrievalPlanService.buildPdf(id);
+        return AjaxResult.success("生成监控调阅登记簿成功!");
+    }
 }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java

@@ -184,6 +184,6 @@ public class CoreSafecheckPlanController extends BaseController {
     @GetMapping(value = "/buildPdf/{id}")
     public AjaxResult buildPdf(@PathVariable("id") Long id) {
         coreSafecheckPlanService.buildPdf(id);
-        return AjaxResult.success("开始更新安全检查状态!");
+        return AjaxResult.success("生成安全检查登记簿成功!");
     }
 }

+ 0 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java

@@ -1042,7 +1042,6 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
             v.setPointName(vo.getPointName());
             v.setResRemark(vo.getRemark());
             v.setCheckStatus(vo.getStatus()==0);
-            v.setCheckTime(DateUtil.format(vo.getSubmitTime(), "yyyy年MM月dd日"));
             v.setRectificationDeadline(vo.getRectificationDeadline());
             pointCheckDataList.add(v);
         }

+ 16 - 10
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ArrayUtil;
-import cn.hutool.core.util.ByteUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@@ -35,7 +34,6 @@ import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
 import com.xunmei.system.api.vo.SysOrgVO;
 import io.netty.util.internal.StringUtil;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.text.StringEscapeUtils;
 import org.apache.tools.zip.ZipEntry;
@@ -314,7 +312,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         PdfFilePathVo pathVo = getLocalFilePath("access", data.getDest());
         String afterStr = StringEscapeUtils.escapeEcmaScript(pathVo.getAbsolutePath());
         log.info("开始生成监控调阅登记簿,当前绝对地址为:{}", afterStr);
-        final ItextPdfTableVo pdfTableVo = PdfUtil.createTable(pathVo.getAbsolutePath(), 46, 10);
+        final ItextPdfTableVo pdfTableVo = PdfUtil.createTable(pathVo.getAbsolutePath(), 19, 10);
         final Document document = pdfTableVo.getDocument();
         final PdfWriter writer = pdfTableVo.getWriter();
         final PdfPTable table = pdfTableVo.getTable();
@@ -326,14 +324,22 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         String checkUser = data.getCheckUser();
 
         Font titleFont = new Font(fs, 10, Font.NORMAL);
-        PdfUtil.createPDFCell(titleFont, table, "调阅单位", Element.ALIGN_MIDDLE, 10, 0);
-        PdfUtil.createPDFCell(titleFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 13, 0);
-        PdfUtil.createPDFCell(titleFont, table, "调阅人", Element.ALIGN_MIDDLE, 8, 0);
-        PdfUtil.createPDFCell(titleFont, table, checkUser, Element.ALIGN_MIDDLE, 15, 0);
-        PdfUtil.createPDFCell(titleFont, table, "调阅时间", Element.ALIGN_MIDDLE, 10, 0);
-        PdfUtil.createPDFCell(titleFont, table, checkTime, Element.ALIGN_MIDDLE, 36, 0);
-        PdfUtil.createPDFCell(titleFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 46, 0);
+        PdfUtil.createPDFCell(titleFont, table, "调阅单位", Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(titleFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 6, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "调阅人", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(titleFont, table, checkUser, Element.ALIGN_MIDDLE, 6, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "调阅时间", Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(titleFont, table, checkTime, Element.ALIGN_MIDDLE, 15, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "调阅人签字", Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(titleFont, table, checkTime, Element.ALIGN_MIDDLE, 15, 1);
+
+        PdfUtil.createPDFCell(titleFont, table, "监控调阅情况", Element.ALIGN_MIDDLE, 19, 1);
+
         PdfUtil.dealAccessPBody(document, table, tableFont, titleFont, data.getDataVos());
+        document.add(table);
         document.close();
         writer.close();
         log.info("监控调阅登记簿生成结束,当前绝对地址为:{}", afterStr);

+ 36 - 23
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -561,19 +561,28 @@ 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);
+        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);
         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(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 1);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 6, 1);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 5, 1);
+            PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 6, 1);
         }
-        document.add(table);
+        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);
+
+        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);
+
     }
 
     public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, SafeCheckTaskRegisterBookVo data) throws DocumentException {
@@ -589,21 +598,25 @@ 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);
         PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_MIDDLE, 4, 1);
 
-        PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_MIDDLE, 11, 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, 3, 1);
-            PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_MIDDLE, 7, 1);
-            PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_MIDDLE, 4, 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);
             for (CheckDataVo checkDataVo : normalDataList) {
-                PdfUtil.createPDFCell(tableFont, table, checkDataVo.getCheckTime(), Element.ALIGN_MIDDLE, 3, 1);
-                PdfUtil.createPDFCell(tableFont, table, checkDataVo.getPointName(), Element.ALIGN_MIDDLE, 7, 1);
-                PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 4, 1);
+                PdfUtil.createPDFCell(tableFont, table, String.valueOf(normalDataList.indexOf(checkDataVo)+1), Element.ALIGN_MIDDLE, 2, 1);
+                PdfUtil.createPDFCell(tableFont, table, checkDataVo.getPointName(), Element.ALIGN_MIDDLE, 6, 1);
+                PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 6, 1);
             }
         }
 
@@ -617,9 +630,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, "1", 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;
         }