Kaynağa Gözat

履职登记簿

luojun 1 yıl önce
ebeveyn
işleme
c988c84420
16 değiştirilmiş dosya ile 609 ekleme ve 19 silme
  1. 3 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteFileService.java
  2. 5 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteFileFallbackFactory.java
  3. 7 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ApiPlanController.java
  4. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppPlan.java
  5. 2 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionMapper.java
  6. 2 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/AppPlanService.java
  7. 98 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java
  8. 4 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/AppResumptionDataInfoVo.java
  9. 2 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java
  10. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/job/SafetyCheckJobBusiness.java
  11. 9 0
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionMapper.xml
  12. 2 1
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml
  13. 5 0
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/controller/SysFileController.java
  14. 1 0
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/ISysFileService.java
  15. 272 2
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java
  16. 195 4
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

+ 3 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteFileService.java

@@ -40,6 +40,9 @@ public interface RemoteFileService {
     @PostMapping(value = "/file/generateEduTrainingPdf")
     R<String> generateEduTrainingPdf(@RequestBody Map<String, Object> data);
 
+    @PostMapping(value = "/file/generateResumptionPdf")
+    R<String> generateResumptionPdf(@RequestBody Map<String, Object> data);
+
     /**
      * 生成预案演练登记簿
      *

+ 5 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteFileFallbackFactory.java

@@ -37,6 +37,11 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
             }
 
             @Override
+            public R<String> generateResumptionPdf(Map<String, Object> data) {
+                return null;
+            }
+
+            @Override
             public R<String> generateDrillPdf(Map<String, Object> data) {
                 log.error("生成预案演练登记簿失败:{},参数:{}", throwable.getMessage(), JSON.toJSONString(data));
                 return null;

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

@@ -131,6 +131,10 @@ public class ApiPlanController {
         List<Map<String, Object>> list = appPlanService.findByOrg(info);
         return AjaxResult.success(list);
     }
+    @PostMapping("/buildPdf")
+    public void buildPdf() {
+        appPlanService.buildResumptionPdf(4358025846522215L);
+    }
 
     /**
      * 新增 修改履职计划
@@ -148,13 +152,13 @@ public class ApiPlanController {
             AppPlan plan = null;
             plan = appPlanService.getById(info.getId());
             Long planOfOrgType = null;
-            if(info.getId()!=null) {
+            if (info.getId() != null) {
                 planOfOrgType = plan.getPlanOfOrgType();
             }
             //判断是否是编辑并且计划所属任务不存在已完成或者逾期,需要删除所有任务重新生成
-            boolean isEditAll = info.getHasEdit() == null && info.getId() != null&&info.getBuildTaskNow()>0;
+            boolean isEditAll = info.getHasEdit() == null && info.getId() != null && info.getBuildTaskNow() > 0;
             //如果计划所属机构类型为行社并且勾选立即执行,新增的时候立即生成任务
-            if ( isEditAll) {
+            if (isEditAll) {
 
                 //如果编辑
                 List<AppPlan> list = appPlanService.list(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()).eq(AppPlan::getDeleted, 0));

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppPlan.java

@@ -32,6 +32,7 @@ public class AppPlan extends Model<AppPlan> implements Serializable {
     @TableField(exist = false)
     private Integer orgType;
     private String distribute;
+    private String pdfUrl;
     /**
      * 主键
      */

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

@@ -80,4 +80,6 @@ public interface ResumptionMapper extends BaseMapper<Resumption> {
     int saveResumptionExceptionList(@Param("year") int year, @Param("quarter") int quarter, @Param("month") int month, @Param("roleId") Long roleId);
 
     int saveResumptionExceptionListNew(@Param("orgIds") List<Long> orgIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("roleId") Long roleId, @Param("request") CoreSafetyIndexReCalculateDto request);
+
+    List<Resumption> selectByYmdDateAndExec(@Param("date")Date date, @Param("exec")Integer exec,@Param("orgId")Long orgId);
 }

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

@@ -2,6 +2,7 @@ package com.xunmei.core.resumption.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.core.resumption.domain.AppPlan;
 import com.xunmei.core.resumption.dto.DistributeDto;
 import com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto;
@@ -86,4 +87,5 @@ public interface AppPlanService extends IService<AppPlan> {
     void cheHui(Long id);
 
     int distributeCheHui(Long id);
+    AjaxResult buildResumptionPdf(Long id);
 }

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

@@ -6,11 +6,19 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+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.ErrorMsgConstants;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.domain.DateRange;
+import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingTask;
+import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingTaskToUser;
+import com.xunmei.common.core.domain.edu.vo.CoreEduTrainingTaskDetailVo;
+import com.xunmei.common.core.exception.SystemException;
 import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.resumption.domain.*;
 import com.xunmei.core.resumption.dto.DistributeDto;
@@ -18,22 +26,37 @@ import com.xunmei.core.resumption.dto.DistributeStatusDto;
 import com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto;
 import com.xunmei.core.resumption.mapper.*;
 import com.xunmei.core.resumption.service.AppPlanService;
+import com.xunmei.core.resumption.service.IResumptionRecordService;
 import com.xunmei.core.resumption.task.ResumptionTaskBusiness;
 import com.xunmei.core.resumption.vo.appPlan.AppPlanVo;
 import com.xunmei.core.resumption.vo.appPlan.ResumptionPlanPageVo;
 import com.xunmei.core.resumption.vo.appPlan.RuleItemVo;
 import com.xunmei.core.resumption.vo.appPlan.RuleRequestVo;
+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.thread.ThreadPoolConfig;
+import com.xunmei.system.api.RemoteFileService;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysDept;
 import com.xunmei.system.api.domain.SysOrg;
+import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
+import io.netty.util.internal.StringUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
+import static com.xunmei.common.core.constant.ErrorMsgConstants.QUERY_ORG_DATA_ERROR;
+
 /**
  * @author : 高雄
  * @date :2022/4/27 17:44
@@ -42,13 +65,15 @@ import java.util.stream.Collectors;
  */
 @Service
 public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> implements AppPlanService {
-
+    @Resource
+    IResumptionRecordService resumptionRecordService;
     @Autowired
     private AppRuleMapper appRuleMapper;
 
     @Autowired
     private RemoteOrgService orgService;
-
+    @Autowired
+    private RemoteFileService fileService;
     @Autowired
     private AppPlanToRoleMapper appPlanToRoleMapper;
 
@@ -58,6 +83,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     private AppPlanToExecOrgMapper appPlanToExecOrgMapper;
     @Autowired
     private ResumptionMapper resumptionMapper;
+    @Autowired
+    @Qualifier(ThreadPoolConfig.SOC_EXECUTOR)
+    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
 
     @Override
     public List<Long> selectItemIdsByPlanId(Long id) {
@@ -215,7 +243,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             baseMapper.updateById(ap);
             //撤回需要删除本周期所有任务
             DateRange dateRange = DateUtils.getStartAndEnd(new Date(), plan.getPlanCycle());
-            resumptionMapper.delete(new LambdaQueryWrapper<Resumption>().eq(Resumption::getPlanId, ap.getId()).in(Resumption::getStatus,1,2).between(Resumption::getYmdDate, dateRange.getStartTime(), dateRange.getEndTime()));
+            resumptionMapper.delete(new LambdaQueryWrapper<Resumption>().eq(Resumption::getPlanId, ap.getId()).in(Resumption::getStatus, 1, 2).between(Resumption::getYmdDate, dateRange.getStartTime(), dateRange.getEndTime()));
 
         }
         //设置下发状态为未下发
@@ -225,7 +253,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
 //撤回需要删除本周期所有任务
         DateRange dateRange = DateUtils.getStartAndEnd(new Date(), plan.getPlanCycle());
-        resumptionMapper.delete(new LambdaQueryWrapper<Resumption>().eq(Resumption::getPlanId, plan.getId()).in(Resumption::getStatus,1,2).between(Resumption::getYmdDate, dateRange.getStartTime(), dateRange.getEndTime()));
+        resumptionMapper.delete(new LambdaQueryWrapper<Resumption>().eq(Resumption::getPlanId, plan.getId()).in(Resumption::getStatus, 1, 2).between(Resumption::getYmdDate, dateRange.getStartTime(), dateRange.getEndTime()));
 
     }
 
@@ -704,4 +732,70 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         }
         return list;
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxResult buildResumptionPdf(Long orgid) {
+
+        SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgid, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+        String[] strings = sysOrg.getPath().split("-");
+        List<Long> list = Arrays.stream(strings).map(Long::valueOf).collect(Collectors.toList());
+        List<SysOrg> sysOrgList = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgByIdList(list, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+        String orgName = sysOrgList.stream().map(SysOrg::getName).collect(Collectors.joining("_"));
+
+        String fileName = orgName + "_" + "_" + DateUtil.format(new Date(), "yyyyMMddHHmmss") + ".pdf";
+        Map<String, Object> data = this.getFtlResumption(orgid);
+        data.put("fileName", fileName);
+        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);
+            }
+//            String pdfUrl = r.getData();
+//            LambdaUpdateWrapper<AppPlan> updateWrapper = new LambdaUpdateWrapper<>();
+//            updateWrapper.eq(AppPlan::getId, id);
+//            updateWrapper.set(AppPlan::getPdfUrl, pdfUrl);
+//            this.update(updateWrapper);
+        }, threadPoolTaskExecutor);
+
+
+        return AjaxResult.success("正在生成pdf,请稍后刷新页面查看!");
+    }
+
+    private Map<String, Object> getFtlResumption(Long orgId) {
+        Map<String, Object> data = new HashMap<>();
+        //获取前一天
+        Date date = DateUtils.addDays(new Date(), 0);
+//        Date date = DateUtils.addDays(new Date(), -1);
+        //获取营业前的所有履职信息
+        List<Resumption> before = resumptionMapper.selectByYmdDateAndExec(date, 2, orgId);
+        //获取营业期间的所有履职信息
+        List<Resumption> ing = resumptionMapper.selectByYmdDateAndExec(date, 3, orgId);
+        //获取营业终了的所有履职信息
+        List<Resumption> after = resumptionMapper.selectByYmdDateAndExec(date, 4, orgId);
+        List<AppResumptionDataInfoVo> beforevos = getItems(before);
+        List<AppResumptionDataInfoVo> ingvos = getItems(ing);
+        List<AppResumptionDataInfoVo> aftervos = getItems(after);
+        Map<Long, List<AppResumptionDataInfoVo>> bef = beforevos.stream().collect(Collectors.groupingBy(AppResumptionDataInfoVo::getItemId));
+
+        data.put("营业前", getItems(before));
+        data.put("营业期间", getItems(ing));
+        data.put("营业终了", getItems(after));
+        return data;
+    }
+
+    public List<AppResumptionDataInfoVo> getItems(List<Resumption> resumptions) {
+        List<AppResumptionDataInfoVo> vos = new ArrayList<>();
+        for (Resumption r :
+                resumptions) {
+            ResumptionRecordVo resumptionRecordVo = resumptionRecordService.selectInfo(r.getId());
+            List<ResumptionRecordItemVo> items = resumptionRecordVo.getItems();
+            for (ResumptionRecordItemVo v :
+                    items) {
+                vos.addAll(v.getDataInfoList());
+            }
+        }
+        return vos;
+    }
+
 }

