Parcourir la source

Merge branch 'V0.0.5' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.5

zhulu il y a 1 an
Parent
commit
6d8b5d1804
27 fichiers modifiés avec 817 ajouts et 402 suppressions
  1. 14 0
      project_data/sql/0.0.5/soc/soc.sql
  2. 123 72
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/retrieval/domain/CoreMonitoringRetrievalTask.java
  3. 4 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java
  4. 9 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java
  5. 96 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/controller/AppQuestionController.java
  6. 24 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/dto/AppQuestionPageDto.java
  7. 0 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/dto/QuestionPageDto.java
  8. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/mapper/QuestionFlowMapper.java
  9. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/mapper/QuestionMapper.java
  10. 33 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/IAppQuestionService.java
  11. 9 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/IQuestionService.java
  12. 98 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/AppQuestionServiceImpl.java
  13. 30 52
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java
  14. 8 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionRecordPageDto.java
  15. 38 20
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java
  16. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/AppPlanVo.java
  17. 33 32
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java
  18. 6 2
      soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml
  19. 8 0
      soc-modules/soc-modules-core/src/main/resources/mapper/question/QuestionFlowMapper.xml
  20. 33 12
      soc-modules/soc-modules-core/src/main/resources/mapper/question/QuestionMapper.xml
  21. 51 47
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml
  22. 62 27
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java
  23. 31 11
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfPageHelperEvent.java
  24. 93 111
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java
  25. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaCheckController.java
  26. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaController.java
  27. 2 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysWorkTimeSetServiceImpl.java

+ 14 - 0
project_data/sql/0.0.5/soc/soc.sql

