浏览代码

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc into V0.0.2

zhulu 2 年之前
父节点
当前提交
2005e12eb4

+ 56 - 43
project_data/sql/0.0.2/soc/soc.sql

@@ -196,15 +196,15 @@ INSERT INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_cla
 
 
 -- 公告通知start
-delete from sys_dict_type where dict_id in(149,150);
-INSERT INTO `sys_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (149, '消息类型', 'messag_type', '0', '超级管理员', '2023-09-13 17:03:11', '超级管理员', '2023-09-13 17:07:06', NULL);
-INSERT INTO `sys_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (150, '消息状态', 'message_status', '0', '超级管理员', '2023-09-13 17:08:11', '', NULL, NULL);
+delete from sys_dict_type where dict_type in('messag_type','message_status');
+INSERT INTO `sys_dict_type`( `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( '消息类型', 'messag_type', '0', '超级管理员', '2023-09-13 17:03:11', '超级管理员', '2023-09-13 17:07:06', NULL);
+INSERT INTO `sys_dict_type`( `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( '消息状态', 'message_status', '0', '超级管理员', '2023-09-13 17:08:11', '', NULL, NULL);
 
-delete from sys_dict_data where dict_code in(356,357,358,359);
-INSERT INTO `sys_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (356, 0, '公告', '0', 'messag_type', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:06:33', '', NULL, NULL);
-INSERT INTO `sys_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (357, 0, '通知', '1', 'messag_type', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:06:43', '', NULL, NULL);
-INSERT INTO `sys_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (358, 0, '待发布', '0', 'message_status', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:09:11', '', NULL, NULL);
-INSERT INTO `sys_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (359, 0, '已发布', '1', 'message_status', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:09:19', '', NULL, NULL);
+delete from sys_dict_data where dict_type in('messag_type','message_status');
+INSERT INTO `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '公告', '0', 'messag_type', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:06:33', '', NULL, NULL);
+INSERT INTO `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '通知', '1', 'messag_type', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:06:43', '', NULL, NULL);
+INSERT INTO `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '待发布', '0', 'message_status', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:09:11', '', NULL, NULL);
+INSERT INTO `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '已发布', '1', 'message_status', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:09:19', '', NULL, NULL);
 
 delete from sys_menu where id in(2196,2208,2209,2210,2211,2212,2213);
 INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2196, '公告通知', 2168, 1, 'core/message', 'core/message/index', NULL, 1, 0, 'C', '0', '0', 'core:notification:list', '1', 'dashboard', NULL, '超级管理员', '2023-09-13 17:50:26', '超级管理员', '2023-09-15 16:47:45', '');
@@ -511,6 +511,23 @@ CREATE TABLE `core_safety_task_data` (
                                          KEY `check_task_id` (`task_id`) USING BTREE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='安全检查项表';
 
+
+DROP TABLE IF EXISTS `core_resumption_configuration`;
+CREATE TABLE `core_resumption_configuration` (
+                                                 `id` bigint NOT NULL COMMENT '主键',
+                                                 `resumption_cycle` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '履职周期',
+                                                 `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+                                                 `create_time` datetime DEFAULT NULL,
+                                                 `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+                                                 `update_time` datetime DEFAULT NULL,
+                                                 `del_flag` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
+                                                 `all_day` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '全天',
+                                                 `front` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '营业前',
+                                                 `centre` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '营业中',
+                                                 `after` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '营业后',
+                                                 `time_unit` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '时间单位',
+                                                 PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='履职任务定时提醒';
 DROP TABLE IF EXISTS `core_safety_task_data_nfc`;
 CREATE TABLE `core_safety_task_data_nfc` (
                                              `id` bigint NOT NULL DEFAULT '0',
@@ -532,48 +549,44 @@ INSERT INTO sys_config (config_name, config_key, config_value, config_type, crea
 -- Table structure for core_message_send
 -- ----------------------------
 DROP TABLE IF EXISTS `core_message_send`;
-CREATE TABLE `core_message_send`  (
-                                      `id` bigint NOT NULL COMMENT '主键',
-                                      `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
-                                      `type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-                                      `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '内容',
-                                      `send_user` bigint NULL DEFAULT NULL COMMENT '按用户选择',
-                                      `send_role` bigint NULL DEFAULT NULL COMMENT '按角色选择',
-                                      `send_time_type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发送时间类型1立即2指定时间',
-                                      `send_time` datetime NULL DEFAULT NULL COMMENT '发送时间',
-                                      `del_flag` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '0未2删',
-                                      `send_status` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '1已发送2待发送',
-                                      `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
-                                      `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
-                                      `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
-                                      `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人',
-                                      PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '消息发送配置' ROW_FORMAT = Dynamic;
-
-SET FOREIGN_KEY_CHECKS = 1;
+CREATE TABLE `core_message_send` (
+                                     `id` bigint NOT NULL COMMENT '主键',
+                                     `title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '标题',
+                                     `type` varchar(2) COLLATE utf8mb4_general_ci DEFAULT NULL,
+                                     `content` varchar(4000) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '内容',
+                                     `send_user` bigint DEFAULT NULL COMMENT '按用户选择',
+                                     `send_role` bigint DEFAULT NULL COMMENT '按角色选择',
+                                     `send_time_type` varchar(2) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发送时间类型1立即2指定时间',
+                                     `send_time` datetime DEFAULT NULL COMMENT '发送时间',
+                                     `del_flag` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '0未2删',
+                                     `send_status` varchar(2) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '1已发送2待发送',
+                                     `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+                                     `create_by` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
+                                     `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+                                     `update_by` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
+                                     PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='消息发送配置';
 -- 消息发送配置end
 
 -- ----------------------------
 -- Table structure for core_message_center
 -- ----------------------------
 DROP TABLE IF EXISTS `core_message_center`;
-CREATE TABLE `core_message_center`  (
-                                        `id` bigint NOT NULL,
-                                        `type` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '1公告2业务提醒3消息',
-                                        `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
-                                        `read` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '0未读1已读',
-                                        `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '内容',
-                                        `del_flag` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '0未2删',
-                                        `user_id` bigint NULL DEFAULT NULL COMMENT '用户',
-                                        `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
-                                        `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
-                                        `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人',
-                                        `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
-                                        PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '消息中心' ROW_FORMAT = Dynamic;
+CREATE TABLE `core_message_center` (
+                                       `id` bigint NOT NULL,
+                                       `type` varchar(2) COLLATE utf8mb4_general_ci NOT NULL COMMENT '1公告2业务提醒3消息',
+                                       `title` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '标题',
+                                       `is_read` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '0未读1已读',
+                                       `content` varchar(4000) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '内容',
+                                       `del_flag` varchar(2) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '0未2删',
+                                       `user_id` bigint DEFAULT NULL COMMENT '用户',
+                                       `create_by` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
+                                       `create_time` datetime DEFAULT NULL COMMENT '创建时间',
+                                       `update_by` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
+                                       `update_time` datetime DEFAULT NULL COMMENT '修改时间',
+                                       PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='消息中心';
 
-SET FOREIGN_KEY_CHECKS = 1;
--- 消息中心end
 DROP TABLE IF EXISTS `core_safety_task_data_remark`;
 CREATE TABLE `core_safety_task_data_remark` (
                                                 `id` bigint NOT NULL DEFAULT '0',

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/vo/CoreDrillTaskDetailVo.java

@@ -43,11 +43,11 @@ public class CoreDrillTaskDetailVo {
     private String typeText;
 
     @JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
-    @ApiModelProperty(value = "主持人")
+    @ApiModelProperty(value = "指挥人")
     private Long hostId;
 
 
-    @ApiModelProperty(value = "主持人名称")
+    @ApiModelProperty(value = "指挥人名称")
     private String hostName;
 
     @JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/controller/CoreDrillTaskController.java

@@ -97,7 +97,7 @@ public class CoreDrillTaskController extends BaseController {
     @ApiOperation(value = "生成预案培训登记簿")
     @GetMapping("build/{id}")
     public AjaxResult pdf(@PathVariable("id") Long id) {
-        return coreDrillTaskService.buildEduPdf(id);
+        return coreDrillTaskService.buildDrillTaskPdf(id);
     }
 
     @ApiOperation(value = "生成任务")

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/ICoreDrillTaskService.java

@@ -82,7 +82,7 @@ public interface ICoreDrillTaskService extends IService<CoreDrillTask> {
 
     Integer sign(CoreDrillTaskSignDto request);
 
-    AjaxResult buildEduPdf(Long id);
+    AjaxResult buildDrillTaskPdf(Long id);
 
     String buildDrillTask(Integer cycle, Date date);
 

+ 22 - 34
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java

@@ -59,6 +59,7 @@ import java.io.File;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.NumberFormat;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
@@ -494,7 +495,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
 
 
     @Override
-    public AjaxResult buildEduPdf(Long id) {
+    public AjaxResult buildDrillTaskPdf(Long id) {
         CoreDrillTaskDetailVo task = this.selectCoreDrillTaskById(id);
         if (ObjectUtil.isNotEmpty(task.getPdfUrl())) {
             return AjaxResult.success(task.getPdfUrl());
@@ -506,14 +507,11 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         String orgName = sysOrgList.stream().map(SysOrg::getName).collect(Collectors.joining("_"));
 
         String fileName = orgName + "_" + ExportPdfType.SAFETY_DRILL.getText() + "_" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + ".pdf";
-        Map<String, Object> data = this.getFtlEdu(task);
+        Map<String, Object> data = this.getFtlDrill(task);
         data.put("fileName", fileName);
         data.put("id", id);
         CompletableFuture.runAsync(() -> {
             R<String> r = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.generateDrillPdf(data), ErrorMsgConstants.GENERATE_PDF_ERROR);
-            if (null == r || null == r.getData()) {
-                throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
-            }
             String pdfUrl = r.getData();
             LambdaUpdateWrapper<CoreDrillTask> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(CoreDrillTask::getId, id);
@@ -521,40 +519,27 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
             this.update(updateWrapper);
         });
 
-       /* //新方式生成pdf
-        try {
-            String url = createEduPdfByNewType(data, dest);
-            //此处set以后 jpa框架自动保存入库
-            edu.setPdfUrl(url);
-
-            final RegisterBookPdf bookPdf = new RegisterBookPdf();
-            bookPdf.setId(IDHelper.id());
-            bookPdf.setRegisterBookType(ExportPdfType.EDUCATION_TRAINING);
-            bookPdf.setDate(new Date());
-            bookPdf.setOrgId(edu.getOrgId());
-            bookPdf.setPdfUrl(url);
-            registerBookPdfMapper.insert(bookPdf);
-            return url;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }*/
         return AjaxResult.error("正在生成pdf,请稍后刷新页面查看!");
     }
 
-    private Map<String, Object> getFtlEdu(CoreDrillTaskDetailVo task) {
+    private Map<String, Object> getFtlDrill(CoreDrillTaskDetailVo task) {
         Map<String, Object> data = new HashMap<>();
-        String time = DateUtil.format(task.getDrillTime(), "yyyy年MM月dd日");
-        String address = task.getOrgName();
+
+        String orgName = task.getOrgName();
+        String drillSite = task.getDrillSite();
+        String drillTime = DateUtil.format(task.getDrillTime(), "yyyy-MM-dd HH:mm:ss");
         String hostName = task.getHostName() == null ? StringUtil.EMPTY_STRING : task.getHostName();
-        String recorderName = task.getRecorderName() == null ? StringUtil.EMPTY_STRING : task.getRecorderName();
-        String content = "";
-        String note = "";
-        data.put("time", StringUtils.isNotEmpty(time) ? time : StringUtil.EMPTY_STRING);
-        data.put("address", StringUtils.isNotEmpty(address) ? time : StringUtil.EMPTY_STRING);
+        String typeText = task.getTypeText() == null ? StringUtil.EMPTY_STRING : task.getTypeText();
+        String presetCase = task.getPresetCase() == null ? StringUtil.EMPTY_STRING : task.getPresetCase();
+        String drillSituation = task.getDrillSituation() == null ? StringUtil.EMPTY_STRING : task.getDrillSituation();
+
+        data.put("orgName", StringUtils.isNotEmpty(orgName) ? orgName : StringUtil.EMPTY_STRING);
+        data.put("drillSite", StringUtils.isNotEmpty(drillSite) ? drillSite : StringUtil.EMPTY_STRING);
+        data.put("drillTime", StringUtils.isNotEmpty(drillTime) ? drillTime : StringUtil.EMPTY_STRING);
         data.put("hostName", StringUtils.isNotEmpty(hostName) ? hostName : StringUtil.EMPTY_STRING);
-        data.put("recorderName", StringUtils.isNotEmpty(recorderName) ? recorderName : StringUtil.EMPTY_STRING);
-        data.put("content", StringUtils.isNotEmpty(content) ? "内容: " + content : StringUtil.EMPTY_STRING);
-        data.put("note", StringUtils.isNotEmpty(note) ? "总结: " + note : StringUtil.EMPTY_STRING);
+        data.put("typeText", StringUtils.isNotEmpty(typeText) ? typeText : StringUtil.EMPTY_STRING);
+        data.put("presetCase", StringUtils.isNotEmpty(presetCase) ? "预设案由: " + presetCase : StringUtil.EMPTY_STRING);
+        data.put("drillSituation", StringUtils.isNotEmpty(drillSituation) ? "演练情况: " + drillSituation : StringUtil.EMPTY_STRING);
         List<CoreDrillTaskToUser> taskUserList = task.getTaskUserList();
         if (ObjectUtil.isEmpty(taskUserList)) {
             data.put("image", new ArrayList<>());
@@ -629,7 +614,10 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         drillTask.setStatus(DrillDoStatus.DONE.getCode());
         drillTask.setComment(request.getComment());
         drillTask.setRecStatus(0);
-        return baseMapper.updateById(drillTask);
+        int i = baseMapper.updateById(drillTask);
+        buildDrillTaskPdf(request.getTaskId());
+
+        return i;
     }
 
     @Override

+ 7 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml

@@ -228,6 +228,13 @@
             and t.status =#{task.status}
         </if>
 
+        <if test="task.checkSub==false">
+            and t.check_org_id=#{task.orgId}
+        </if>
+        <if test="task.checkSub==true">
+            and t.check_org_id in (select id from sys_org
+            where path like concat((select path from sys_org where id=#{task.orgId}),'%'))
+        </if>
         <if test="task.checkOrgIds!=null and task.checkOrgIds.size>0">
             and t.org_id in
             <foreach collection="task.checkOrgIds" close=")" open="(" separator="," item="id">

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

@@ -202,7 +202,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         final BaseFont fs = pdfTableVo.getFs();
         final Font tableFont = pdfTableVo.getTableFont();
         PdfUtil.dealHeader(document, fs, "学 习 教 育 记 录", 24);
-        PdfUtil.dealEduBody(document, table, tableFont, data);
+        PdfUtil.dealDrillBody(document, table, tableFont, data);
         document.close();
         writer.close();
         log.info("预案演练登记簿生成结束,当前绝对地址为:{}", pathVo.getAbsolutePath());

+ 29 - 14
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -219,15 +219,15 @@ public class PdfUtil {
         createPDFCell(tableFont, table, "指挥人", Element.ALIGN_CENTER, 1, 1);
         createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_CENTER, 2, 1);
 
-        //第三行 todo 待改正
+        //第三行
         createPDFCell(tableFont, table, "演练项目", Element.ALIGN_CENTER, 5, 1);
-        createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_CENTER, 2, 1);
+        createPDFCell(tableFont, table, data.get("typeText").toString(), Element.ALIGN_CENTER, 2, 1);
 
         //内容
         PdfPCell contentCell = new PdfPCell();
         contentCell.setColspan(6);
         Paragraph content = new Paragraph();
-        String text = data.get("content").toString();
+        String text = data.get("presetCase").toString();
         content.add(new Chunk(text, tableFont));
         contentCell.addElement(content);
         contentCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
@@ -237,7 +237,7 @@ public class PdfUtil {
         PdfPCell noteCell = new PdfPCell();
         noteCell.setColspan(6);
         Paragraph paragraph = new Paragraph();
-        String noteText = data.get("note").toString();
+        String noteText = data.get("drillSituation").toString();
         paragraph.add(new Chunk(noteText, tableFont));
         noteCell.addElement(paragraph);
         noteCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
@@ -246,7 +246,7 @@ public class PdfUtil {
         PdfPCell signCell = new PdfPCell();
         signCell.setColspan(6);
         Paragraph signParagraph = new Paragraph();
-        signParagraph.add(new Chunk("参会人员签字:", tableFont));
+        signParagraph.add(new Chunk("参会演练人员(签字):", tableFont));
         signCell.addElement(signParagraph);
         signCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
         table.addCell(signCell);
@@ -270,18 +270,34 @@ public class PdfUtil {
         document.add(table);
     }
 
+    public static Image getImage(String image) throws Exception {
+        Image imageData = null;
+        if (image.contains("black.png")) {
+            final ApplicationContext applicationContext = SpringUtil.getApplicationContext();
+            final Resource[] resources = applicationContext.getResources("classpath:file/black.png");
+            imageData = Image.getInstance(resources[0].getURL());
+        } else {
+            try {
+                imageData = convertFileToByteArray(new File(image));
+            } catch (IOException e) {
+                //此处如果未能读取到图片则放弃,选择使用空白图片来填充,继续生成pdf
+                log.error("读取图片失败,图片路径:{}", image);
+                final ApplicationContext applicationContext = SpringUtil.getApplicationContext();
+                final Resource[] resources = applicationContext.getResources("classpath:file/black.png");
+                imageData = Image.getInstance(resources[0].getURL());
+            }
+        }
+        imageData.scaleAbsolute(100, 100);
+        return imageData;
+    }
+
     private static PdfPTable getImage(List<String> images, int totalImages) throws Exception {
         if (images == null) {
             images = new ArrayList<>();
         }
         PdfPTable innerTable = new PdfPTable(3);
-        /*for (int i = 0; i < 7; i++) {
-            //模拟数据
-            images.add("1.jpg");
-        }*/
         //这里根据实际图片数量来判断是否需要补充白色图片,保证每行显示3张图片,用以填充空白
         final int reallySize = images.size();
-        //此处重新new对象, JPA会自动将images的更新持久化到数据,导致数据出错
         List<String> list = new ArrayList<>(images);
         for (int i = 0; i < totalImages - reallySize && totalImages > reallySize; i++) {
             list.add("black.png");
@@ -296,13 +312,12 @@ public class PdfUtil {
         for (List<String> row : rows) {
             for (String image : row) {
                 Image imageData = null;
-                if (image.contains("black.png")) {
+                try {
+                    imageData=  getImage(image);
+                } catch (Exception e) {
                     final ApplicationContext applicationContext = SpringUtil.getApplicationContext();
                     final Resource[] resources = applicationContext.getResources("classpath:file/black.png");
                     imageData = Image.getInstance(resources[0].getURL());
-                } else {
-                  //  byte[] bytes = convertFileToByteArray(new File(image));
-                    imageData = convertFileToByteArray(new File(image));
                 }
                 imageData.scaleAbsolute(100, 100);
                 PdfPCell cell = new PdfPCell(imageData);