Browse Source

登记簿修改

jingyuanchao 1 năm trước cách đây
mục cha
commit
16b448878f

+ 1 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/enums/RegisterBookType.java

@@ -22,7 +22,7 @@ public enum RegisterBookType {
     ALARM_TEST(4, "110报警测试登记簿"),
     SELF_SERVICE_BANK(5, "备用电源维护登记簿"),
     BACKUP_POWER(6, "离行式自助银行巡检登记簿"),
-    ON_DUTY_USER(7, "值班人员履职登记簿"),
+    ON_DUTY_USER(7, "值班履职登记簿"),
     SAFE_CHECK_REPORT(26, "安全检查登记簿"),
     MONITOR_ACCESS(28,"监控调阅登记簿"),
 

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ApiPlanController.java

@@ -259,6 +259,8 @@ public class ApiPlanController {
     @GetMapping(value = "/buildResumptionPdf/{orgId}/{dateStr}")
     AjaxResult buildResumptionPdf(@PathVariable("orgId") Long orgId, @PathVariable String dateStr) {
         appPlanService.buildResumptionPdfDaily(orgId, DateUtil.parse(dateStr, Constants.DAILY_FORMAT));
+        appPlanService.buildResumptionNotWorkTimePdf(orgId, DateUtil.parse(dateStr, Constants.DAILY_FORMAT));
+        appPlanService.buildResumptionAllDayPdf(orgId, DateUtil.parse(dateStr, Constants.DAILY_FORMAT));
         return AjaxResult.success();
     }
 

+ 9 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -1736,7 +1736,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     @Override
     public void buildResumptionAllDayPdf(Long orgId, Date date) {
         SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgId, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
-
+        //110报警:4
+        //电源:5
         final List<Map<String, Object>> mapList = this.getFtlResumptionAllDay(sysOrg, date);
         for (Map<String, Object> data : mapList) {
             if (!checkHasData(data)) {
@@ -1801,6 +1802,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.getEnums(planType), sysOrg);
             Map<String, Object> data = new HashMap<>();
             data.put("planType", planType);
+            //任务类型总数
+            data.put("planTypes","1");
             List<AppResumptionDataInfoVo> allDayInfo = getItems(listMap.get(planType));
             Map<Long, List<AppResumptionDataInfoVo>> afterf = allDayInfo.stream().collect(Collectors.groupingBy(AppResumptionDataInfoVo::getItemId));
             data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 1), getResult(afterf));
@@ -1842,6 +1845,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         data.put("submiterNames", tempSubmitNames);
         // 获取任务相关问题
         data.put("questions", getListQuestionPdfVo(dataList.stream().map(Resumption::getId).collect(Collectors.toList())));
+        data.put("planType","7");
+        //任务类型总数
+        data.put("planTypes","1");
         return data;
     }
 
@@ -1881,6 +1887,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 2), getResult(bef));
         data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 3), getResult(ingf));
         data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 4), getResult(afterf));
+        //任务类型总数
+        data.put("planTypes","3");
         // 提交人
 
         List<String> submiterNames = before.stream().map(Resumption::getSubmitorName).collect(Collectors.toList());

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

@@ -251,7 +251,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         final Font tableFont = pdfTableVo.getTableFont();
 
         document.open();
-        PdfUtil.dealHeader(document, fs, "学 习 教 育 记 录", 24);
+        PdfUtil.dealHeader(document, fs, RegisterBookType.EDUCATION_TRAINING.getText(), 24);
         PdfUtil.dealEduBody(document, table, tableFont, data);
 
 
@@ -366,7 +366,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         final BaseFont fs = pdfTableVo.getFs();
         final Font tableFont = pdfTableVo.getTableFont();
         document.open();
-        PdfUtil.dealHeader(document, fs, "预 案 演 练 记 录", 24);
+        PdfUtil.dealHeader(document, fs, RegisterBookType.SAFETY_DRILL.getText(), 24);
         PdfUtil.dealDrillBody(document, table, tableFont, data);
         document.close();
         writer.close();

