瀏覽代碼

履职登记簿代码提交

jingyuanchao 1 年之前
父節點
當前提交
5d6f4004aa

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

@@ -19,6 +19,10 @@ public enum RegisterBookType {
     EDUCATION_TRAINING(1, "教育培训登记簿"),
     SAFETY_DRILL(2, "预案演练登记簿"),
     VISIT_RECORD(3, "来访管理登记簿"),
+    ALARM_TEST(4, "110报警测试登记簿"),
+    SELF_SERVICE_BANK(5, "备用电源维护登记簿"),
+    BACKUP_POWER(6, "离行式自助银行巡检登记簿"),
+    ON_DUTY_USER(7, "值班人员履职登记簿"),
     SAFE_CHECK_REPORT(26, "安全检查登记簿"),
     MONITOR_ACCESS(28,"监控调阅登记簿"),
 

+ 5 - 5
soc-common/soc-common-security/src/main/java/com/xunmei/common/security/utils/DictUtils.java

@@ -68,14 +68,14 @@ public class DictUtils {
         return CacheConstants.SYS_DICT_KEY + configKey;
     }
 
-    public static String getDictLabel(String status, Integer statusNum) {
-        if (ObjectUtil.hasEmpty(status, statusNum)) {
+    public static String getDictLabel(String dictCode, Integer dictValue) {
+        if (ObjectUtil.hasEmpty(dictCode, dictValue)) {
             return StringUtil.EMPTY_STRING;
         }
-        final List<SysDictData> statusTextList = DictUtils.getDictCache(status);
-        if (ObjectUtil.isNotEmpty(statusTextList) && ObjectUtil.isNotNull(statusNum)) {
+        final List<SysDictData> statusTextList = DictUtils.getDictCache(dictCode);
+        if (ObjectUtil.isNotEmpty(statusTextList) && ObjectUtil.isNotNull(dictValue)) {
             Optional<SysDictData> optional = statusTextList.stream()
-                    .filter(dict -> ObjectUtil.equal(String.valueOf(dict.getDictValue()), String.valueOf(statusNum)))
+                    .filter(dict -> ObjectUtil.equal(String.valueOf(dict.getDictValue()), String.valueOf(dictValue)))
                     .findFirst();
             if (optional.isPresent()) {
                 return optional.get().getDictLabel();

+ 23 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ApiPlanController.java

@@ -1,9 +1,12 @@
 package com.xunmei.core.resumption.controller;
 
+import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.constant.CacheConstants;
+import com.xunmei.common.core.constant.Constants;
 import com.xunmei.common.core.domain.DateRange;
 import com.xunmei.common.core.enums.CycleCommonEnum;
 import com.xunmei.common.core.enums.OrgTypeEnum;
@@ -114,7 +117,22 @@ public class ApiPlanController {
 
     @GetMapping("/buildPdf")
     public AjaxResult buildPdf() {
-        appPlanService.buildPdf();
+        final Date date = new Date();
+        appPlanService.buildPdf(date);
+        return AjaxResult.success();
+    }
+
+
+
+    @GetMapping("/buildPdf")
+    public AjaxResult buildPdf(String dateStr) {
+        Date date;
+        if (ObjectUtil.isEmpty(dateStr)) {
+            date = new Date();
+        } else {
+            date = DateUtil.parse(dateStr, Constants.DAILY_FORMAT);
+        }
+        appPlanService.buildPdf(date);
         return AjaxResult.success();
     }
 
@@ -247,15 +265,17 @@ public class ApiPlanController {
     @ApiOperation(value = "生成履职登记簿")
     @GetMapping(value = "/buildResumptionPdf/{orgId}")
     AjaxResult buildResumptionPdf(@PathVariable("orgId") Long orgId) {
-        return appPlanService.buildResumptionPdf(orgId);
+        final Date date = new Date();
+        return appPlanService.buildResumptionPdfDaily(orgId, date);
     }
 
     /**
      * 获取计划指定检查机构的行社列表。非指定机构返回空列表
+     *
      * @return
      */
     @GetMapping(value = "/designatehangshe/{planId}")
-    public AjaxResult getDesignateHangshe(@PathVariable Long planId){
+    public AjaxResult getDesignateHangshe(@PathVariable Long planId) {
         return AjaxResult.success(appPlanService.getDesignateHangshe(planId));
     }
 }

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/Resumption.java

@@ -183,6 +183,11 @@ public class Resumption extends BaseEntity {
     @TableField(exist = false)
     private List<FormData> dataList;
 
+    @TableField(exist = false)
+    private Integer planExec;
+
+    @TableField(exist = false)
+    private Integer planType;
 
     public Resumption() {
     }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionMapper.java

@@ -18,7 +18,6 @@ import com.xunmei.core.resumption.vo.WorkChangeResumptionVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -93,6 +92,7 @@ public interface ResumptionMapper extends BaseMapper<Resumption> {
 
 
     List<Resumption> selectByYmdDateAndExec(@Param("date") Date date, @Param("exec") Integer exec, @Param("orgId") Long orgId);
+    List<Resumption> selectByYmdDateAndExecList(@Param("date") Date date, @Param("exec") List<Integer> exec, @Param("orgId") Long orgId);
 
     void batchInsertResumptionData(@Param("list") List<AppResumptionData> list);
 

+ 8 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/AppPlanService.java

@@ -9,6 +9,7 @@ import com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto;
 import com.xunmei.core.resumption.vo.appPlan.*;
 import com.xunmei.system.api.domain.SysOrg;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -86,8 +87,13 @@ public interface AppPlanService extends IService<AppPlan> {
 
     AppPlan distributeHS(Long id, Boolean immediateEffect);
 
-    void buildPdf();
-    AjaxResult buildResumptionPdf(Long id);
+    void buildPdf(Date date);
+
+    void buildResumptionNotWorkTimePdf(Long orgId, Date date);
+
+    AjaxResult buildResumptionPdfDaily(Long orgId, Date date);
+
+    void buildResumptionAllDayPdf(Long orgId, Date date);
 
     /**
      * 更新计划及父计划的任务是否有已完成标志。

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

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.Constants;
+import com.xunmei.common.core.constant.DictConstants;
 import com.xunmei.common.core.constant.ErrorMsgConstants;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.DateRange;
@@ -28,6 +29,7 @@ import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.utils.IDHelper;
 import com.xunmei.common.core.vo.IdNameVo;
 import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.common.security.utils.DictUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.question.QuestionSrcType;
 import com.xunmei.core.question.domain.Question;
@@ -45,8 +47,6 @@ import com.xunmei.core.resumption.vo.appPlan.*;
 import com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo;
 import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordItemVo;
 import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordVo;
-import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToExecOrg;
-import com.xunmei.core.safetyCheck.enums.SafetyPlanCycle;
 import com.xunmei.core.thread.ThreadPoolConfig;
 import com.xunmei.system.api.RemoteFileService;
 import com.xunmei.system.api.RemoteOrgService;
@@ -65,7 +65,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.io.File;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
@@ -905,24 +904,26 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
     /**
      * 获取详情
+     *
      * @param planId
      * @return
      */
     @Override
-    public AppPlanDetailVo getDetail(Long planId){
-        AppPlanVo vo= findById(planId);
-        AppPlanDetailVo detailVo=new AppPlanDetailVo();
-        BeanUtils.copyProperties(vo,detailVo);
-
-        if(ObjectUtil.isNotEmpty(vo.getOrgList())){
-            List<IdNameVo> idNameVos= remoteOrgService.selectOrgByIdList(vo.getOrgList(),SecurityConstants.INNER)
-                    .stream().map(o->new IdNameVo(o.getId(),o.getName(),null))
+    public AppPlanDetailVo getDetail(Long planId) {
+        AppPlanVo vo = findById(planId);
+        AppPlanDetailVo detailVo = new AppPlanDetailVo();
+        BeanUtils.copyProperties(vo, detailVo);
+
+        if (ObjectUtil.isNotEmpty(vo.getOrgList())) {
+            List<IdNameVo> idNameVos = remoteOrgService.selectOrgByIdList(vo.getOrgList(), SecurityConstants.INNER)
+                    .stream().map(o -> new IdNameVo(o.getId(), o.getName(), null))
                     .collect(Collectors.toList());
             detailVo.setOrgs(idNameVos);
         }
 
-        return  detailVo;
+        return detailVo;
     }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void deleted(Long id) throws Exception {
@@ -1065,13 +1066,49 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         return list;
     }
 
+    @Override
+    public void buildResumptionNotWorkTimePdf(Long orgId, Date date) {
+        SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgId, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+        String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.ON_DUTY_USER, sysOrg.getName());
+        Map<String, Object> data = this.getFtlResumptionNotWorkTime(orgId, date);
+        data.put("fileName", fileName);
+        data.put("orgName", sysOrg.getShortName());
+        data.put("dateStr", DateUtil.format(new Date(), Constants.DAILY_FORMAT));
+        data.put("remark", "");
+        CompletableFuture.runAsync(() -> {
+            R<String> r = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.generateResumptionPdf(data), ErrorMsgConstants.GENERATE_PDF_ERROR);
+            if (null == r || null == r.getData()) {
+                throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
+            }
+           /* Long id = (Long) data.get("id");
+            if (ObjectUtil.isNull(id)) {
+                throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
+            }*/
+            String pdfUrl = r.getData();
+            CoreRegisterBookPdf registerBookPdf = new CoreRegisterBookPdf();
+            registerBookPdf.setId(IdWorker.getId());
+            registerBookPdf.setRegisterBookType(RegisterBookType.ON_DUTY_USER.getNum());
+            registerBookPdf.setDate(date);
+            registerBookPdf.setOrgId(orgId);
+            registerBookPdf.setOrgName(sysOrg.getShortName());
+            registerBookPdf.setOrgPath(sysOrg.getPath());
+            registerBookPdf.setFileUrl(pdfUrl);
+            registerBookPdf.setFileName(fileName);
+            if (StringUtils.isEmpty(registerBookPdf.getFileName()) || StringUtils.isEmpty(pdfUrl)) {
+                throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
+            }
+            registerBookPdfService.saveOrUpdate(registerBookPdf);
+        }, threadPoolTaskExecutor);
+    }
+
+
     @Async
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public AjaxResult buildResumptionPdf(Long orgid) {
-        SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgid, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+    public AjaxResult buildResumptionPdfDaily(Long orgId, Date date) {
+        SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgId, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
         String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.SECURITY_PERFORMANCE, sysOrg.getName());
-        Map<String, Object> data = this.getFtlResumption(orgid);
+        Map<String, Object> data = this.getFtlResumptionDaily(orgId, date);
         data.put("fileName", fileName);
         data.put("orgName", sysOrg.getShortName());
         data.put("dateStr", DateUtil.format(new Date(), Constants.DAILY_FORMAT));
@@ -1081,30 +1118,24 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             if (null == r || null == r.getData()) {
                 throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
             }
-            Long id = (Long) data.get("id");
+            /*Long id = (Long) data.get("id");
             if (ObjectUtil.isNull(id)) {
                 throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
-            }
+            }*/
             String pdfUrl = r.getData();
             CoreRegisterBookPdf registerBookPdf = new CoreRegisterBookPdf();
-            registerBookPdf.setId(id);
+            registerBookPdf.setId(IdWorker.getId());
             registerBookPdf.setRegisterBookType(RegisterBookType.SECURITY_PERFORMANCE.getNum());
-            registerBookPdf.setDate(new Date());
-            registerBookPdf.setOrgId(orgid);
+            registerBookPdf.setDate(date);
+            registerBookPdf.setOrgId(orgId);
             registerBookPdf.setOrgName(sysOrg.getShortName());
             registerBookPdf.setOrgPath(sysOrg.getPath());
             registerBookPdf.setFileUrl(pdfUrl);
-            //registerBookPdf.setFileName(StringUtils.substringAfterLast(pdfUrl, "\\"));
             registerBookPdf.setFileName(fileName);
-            //registerBookPdf.setFileName(StringUtils.substringAfterLast(pdfUrl, File.separator));
             if (StringUtils.isEmpty(registerBookPdf.getFileName()) || StringUtils.isEmpty(pdfUrl)) {
                 throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
             }
-            registerBookPdfService.save(registerBookPdf);
-//            LambdaUpdateWrapper<AppPlan> updateWrapper = new LambdaUpdateWrapper<>();
-//            updateWrapper.eq(AppPlan::getId, id);
-//            updateWrapper.set(AppPlan::getPdfUrl, pdfUrl);
-//            this.update(updateWrapper);
+            registerBookPdfService.saveOrUpdate(registerBookPdf);
         }, threadPoolTaskExecutor);
 
 
@@ -1113,21 +1144,110 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
     @Async
     @Override
-    public void buildPdf() {
-        Date date = new Date();
+    public void buildPdf(Date date) {
 
-        List<Resumption> resumptions = resumptionMapper.selectList(new LambdaQueryWrapper<Resumption>().eq(Resumption::getYmdDate, DateUtils.toLocalDate(date)).eq(Resumption::getStatus, 3));
+        List<Resumption> resumptions = resumptionMapper.selectList(new LambdaQueryWrapper<Resumption>().like(Resumption::getSubmitTime, DateUtils.toLocalDate(date)).eq(Resumption::getStatus, 3));
         List<Long> orgIds = resumptions.stream().map(Resumption::getOrgId).distinct().collect(Collectors.toList());
-        orgIds.forEach(this::buildResumptionPdf);
+        for (Long orgId : orgIds) {
+            buildResumptionPdfDaily(orgId, date);
+            buildResumptionNotWorkTimePdf(orgId, date);
+            buildResumptionAllDayPdf(orgId, date);
+        }
     }
 
-    private Map<String, Object> getFtlResumption(Long orgId) {
+    //1703700546288825444
+    @Override
+    public void buildResumptionAllDayPdf(Long orgId, Date date) {
+        final List<Map<String, Object>> mapList = this.getFtlResumptionAllDay(orgId, date);
+        for (Map<String, Object> data : mapList) {
+            CompletableFuture.runAsync(() -> {
+                R<String> r = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.generateResumptionPdf(data), ErrorMsgConstants.GENERATE_PDF_ERROR);
+                if (null == r || null == r.getData()) {
+                    throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
+                }
+               /* Long id = (Long) data.get("id");
+                if (ObjectUtil.isNull(id)) {
+                    throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
+                }*/
+                SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgId, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+                String pdfUrl = r.getData();
+                CoreRegisterBookPdf registerBookPdf = new CoreRegisterBookPdf();
+                registerBookPdf.setId(IdWorker.getId());
+                registerBookPdf.setRegisterBookType(RegisterBookType.getEnums((Integer) data.get("planType")).getNum());
+                registerBookPdf.setDate(date);
+                registerBookPdf.setOrgId(orgId);
+                registerBookPdf.setOrgName(sysOrg.getShortName());
+                registerBookPdf.setOrgPath(sysOrg.getPath());
+                registerBookPdf.setFileUrl(pdfUrl);
+                registerBookPdf.setFileName(data.get("fileName").toString());
+                if (StringUtils.isEmpty(registerBookPdf.getFileName()) || StringUtils.isEmpty(pdfUrl)) {
+                    throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
+                }
+                registerBookPdfService.saveOrUpdate(registerBookPdf);
+            }, threadPoolTaskExecutor);
+        }
+
+
+    }
+
+    private List<Map<String, Object>> getFtlResumptionAllDay(Long orgId, Date date) {
+
+        SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgId, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+
+        //查询执行时刻为全天的的履职数据
+        List<Resumption> allDayDataList = resumptionMapper.selectByYmdDateAndExecList(date, Arrays.asList(1), orgId);
+        //全天的的履职数据需要生成三种登记簿,所以还需要跟根据任务类型来分组 // 4:“110”入侵报警系统测试 5:不间断电源(UPS)维护 6:离行式自助银行巡检
+        final Map<Integer, List<Resumption>> listMap = allDayDataList.stream().filter(res -> Arrays.asList(4, 5, 6).contains(res.getPlanType())).collect(Collectors.groupingBy(Resumption::getPlanType));
+        final ArrayList<Map<String, Object>> maps = new ArrayList<>();
+        for (Integer planType : listMap.keySet()) {
+            String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.getEnums(planType), sysOrg.getName());
+            Map<String, Object> data = new HashMap<>();
+            data.put("planType", planType);
+            List<AppResumptionDataInfoVo> allDayInfo = getItems(allDayDataList);
+            Map<Long, List<AppResumptionDataInfoVo>> afterf = allDayInfo.stream().collect(Collectors.groupingBy(AppResumptionDataInfoVo::getItemId));
+            data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 1), getResult(afterf));
+            // 提交人
+            data.put("submiterNames", allDayDataList.stream().map(Resumption::getSubmitorName).distinct().collect(Collectors.joining(",")));
+            // 获取任务相关问题
+            data.put("questions", getListQuestionPdfVo(allDayDataList.stream().map(Resumption::getId).collect(Collectors.toList())));
+            data.put("fileName", fileName);
+            data.put("orgName", sysOrg.getShortName());
+            data.put("dateStr", DateUtil.format(date, Constants.DAILY_FORMAT));
+            data.put("remark", "");
+            maps.add(data);
+        }
+        return maps;
+    }
+
+    private Map<String, Object> getFtlResumptionNotWorkTime(Long orgId, Date date) {
         Map<String, Object> data = new HashMap<>();
-        //获取前一天
-//        Date date = DateUtils.addDays(new Date(), 0);
-//        Date date = DateUtil.date().setField(DateField.DAY_OF_MONTH,26);//new Date(123,12,26);
-        Date date = new Date();
+        List<Resumption> dataList = resumptionMapper.selectByYmdDateAndExecList(date, Arrays.asList(5), orgId);
+        List<AppResumptionDataInfoVo> notWorkTimeInfo = getItems(dataList);
+        Map<Long, List<AppResumptionDataInfoVo>> afterf = notWorkTimeInfo.stream().collect(Collectors.groupingBy(AppResumptionDataInfoVo::getItemId));
+        data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 5), getResult(afterf));
+        // 提交人
+        data.put("submiterNames", dataList.stream().map(Resumption::getSubmitorName).distinct().collect(Collectors.joining(",")));
+        // 获取任务相关问题
+        data.put("questions", getListQuestionPdfVo(dataList.stream().map(Resumption::getId).collect(Collectors.toList())));
+        return data;
+    }
+
+    private List<QuestionPdfVo> getListQuestionPdfVo(List<Long> taskIds) {
+        List<QuestionPdfVo> questionPdfVos = new ArrayList<>();
+        if (ObjectUtil.isNotEmpty(taskIds)) {
+            List<Question> questions = questionService.selectQuestionByTaskIds(taskIds);
+            questions.forEach(x -> {
+                QuestionPdfVo questionPdfVo = new QuestionPdfVo();
+                BeanUtils.copyProperties(x, questionPdfVo);
+                questionPdfVos.add(questionPdfVo);
+            });
+        }
+        return questionPdfVos;
+    }
 
+    private Map<String, Object> getFtlResumptionDaily(Long orgId, Date date) {
+        Map<String, Object> data = new HashMap<>();
+        //获取前一天
         //获取营业前的所有履职信息
         List<Resumption> before = resumptionMapper.selectByYmdDateAndExec(date, 2, orgId);
         //获取营业期间的所有履职信息
@@ -1142,9 +1262,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         Map<Long, List<AppResumptionDataInfoVo>> afterf = aftervos.stream().collect(Collectors.groupingBy(AppResumptionDataInfoVo::getItemId));
 
         data.put("id", CollectionUtil.isNotEmpty(before) ? before.get(0).getId() : (CollectionUtil.isNotEmpty(ing) ? ing.get(0).getId() : (CollectionUtil.isNotEmpty(after) ? after.get(0).getId() : null)));
-        data.put("营业前", getResult(bef));
-        data.put("营业期间", getResult(ingf));
-        data.put("营业终了", getResult(afterf));
+        data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 2), getResult(bef));
+        data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 3), getResult(ingf));
+        data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 4), getResult(afterf));
         // 提交人
 
         List<String> submiterNames = before.stream().map(x -> x.getSubmitorName()).collect(Collectors.toList());
@@ -1153,21 +1273,10 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         submiterNames = submiterNames.stream().distinct().collect(Collectors.toList());
         data.put("submiterNames", String.join(",", submiterNames));
         // 获取任务相关问题
-        List<QuestionPdfVo> questionPdfVos = new ArrayList<>();
         List<Long> taskIds = before.stream().map(x -> x.getId()).collect(Collectors.toList());
         taskIds.addAll(ing.stream().map(x -> x.getId()).collect(Collectors.toList()));
         taskIds.addAll(after.stream().map(x -> x.getId()).collect(Collectors.toList()));
-        if (ObjectUtil.isNotEmpty(taskIds)) {
-            List<Question> questions = questionService.selectQuestionByTaskIds(taskIds);
-
-            questions.forEach(x -> {
-                QuestionPdfVo questionPdfVo = new QuestionPdfVo();
-                BeanUtils.copyProperties(x, questionPdfVo);
-                questionPdfVos.add(questionPdfVo);
-            });
-        }
-
-        data.put("questions", questionPdfVos);
+        data.put("questions", getListQuestionPdfVo(taskIds));
         return data;
     }
 

+ 14 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionMapper.xml

@@ -340,7 +340,7 @@
         </foreach>
     </select>
     <select id="selectByYmdDateAndExec" resultType="com.xunmei.core.resumption.domain.Resumption">
-        select res.*
+        select res.*,pl.plan_exec as planExec,pl.plan_type as planType
         from core_resumption res
                  left join core_resumption_plan pl on res.plan_id = pl.id
         where pl.plan_exec = #{exec}
@@ -349,6 +349,18 @@
           and res.status = 3
     </select>
 
+    <select id="selectByYmdDateAndExecList" resultType="com.xunmei.core.resumption.domain.Resumption">
+        select res.*,pl.plan_exec as planExec,pl.plan_type as planType
+        from core_resumption res
+                 left join core_resumption_plan pl on res.plan_id = pl.id
+        where  DATE(res.submit_time) = DATE(#{date})
+          and res.org_id = #{orgId}
+          and res.status = 3
+        and  pl.plan_exec in
+        <foreach collection="exec" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
     <insert id="saveResumptionExceptionList">
         insert into core_safety_exception_data (data_id, org_id, org_name, org_path, data_source, data_time,
         create_time,
@@ -515,4 +527,5 @@
     <update id="updatePlanId">
         update core_resumption set parent_plan_id=#{newPlanParentId},plan_id=#{newPlanId} where plan_id=#{oldPlanId} and (status=0 or status=1)
     </update>
+
 </mapper>

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

@@ -6,10 +6,13 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.lowagie.text.*;
 import com.lowagie.text.pdf.*;
+import com.xunmei.common.core.constant.DictConstants;
+import com.xunmei.common.security.utils.DictUtils;
 import com.xunmei.file.vo.ItextPdfTableVo;
 import com.xunmei.system.api.domain.AccessDataVo;
 import com.xunmei.system.api.domain.CheckDataVo;
 import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
+import com.xunmei.system.api.domain.SysDictData;
 import com.xunmei.system.api.vo.QuestionPdfVo;
 import io.netty.util.internal.StringUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -23,6 +26,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.List;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Slf4j
 public class PdfUtil {
@@ -212,7 +216,7 @@ public class PdfUtil {
         // 第三行
         PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_MIDDLE, 2, 0);
         PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_MIDDLE, 6, 0);
-        PdfUtil.createPDFCell(tableFont, table,"检查情况", Element.ALIGN_MIDDLE, 2, 0);
+        PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_MIDDLE, 2, 0);
 
 
 //        PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_CENTER, 1, 0);
@@ -220,12 +224,12 @@ public class PdfUtil {
 //        PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_CENTER, 0, 0);
 //        PdfUtil.createPDFCell(tableFont, table, "登记人", Element.ALIGN_CENTER, 0, 0);
 
-        List<String> names = new ArrayList<>();
-        names.add("营业前");
-        names.add("营业期间");
-        names.add("营业终了");
-
-
+        /*List<String> names = new ArrayList<>();
+        names.add(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 2));
+        names.add(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 3));
+        names.add(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 4));*/
+        final List<SysDictData> dictCache = DictUtils.getDictCache(DictConstants.RESUMPTION_PLAN_EXEC);
+        final List<String> names = dictCache.stream().map(SysDictData::getDictLabel).collect(Collectors.toList());
         for (String s : names) {
             List<LinkedHashMap<String, Object>> lists = (List<LinkedHashMap<String, Object>>) data.get(s);
             if (ObjectUtil.isEmpty(lists)) {
@@ -252,7 +256,7 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_MIDDLE, 4, 1);
         PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 4, 1);
 
-        final List<LinkedHashMap> questionPdfVoList =  (List<LinkedHashMap>)data.get("questions");
+        final List<LinkedHashMap> questionPdfVoList = (List<LinkedHashMap>) data.get("questions");
         if (ObjectUtil.isEmpty(questionPdfVoList)) {
             PdfUtil.createPDFCell(tableFont, table, "1", Element.ALIGN_MIDDLE, 2, 1);
             PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_LEFT, 4, 1);
@@ -260,7 +264,7 @@ public class PdfUtil {
             document.add(table);
             return;
         }
-        int questionIndex=1;
+        int questionIndex = 1;
         for (int i = 0; i < questionPdfVoList.size(); i++) {
 
             PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionIndex++), Element.ALIGN_MIDDLE, 2, 1);
@@ -605,7 +609,7 @@ public class PdfUtil {
             document.add(table);
             return;
         }
-        int questionIndex=1;
+        int questionIndex = 1;
         for (int i = 1; i <= data.getCheckDatas().size(); i++) {
             final CheckDataVo checkDataVo = data.getCheckDatas().get(i - 1);
             if (ObjectUtil.isEmpty(checkDataVo.getResRemark())) {