@@ -124,3 +124,17 @@ VALUES (10, '监控中心', '10', 'monitor_org', null, 'default', 'N', '0',  nul
 delete  from `sys_menu` where  id=01719892877586239490;
 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 (01719892877586239490, '外包履职评价统计表', 1719287834364436482, 2, 'evaluateTable', 'evaluateTable/index', NULL, 1, 1, 'C', '0', '0', 'core:evaluateTask:statistics', '1', 'chart', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+
+
+UPDATE sys_menu set menu_type='C',perms='appquestion:list' WHERE platform_type=0 and menu_name='隐患问题清单';
+
+DELETE from `sys_dict_type`  WHERE `dict_type`='app_question_status';
+DELETE from `sys_dict_data`  WHERE `dict_type`='app_question_status';
+
+INSERT INTO `sys_dict_type` ( `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 'APP隐患问题状态', 'app_question_status', '0', '超级管理员', '2023-12-19 15:40:55', '', 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', 'app_question_status', NULL, 'default', 'N', '0', '超级管理员', '2023-12-19 15:42:47', '', 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 ( 1, '提出异议', '1', 'app_question_status', NULL, 'default', 'N', '0', '超级管理员', '2023-12-19 15:42:59', '', 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 ( 3, '已关闭', '3', 'app_question_status', NULL, 'default', 'N', '0', '超级管理员', '2023-12-19 15:43:23', '超级管理员', '2023-12-19 15:43:30', 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 ( 10, '待整改', '10', 'app_question_status', NULL, 'default', 'N', '0', '超级管理员', '2023-12-19 15:43:55', '', 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 ( 11, '已整改', '11', 'app_question_status', NULL, 'default', 'N', '0', '超级管理员', '2023-12-19 15:44:07', '超级管理员', '2023-12-19 15:44:31', 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 ( 12, '已逾期', '12', 'app_question_status', NULL, 'default', 'N', '0', '超级管理员', '2023-12-19 15:44:18', '', NULL, NULL);

+ 123 - 72
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/retrieval/domain/CoreMonitoringRetrievalTask.java

@@ -1,6 +1,7 @@
 package com.xunmei.common.core.domain.retrieval.domain;
 
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -24,186 +25,236 @@ import com.xunmei.common.core.web.domain.BaseEntity;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @TableName("core_monitoring_retrieval_task")
-@ApiModel(value = "CoreMonitoringRetrievalTask对象" , description = "监控调阅任务")
-public class CoreMonitoringRetrievalTask extends BaseEntity
-        {
-private static final long serialVersionUID=1L;
+@ApiModel(value = "CoreMonitoringRetrievalTask对象", description = "监控调阅任务")
+public class CoreMonitoringRetrievalTask extends BaseEntity {
+    private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    /**
+     * 主键
+     */
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
-    /** 计划id */
+    /**
+     * 计划id
+     */
     @JsonSerialize(using = ToStringSerializer.class)
     private Long planId;
 
-    /** 任务名称 */
-            @ApiModelProperty(value = "任务名称")
+    /**
+     * 任务名称
+     */
+    @ApiModelProperty(value = "任务名称")
     private String taskName;
 
-    /** 调阅机构 */
+    /**
+     * 调阅机构
+     */
     @JsonSerialize(using = ToStringSerializer.class)
     private Long orgId;
 
-    /** 调阅机构 */
+    /**
+     * 调阅机构
+     */
     private String orgPath;
 
-    /** 调阅机构 */
-            @ApiModelProperty(value = "调阅机构")
+    /**
+     * 调阅机构
+     */
+    @ApiModelProperty(value = "调阅机构")
     private String orgName;
 
-    /** 年月日 */
+    /**
+     * 年月日
+     */
     private Date ymdDate;
 
-    /** 年 */
+    /**
+     * 年
+     */
     private Integer ymdYear;
 
-    /** 半年 */
+    /**
+     * 半年
+     */
     private Integer ymdHalfyear;
 
-    /** 季度 */
+    /**
+     * 季度
+     */
     private Integer ymdQuarter;
 
-    /** 月 */
+    /**
+     * 月
+     */
     private Integer ymdMonth;
 
-    /** 周 */
+    /**
+     * 周
+     */
     private Integer ymdWeek;
 
-    /** 日 */
+    /**
+     * 日
+     */
     private Integer ymdDay;
 
-    /** 周期无周期、每日、每周、每月、每季度、每半年、每年(0-6) */
+    /**
+     * 周期无周期、每日、每周、每月、每季度、每半年、每年(0-6)
+     */
     private String cycle;
 
-    /** 开始时间 */
-            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-            @ApiModelProperty(value = "开始时间")
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "开始时间")
     private Date planStartTime;
 
-    /** 结束时间 */
-            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-            @ApiModelProperty(value = "结束时间")
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "结束时间")
     private Date planEndTime;
 
-    /** 调阅开始时间 */
-            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-            @ApiModelProperty(value = "调阅开始时间")
+    /**
+     * 调阅开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "调阅开始时间")
     private Date startTime;
 
-    /** 调阅结束时间 */
-            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-            @ApiModelProperty(value = "调阅结束时间")
+    /**
+     * 调阅结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "调阅结束时间")
     private Date endTime;
 
-    /** 状态 */
-            @ApiModelProperty(value = "状态")
+    /**
+     * 状态
+     */
+    @ApiModelProperty(value = "状态")
     private String status;
 
-    /** 角色id */
+    /**
+     * 角色id
+     */
     @JsonSerialize(using = ToStringSerializer.class)
     private Long roleId;
 
-    /** 调阅人 */
+    /**
+     * 调阅人
+     */
     @JsonSerialize(using = ToStringSerializer.class)
     private Long retrievalUser;
 
-    /** 第几次调阅(根据计划的频次计算的来) */
+    /**
+     * 第几次调阅(根据计划的频次计算的来)
+     */
     @JsonSerialize(using = ToStringSerializer.class)
     private Integer orderNum;
 
-    /** 批次号(同一计划多频次为一个批次号) */
+    /**
+     * 批次号(同一计划多频次为一个批次号)
+     */
     @JsonSerialize(using = ToStringSerializer.class)
     private Long batchNum;
 
-    /** 提交时间 */
+    /**
+     * 提交时间
+     */
     private Date submitTime;
 
-    /** 异常数 */
+    /**
+     * 异常数
+     */
     @ApiModelProperty(value = "异常数")
     private Integer exceptionCount;
     @ApiModelProperty(value = "0正常,1删除")
     private Integer isDeleted;
 
-      private String pdfUrl;
-@Override
-public String toString(){
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+    private String pdfUrl;
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
 
 
-                .append("id" ,getId())
+                .append("id", getId())
 
 
-                .append("planId" ,getPlanId())
+                .append("planId", getPlanId())
 
 
-                .append("taskName" ,getTaskName())
+                .append("taskName", getTaskName())
 
 
-                .append("orgId" ,getOrgId())
+                .append("orgId", getOrgId())
 
 
-                .append("orgPath" ,getOrgPath())
+                .append("orgPath", getOrgPath())
 
 
-                .append("orgName" ,getOrgName())
+                .append("orgName", getOrgName())
 
 
-                .append("ymdDate" ,getYmdDate())
+                .append("ymdDate", getYmdDate())
 
 
-                .append("ymdYear" ,getYmdYear())
+                .append("ymdYear", getYmdYear())
 
 
-                .append("ymdHalfyear" ,getYmdHalfyear())
+                .append("ymdHalfyear", getYmdHalfyear())
 
 
-                .append("ymdQuarter" ,getYmdQuarter())
+                .append("ymdQuarter", getYmdQuarter())
 
 
-                .append("ymdMonth" ,getYmdMonth())
+                .append("ymdMonth", getYmdMonth())
 
 
-                .append("ymdWeek" ,getYmdWeek())
+                .append("ymdWeek", getYmdWeek())
 
 
-                .append("ymdDay" ,getYmdDay())
+                .append("ymdDay", getYmdDay())
 
 
-                .append("cycle" ,getCycle())
+                .append("cycle", getCycle())
 
 
-                .append("planStartTime" ,getPlanStartTime())
+                .append("planStartTime", getPlanStartTime())
 
 
-                .append("planEndTime" ,getPlanEndTime())
+                .append("planEndTime", getPlanEndTime())
 
 
-                .append("startTime" ,getStartTime())
+                .append("startTime", getStartTime())
 
 
-                .append("endTime" ,getEndTime())
+                .append("endTime", getEndTime())
 
 
-                .append("status" ,getStatus())
+                .append("status", getStatus())
 
 
-                .append("roleId" ,getRoleId())
+                .append("roleId", getRoleId())
 
 
-                .append("retrievalUser" ,getRetrievalUser())
+                .append("retrievalUser", getRetrievalUser())
 
 
-                .append("orderNum" ,getOrderNum())
+                .append("orderNum", getOrderNum())
 
 
-                .append("batchNum" ,getBatchNum())
+                .append("batchNum", getBatchNum())
 
 
-                .append("submitTime" ,getSubmitTime())
+                .append("submitTime", getSubmitTime())
 
 
-                .append("exceptionCount" ,getExceptionCount())
-        .toString();
-        }
-        }
+                .append("exceptionCount", getExceptionCount())
+                .toString();
+    }
+}

+ 4 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -54,10 +54,7 @@ import java.io.File;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 import java.util.stream.Collectors;
 
@@ -924,8 +921,9 @@ private CoreMonitoringRetrievalTaskMapper coreMonitoringRetrievalTaskMapper;
     public AccessPdf buildSafetyCheckRegisterBookData(AccessPdfVO accessPdfVO) {
         AccessPdf accessPdf = new AccessPdf();
         accessPdf.setTaskTitle("标题");
-        final SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
-        String dateStr = format.format(accessPdfVO.getTaskStartTime());
+        final SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分");
+       Calendar calendar=Calendar.getInstance();
+        String dateStr = format.format(accessPdfVO.getTaskStartTime())+"-"+calendar.get(Calendar.HOUR_OF_DAY)+"时"+calendar.get(Calendar.MINUTE)+"分";
         accessPdf.setTaskStartTime(dateStr);
         accessPdf.setCheckUser(accessPdfVO.getCheckUser());
         accessPdf.setOrgId(accessPdfVO.getOrgId());

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

@@ -768,8 +768,8 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         String staticsPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getStaticPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR).getData();
         String orgName = task.getOrgName();
         String drillSite = task.getDrillSite();
-        String startTime = DateUtil.format(task.getDrillStartTime(), "yyyy年MM月dd日 HH:mm");
-        String endTime = DateUtil.format(task.getDrillEndTime(), "HH:mm");
+        String startTime = DateUtil.format(task.getDrillStartTime(), "yyyy年MM月dd日 HH时mm分");
+        String endTime = DateUtil.format(task.getDrillEndTime(), "HH时mm分");
         String drillTime = startTime + " - " + endTime;
         String hostName = task.getHostName() == null ? StringUtil.EMPTY_STRING : task.getHostName();
         String typeText = task.getTypeText() == null ? StringUtil.EMPTY_STRING : task.getTypeText();
@@ -783,17 +783,21 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         data.put("drillTime", StringUtils.isNotEmpty(drillTime) ? drillTime : StringUtil.EMPTY_STRING);
         data.put("hostName", StringUtils.isNotEmpty(hostName) ? hostName : StringUtil.EMPTY_STRING);
         data.put("typeText", StringUtils.isNotEmpty(typeText) ? typeText : StringUtil.EMPTY_STRING);
-        data.put("imageData", getFileRealPath(Arrays.asList(task.getImageList().split(",")), prefixPath, staticsPath));
+        data.put("fileImage", getFileRealPath(Arrays.asList(task.getImageList().split(",")), prefixPath, staticsPath));
         data.put("recorderName", StringUtils.isNotEmpty(recorderName) ? recorderName : StringUtil.EMPTY_STRING);
         data.put("presetCase", StringUtils.isNotEmpty(presetCase) ? "预设案由: " + presetCase : StringUtil.EMPTY_STRING);
         data.put("drillSituation", StringUtils.isNotEmpty(drillSituation) ? "演练情况: " + drillSituation : StringUtil.EMPTY_STRING);
         data.put("comment", StringUtils.isNotEmpty(comment) ? "点评总结: " + comment : StringUtil.EMPTY_STRING);
         List<CoreDrillTaskToUser> taskUserList = task.getTaskUserList();
         if (ObjectUtil.isEmpty(taskUserList)) {
-            data.put("image", new ArrayList<>());
+            data.put("signImage", new ArrayList<>());
         } else {
             List<String> collect = taskUserList.stream().filter(item -> item.getType() == 1 && ObjectUtil.isNotEmpty(item.getSignImage())).map(CoreDrillTaskToUser::getSignImage).collect(Collectors.toList());
-            data.put("image", getFileRealPath(collect, prefixPath, staticsPath));
+            /*final String str = collect.get(0);
+            for (int i = 0; i < 10; i++) {
+                collect.add(str);
+            }*/
+            data.put("signImage", getFileRealPath(collect, prefixPath, staticsPath));
         }
         return data;
     }

+ 96 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/controller/AppQuestionController.java

@@ -0,0 +1,96 @@
+package com.xunmei.core.question.controller;
+
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.core.question.domain.Question;
+import com.xunmei.core.question.dto.AppQuestionPageDto;
+import com.xunmei.core.question.dto.QuestionConfirmDto;
+import com.xunmei.core.question.dto.QuestionPageDto;
+import com.xunmei.core.question.dto.QuestionReformDto;
+import com.xunmei.core.question.service.IAppQuestionService;
+import com.xunmei.core.question.service.IQuestionReformService;
+import com.xunmei.core.question.service.IQuestionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 隐患问题清单Controller
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Api(tags = {"隐患问题清单"})
+@RestController
+@RequestMapping("/appquestion")
+public class AppQuestionController extends BaseController {
+    @Autowired
+    private IQuestionService questionService;
+
+    @Autowired
+    private IQuestionReformService questionReformService;
+
+    @Autowired
+    private IAppQuestionService appQuestionService;
+    /**
+     * 查询隐患问题清单列表
+     */
+    @ApiOperation(value = "查询列表")
+    @RequiresPermissions("appquestion:list")
+    @GetMapping("/list")
+    public TableDataInfo<Question> questionPage(AppQuestionPageDto query) {
+        return appQuestionService.selectPage(query);
+    }
+
+    /**
+     * 获取隐患问题清单详细信息
+     */
+    @ApiOperation(value = "获取详细信息")
+    @RequiresPermissions("appquestion:list")
+    @GetMapping(value = "/info/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(questionService.selectQuestionById(id));
+    }
+
+    /**
+     * 确认
+     *
+     * @return
+     */
+    @ApiOperation(value = "隐患确认")
+    @PutMapping("/confirm/{id}")
+    @RequiresPermissions("appquestion:list")
+    public AjaxResult confirm(@RequestBody QuestionConfirmDto confirmDto, @PathVariable Long id) {
+        return AjaxResult.success(questionService.confirm(confirmDto));
+    }
+
+    /**
+     * 确认
+     *
+     * @return
+     */
+    @ApiOperation(value = "异议审批")
+    @RequiresPermissions("appquestion:list")
+    @PutMapping("/confirmDissent/{id}")
+    public AjaxResult confirmDissent(@RequestBody QuestionConfirmDto confirmDto, @PathVariable Long id) {
+        return AjaxResult.success(questionService.confirmDissent(confirmDto));
+    }
+
+    /**
+     * 整改
+     *
+     * @param reformDto
+     * @return
+     */
+    @ApiOperation(value = "整改")
+    @RequiresPermissions("appquestion:list")
+    @PutMapping("/reform/{id}")
+    public AjaxResult reform(@RequestBody QuestionReformDto reformDto, @PathVariable Long id) {
+        return AjaxResult.success(questionReformService.reform(reformDto));
+    }
+}

+ 24 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/dto/AppQuestionPageDto.java

@@ -0,0 +1,24 @@
+package com.xunmei.core.question.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.xunmei.common.core.web.domain.PageDto;
+import com.xunmei.core.question.vo.QuestionPageVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class AppQuestionPageDto extends PageDto<QuestionPageVo> {
+    @ApiModelProperty(value ="搜索关键字" )
+    private String searchKey;
+
+    @ApiModelProperty(value ="确认状态" )
+    private Integer status;
+
+    @ApiModelProperty(value = "整改日期")
+    private Date reformDate;
+
+    @JsonIgnore
+    private Date reformDateEnd;
+}

+ 0 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/dto/QuestionPageDto.java

@@ -23,7 +23,4 @@ public class QuestionPageDto extends PageDto<QuestionPageVo> {
 
     @ApiModelProperty(value = "提交日期范围")
     private Date[] submitRange;
-
-    @ApiModelProperty(value = "整改日期")
-    private Date reformDate;
 }

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/mapper/QuestionFlowMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.xunmei.core.question.domain.QuestionFlow;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 隐患问题审批流程Mapper接口
@@ -59,4 +60,6 @@ public interface QuestionFlowMapper extends BaseMapper<QuestionFlow> {
      * @return 结果
      */
     int deleteCoreQuestionFlowByIds(Long[] ids);
+
+    int deleteBySrc(@Param("srcType") int srcType,@Param("taskIds") List<Long> taskIds);
 }

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/mapper/QuestionMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyExceptionData;
 import com.xunmei.core.question.domain.Question;
+import com.xunmei.core.question.dto.AppQuestionPageDto;
 import com.xunmei.core.question.dto.QuestionExportDto;
 import com.xunmei.core.question.dto.QuestionPageDto;
 import com.xunmei.core.question.dto.ReformPageDto;
@@ -26,6 +27,9 @@ public interface QuestionMapper extends BaseMapper<Question> {
     Page<Question> pageQuestion(@Param("page") Page<Question> page,@Param("params") QuestionPageDto query ,@Param("today") Date today);
 
     Page<Question> pageReform(@Param("page") Page<Question> page,@Param("params") ReformPageDto query ,@Param("today") Date today);
+
+    Page<Question> pageApp(@Param("page") Page<Question> page, @Param("params") AppQuestionPageDto query , @Param("today") Date today);
+
     /**
      * 查询隐患问题清单
      *

+ 33 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/IAppQuestionService.java

@@ -0,0 +1,33 @@
+package com.xunmei.core.question.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.domain.panel.dto.PanelListDto;
+import com.xunmei.common.core.domain.panel.vo.PanelListVo;
+import com.xunmei.common.core.domain.panel.vo.WebPanelResult;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.question.QuestionSrcType;
+import com.xunmei.core.question.domain.Question;
+import com.xunmei.core.question.dto.AppQuestionPageDto;
+import com.xunmei.core.question.dto.QuestionConfirmDto;
+import com.xunmei.core.question.dto.QuestionPageDto;
+import com.xunmei.core.question.vo.QuestionVo;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 隐患问题清单Service接口
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+public interface IAppQuestionService extends IService<Question> {
+    /**
+     * 查询隐患问题清单分页数据
+     *
+     * @param query  查询条件对象
+     * @return Page
+     */
+    TableDataInfo<Question> selectPage(AppQuestionPageDto query);
+}

+ 9 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/IQuestionService.java

@@ -5,6 +5,7 @@ import com.xunmei.common.core.domain.panel.dto.PanelListDto;
 import com.xunmei.common.core.domain.panel.vo.PanelListVo;
 import com.xunmei.common.core.domain.panel.vo.WebPanelResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.question.QuestionSrcType;
 import com.xunmei.core.question.domain.Question;
 import com.xunmei.core.question.dto.QuestionConfirmDto;
 import com.xunmei.core.question.dto.QuestionPageDto;
@@ -40,6 +41,14 @@ public interface IQuestionService extends IService<Question> {
     Question handleQuestion(Question question);
 
     /**
+     * 按任务删除问题
+     * @param srcType
+     * @param taskIds
+     * @return
+     */
+    int delete(QuestionSrcType srcType,List<Long> taskIds);
+
+    /**
      * 查询隐患问题清单分页数据
      *
      * @param query  查询条件对象

+ 98 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/AppQuestionServiceImpl.java

@@ -0,0 +1,98 @@
+package com.xunmei.core.question.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.util.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.constant.DictConstants;
+import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.domain.panel.dto.PanelListDto;
+import com.xunmei.common.core.domain.panel.enums.PanelTypeEnums;
+import com.xunmei.common.core.domain.panel.vo.PanelListVo;
+import com.xunmei.common.core.domain.panel.vo.WebPanelResult;
+import com.xunmei.common.core.exception.ServiceException;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.utils.DictUtils;
+import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.question.QuestionConfirmEnum;
+import com.xunmei.core.question.QuestionReformEnum;
+import com.xunmei.core.question.QuestionSrcType;
+import com.xunmei.core.question.QuestionStepEnum;
+import com.xunmei.core.question.domain.Question;
+import com.xunmei.core.question.domain.QuestionFlow;
+import com.xunmei.core.question.dto.AppQuestionPageDto;
+import com.xunmei.core.question.dto.QuestionConfirmDto;
+import com.xunmei.core.question.dto.QuestionExportDto;
+import com.xunmei.core.question.dto.QuestionPageDto;
+import com.xunmei.core.question.mapper.QuestionFlowMapper;
+import com.xunmei.core.question.mapper.QuestionMapper;
+import com.xunmei.core.question.service.IAppQuestionService;
+import com.xunmei.core.question.service.IQuestionService;
+import com.xunmei.core.question.vo.QuestionFlowVo;
+import com.xunmei.core.question.vo.QuestionVo;
+import com.xunmei.core.resumption.service.IAppResumptionDataRemarkimgService;
+import com.xunmei.core.safetyCheck.domain.CoreSafetyTaskDataRemarkimg;
+import com.xunmei.core.safetyCheck.service.ICoreSafetyTaskDataRemarkimgService;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.RemoteUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 隐患问题清单Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Service
+@Slf4j
+public class AppQuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> implements IAppQuestionService {
+    @Autowired
+    private QuestionFlowMapper questionFlowMapper;
+    @Autowired
+    private RemoteOrgService orgService;
+
+    @Autowired
+    RemoteUserService remoteUserService;
+
+    @Autowired
+    private IAppResumptionDataRemarkimgService appResumptionDataRemarkimgService;
+
+    @Autowired
+    private ICoreSafetyTaskDataRemarkimgService iCoreSafetyTaskDataRemarkimgService;
+
+    @Override
+    public TableDataInfo<Question> selectPage(AppQuestionPageDto query) {
+        //未删除
+        Page<Question> page = query.toPage();
+        if(ObjectUtil.isNotNull(query.getReformDate())){
+            query.setReformDateEnd(DateUtil.endOfDay(query.getReformDate()));
+        }
+        //获取数据
+        page = baseMapper.pageApp(page, query, DateUtil.beginOfDay(new Date()));
+        page.getRecords().forEach(r -> {
+            if (ObjectUtil.notEqual(r.getConfirmStatus(), QuestionConfirmEnum.Closed.getValue()) &&
+                    r.getReformDeadline().before(DateUtil.beginOfDay(new Date()))) {
+                //任务未结束并且过了整改结束日期
+                r.setOverdueStatus(QuestionConfirmEnum.OverDue.getValue());
+            }
+        });
+//        Page<QuestionPageDto> r =page.
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+    }
+}

+ 30 - 52
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java

@@ -3,6 +3,7 @@ package com.xunmei.core.question.service.impl;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.util.CollectionUtils;
 import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -83,58 +84,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         //未删除
         Page<Question> page = query.toPage();
 
-        //查询条件
-//        LambdaQueryWrapper<Question> wrapper = new LambdaQueryWrapper<>();
-//        //下穿
-//        if (query.getCheckSub()) {
-//            List<Long> ids = orgService.selectCheckSubOrgIdList(query.getOrgId(), SecurityConstants.INNER);
-//            //添加in条件
-//            wrapper.in(Question::getOrgId, ids);
-//        } else {
-//            wrapper.eq(Question::getOrgId, query.getOrgId());
-//        }
-//
-//        if (ObjectUtil.isNotEmpty(query.getConfirmStatus())) {
-//            if (ObjectUtil.equal(query.getConfirmStatus(), QuestionConfirmEnum.OverDue.getValue())) {
-//                wrapper.ne(Question::getConfirmStatus, QuestionConfirmEnum.Closed.getValue());
-//                wrapper.lt(Question::getReformDeadline, DateUtil.beginOfDay(new Date()));
-//            } else {
-//                wrapper.eq(Question::getConfirmStatus, query.getConfirmStatus());
-//            }
-//        }
-//
-//
-        if (ObjectUtil.isNotNull(query.getReformDate())) {
-            query.setSubmitRange(new Date[2]);
-            Date submitTime = DateUtil.endOfDay(query.getReformDate());
-            query.getSubmitRange()[0] = submitTime;
-
-            Date reformDeadLine = DateUtil.beginOfDay(query.getReformDate());
-            query.getSubmitRange()[1] = reformDeadLine;
-
-
-//            if (ObjectUtil.isNotEmpty(query.getSearchKey())) {
-//                wrapper.and(w ->
-//                        w.like(Question::getQuestionDesc, query.getSearchKey())
-//                );
-//            }
-        } else {
-            //时间范围查询
-            if (ObjectUtil.isNotEmpty(query.getSubmitRange()) && query.getSubmitRange().length == 2) {
-                query.getSubmitRange()[0] = DateUtil.beginOfDay(query.getSubmitRange()[0]);
-                query.getSubmitRange()[1] = DateUtil.endOfDay(query.getSubmitRange()[1]);
-
-//                wrapper.between(Question::getSubmitTime, start, end);
-            }
-
-//            if (ObjectUtil.isNotEmpty(query.getSearchKey())) {
-//                wrapper.and(w ->
-//                        w.like(Question::getCheckContent, query.getSearchKey()).or().like(Question::getQuestionDesc, query.getSearchKey())
-//                );
-//            }
+        //时间范围查询
+        if (ObjectUtil.isNotEmpty(query.getSubmitRange()) && query.getSubmitRange().length == 2) {
+            query.getSubmitRange()[0] = DateUtil.beginOfDay(query.getSubmitRange()[0]);
+            query.getSubmitRange()[1] = DateUtil.endOfDay(query.getSubmitRange()[1]);
         }
-//
-//        wrapper.orderByDesc(Question::getId);
+
         //获取数据
         page = baseMapper.pageQuestion(page, query, DateUtil.beginOfDay(new Date()));
         page.getRecords().forEach(r -> {
@@ -221,6 +176,28 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     /**
+     * 按任务删除问题
+     *
+     * @param srcType
+     * @param taskIds
+     * @return
+     */
+    @Override
+    public int delete(QuestionSrcType srcType, List<Long> taskIds) {
+        if (ObjectUtil.isNull(srcType) || CollectionUtils.isEmpty(taskIds)) {
+            return 0;
+        }
+
+        questionFlowMapper.deleteBySrc(srcType.getValue(), taskIds);
+
+        LambdaQueryWrapper<Question> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Question::getSrcType, srcType.getValue())
+                .in(Question::getSrcTaskId, taskIds);
+
+        return baseMapper.delete(wrapper);
+    }
+
+    /**
      * 确认
      *
      * @return
@@ -418,7 +395,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         }
 
         if (ownPermission.contains(dissentButton)) {
-            wrapper.or(w -> w.eq(Question::getSubmitorId, SecurityUtils.getUserId()).eq(Question::getConfirmStatus, QuestionConfirmEnum.Dissent.getValue()));
+            wrapper.or(w -> w.eq(Question::getSubmitorId, SecurityUtils.getUserId())
+                    .eq(Question::getConfirmStatus, QuestionConfirmEnum.Dissent.getValue()));
         }
 
         return wrapper;

+ 8 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/dto/resumptionRecord/ResumptionRecordPageDto.java

@@ -4,6 +4,7 @@ import com.xunmei.common.core.web.domain.PageDto;
 import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.apache.http.annotation.Obsolete;
 
 import javax.validation.constraints.NotNull;
 import java.util.Date;
@@ -35,9 +36,16 @@ public class ResumptionRecordPageDto extends PageDto<ResumptionRecordPageVo> {
     @ApiModelProperty(value = "机构id")
     private Long orgId;
 
+    /**
+     * 需求变更,暂无此条件
+     */
     @ApiModelProperty(value = "计划id")
+    @Obsolete
     private Long planId;
 
+    @ApiModelProperty(value = "任务名称")
+    private String taskName;
+
     private List<Long> orgIdList;
 
     private String  orgPath;

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

@@ -28,6 +28,8 @@ import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.utils.IDHelper;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.question.QuestionSrcType;
+import com.xunmei.core.question.service.IQuestionService;
 import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
 import com.xunmei.core.resumption.domain.*;
 import com.xunmei.core.resumption.dto.DistributeDto;
@@ -103,6 +105,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     @Autowired
     ICoreRegisterBookPdfService coreRegisterBookPdfService;
 
+    @Autowired
+    IQuestionService questionService;
+
     @Override
     public List<Long> selectItemIdsByPlanId(Long id) {
         return appPlanToItemMapper.selectItemIdsByPlanId(id);
@@ -120,24 +125,33 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         Page<ResumptionPlanPageVo> result = info.getPageDto();
         result = baseMapper.selectPage(result, info);
         for (ResumptionPlanPageVo record : result.getRecords()) {
-            if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DRAFT.getCode())) {
-                record.setHasTaskCurrentCycle(false);
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.USING.getCode())) {
-                record.setHasTaskCurrentCycle(!new Date().before(record.getEffectiveTime()));
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DELETED.getCode())) {
-                if (ObjectUtil.isNull(record.getEffectiveTime()) || ObjectUtil.isNull(record.getWithdrawTime())) {
-                    record.setHasTaskCurrentCycle(false);
-                } else {
-                    boolean b = !new Date().before(record.getEffectiveTime());
-                    DateRange dr = DateUtils.getStartAndEnd(new Date(), record.getPlanCycle());
-                    b &= (!record.getWithdrawTime().before(dr.getStartTime()));
-                    record.setHasTaskCurrentCycle(b);
-                }
-            }
+            Boolean b = getHasTaskCurrentCycle(record.getPlanStatus(), record.getPlanCycle(), record.getEffectiveTime(), record.getWithdrawTime());
+            record.setHasTaskCurrentCycle(b);
         }
         return result;
     }
 
+    private Boolean getHasTaskCurrentCycle(Integer planStatus, Integer planCycle, Date effectiveTime, Date withDrawTime) {
+        if (ObjectUtil.equal(planStatus, PlanStatus.DRAFT.getCode())) {
+            return false;
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.USING.getCode())) {
+            return !new Date().before(effectiveTime);
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.DELETED.getCode())) {
+            return true;
+            //匆删,按需求撤回状态的要提示。
+//            if (ObjectUtil.isNull(effectiveTime) || ObjectUtil.isNull(withDrawTime)) {
+//                return false;
+//            } else {
+//                boolean b = !new Date().before(effectiveTime);
+//                DateRange dr = DateUtils.getStartAndEnd(new Date(), planCycle);
+//                b &= (!withDrawTime.before(dr.getStartTime()));
+//                return b;
+//            }
+        } else {
+            return false;
+        }
+    }
+
     @Override
     public List<Long> findExecOrgByPlan(Long plan_id) {
         return baseMapper.findExecOrgByPlan(plan_id);
@@ -414,6 +428,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         for (Long completedId : completedIds) {
             coreRegisterBookPdfService.deleteWithFile(completedId);
         }
+        questionService.delete(QuestionSrcType.Resumption, completedIds);
     }
 
     /**
@@ -558,7 +573,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
                     child = baseMapper.selectById(newChildPlanId);
                 }
-                if (needRebuildOnEdit(child)) {
+                if (needRebuildOnEdit(existPlan)) {
                     needRebuildPlans.add(child);
                 }
 
@@ -698,8 +713,6 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
                 appPlanToExecOrgMapper.insert(execOrg);
             }
-            //更新任务的名称
-            resumptionMapper.updateNameByPlanId(existPlan.getPlanName(), app.getPlanName(), app.getId());
 
             //最后处理本计划
             plan.setUpdateTime(new Date());
@@ -711,7 +724,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             plan.setPlanCreateOrgName(null);
             baseMapper.updateById(plan);
 
-            if (needRebuildOnEdit(plan)) {
+            if (needRebuildOnEdit(existPlan)) {
                 needRebuildPlans.add(baseMapper.selectById(plan.getId()));
             }
             resumptionTaskBusiness.rebuildCurrentCycleTask(needRebuildPlans);
@@ -766,8 +779,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
      * @return
      */
     private Boolean needRebuildOnEdit(AppPlan plan) {
-        if (ObjectUtil.equal(plan.getPlanStatus(), PlanStatus.USING.getCode()) && ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode())
-                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getPlanStatus(), 0))
+        if (ObjectUtil.equal(plan.getPlanStatus(), PlanStatus.USING.getCode())
+                && ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode())
+                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getTaskHasCompleted(), 0))
                 && !new Date().before(plan.getEffectiveTime())) {
             return true;
         }
@@ -849,6 +863,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     @Transactional(rollbackFor = Exception.class)
     public void deleted(Long id) throws Exception {
         AppPlan plan = baseMapper.selectById(id);
+        if (ObjectUtil.isNull(plan)) {
+            throw new ServiceException("任务不存在");
+        }
         List<AppPlan> plans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>()
                 .eq(AppPlan::getId, id).or().eq(AppPlan::getParentId, id)
                 .select(AppPlan::getId, AppPlan::getSolidId));
@@ -909,6 +926,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         plan.setPlanOfOrgId(app.getPlanOfOrgId());
         plan.setPlanOfOrgType(app.getPlanOfOrgType());
         plan.setTaskHasCompleted(app.getTaskHasCompleted());
+        plan.setHasTaskCurrentCycle(getHasTaskCurrentCycle(app.getPlanStatus(), app.getPlanCycle(), app.getEffectiveTime(), app.getWithdrawTime()));
         return plan;
     }
 

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/appPlan/AppPlanVo.java

@@ -104,6 +104,9 @@ public class AppPlanVo extends PageDto<AppPlan> {
      */
     private Integer notResumptionOnRest;
 
+    @ApiModelProperty("查询时间所在的周期是否有任务")
+    private Boolean hasTaskCurrentCycle;
+
     /**
      * 要点列表
      */

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

@@ -27,6 +27,8 @@ import com.xunmei.common.core.exception.SystemException;
 import com.xunmei.common.core.utils.DateHelper;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
+import com.xunmei.core.question.QuestionSrcType;
+import com.xunmei.core.question.service.IQuestionService;
 import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
 import com.xunmei.core.resumption.domain.AppPlan;
 import com.xunmei.core.resumption.domain.Resumption;
@@ -98,6 +100,9 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
     ICoreRegisterBookPdfService coreRegisterBookPdfService;
 
     @Autowired
+    IQuestionService questionService;
+
+    @Autowired
     private CoreSafecheckPlanToCheckOrgTypeMapper coreSafecheckPlanToCheckOrgTypeMapper;
 
     @Override
@@ -115,42 +120,33 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         //获取数据
         page = coreSafecheckPlanMapper.selectCoreSafecheckPlanPage(page, coreSafecheckPlan);
         for (CoreSafecheckPlan record : page.getRecords()) {
-            if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DRAFT.getCode())) {
-                record.setHasTaskCurrentCycle(false);
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.USING.getCode())) {
-                record.setHasTaskCurrentCycle(!new Date().before(record.getEffectiveTime()));
-            } else if (ObjectUtil.equal(record.getPlanStatus(), PlanStatus.DELETED.getCode())) {
-                if (ObjectUtil.isNull(record.getEffectiveTime()) || ObjectUtil.isNull(record.getWithdrawTime())) {
-                    record.setHasTaskCurrentCycle(false);
-                } else {
-                    boolean b = !new Date().before(record.getEffectiveTime());
-                    DateRange dr = DateUtils.getStartAndEnd(new Date(), record.getPlanCycle());
-                    b &= (!record.getWithdrawTime().before(dr.getStartTime()));
-                    record.setHasTaskCurrentCycle(b);
-                }
-            }
+            Boolean b = getHasTaskCurrentCycle(record.getPlanStatus(), record.getPlanCycle(), record.getEffectiveTime(), record.getWithdrawTime());
+            record.setHasTaskCurrentCycle(b);
         }
 
-//        coreSafecheckPlan.setParentIds(page.getRecords().stream().map(CoreSafecheckPlan::getId).collect(Collectors.toList()));
-//        List<CoreSafecheckPlan> allChildren = new ArrayList<>();
-//        if (CollectionUtil.isNotEmpty(coreSafecheckPlan.getParentIds())) {
-//            allChildren = baseMapper.selectChildren(coreSafecheckPlan);
-//        }
-//        Long order = ((coreSafecheckPlan.getPageNum() - 1) * coreSafecheckPlan.getPageSize()) + 1;
-//        for (CoreSafecheckPlan r : page.getRecords()) {
-//            r.setIndex(order++);
-//            Long childOrder = 1L;
-//            List<CoreSafecheckPlan> children = allChildren.stream().filter(c -> ObjectUtil.equal(c.getParentId(), r.getId())).collect(Collectors.toList());
-//            for (CoreSafecheckPlan child : children) {
-//
-//                child.setIndex(childOrder++);
-//            }
-//            r.setChildren(children);
-//        }
         //抓换为TableDataInfo适配前端
         return TableDataInfo.build(page);
+    }
 
-
+    private Boolean getHasTaskCurrentCycle(Integer planStatus, Integer planCycle, Date effectiveTime, Date withDrawTime) {
+        if (ObjectUtil.equal(planStatus, PlanStatus.DRAFT.getCode())) {
+            return false;
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.USING.getCode())) {
+            return !new Date().before(effectiveTime);
+        } else if (ObjectUtil.equal(planStatus, PlanStatus.DELETED.getCode())) {
+            return true;
+            //匆删,按需求撤回状态的要提示。
+//            if (ObjectUtil.isNull(effectiveTime) || ObjectUtil.isNull(withDrawTime)) {
+//                return false;
+//            } else {
+//                boolean b = !new Date().before(effectiveTime);
+//                DateRange dr = DateUtils.getStartAndEnd(new Date(), planCycle);
+//                b &= (!withDrawTime.before(dr.getStartTime()));
+//                return b;
+//            }
+        } else {
+            return false;
+        }
     }
 
     @Override
@@ -472,6 +468,8 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         for (Long completedId : completedIds) {
             coreRegisterBookPdfService.deleteWithFile(completedId);
         }
+
+        questionService.delete(QuestionSrcType.SafetyCheck,completedIds);
     }
 
     /**
@@ -503,6 +501,9 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         CoreSafecheckPlan plan = coreSafecheckPlanMapper.selectOne(new LambdaQueryWrapper<CoreSafecheckPlan>().eq(CoreSafecheckPlan::getId, coreSafecheckPlan.getParentId()).eq(CoreSafecheckPlan::getIsDeleted, 0));
         //如果没获取到父计划则默认最低为1
         coreSafecheckPlan.setParentCount(Math.toIntExact(plan == null ? 1 : plan.getCount()));
+        Boolean b = getHasTaskCurrentCycle(coreSafecheckPlan.getPlanStatus(), coreSafecheckPlan.getPlanCycle(),
+                coreSafecheckPlan.getEffectiveTime(), coreSafecheckPlan.getWithdrawTime());
+        coreSafecheckPlan.setHasTaskCurrentCycle(b);
         return coreSafecheckPlan;
     }
 
@@ -807,7 +808,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
     private Boolean needRebuildOnEdit(CoreSafecheckPlan plan, Integer planStatus) {
         if (ObjectUtil.equal(planStatus, PlanStatus.USING.getCode())
                 && (ObjectUtil.equal(plan.getPlanOfOrgType(), OrgTypeEnum.HANG_SHE.getCode()) || ObjectUtil.equal(plan.getExecOrgType(), OrgTypeEnum.BAN_SHI_CHU.getCode()) || ObjectUtil.equal(plan.getExecOrgType(), OrgTypeEnum.SHEGN_LIAN_SHE.getCode()))
-                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getPlanStatus(), 0))
+                && (ObjectUtil.isNull(plan.getTaskHasCompleted()) || ObjectUtil.equal(plan.getTaskHasCompleted(), 0))
                 && !new Date().before(plan.getEffectiveTime())) {
             return true;
         }

+ 6 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml

@@ -130,7 +130,7 @@
         SELECT
             e.device_name AS hostName,
             d.device_name AS videoChannelName,
-            c.project AS project,
+            f.dict_label AS project,
             IF
                 ( c.situation = 0, '正常', '异常' ) AS situation,
             c.abnormal_illustrate AS abnormalIllustrate
@@ -140,8 +140,11 @@
                 LEFT JOIN core_monitoring_task_monitor_info c ON c.task_monitor_id = b.id
                 LEFT JOIN sys_device d ON b.video_channel = d.id
                 LEFT JOIN sys_device e ON e.id = d.host_id
+                LEFT JOIN sys_dict_data f ON f.dict_value = c.project
+                AND f.dict_type = 'core_registration_project'
         WHERE
             c.project IS NOT NULL
+          AND c.situation = 1
           AND a.task_id = #{taskId}
     </select>
     <select id="selectTask" resultType="com.xunmei.core.access.vo.AccessPdfVO">
@@ -152,7 +155,8 @@
             cycle AS cycle,
             plan_start_time AS startTime,
             plan_end_time AS endTime,
-            b.task_start_time AS taskStartTime
+            b.task_start_time AS taskStartTime,
+            b.create_by AS checkUser
         FROM
             core_monitoring_retrieval_task a
                 LEFT JOIN core_monitoring_task_registration b ON a.id = b.task_id

+ 8 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/question/QuestionFlowMapper.xml

@@ -122,4 +122,12 @@
             #{id}
         </foreach>
     </delete>
+
+    <delete id="deleteBySrc">
+        delete  from core_question_flow where  question_id in (
+            select  id from core_question where src_type=#{srcType} and src_task_id in
+        <foreach collection="taskIds" item="taskId" close=")" open="(" separator=",">
+            #{taskId}
+        </foreach> )
+    </delete>
 </mapper>

+ 33 - 12
soc-modules/soc-modules-core/src/main/resources/mapper/question/QuestionMapper.xml

@@ -293,22 +293,43 @@
                 and q.confirm_status=#{params.confirmStatus}
             </if>
         </if>
-        <if test="params.reformDate!=null">
-            and q.submit_time &lt;=#{params.submitRange[0]}
-            and q.reform_deadline>=#{params.submitRange[1]}
-            <if test="params.searchKey!=null">
-                and q.question_desc like concat('%',#{params.searchKey},'%')
-            </if>
+        <if test="params.submitRange!=null and params.submitRange.length==2">
+            and q.submit_time between #{params.submitRange[0]} and #{params.submitRange[1]}
         </if>
-        <if test="params.reformDate==null">
-            <if test="params.submitRange!=null and params.submitRange.length==2">
-                and q.submit_time between #{params.submitRange[0]} and #{params.submitRange[1]}
+        <if test="params.searchKey!=null">
+            and (q.question_desc like concat('%',#{params.searchKey},'%') or q.check_content like
+            concat('%',#{params.searchKey},'%'))
+        </if>
+        order by q.submit_time desc,q.id desc
+    </select>
+    <select id="pageApp" resultType="com.xunmei.core.question.domain.Question">
+        select * from core_question q
+        inner join sys_org o on q.org_id =o.id
+        where 1=1
+        <if test="params.checkSub==true">
+            and o.path like concat((select path from sys_org where id=#{params.orgId}),"%")
+        </if>
+        <if test="params.checkSub!=true">
+            and q.org_id=#{params.orgId}
+        </if>
+        <if test="params.status!=null">
+            <if test="params.status==12">
+                and (q.confirm_status!=3) and q.reform_deadline &lt; #{today}
+            </if>
+            <if test="params.status>=10 and params.status &lt;12">
+                and q.reform_status=#{params.status}
             </if>
-            <if test="params.searchKey!=null">
-                and (q.question_desc like concat('%',#{params.searchKey},'%') or q.check_content like
-                concat('%',#{params.searchKey},'%'))
+            <if test="params.status &lt; 10">
+                and q.confirm_status=#{params.status}
             </if>
         </if>
+        <if test="params.reformDate!=null">
+            and q.reform_deadline>= #{params.reformDate} and q.submit_time&lt;=#{params.reformDateEnd}
+        </if>
+        <if test="params.searchKey!=null">
+            and (q.question_desc like concat('%',#{params.searchKey},'%') or q.check_content like
+            concat('%',#{params.searchKey},'%'))
+        </if>
         order by q.submit_time desc,q.id desc
     </select>
     <select id="pageReform" resultType="com.xunmei.core.question.domain.Question">

+ 51 - 47
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml

@@ -130,16 +130,16 @@
                     #{item}
                 </foreach>
                 and ((
-                #{hashMap.startDate}  &lt;= r.plan_start_time
+                #{hashMap.startDate} &lt;= r.plan_start_time
                 and #{hashMap.endDate} >= r.plan_start_time
                 )
                 or (
-                #{hashMap.startDate}   &lt;= r.plan_end_time
+                #{hashMap.startDate} &lt;= r.plan_end_time
                 and #{hashMap.endDate} >= r.plan_end_time
                 )
                 or (
                 #{hashMap.startDate} >= r.plan_start_time
-                and #{hashMap.endDate} &lt;=  r.plan_end_time
+                and #{hashMap.endDate} &lt;= r.plan_end_time
                 ))
             </if>
             <if test="pageDto.status !=null ">
@@ -154,16 +154,18 @@
                     #{orgId}
                 </foreach>
             </if>
+            <if test="pageDto.taskName!=null and pageDto.taskName.length()>0">
+                and r.name like concat('%',#{pageDto.taskName},'%')
+            </if>
             <if test="pageDto.executeRole !=null ">
                 and r.plan_id in (select plan_id from core_resumption_plan_to_role where role_id=#{pageDto.executeRole})
             </if>
-            <if test="pageDto.planId !=null ">
-                and r.parent_plan_id = #{pageDto.planId}
-            </if>
+            <!--            <if test="pageDto.planId !=null ">-->
+            <!--                and r.parent_plan_id = #{pageDto.planId}-->
+            <!--            </if>-->
             <!--            <if test="pageDto.checkSub == true">-->
             <!--                and o.path like concat(#{pageDto.orgPath},'%')-->
             <!--            </if>-->
-
         </where>
         order by r.plan_start_time desc, r.name desc ,r.id desc
     </select>
@@ -207,16 +209,16 @@
                        where pti.plan_id in (select plan_id from core_resumption where id = #{resumptionId}))
     </select>
 
-<!--    <select id="selectResumptionRole" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
-<!--        select distinct tr.id as id, tr.name as name-->
-<!--        from core_resumption r-->
-<!--        inner join sys_role tr on r.role_id = tr.id-->
-<!--        inner join sys_org o on r.org_id = o.id and o.deleted=0-->
-<!--        where o.path like concat(#{roleDto.orgPath},'%')-->
-<!--        <if test="roleDto.type != null">-->
-<!--            and r.type = #{roleDto.type}-->
-<!--        </if>-->
-<!--    </select>-->
+    <!--    <select id="selectResumptionRole" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
+    <!--        select distinct tr.id as id, tr.name as name-->
+    <!--        from core_resumption r-->
+    <!--        inner join sys_role tr on r.role_id = tr.id-->
+    <!--        inner join sys_org o on r.org_id = o.id and o.deleted=0-->
+    <!--        where o.path like concat(#{roleDto.orgPath},'%')-->
+    <!--        <if test="roleDto.type != null">-->
+    <!--            and r.type = #{roleDto.type}-->
+    <!--        </if>-->
+    <!--    </select>-->
 
     <select id="selectNFCRecord" resultType="com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo">
         select distinct a.name as areaName,
@@ -265,24 +267,24 @@
     <!--    </select>-->
 
     <select id="selectDataInfo" resultType="com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo">
-        SELECT p.name  AS pointName,
-               case a.`name` when null then '其它' else a.`name` end      AS areaName,
-               ch.check_name as check_name,
-               d.res_value   AS executeResult,
-               d.submit_time AS executeTime,
-               d.res_remark  AS resRemark,
-               d.res_status  AS executeStatus,
-               d.id          AS dataId,
+        SELECT p.name                                              AS pointName,
+               case a.`name` when null then '其它' else a.`name` end AS areaName,
+               ch.check_name                                       as check_name,
+               d.res_value                                         AS executeResult,
+               d.submit_time                                       AS executeTime,
+               d.res_remark                                        AS resRemark,
+               d.res_status                                        AS executeStatus,
+               d.id                                                AS dataId,
                d.item_id,
                d.res_value,
                d.submit_name
         FROM core_resumption_data d
                  INNER JOIN core_resumption_rule_point p ON d.item_id = p.id
                  LEFT JOIN sys_area a ON a.id = d.area_id
-                 LEFT JOIN sys_area_check ch on ch.id=d.check_id
+                 LEFT JOIN sys_area_check ch on ch.id = d.check_id
         WHERE d.resumption_id = #{resumptionId}
           and p.item_id = #{ruleItemId}
-            order by d.item_id
+        order by d.item_id
     </select>
 
     <select id="selectRuleItemIdList" resultType="java.lang.Long">
@@ -306,24 +308,24 @@
         where id = #{ruleItemId}
     </select>
 
-<!--    <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
-<!--        select distinct p.id as id, p.plan_name as name, p.plan_status as status-->
-<!--        from core_resumption_plan p INNER JOIN core_resumption r on r.plan_id = p.id and p.plan_type = 0-->
-<!--        inner join core_resumption_plan_to_role pr on p.id = pr.plan_id-->
-<!--        INNER JOIN sys_org o on o.id=r.org_id-->
-<!--        where o.path like concat(#{planDto.orgPath},'%')-->
-<!--        <choose>-->
-<!--            <when test="planDto.type != null and planDto.type ==0">-->
-<!--                and r.type in (0,6)-->
-<!--            </when>-->
-<!--            <otherwise>-->
-<!--                and r.type = #{planDto.type}-->
-<!--            </otherwise>-->
-<!--        </choose>-->
-<!--        <if test="planDto.roleId != null">-->
-<!--            and pr.role_id = #{planDto.roleId}-->
-<!--        </if>-->
-<!--    </select>-->
+    <!--    <select id="selectResumptionPlan" resultType="com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRoleVo">-->
+    <!--        select distinct p.id as id, p.plan_name as name, p.plan_status as status-->
+    <!--        from core_resumption_plan p INNER JOIN core_resumption r on r.plan_id = p.id and p.plan_type = 0-->
+    <!--        inner join core_resumption_plan_to_role pr on p.id = pr.plan_id-->
+    <!--        INNER JOIN sys_org o on o.id=r.org_id-->
+    <!--        where o.path like concat(#{planDto.orgPath},'%')-->
+    <!--        <choose>-->
+    <!--            <when test="planDto.type != null and planDto.type ==0">-->
+    <!--                and r.type in (0,6)-->
+    <!--            </when>-->
+    <!--            <otherwise>-->
+    <!--                and r.type = #{planDto.type}-->
+    <!--            </otherwise>-->
+    <!--        </choose>-->
+    <!--        <if test="planDto.roleId != null">-->
+    <!--            and pr.role_id = #{planDto.roleId}-->
+    <!--        </if>-->
+    <!--    </select>-->
 
     <!--    <select id="selectData" resultType="com.xunmei.core.resumption.vo.registerBook.RegisterBookItemInfoVo">-->
     <!--        select distinct o.name as orgName, r.start_time as date, #{id} as resumptionId-->
@@ -385,7 +387,8 @@
                 #{id}
             </foreach>
             or p.plan_create_org_id in (select id from sys_org
-            where type in ('1','2','3','4','11') and deleted=0 and path like concat((select path from sys_org where id=#{query.orgId}),'%'))
+            where type in ('1','2','3','4','11') and deleted=0 and path like concat((select path from sys_org where
+            id=#{query.orgId}),'%'))
             )
         </if>
     </select>
@@ -405,7 +408,8 @@
                 #{id}
             </foreach>
             or plan_create_org_id in (select id from sys_org
-            where type in ('1','2','3') and deleted=0 and path like concat((select path from sys_org where id=#{query.orgId}),'%'))
+            where type in ('1','2','3') and deleted=0 and path like concat((select path from sys_org where
+            id=#{query.orgId}),'%'))
             )
         </if>
     </select>

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

@@ -241,7 +241,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         final BaseFont fs = pdfTableVo.getFs();
         final Font tableFont = pdfTableVo.getTableFont();
 
-        writer.setPageEvent(new PdfPageHelperEvent(ListUtil.split((List<String>) data.get("fileImage"), 6).size() + 1, writer, fs,tableFont));
+        writer.setPageEvent(new PdfPageHelperEvent(ListUtil.split((List<String>) data.get("fileImage"), 6).size() + 1, writer, fs, tableFont));
         document.open();
         PdfUtil.dealHeader(document, fs, "学 习 教 育 记 录", 24);
         PdfUtil.dealEduBody(document, table, tableFont, data);
@@ -254,11 +254,6 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         return this.prefix + pathVo.getRelativePath();
     }
 
-    private Integer getEduTotalPageSize(Map<String, Object> data) {
-        final List<String> list = (List<String>) data.get("signImage");
-        Integer size = list.size() > 12 ? 2 : 1;
-        return ListUtil.split((List<String>) data.get("fileImage"), 2).size() + 1;
-    }
 
     @Override
     public String generateResumptionPdf(Map<String, Object> data) throws Exception {
@@ -344,30 +339,67 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         final BaseFont fs = pdfTableVo.getFs();
         final Font tableFont = pdfTableVo.getTableFont();
         Font font = new Font(fs, 9, Font.NORMAL);
-        PdfUtil.dealHeader(document, fs, data.getOrgName()+data.getPlanCycle()+"("+data.getStartTime()+"~"+data.getEndTime()+")", 14);
-        String checkTime =  data.getTaskStartTime();
-        String checkUser = "检查人: " + data.getCheckUser();
-   /*     PdfPCell orgCell = new PdfPCell(new Phrase(orgName, font));
-        orgCell.setColspan(16);
+        PdfUtil.dealHeader(document, fs, "监控点阅情况登记簿", 14);
+        String checkTime = data.getTaskStartTime();
+        String checkUser = data.getCheckUser();
+
+        PdfPCell orgCell = new PdfPCell(new Phrase("调阅单位", font));
+        orgCell.setColspan(8);
         orgCell.setRowspan(1);
         orgCell.setBorder(Rectangle.NO_BORDER);
-        orgCell.setHorizontalAlignment(Element.ALIGN_LEFT);*/
-
-        PdfPCell checkUserCell = new PdfPCell(new Phrase(checkUser, font));
-        checkUserCell.setColspan(20);
-        checkUserCell.setRowspan(1);
-        checkUserCell.setBorder(Rectangle.NO_BORDER);
-        checkUserCell.setHorizontalAlignment(Element.ALIGN_CENTER);
-
-        PdfPCell dateStrCell = new PdfPCell(new Phrase(checkTime, font));
-        dateStrCell.setColspan(10);
-        dateStrCell.setRowspan(1);
-        dateStrCell.setBorder(Rectangle.NO_BORDER);
-        dateStrCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
-      //  table.addCell(orgCell);
-        table.addCell(checkUserCell);
-        table.addCell(dateStrCell);
+        orgCell.setHorizontalAlignment(Element.ALIGN_CENTER);
+
+        PdfPCell orgNameCell = new PdfPCell(new Phrase(data.getOrgName(), font));
+        orgNameCell.setColspan(15);
+        orgNameCell.setRowspan(1);
+        orgNameCell.setBorder(Rectangle.NO_BORDER);
+        orgNameCell.setHorizontalAlignment(Element.ALIGN_CENTER);
+
+        PdfPCell userCell = new PdfPCell(new Phrase("调阅人", font));
+        userCell.setColspan(8);
+        userCell.setRowspan(1);
+        userCell.setBorder(Rectangle.NO_BORDER);
+        userCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+
+        PdfPCell userNameCell = new PdfPCell(new Phrase(checkUser, font));
+        userNameCell.setColspan(15);
+        userNameCell.setRowspan(1);
+        userNameCell.setBorder(Rectangle.NO_BORDER);
+        userNameCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+
+        PdfPCell timeNameCell = new PdfPCell(new Phrase("调阅时间", font));
+        timeNameCell.setColspan(9);
+        timeNameCell.setRowspan(1);
+        timeNameCell.setBorder(Rectangle.NO_BORDER);
+        timeNameCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+
+        PdfPCell timeCell = new PdfPCell(new Phrase(checkTime, font));
+        timeCell.setColspan(37);
+        timeCell.setRowspan(1);
+        timeCell.setBorder(Rectangle.NO_BORDER);
+        timeCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
+
+      /*  PdfPCell findCell = new PdfPCell(new Phrase("发现问题情况", font));
+        findCell.setColspan(46);
+        findCell.setRowspan(1);
+        findCell.setBorder(Rectangle.NO_BORDER);
+        findCell.setHorizontalAlignment(Element.ALIGN_RIGHT);*/
+
+/*        table.addCell(orgCell);
+        table.addCell(orgNameCell);
+        table.addCell(userCell);
+        table.addCell(userNameCell);
+        table.addCell(timeNameCell);
+        table.addCell(timeCell);*/
+        //    table.addCell(findCell);
         Font titleFont = new Font(fs, 8, Font.NORMAL);
+        PdfUtil.createPDFCell(titleFont, table, "调阅单位", Element.ALIGN_MIDDLE, 8, 0);
+        PdfUtil.createPDFCell(titleFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 15, 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, 9, 0);
+        PdfUtil.createPDFCell(titleFont, table, checkTime, Element.ALIGN_MIDDLE, 37, 0);
+        PdfUtil.createPDFCell(titleFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 46, 0);
         PdfUtil.dealAccessPBody(document, table, tableFont, titleFont, data.getDataVos());
         document.close();
         writer.close();
@@ -388,6 +420,9 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         final PdfPTable table = pdfTableVo.getTable();
         final BaseFont fs = pdfTableVo.getFs();
         final Font tableFont = pdfTableVo.getTableFont();
+
+        writer.setPageEvent(new PdfPageHelperEvent(ListUtil.split((List<String>) data.get("fileImage"), 6).size() + 1, writer, fs, tableFont));
+        document.open();
         PdfUtil.dealHeader(document, fs, "预 案 演 练 记 录", 24);
         PdfUtil.dealDrillBody(document, table, tableFont, data);
         document.close();

+ 31 - 11
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfPageHelperEvent.java

@@ -1,16 +1,11 @@
 package com.xunmei.file.utils;
 
 import com.lowagie.text.*;
-import com.lowagie.text.pdf.BaseFont;
-import com.lowagie.text.pdf.PdfContentByte;
-import com.lowagie.text.pdf.PdfPageEvent;
-import com.lowagie.text.pdf.PdfWriter;
+import com.lowagie.text.pdf.*;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.io.IOException;
-
 /**
  * @author jingyuanchao
  * @date 2023/12/18 20:18
@@ -25,6 +20,8 @@ public class PdfPageHelperEvent implements PdfPageEvent {
     private PdfWriter writer;
 
     private BaseFont fs;
+
+
     private Font tableFont;
 
     @Override
@@ -43,20 +40,43 @@ public class PdfPageHelperEvent implements PdfPageEvent {
 
     @Override
     public void onEndPage(PdfWriter pdfWriter, Document document) {
-        PdfContentByte cb = writer.getDirectContent();// 得到层
+       /* PdfContentByte cb = writer.getDirectContent();// 得到层
         cb.saveState(); // 开始
         cb.beginText();
         cb.setFontAndSize(fs, 10); // Header
-   /*             float x = document.top(-20);// 位置 // 左
+   *//*             float x = document.top(-20);// 位置 // 左
                 cb.showTextAligned(PdfContentByte.ALIGN_LEFT, "H-Left", document.left(), x, 0); // 中
                 cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "第" + writer.getCurrentPageNumber() + "页", (document.right() + document.left()) / 2, x, 0); // 右
-                cb.showTextAligned(PdfContentByte.ALIGN_RIGHT, "H-Right", document.right(), x, 0); */
-        float y = document.bottom(10); // 左
+                cb.showTextAligned(PdfContentByte.ALIGN_RIGHT, "H-Right", document.right(), x, 0); *//*
+        float y = document.bottom(-80); // 左
         cb.showTextAligned(PdfContentByte.ALIGN_LEFT, "", document.left(), y, 0); // 中
         cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "第" + writer.getCurrentPageNumber() + "页/共" + totalPageSize + "页", (document.right() + document.left()) / 2, y, 0); // 右
         cb.showTextAligned(PdfContentByte.ALIGN_RIGHT, "", document.right(), y, 0);
         cb.endText();
-        cb.restoreState();
+        cb.restoreState();*/
+
+        try {
+            // PDF文档内容
+            PdfContentByte pdfContent = writer.getDirectContent();
+            pdfContent.saveState();
+            pdfContent.beginText();
+            int footerFontSize = 10;
+            Font fontDetail = new Font(fs, footerFontSize, Font.NORMAL);
+            pdfContent.setFontAndSize(fs, footerFontSize);
+            // 页脚的页码 展示
+            String footerNum = String.format("第%d页,共" + totalPageSize + "页", writer.getPageNumber());
+            Phrase phrase = new Phrase(footerNum, fontDetail);
+            // 页码的 横轴 坐标 居中
+            float x = (document.left() + document.right()) / 2 + 10;
+            // 页码的 纵轴 坐标
+            float y = document.bottom(-20);
+            // 添加文本内容,进行展示页码
+            ColumnText.showTextAligned(pdfContent, Element.ALIGN_CENTER, phrase, x, y, 0);
+            pdfContent.endText();
+            pdfContent.restoreState();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
     }
 

+ 93 - 111
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -7,29 +7,30 @@ import cn.hutool.extra.spring.SpringUtil;
 import com.lowagie.text.*;
 import com.lowagie.text.pdf.*;
 import com.xunmei.file.vo.ItextPdfTableVo;
-import com.xunmei.file.vo.PdfFilePathVo;
 import com.xunmei.system.api.domain.AccessDataVo;
 import com.xunmei.system.api.domain.CheckDataVo;
-import com.xunmei.system.api.domain.ResumptionPdf;
-import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.text.StringEscapeUtils;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.ApplicationContext;
 import org.springframework.core.io.Resource;
 
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 
 @Slf4j
 public class PdfUtil {
 
 
     public static ItextPdfTableVo createTable(String filename, int numColumns, int fontSize) throws Exception {
-        Document document = new Document(PageSize.A4, 0, 0, 50, 0);//SUPPRESS
+        Document document = new Document(PageSize.A4, 0, 0, 50, 100);//SUPPRESS
         File file = FileUtils.getFile(filename);
         FileOutputStream fos = new FileOutputStream(file);
         String afterStr_1 = StringEscapeUtils.escapeEcmaScript(filename);
@@ -45,8 +46,8 @@ public class PdfUtil {
         // 设置各列列宽
         // table.setTotalWidth(new float[]{90, 100, 100, 120, 100, 100});
         table.setSpacingBefore(16f);
-        table.setSplitRows(false);
-        table.setSplitLate(true);
+        table.setSplitRows(true);
+        table.setSplitLate(false);
         ItextPdfTableVo itextPdfTableVo = new ItextPdfTableVo();
         itextPdfTableVo.setDocument(document);
         itextPdfTableVo.setWriter(writer);
@@ -331,104 +332,53 @@ public class PdfUtil {
     }
 
     public static void dealDrillBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
-        table.setSplitLate(false);
-        table.setSplitRows(true);
         //第一行
         createPDFCell(tableFont, table, "演练单位", Element.ALIGN_CENTER, 1, 1);
         createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_CENTER, 2, 1);
         createPDFCell(tableFont, table, "地点", Element.ALIGN_CENTER, 1, 1);
         createPDFCell(tableFont, table, data.get("drillSite").toString(), Element.ALIGN_CENTER, 2, 1);
         //第二行
-        createPDFCell(tableFont, table, "演练时间", Element.ALIGN_CENTER, 1, 1);
-        createPDFCell(tableFont, table, data.get("drillTime").toString(), Element.ALIGN_CENTER, 2, 1);
-        createPDFCell(tableFont, table, "演练项目", Element.ALIGN_CENTER, 1, 1);
-        createPDFCell(tableFont, table, data.get("typeText").toString(), Element.ALIGN_CENTER, 2, 1);
-        //第三行
         createPDFCell(tableFont, table, "指挥人", Element.ALIGN_CENTER, 1, 1);
         createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_CENTER, 2, 1);
         createPDFCell(tableFont, table, "记录人", Element.ALIGN_CENTER, 1, 1);
         createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_CENTER, 2, 1);
-
+        //第三行
+        createPDFCell(tableFont, table, "演练时间", Element.ALIGN_CENTER, 1, 1);
+        createPDFCell(tableFont, table, data.get("drillTime").toString(), Element.ALIGN_LEFT, 5, 1);
+        createPDFCell(tableFont, table, "演练项目", Element.ALIGN_CENTER, 1, 1);
+        createPDFCell(tableFont, table, data.get("typeText").toString(), Element.ALIGN_LEFT, 5, 1);
         //预设案由
-        PdfPCell contentCell = new PdfPCell();
-        contentCell.setColspan(6);
-        final Paragraph presetCase = new Paragraph(new Chunk(data.get("presetCase").toString(), tableFont));
-        presetCase.setSpacingAfter(8F);
-        contentCell.addElement(presetCase);
-        contentCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
-        table.addCell(contentCell);
-        dealDrillImageCell(data.get("drillSituation").toString(), tableFont, (List<String>) data.get("imageData"), table);
-        dealDrillImageCell("参会演练人员(签字):", tableFont, (List<String>) data.get("image"), table);
-       /* //演练情况
-        PdfPCell noteCell = new PdfPCell();
-        noteCell.setColspan(6);
-        Paragraph noteParagraph = new Paragraph(new Chunk(data.get("drillSituation").toString(), tableFont));
-        noteParagraph.setSpacingAfter(8F);
-        noteCell.addElement(noteParagraph);
-        noteCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
-        final List<String> imageDataList = (List<String>) data.get("imageData");
-        final int imageDataAddNums = imageDataList.size() % 3;
-        for (int i = 0; i < 3 - imageDataAddNums; i++) {
-            imageDataList.add("black.png");
-        }
-        PdfPTable imageDataInnerTable = new PdfPTable(3);
-        for (String str : imageDataList) {
-            Image imageData = convertFileToByteArray(new File(str));
-            if (imageData != null) {
-                imageData.scaleAbsolute(130, 130);
-            }
-            PdfPCell cell = new PdfPCell(imageData);
-            cell.setBorder(Rectangle.NO_BORDER);
-            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
-            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
-            imageDataInnerTable.addCell(cell);
-        }
-        noteCell.addElement(imageDataInnerTable);
-        table.addCell(noteCell);
-
-        //签字区域
-        PdfPCell signCell = new PdfPCell();
-        signCell.setColspan(6);
-        final Paragraph paragraph1 = new Paragraph(new Chunk("参会演练人员(签字):", tableFont));
-        paragraph1.setSpacingAfter(8F);
-        signCell.addElement(paragraph1);
-        signCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
-        final List<String> imageList = (List<String>) data.get("image");
-        final int imageAddNums = imageList.size() % 3;
-        for (int i = 0; i < 3 - imageAddNums; i++) {
-            imageList.add("black.png");
-        }
-        PdfPTable imageInnerTable = new PdfPTable(3);
-        for (String str : imageList) {
-            Image imageData = convertFileToByteArray(new File(str));
-            if (imageData != null) {
-                imageData.scaleAbsolute(130, 130);
-            }
-            PdfPCell cell = new PdfPCell(imageData);
-            cell.setBorder(Rectangle.NO_BORDER);
-            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
-            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
-            imageInnerTable.addCell(cell);
-        }
-        signCell.addElement(imageInnerTable);
-        table.addCell(signCell);*/
-
-
+        createPDFCell(tableFont, table, "预设案由", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("presetCase").toString(), Element.ALIGN_LEFT, 5, 1);
+        //演练情况
+        createPDFCell(tableFont, table, "演练情况", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("drillSituation").toString(), Element.ALIGN_LEFT, 5, 1);
         //点评总结
-        PdfPCell commentCell = new PdfPCell();
-        commentCell.setColspan(6);
-        commentCell.addElement(new Paragraph(new Chunk(data.get("comment").toString(), tableFont)));
-        table.addCell(commentCell);
+        createPDFCell(tableFont, table, "点评总结", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("comment").toString(), Element.ALIGN_LEFT, 5, 1);
+        //参会人员签字
+        createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_MIDDLE, 1, 1);
+        dealEduImageCell((List<String>) data.get("signImage"), table, 5, 30, 30);
         document.add(table);
+
+        //第二页
+        //按6份等分图片数组,一页只显示6张
+        final List<List<String>> listList = ListUtil.split((List<String>) data.get("fileImage"), 6);
+        for (List<String> stringList : listList) {
+            PdfPTable innerTable = new PdfPTable(6);
+            createPDFCell(tableFont, innerTable, "图片附件", Element.ALIGN_MIDDLE, 1, 1);
+            innerTable.setSpacingBefore(10f);
+            //一行展示一张图片
+            dealEduImageCell(new ArrayList<>(stringList), innerTable, 2, 150, 200);
+            document.newPage();
+             document.add(innerTable);
+         }
     }
 
-    public static void dealDrillImageCell(String chunk, Font tableFont, List<String> imageList, PdfPTable table) throws Exception {
+    public static void dealDrillImageCell( List<String> imageList, PdfPTable table) throws Exception {
         //签字区域
         PdfPCell outCell = new PdfPCell();
-        outCell.setColspan(6);
-        final Paragraph paragraph1 = new Paragraph(new Chunk(chunk, tableFont));
-        paragraph1.setSpacingAfter(8F);
-        outCell.addElement(paragraph1);
+        outCell.setColspan(5);
         outCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
         final int imageAddNums = imageList.size() % 3;
         if (imageAddNums != 0) {
@@ -465,8 +415,8 @@ public class PdfUtil {
             }
         }
         PdfPTable imageInnerTable = new PdfPTable(imageNumsOfRow);
-        imageInnerTable.setSplitRows(false);
-        imageInnerTable.setSplitLate(true);
+        imageInnerTable.setSplitRows(true);
+        imageInnerTable.setSplitLate(false);
         for (String image : imageList) {
             Image imageData = convertFileToByteArray(new File(image));
             if (imageData != null) {
@@ -484,8 +434,6 @@ public class PdfUtil {
             imageInnerTable.addCell(innerCell);
         }
         outCell.addElement(imageInnerTable);
-        table.setSplitRows(false);
-        table.setSplitLate(true);
         table.addCell(outCell);
     }
 
@@ -495,8 +443,8 @@ public class PdfUtil {
             images = new ArrayList<>();
         }
         PdfPTable innerTable = new PdfPTable(ImageNumsOfRow);
-        innerTable.setSplitRows(false);
-        innerTable.setSplitLate(true);
+        innerTable.setSplitRows(true);
+        innerTable.setSplitLate(false);
         //这里根据实际图片数量来判断是否需要补充白色图片,保证每行显示3张图片,用以填充空白
         final int reallySize = images.size();
         List<String> list = new ArrayList<>(images);
@@ -528,8 +476,8 @@ public class PdfUtil {
         PdfPTable outerTable = new PdfPTable(1);
         PdfPCell innerCell = new PdfPCell(innerTable);
         innerCell.setBorder(Rectangle.NO_BORDER);
-        outerTable.setSplitRows(false);
-        outerTable.setSplitLate(true);
+        outerTable.setSplitRows(true);
+        outerTable.setSplitLate(false);
         outerTable.addCell(innerCell);
         return outerTable;
     }
@@ -561,19 +509,19 @@ 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, 2, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "视频主机", Element.ALIGN_MIDDLE, 5, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "视频通道", Element.ALIGN_MIDDLE, 5, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "项目", Element.ALIGN_MIDDLE, 5, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "检查情况", Element.ALIGN_MIDDLE, 2, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "说明", Element.ALIGN_MIDDLE, 17, 0);
+
+        PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 3, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "硬盘录像机", Element.ALIGN_MIDDLE, 16, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "通道名称", Element.ALIGN_MIDDLE, 9, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "检查项目", Element.ALIGN_MIDDLE, 9, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "存在问题", Element.ALIGN_MIDDLE, 9, 0);
         for (int i = 1; i <= data.size(); i++) {
-            PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 0, 10);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 5, 0, 10);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 5, 0, 10);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getProject(), Element.ALIGN_MIDDLE, 5, 0, 10);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getSituation().equals("0") ? "正常" : "异常", Element.ALIGN_MIDDLE, 2, 0, 10);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 17, 0, 10);
+            PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 3, 0, 10);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 16, 0, 10);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 9, 0, 10);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getProject(), Element.ALIGN_MIDDLE, 9, 0, 10);
+         //   PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getSituation().equals("0") ? "正常" : "异常", Element.ALIGN_MIDDLE, 2, 0, 10);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 9, 0, 10);
      }
         document.add(table);
     }
@@ -584,7 +532,6 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableTitleFont, table, "检查情况", Element.ALIGN_MIDDLE, 5, 0);
         PdfUtil.createPDFCell(tableTitleFont, table, "存在的问题及整改意见", Element.ALIGN_MIDDLE, 15, 0);
         PdfUtil.createPDFCell(tableTitleFont, table, "整改期限", Element.ALIGN_MIDDLE, 2, 0);
-//        List<Object> dataList = (List<Object>) data.get("content");
         for (int i = 1; i <= data.size(); i++) {
             PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 0, 10);
             PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getItemName(), Element.ALIGN_MIDDLE, 5, 0, 10);
@@ -595,4 +542,39 @@ public class PdfUtil {
         }
         document.add(table);
     }
+
+    public static void addPageNum(String srcPdfPath, String tagetPdfPath) {
+        try {
+            // 输出文件 流
+            FileOutputStream fos = new FileOutputStream(tagetPdfPath);
+
+            // 读取 源PDF文件,进行一页一页复制,才能触发 添加页码的  页面监听事件
+            PdfReader reader = new PdfReader(srcPdfPath);
+            // 获取 源文件总页数
+            int num = reader.getNumberOfPages();
+
+            // 新建文档,默认A4大小
+            Document document = new Document(PageSize.A4);
+            PdfWriter writer = PdfWriter.getInstance(document, fos);
+            // 设置页面监听事件,必须在open方法前
+           // writer.setPageEvent(new PdfPageHelperEvent(num,writer,document,));
+            document.open();
+            // PDF内容体
+            PdfContentByte pdfContent = writer.getDirectContent();
+            //System.out.println("总页数:" + num);
+            // 页面数是从1开始的
+            for (int i = 1; i <= num; i++) {
+                document.newPage();
+                // 设置空页码进行展示
+                writer.setPageEmpty(false);
+                PdfImportedPage page = writer.getImportedPage(reader, i);
+                // 复制好的页面,添加到内容去,触发事件监听
+                pdfContent.addTemplate(page, 0, 42);
+            }
+            document.close();
+            reader.close();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
 }

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaCheckController.java

@@ -121,7 +121,7 @@ public class SysAreaCheckController extends BaseController {
     }
 
     @ApiOperation(value = "获取SysNfcBind通过机构id")
-    @RequiresPermissions("system:bind:query")
+
     @GetMapping(value = "/getAreaCheckInfoByOrg/{orgId}")
     public AjaxResult getAreaCheckInfoByOrg(@PathVariable(value = "orgId", required = false) Long orgId) {
         AjaxResult ajax = AjaxResult.success();

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysAreaController.java

@@ -63,7 +63,7 @@ public class SysAreaController extends BaseController {
      * 获取【请填写功能名称】详细信息
      */
     @ApiOperation(value = "根据机构获取区域")
-    @RequiresPermissions("system:area:query")
+
     @GetMapping("/getAreaByOrg/{orgId}")
     public AjaxResult getAreaByOrg(@PathVariable("orgId") Long orgId) {
  /*       SysOrg sysOrg = sysOrgMapper.selectSysOrgById(orgId);

+ 2 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysWorkTimeSetServiceImpl.java

@@ -131,6 +131,8 @@ public class SysWorkTimeSetServiceImpl extends ServiceImpl<SysWorkTimeSetMapper,
             sysWorkTimeSet.setOrgId(null);
             //添加in条件
             query.in("t.org_id", ids);
+        }else{
+            query.eq("t.org_id",sysWorkTimeSet.getOrgId());
         }
         if(sysWorkTimeSet.getOrgType()!=null){
             query.eq("o.type", sysWorkTimeSet.getOrgType());