+ 49 - 21
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -101,6 +101,7 @@ public class PdfUtil {
         }
         return cell;
     }
+
     private static PdfPCell cell(Font tableFont, String content, int align, Integer colspan, Integer rowspan, Integer paddingLeft, Integer paddingRight) {
         PdfPCell cell = new PdfPCell(new Phrase(content, tableFont));
         if (colspan != null && colspan > 0) {
@@ -216,7 +217,6 @@ 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_MIDDLE, 2, 0);
@@ -227,32 +227,60 @@ public class PdfUtil {
         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);
+        Object planTypes = data.get("planTypes");
+        if ("1".equals(planTypes)) {
+            PdfUtil.createPDFCell(tableFont, table, "检查工作情况", Element.ALIGN_MIDDLE, 10, 0);
+            PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 0);
+        } else {
+            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);
         final List<SysDictData> dictCache = DictUtils.getDictCache(DictConstants.RESUMPTION_PLAN_EXEC);
         final List<String> names = dictCache.stream().map(SysDictData::getDictLabel).collect(Collectors.toList());
-        for (String s : names) {
+        if ("1".equals(planTypes)) {
+            String s = names.get(0);
             List<LinkedHashMap<String, Object>> lists = (List<LinkedHashMap<String, Object>>) data.get(s);
-            if (ObjectUtil.isEmpty(lists)) {
-                //不同的执行时刻
-                continue;
-            }
-            //不同的执行时刻
-            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, 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, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
-                o++;
+            if (ObjectUtil.isNotEmpty(lists)) {
+                for (LinkedHashMap<String, Object> listVo : lists) {
+                    //序号
+                    PdfUtil.createPDFCell(tableFont, table, String.valueOf(o), PdfPCell.ALIGN_MIDDLE, 2, 0);
+                    // 检查内容
+                    String rowContent = 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, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
+                    o++;
+                }
+            }
+
+        } else {
+            for (String s : names) {
+                List<LinkedHashMap<String, Object>> lists = (List<LinkedHashMap<String, Object>>) data.get(s);
+                if (ObjectUtil.isEmpty(lists)) {
+                    //不同的执行时刻
+                    continue;
+                }
+                //不同的执行时刻
+                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, 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, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
+                    o++;
+                }
             }
         }
 
+
         List<Map<String, List<Map<String, Object>>>> protectionList = (List<Map<String, List<Map<String, Object>>>>) data.get("protection");
 
         if (ObjectUtil.isNotEmpty(protectionList)) {
@@ -260,7 +288,7 @@ public class PdfUtil {
             //日常登记簿-布撤防数据
             PdfUtil.createPDFCell(tableFont, table, "布撤防情况", Element.ALIGN_MIDDLE, 10, 1);
 
-            PdfUtil.createPDFCell(tableFont, table, "控制器", Element.ALIGN_MIDDLE, 4, 1);
+            PdfUtil.createPDFCell(tableFont, table, "防区", Element.ALIGN_MIDDLE, 4, 1);
             PdfUtil.createPDFCell(tableFont, table, "状态", Element.ALIGN_MIDDLE, 3, 1);
             PdfUtil.createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 3, 1);
 
@@ -689,10 +717,10 @@ public class PdfUtil {
 
         PdfUtil.createPDFCell(tableFont, table, "检查开始时间", Element.ALIGN_MIDDLE, 3, 1);
         //PdfUtil.createPDFCell(tableFont, table, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
-        table.addCell( cell(tableFont, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
+        table.addCell(cell(tableFont, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1, 2, 2));
         PdfUtil.createPDFCell(tableFont, table, "检查结束时间", Element.ALIGN_MIDDLE, 3, 1);
         //PdfUtil.createPDFCell(tableFont, table, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
-        table.addCell( cell(tableFont, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
+        table.addCell(cell(tableFont, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1, 2, 2));
         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);