+ 4 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRecord/AppResumptionDataInfoVo.java

@@ -36,7 +36,7 @@ public class AppResumptionDataInfoVo {
 //    @ApiModelProperty(value = "标记,仅供前端页面渲染字体颜色使用")
 //    private String executeFlag;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "执行时间")
     private Date executeTime;
 
@@ -45,9 +45,11 @@ public class AppResumptionDataInfoVo {
 
     @ApiModelProperty(value = "状态")
     private Integer executeStatus;
+    @ApiModelProperty(value = "检查要点id")
+    private Long itemId;
 
     @ApiModelProperty(value = "图片数组")
-   // private List<AppResumptionDataImg> appResumptionDataImgList;
+    // private List<AppResumptionDataImg> appResumptionDataImgList;
     private List<AppResumptionDataRemarkimg> appResumptionDataImgList;
 
     private List<ResumptionDataProtectionVo> protections;

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

@@ -76,7 +76,7 @@ public class CoreSafecheckPlanController extends BaseController {
         if (plan.isBuildTaskNow() || plan.getPlanCycle() == 6) {
 //获取父计划下面所有父id相等并且未删除并且已启用的计划
             List<CoreSafecheckPlan> plans = coreSafecheckPlanService.list(new LambdaQueryWrapper<CoreSafecheckPlan>().eq(CoreSafecheckPlan::getParentId, plan.getId()).eq(CoreSafecheckPlan::getIsDeleted, 0).eq(CoreSafecheckPlan::getPlanStatus, 1));
-            if (plan.getPlanOfOrgType() == 3) {
+            if (plan.getPlanOfOrgType() == 3||plan.getExecOrgType()==1||plan.getExecOrgType()==2) {
                 plans.add(plan);
             }
             jobBusiness.createTaskByPlans(plans);
@@ -177,7 +177,7 @@ public class CoreSafecheckPlanController extends BaseController {
             if (plan.isBuildTaskNow() || plan.getPlanCycle() == 6) {
 //获取父计划下面所有父id相等并且未删除并且已启用的计划
                 List<CoreSafecheckPlan> plans = coreSafecheckPlanService.list(new LambdaQueryWrapper<CoreSafecheckPlan>().eq(CoreSafecheckPlan::getParentId, plan.getId()).eq(CoreSafecheckPlan::getIsDeleted, 0).eq(CoreSafecheckPlan::getPlanStatus, 1));
-                if (plan.getPlanOfOrgType() == 3) {
+                if (plan.getPlanOfOrgType() == 3||plan.getExecOrgType()==1||plan.getExecOrgType()==2) {
                     plans.add(plan);
                 }
                 jobBusiness.createTaskByPlans(plans);

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/job/SafetyCheckJobBusiness.java

@@ -516,7 +516,7 @@ public class SafetyCheckJobBusiness extends TaskCreatingServiceImplBase<CoreSafe
                 //如果存在同批次的已完成或者已逾期的任务需要同步批次id
                 checkTask.setBatchId(coreSafetyTasks.get(0).getBatchId());
             } else {
-                checkTaskService.remove(new LambdaQueryWrapper<CoreSafetyTask>().eq(CoreSafetyTask::getOrgId, checkTask.getOrgId()).eq(CoreSafetyTask::getYmdDate, checkTask.getYmdDate()).in(CoreSafetyTask::getStatus, 1, 2));
+                checkTaskService.remove(new LambdaQueryWrapper<CoreSafetyTask>().eq(CoreSafetyTask::getOrgId, checkTask.getOrgId()).eq(CoreSafetyTask::getYmdDate, checkTask.getYmdDate()).in(CoreSafetyTask::getStatus, 1, 2).eq(CoreSafetyTask::getPlanId,checkTask.getPlanId()));
                 ats.add(checkTask);
             }
 

+ 9 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionMapper.xml

@@ -325,6 +325,15 @@
             #{orgId}
         </foreach>
     </select>
+    <select id="selectByYmdDateAndExec" resultType="com.xunmei.core.resumption.domain.Resumption">
+        select res.*
+        from core_resumption res
+                 left join core_resumption_plan pl on res.plan_id = pl.id
+        where pl.plan_exec = #{exec}
+          and DATE(res.ymd_date) = DATE(#{date})
+          and res.org_id = #{orgId}
+          and res.status = 3
+    </select>
 
     <insert id="saveResumptionExceptionList">
         insert into core_safety_exception_data

+ 2 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionRecordMapper.xml

@@ -290,7 +290,8 @@
                d.submit_time AS executeTime,
                d.res_remark  AS resRemark,
                d.res_status  AS executeStatus,
-               d.id          AS dataId
+               d.id          AS dataId,
+               d.item_id
         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

+ 5 - 0
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/controller/SysFileController.java

@@ -139,7 +139,12 @@ public class SysFileController {
         return R.ok(sysFileService.generateEduTrainingPdf(data));
 
     }
+    @ApiOperation(value = "生成履职pdf")
+    @PostMapping(value = "/generateResumptionPdf")
+    R<String> generateResumptionPdf(@RequestBody Map<String, Object> data) throws Exception {
+        return R.ok(sysFileService.generateResumptionPdf(data));
 
+    }
     @ApiOperation(value = "预案演练pdf")
     @PostMapping(value = "/generateDrillPdf")
     R<String> generateDrillPdf(@RequestBody Map<String, Object> data) throws Exception {

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

@@ -44,6 +44,7 @@ public interface ISysFileService
     void downloadFile(HttpServletResponse response, String filePath) throws Exception;
 
     String generateEduTrainingPdf(Map<String, Object> data) throws Exception;
+    String generateResumptionPdf(Map<String, Object> data) throws Exception;
 
     String getRelativePath(String path);
 

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

@@ -4,9 +4,9 @@ import cn.hutool.Hutool;
 import cn.hutool.core.codec.Base64;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.lowagie.text.Document;
-import com.lowagie.text.Font;
+import com.lowagie.text.*;
 import com.lowagie.text.pdf.BaseFont;
+import com.lowagie.text.pdf.PdfPCell;
 import com.lowagie.text.pdf.PdfPTable;
 import com.lowagie.text.pdf.PdfWriter;
 import com.xunmei.common.core.utils.uuid.UUID;
@@ -191,6 +191,25 @@ public class LocalSysFileServiceImpl implements ISysFileService {
     }
 
     @Override
+    public String generateResumptionPdf(Map<String, Object> data) throws Exception {
+        PdfFilePathVo pathVo = getLocalFilePath(localFilePath, "resumption", data.get("fileName").toString());
+        log.info("开始生成履职登记簿,当前绝对地址为:{}", pathVo.getAbsolutePath());
+        final ItextPdfTableVo pdfTableVo = PdfUtil.createTable(pathVo.getAbsolutePath(), 6, 10);
+        final Document document = pdfTableVo.getDocument();
+        final PdfWriter writer = pdfTableVo.getWriter();
+        final PdfPTable table = pdfTableVo.getTable();
+        final BaseFont fs = pdfTableVo.getFs();
+        final Font tableFont = pdfTableVo.getTableFont();
+        PdfUtil.dealHeader(document, fs, "保 安 履 职", 24);
+        PdfUtil.dealResumptionBody(document, table, tableFont, data);
+        document.close();
+        writer.close();
+        log.info("履职登记簿生成结束,当前绝对地址为:{}", pathVo.getAbsolutePath());
+        //此处返回  /statics/edu/xxx.pdf
+        return this.prefix + pathVo.getRelativePath();
+    }
+
+    @Override
     public String generateDrillPdf(Map<String, Object> data) throws Exception {
         PdfFilePathVo pathVo = getLocalFilePath(localFilePath, "drill", data.get("fileName").toString());
         log.info("开始生成预案演练登记簿,当前绝对地址为:{}", pathVo.getAbsolutePath());
@@ -216,4 +235,255 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         String filePath = FileUploadUtils.uploadBase64(localFilePath, file);
         return filePath;
     }
+    /**
+     * 履职转pdf
+     * @param dest
+     * @throws IOException
+     * @throws DocumentException
+     */
+    public void dataToPdf(String dest) throws IOException, DocumentException {
+        Document document = new Document();
+        PdfWriter.getInstance(document, new FileOutputStream(dest));
+        document.open();
+
+        // 使用语言包字体
+        BaseFont abf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
+        //字体
+        Font font = new Font(abf, 8);
+
+        //段落
+        Paragraph p = new Paragraph("测试结算单", new Font(abf, 12, Font.BOLD));
+        p.setAlignment(Paragraph.ALIGN_CENTER);
+        document.add(p);
+
+        //表格
+        PdfPTable table = new PdfPTable(8);//numcolumns:列数
+        table.setSpacingBefore(16f);//表格与上面段落的空隙
+
+        //表格列创建并赋值
+        PdfPCell cell = new PdfPCell(new Phrase("单位名称:测试有限公司", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);//居中
+        cell.disableBorderSide(13);//去除左右上边框,保留下边框
+        cell.setColspan(4);//合并列数
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("日期:2020-06-05", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.disableBorderSide(13);
+        cell.setColspan(3);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("单位(元)", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+        cell.disableBorderSide(13);
+        cell.setColspan(1);
+        table.addCell(cell);
+        //首行
+        cell = new PdfPCell(new Phrase("期间", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.setColspan(2);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("月份", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("分类", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("年利率", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("日利率", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("基数", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("利息", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("起始日:2020-03-26\n" +
+                "结束日:2020-04-25", font));
+        cell.setPadding(16f);
+        cell.setVerticalAlignment(Element.ALIGN_CENTER);
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.setRowspan(3);
+        cell.setColspan(2);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("4", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("资金", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("1.10%", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("0.000031", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("10598164.91", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("325.01", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("4", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("资金", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("1.10%", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("0.000031", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("-", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("-", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("4", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("资金", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("1.10%", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("0.000031", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("-", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("-", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("合计", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.setColspan(7);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("325.01", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("会计制单:", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+        cell.disableBorderSide(14);
+        cell.setColspan(4);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("复核:", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+        cell.disableBorderSide(14);
+        cell.setColspan(4);
+        table.addCell(cell);
+        table.setSpacingBefore(16f);
+        document.add(table);
+
+        //下一页
+        document.newPage();
+        //段落
+        Paragraph p1 = new Paragraph("下一页测试结算单", new Font(abf, 12, Font.BOLD));
+        p1.setAlignment(Paragraph.ALIGN_CENTER);
+        document.add(p1);
+
+        //表格
+        table = new PdfPTable(8);//numcolumns:列数
+        table.setSpacingBefore(16f);//表格与上面段落的空隙
+
+        //表格列创建并赋值
+        cell = new PdfPCell(new Phrase("单位名称:测试有限公司", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);//居中
+        cell.disableBorderSide(13);//去除左右上边框,保留下边框
+        cell.setColspan(4);//合并列数
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("日期:2020-06-05", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.disableBorderSide(13);
+        cell.setColspan(3);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("单位(元)", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+        cell.disableBorderSide(13);
+        cell.setColspan(1);
+        table.addCell(cell);
+        //首行
+        cell = new PdfPCell(new Phrase("期间", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.setColspan(2);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("月份", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("分类", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("年利率", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("日利率", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("基数", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("利息", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("起始日:2020-04-26\n" +
+                "结束日:2020-05-25", font));
+        cell.setPadding(16f);
+        cell.setVerticalAlignment(Element.ALIGN_CENTER);
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.setColspan(2);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("4", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("资金", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("1.10%", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("0.000031", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("10598164.91", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("325.01", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("合计", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        cell.setColspan(7);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("325.01", font));
+        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+        table.addCell(cell);
+
+        cell = new PdfPCell(new Phrase("会计制单:", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+        cell.disableBorderSide(14);
+        cell.setColspan(4);
+        table.addCell(cell);
+        cell = new PdfPCell(new Phrase("复核:", font));
+        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+        cell.disableBorderSide(14);
+        cell.setColspan(4);
+        table.addCell(cell);
+        table.setSpacingBefore(16f);
+        document.add(table);
+
+        document.close();
+    }
 }

+ 195 - 4
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -1,6 +1,7 @@
 package com.xunmei.file.utils;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.lowagie.text.*;
 import com.lowagie.text.pdf.*;
@@ -14,18 +15,18 @@ import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Iterator;
 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
         FileOutputStream fos = new FileOutputStream(filename);
-        log.info("filename,{}",filename);
+        log.info("filename,{}", filename);
         final PdfWriter writer = PdfWriter.getInstance(document, fos);
         document.open();
         // 使用语言包字
@@ -201,6 +202,196 @@ public class PdfUtil {
         document.add(table);
     }
 
+    public static void dealResumptionBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
+        PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_CENTER, 6, 0);
+        PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_CENTER, 0, 0);
+        PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_CENTER, 0, 0);
+
+        final Map<String,List<AppResumptionDataInfoVo>> lists = (Map<String,List<AppResumptionDataInfoVo>>) data.get("items");
+        if (ObjectUtil.isEmpty(lists)) {
+            return;
+        }
+        Iterator<String> iterator=lists.keySet().iterator();
+        while (iterator.hasNext()) {
+            List<AppResumptionDataInfoVo> list = lists.get(iterator.next());
+            //不同的执行时刻
+            String execTimeName = iterator.next();
+            PdfUtil.createPDFCell(tableFont, table, getLineStr(execTimeName), PdfPCell.ALIGN_MIDDLE, 0, list.size());
+            int o=1;
+            for (AppResumptionDataInfoVo listVo : list) {
+
+                // 检查内容
+                String rowContent = o+ "、" + listVo.getPointName();
+                PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 5, 0);
+                // 检查情况
+                PdfUtil.createPDFCell(tableFont, table, listVo.getExecuteResult(), Element.ALIGN_CENTER, 0, 0);
+                // 检查人
+                PdfUtil.createPDFCell(tableFont, table, listVo.getCheckName(), Element.ALIGN_CENTER, 0, 0);
+                o++;
+            }
+        }
+
+
+        // 备注数据
+        PdfUtil.createPDFCell(tableFont, table, getLineStr("备注"), PdfPCell.ALIGN_MIDDLE, 0, 0);
+        PdfUtil.createPDFCell(tableFont, table, data.get("remark").toString(), Element.ALIGN_LEFT, 7, 0);
+
+        document.add(table);
+
+        Paragraph foot = new Paragraph("                  注:检查情况正常打“√”;发现问题打“×”,并在备注中具体说明。", tableFont);
+//        Paragraph foot = new Paragraph("                  注:检查情况正常打“√”;发现问题打“×”,并在备注中具体说明。", new Font(fs, 8, Font.NORMAL));
+        foot.setAlignment(Paragraph.ALIGN_LEFT);
+        //在后方加入16个空格
+        document.add(foot);
+
+
+
+
+        //
+//
+////        //段落
+////        Paragraph p = new Paragraph("测试结算单", new Font(abf, 12, Font.BOLD));
+////        p.setAlignment(Paragraph.ALIGN_CENTER);
+////        document.add(p);
+//
+//        //表格
+//        table.setSpacingBefore(16f);//表格与上面段落的空隙
+//
+//        //表格列创建并赋值
+//        PdfPCell cell = new PdfPCell(new Phrase("单位名称:测试有限公司", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_LEFT);//居中
+//        cell.disableBorderSide(13);//去除左右上边框,保留下边框
+//        cell.setColspan(4);//合并列数
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("日期:2020-06-05", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        cell.disableBorderSide(13);
+//        cell.setColspan(3);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("单位(元)", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+//        cell.disableBorderSide(13);
+//        cell.setColspan(1);
+//        table.addCell(cell);
+//        //首行
+//        cell = new PdfPCell(new Phrase("期间", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        cell.setColspan(2);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("月份", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("分类", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("年利率", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("日利率", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("基数", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("利息", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//
+//        cell = new PdfPCell(new Phrase("起始日:2020-03-26\n" +
+//                "结束日:2020-04-25", font));
+//        cell.setPadding(16f);
+//        cell.setVerticalAlignment(Element.ALIGN_CENTER);
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        cell.setRowspan(3);
+//        cell.setColspan(2);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("4", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("资金", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("1.10%", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("0.000031", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("10598164.91", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("325.01", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//
+//        cell = new PdfPCell(new Phrase("4", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("资金", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("1.10%", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("0.000031", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("-", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("-", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//
+//        cell = new PdfPCell(new Phrase("4", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("资金", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("1.10%", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("0.000031", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("-", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("-", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//
+//        cell = new PdfPCell(new Phrase("合计", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        cell.setColspan(7);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("325.01", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
+//        table.addCell(cell);
+//
+//        cell = new PdfPCell(new Phrase("会计制单:", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+//        cell.disableBorderSide(14);
+//        cell.setColspan(4);
+//        table.addCell(cell);
+//        cell = new PdfPCell(new Phrase("复核:", font));
+//        cell.setHorizontalAlignment(Element.ALIGN_LEFT);
+//        cell.disableBorderSide(14);
+//        cell.setColspan(4);
+//        table.addCell(cell);
+//        table.setSpacingBefore(16f);
+//
+//
+//        document.add(table);
+}
+    public static String getLineStr(String str) {
+        StringBuilder result = new StringBuilder();
+        for (int i = 0; i < str.length(); i++) {
+            result.append(str.charAt(i)).append("\r");
+        }
+        return result.toString();
+    }
     public static void dealDrillBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
         //第一行
         createPDFCell(tableFont, table, "演练单位", Element.ALIGN_CENTER, 1, 1);
@@ -324,7 +515,7 @@ public class PdfUtil {
             for (String image : row) {
                 Image imageData = null;
                 try {
-                    imageData=  getImage(image);
+                    imageData = getImage(image);
                 } catch (Exception e) {
                     final ApplicationContext applicationContext = SpringUtil.getApplicationContext();
                     final Resource[] resources = applicationContext.getResources("classpath:file/black.png");