Quellcode durchsuchen

1.机器设备报告生成新增对多种不同报告的生成支持
2.新增机器设备融资项目咨询报告生成

GouGengquan vor 4 Monaten
Ursprung
Commit
7c35331d9c

+ 2 - 1
dao/src/main/java/com/dayou/mapper/TmplAssetReportMapper.java

@@ -35,8 +35,9 @@ public interface TmplAssetReportMapper extends BaseMapper<TmplAssetReport> {
     /**
      * 根据模板code获取报告主模板
      * @param tmplCode 模板code
+     * @param reportType 模板类型
      * @return TmplAssetReport
      */
-    TmplAssetReport getTmplByCode(@Param("tmplCode") String tmplCode);
+    TmplAssetReport getTmplByCode(@Param("tmplCode") String tmplCode, @Param("reportType") String reportType);
 
 }

+ 2 - 1
dao/src/main/java/com/dayou/mapper/TmplAssetReportSectionMapper.java

@@ -23,7 +23,8 @@ public interface TmplAssetReportSectionMapper extends BaseMapper<TmplAssetReport
     /**
      * 根据模板code获取报告段落模板
      * @param tmplCode 模板code
+     * @param templateReportId 主模板id
      * @return TmplAssetReportSection
      */
-    TmplAssetReportSection getTmplByCode(@Param("tmplCode") String tmplCode);
+    TmplAssetReportSection getTmplByCode(@Param("tmplCode") String tmplCode, @Param("templateReportId") Long templateReportId);
 }

+ 1 - 0
dao/src/main/resources/mapper/TmplAssetReportMapper.xml

@@ -48,6 +48,7 @@
         FROM tmpl_asset_report
         WHERE delete_status = 0
         AND tmpl_code = #{tmplCode}
+        AND report_type = #{reportType}
     </select>
 
 </mapper>

+ 13 - 8
domain/src/main/java/com/dayou/dto/report/equipment/EqptReportBaseInfoDTO.java

@@ -8,17 +8,22 @@ import java.util.List;
 public class EqptReportBaseInfoDTO {
 
     /**
-     * 评估报告名称
+     * 报告类型(评估报告\咨询报告)
+     */
+    private String reportType;
+
+    /**
+     * 报告名称
      */
     private String reportName;
 
     /**
-     * 评估目的
+     * 目的
      */
     private String purpose;
 
     /**
-     * 评估范围
+     * 范围
      */
     private String scope;
 
@@ -33,7 +38,7 @@ public class EqptReportBaseInfoDTO {
     private String preparationPhase;
 
     /**
-     * 评估基准日
+     * 基准日
      */
     private String valuationBasisDate;
 
@@ -43,12 +48,12 @@ public class EqptReportBaseInfoDTO {
     private String fieldInvestigationDay;
 
     /**
-     * 评估方法
+     * 方法
      */
     private String method;
 
     /**
-     * 评估结论
+     * 结论
      */
     private String conclusion;
 
@@ -58,12 +63,12 @@ public class EqptReportBaseInfoDTO {
     private String hasVAT;
 
     /**
-     * 评估报告日
+     * 报告日
      */
     private String reportDate;
 
     /**
-     * 报告有效期
+     * 有效期
      */
     private String reportValidity;
 

+ 3 - 0
domain/src/main/java/com/dayou/entity/AssetsReport.java

@@ -1,4 +1,6 @@
 package com.dayou.entity;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.dayou.common.BaseEntity;
 
 import java.io.Serializable;
@@ -52,6 +54,7 @@ public class AssetsReport extends BaseEntity implements Serializable {
     /**
      * 报告号(产品号)
      */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String productionNo;
 
 }

+ 3 - 0
domain/src/main/java/com/dayou/enums/CRReportTmplCode.java

@@ -1,5 +1,8 @@
 package com.dayou.enums;
 
+/**
+ * 债权报告
+ */
 public enum CRReportTmplCode {
 
     ANALYSIS_MAIN("ANALYSIS_MAIN", "债权分析报告-框架-主模板"),

+ 19 - 8
domain/src/main/java/com/dayou/enums/EqptReportTmplCode.java

@@ -1,15 +1,26 @@
 package com.dayou.enums;
 
+/**
+ * 机器设备融资项目报告
+ */
 public enum EqptReportTmplCode {
 
-    MAIN("MAIN", "设备融资项目报告-框架-主模板"),
-    COVER("COVER", "设备融资项目报告-封面-段落模板"),
-    CATALOGUE("CATALOGUE", "设备融资项目报告-目录-段落模板"),
-    ATTACHMENTS("ATTACHMENTS", "设备融资项目报告-附件-段落模板"),
-    DETAIL("DETAIL", "设备融资项目报告-正文-段落模板"),
-    DIGEST("DIGEST", "设备融资项目报告-摘要-段落模板"),
-    CONSIGNOR("CONSIGNOR", "设备融资项目报告-委托人概况-段落模板"),
-    PROPERTY_OWNER("PROPERTY_OWNER", "设备融资项目报告-产权持有人概况-段落模板");
+    MAIN("MAIN", "设备融资项目评估报告-框架-主模板"),
+    COVER("COVER", "设备融资项目评估报告-封面-段落模板"),
+    CATALOGUE("CATALOGUE", "设备融资项目评估报告-目录-段落模板"),
+    ATTACHMENTS("ATTACHMENTS", "设备融资项目评估报告-附件-段落模板"),
+    DETAIL("DETAIL", "设备融资项目评估报告-正文-段落模板"),
+    DIGEST("DIGEST", "设备融资项目评估报告-摘要-段落模板"),
+    CONSIGNOR("CONSIGNOR", "设备融资项目评估报告-委托人概况-段落模板"),
+    PROPERTY_OWNER("PROPERTY_OWNER", "设备融资项目评估报告-产权持有人概况-段落模板"),
+    CONSULT_MAIN("CONSULT_MAIN", "设备融资项目咨询报告-框架-主模板"),
+    CONSULT_COVER("CONSULT_COVER", "设备融资项目咨询报告-封面-段落模板"),
+    CONSULT_CATALOGUE("CONSULT_CATALOGUE", "设备融资项目咨询报告-目录-段落模板"),
+    CONSULT_ATTACHMENTS("CONSULT_ATTACHMENTS", "设备融资项目咨询报告-附件-段落模板"),
+    CONSULT_DETAIL("CONSULT_DETAIL", "设备融资项目咨询报告-正文-段落模板"),
+    CONSULT_DIGEST("CONSULT_DIGEST", "设备融资项目咨询报告-摘要-段落模板"),
+    CONSULT_CONSIGNOR("CONSULT_CONSIGNOR", "设备融资项目咨询报告-委托人概况-段落模板"),
+    CONSULT_PROPERTY_OWNER("CONSULT_PROPERTY_OWNER", "设备融资项目咨询报告-产权持有人概况-段落模板");
 
     private String code;
 

+ 98 - 57
service/src/main/java/com/dayou/service/impl/AssetsReportServiceImpl.java

@@ -205,10 +205,61 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         // 将评估报告日转换为中文并设置到中文评估报告日中
         eqptReportFillBO.setChineseReportDate(DateToChinese.dateStrConvertChinese(eqptReportFillBO.getEqptReportBaseInfo().getReportDate()));
 
+        // 获取框架模板(主模板)
+        TmplAssetReport mainTmpl;
+        // 获取封面模板
+        TmplAssetReportSection coverTmpl = null;
+        // 获取摘要模板
+        TmplAssetReportSection digestTmpl = null;
+        // 获取正文模板
+        TmplAssetReportSection detailTmpl = null;
+        // 获取委托人概况模板
+        TmplAssetReportSection consignorTmpl = null;
+        // 获取产权持有人概况模板
+        TmplAssetReportSection ownerTmpl = null;
+        // 获取目录模板
+        TmplAssetReportSection catalogueTmpl = null;
+        // 获取附件模板
+        TmplAssetReportSection attachmentsTmpl = null;
+        if (eqptReportFillBO.getEqptReportBaseInfo().getReportType().equals("评估报告")) {
+            // 获取框架模板(主模板)
+            mainTmpl = tmplAssetReportMapper.getTmplByCode(MAIN.getCode(), "机器设备");
+            // 获取封面模板
+            coverTmpl = reportSectionMapper.getTmplByCode(COVER.getCode(), mainTmpl.getId());
+            // 获取摘要模板
+            digestTmpl = reportSectionMapper.getTmplByCode(DIGEST.getCode(), mainTmpl.getId());
+            // 获取正文模板
+            detailTmpl = reportSectionMapper.getTmplByCode(DETAIL.getCode(), mainTmpl.getId());
+            // 获取委托人概况模板
+            consignorTmpl = reportSectionMapper.getTmplByCode(CONSIGNOR.getCode(), mainTmpl.getId());
+            // 获取产权持有人概况模板
+            ownerTmpl = reportSectionMapper.getTmplByCode(PROPERTY_OWNER.getCode(), mainTmpl.getId());
+            // 获取目录模板
+            catalogueTmpl = reportSectionMapper.getTmplByCode(CATALOGUE.getCode(), mainTmpl.getId());
+            // 获取附件模板
+            attachmentsTmpl = reportSectionMapper.getTmplByCode(ATTACHMENTS.getCode(), mainTmpl.getId());
+        } else if (eqptReportFillBO.getEqptReportBaseInfo().getReportType().equals("咨询报告")) {
+            // 获取框架模板(主模板)
+            mainTmpl = tmplAssetReportMapper.getTmplByCode(CONSULT_MAIN.getCode(), "机器设备");
+            // 获取封面模板
+            coverTmpl = reportSectionMapper.getTmplByCode(CONSULT_COVER.getCode(), mainTmpl.getId());
+            // 获取摘要模板
+            digestTmpl = reportSectionMapper.getTmplByCode(CONSULT_DIGEST.getCode(), mainTmpl.getId());
+            // 获取正文模板
+            detailTmpl = reportSectionMapper.getTmplByCode(CONSULT_DETAIL.getCode(), mainTmpl.getId());
+            // 获取委托人概况模板
+            consignorTmpl = reportSectionMapper.getTmplByCode(CONSULT_CONSIGNOR.getCode(), mainTmpl.getId());
+            // 获取产权持有人概况模板
+            ownerTmpl = reportSectionMapper.getTmplByCode(CONSULT_PROPERTY_OWNER.getCode(), mainTmpl.getId());
+            // 获取目录模板
+            catalogueTmpl = reportSectionMapper.getTmplByCode(CONSULT_CATALOGUE.getCode(), mainTmpl.getId());
+            // 获取附件模板
+            attachmentsTmpl = reportSectionMapper.getTmplByCode(CONSULT_ATTACHMENTS.getCode(), mainTmpl.getId());
+        } else {
+            throw new BusinessException("无符合条件的模板,请咨询系统管理人员了解详情");
+        }
 
         // 第一步:设置封面
-        // 获取封面模板
-        TmplAssetReportSection coverTmpl = reportSectionMapper.getTmplByCode(COVER.getCode());
         // 封面模板文件位置
         String coverTmplPath = fileNetConfig.getBaseDir() + coverTmpl.getSectionFileUrl() + coverTmpl.getSectionFileName();
         // 读取模板文件
@@ -220,8 +271,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
 
 
         // 第二步:设置摘要内容
-        // 获取摘要模板
-        TmplAssetReportSection digestTmpl = reportSectionMapper.getTmplByCode(DIGEST.getCode());
         // 封面模板文件位置
         String digestTmplPath = fileNetConfig.getBaseDir() + digestTmpl.getSectionFileUrl() + digestTmpl.getSectionFileName();
         // 读取模板文件
@@ -232,8 +281,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         InputStream digestIs = new ByteArrayInputStream(resultdigestByte);
 
         // 第三步:设置正文内容
-        // 获取正文模板
-        TmplAssetReportSection detailTmpl = reportSectionMapper.getTmplByCode(DETAIL.getCode());
         // 封面模板文件位置
         String detailTmplPath = fileNetConfig.getBaseDir() + detailTmpl.getSectionFileUrl() + detailTmpl.getSectionFileName();
         // 读取模板文件
@@ -252,8 +299,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         }
 
         // 第四步:设置委托人概况到正文
-        // 获取委托人概况模板
-        TmplAssetReportSection consignorTmpl = reportSectionMapper.getTmplByCode(CONSIGNOR.getCode());
         // 委托人概况模板文件位置
         String consignorTmplPath = fileNetConfig.getBaseDir() + consignorTmpl.getSectionFileUrl() + consignorTmpl.getSectionFileName();
         // 插入时会导致先插入的排在后插入的后面,所以把顺序反转一下
@@ -271,8 +316,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         }
 
         // 第五步:设置产权持有人概况到正文
-        // 获取产权持有人概况模板
-        TmplAssetReportSection ownerTmpl = reportSectionMapper.getTmplByCode(PROPERTY_OWNER.getCode());
         // 产权持有人概况模板文件位置
         String ownerTmplPath = fileNetConfig.getBaseDir() + ownerTmpl.getSectionFileUrl() + ownerTmpl.getSectionFileName();
         for (int i = eqptReportFillBO.getEqptReportBaseInfo().getPropertyOwnerInfos().size(); i > 0; i--) {
@@ -289,8 +332,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         }
 
         // 第六步:设置主体框架
-        // 获取框架模板
-        TmplAssetReport mainTmpl = tmplAssetReportMapper.getTmplByCode(MAIN.getCode());
         // 框架生成后文件位置
         String docUrl = fileNetConfig.getAssetOutputReportPath() + System.currentTimeMillis() + "_设备融资报告.docx";
         String mainPath = fileNetConfig.getBaseDir() + docUrl;
@@ -309,15 +350,11 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         // 将正文插入到框架
         AsposeWordUtil.insertDocumentAfterBookMark(mainDoc, detailDoc, "insertDetail", false, false);
 
-        // 获取目录模板
-        TmplAssetReportSection catalogueTmpl = reportSectionMapper.getTmplByCode(CATALOGUE.getCode());
         // 目录模板文件位置
         String catalogueTmplPath = fileNetConfig.getBaseDir() + catalogueTmpl.getSectionFileUrl() + catalogueTmpl.getSectionFileName();
         // 将框架读取出来
         Document catalogueDoc = new Document(catalogueTmplPath);
 
-        // 获取附件模板
-        TmplAssetReportSection attachmentsTmpl = reportSectionMapper.getTmplByCode(ATTACHMENTS.getCode());
         // 附件模板文件位置
         String attachmentsPath = fileNetConfig.getBaseDir() + attachmentsTmpl.getSectionFileUrl() + attachmentsTmpl.getSectionFileName();
         // 读取模板文件
@@ -333,25 +370,25 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         AsposeWordUtil.insertDocumentAfterBookMark(mainDoc, catalogueDoc, "insertCatalogue", false, false);
 
         // 第七步:删除预留书签插入位置的空白行
-        DocumentBuilder mainBuilder = new DocumentBuilder(mainDoc);
-        // 移除正文的书签所在段落
-        mainBuilder.moveToBookmark("insertDetail");
-        mainBuilder.getCurrentParagraph().remove();
-        // 移除摘要的书签所在段落
-        mainBuilder.moveToBookmark("insertDigest");
-        mainBuilder.getCurrentParagraph().remove();
-        // 移除目录的书签所在段落
-        mainBuilder.moveToBookmark("insertCatalogue");
-        mainBuilder.getCurrentParagraph().remove();
-        // 移除附件的书签所在段落
-        mainBuilder.moveToBookmark("insertAttachments");
-        mainBuilder.getCurrentParagraph().remove();
-        // 移除委托人概况的书签所在段落
-        mainBuilder.moveToBookmark("insertConsignor");
-        mainBuilder.getCurrentParagraph().remove();
-        // 移除产权持有人概况的书签所在段落
-        mainBuilder.moveToBookmark("insertPropertyOwner");
-        mainBuilder.getCurrentParagraph().remove();
+//        DocumentBuilder mainBuilder = new DocumentBuilder(mainDoc);
+//        // 移除正文的书签所在段落
+//        mainBuilder.moveToBookmark("insertDetail");
+//        mainBuilder.getCurrentParagraph().remove();
+//        // 移除摘要的书签所在段落
+//        mainBuilder.moveToBookmark("insertDigest");
+//        mainBuilder.getCurrentParagraph().remove();
+//        // 移除目录的书签所在段落
+//        mainBuilder.moveToBookmark("insertCatalogue");
+//        mainBuilder.getCurrentParagraph().remove();
+//        // 移除附件的书签所在段落
+//        mainBuilder.moveToBookmark("insertAttachments");
+//        mainBuilder.getCurrentParagraph().remove();
+//        // 移除委托人概况的书签所在段落
+//        mainBuilder.moveToBookmark("insertConsignor");
+//        mainBuilder.getCurrentParagraph().remove();
+//        // 移除产权持有人概况的书签所在段落
+//        mainBuilder.moveToBookmark("insertPropertyOwner");
+//        mainBuilder.getCurrentParagraph().remove();
 
         // 第八步:生成并保存文档
         // 将封面和文档进行拼接
@@ -407,6 +444,31 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
      */
     @Override
     public Boolean generateCRReport(Long reportId) throws Exception {
+
+        // 获取框架模板
+        TmplAssetReport mainTmpl = tmplAssetReportMapper.getTmplByCode(ANALYSIS_MAIN.getCode(), "债权");
+        // 获取封面模板
+        TmplAssetReportSection coverTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_COVER.getCode(), mainTmpl.getId());
+        // 获取摘要模板
+        TmplAssetReportSection digestTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DIGEST.getCode(), mainTmpl.getId());
+        // 获取正文模板
+        TmplAssetReportSection detailTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DETAIL.getCode(), mainTmpl.getId());
+        // 获取债务人信息模板
+        TmplAssetReportSection debtorTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DEBTOR.getCode(), mainTmpl.getId());
+        // 获取自然人保证人信息模板
+        TmplAssetReportSection personGuarantorTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_PERSON_GUARANTOR.getCode(), mainTmpl.getId());
+        // 获取企业保证人信息模板
+        TmplAssetReportSection enterpriseGuarantorTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_ENTERPRISE_GUARANTOR.getCode(), mainTmpl.getId());
+        // 获取资产情况模板
+        TmplAssetReportSection debtorAssetTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DEBTOR_ASSET.getCode(), mainTmpl.getId());
+        TmplAssetReportSection guarantorAssetTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_GUARANTOR_ASSET.getCode(), mainTmpl.getId());
+        // 获取诉讼情况信息模板
+        TmplAssetReportSection lawsuitTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_LAWSUIT.getCode(), mainTmpl.getId());
+        // 获取诉讼情况信息模板
+        TmplAssetReportSection guarantorAdditionalDebtRepaymentSourcesTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_GUARANTOR_ADDITIONAL_DEBT_REPAYMENT_SOURCES.getCode(), mainTmpl.getId());
+        // 获取目录模板
+        TmplAssetReportSection catalogueTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_CATALOGUE.getCode(), mainTmpl.getId());
+
         // 获取与设置基础报告信息
         ObjectMapper objectMapper = new ObjectMapper();
         CRReportFillBO crReportFillBO = assetsReportMapper.getCRReportFillBO(reportId);
@@ -574,8 +636,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         crReportFillBO.setConsolidatedList(consolidatedList);
 
         // 第一步:设置封面
-        // 获取封面模板
-        TmplAssetReportSection coverTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_COVER.getCode());
         // 封面模板文件位置
         String coverTmplPath = fileNetConfig.getBaseDir() + coverTmpl.getSectionFileUrl() + coverTmpl.getSectionFileName();
         // 读取模板文件
@@ -585,8 +645,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         // 将封面的字节流转成输入流以供后续使用
         InputStream coverIs = new ByteArrayInputStream(resultCoverByte);
 
-        // 获取摘要模板
-        TmplAssetReportSection digestTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DIGEST.getCode());
         // 封面模板文件位置
         String digestTmplPath = fileNetConfig.getBaseDir() + digestTmpl.getSectionFileUrl() + digestTmpl.getSectionFileName();
         // 读取模板文件
@@ -597,8 +655,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         InputStream digestIs = new ByteArrayInputStream(resultdigestByte);
 
         // 第三步:设置正文内容
-        // 获取正文模板
-        TmplAssetReportSection detailTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DETAIL.getCode());
         // 封面模板文件位置
         String detailTmplPath = fileNetConfig.getBaseDir() + detailTmpl.getSectionFileUrl() + detailTmpl.getSectionFileName();
         // 读取模板文件
@@ -612,8 +668,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         Document detailDoc = new Document(detailIs);
 
         // 第四步:设置债务人信息到正文
-        // 获取债务人信息模板
-        TmplAssetReportSection debtorTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DEBTOR.getCode());
         // 债务人信息模板文件位置
         String debtorTmplPath = fileNetConfig.getBaseDir() + debtorTmpl.getSectionFileUrl() + debtorTmpl.getSectionFileName();
         // 插入时会导致先插入的排在后插入的后面,所以把顺序反转一下
@@ -630,8 +684,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         }
 
         // 第五步:设置保证人信息到正文
-        // 获取企业保证人信息模板
-        TmplAssetReportSection enterpriseGuarantorTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_ENTERPRISE_GUARANTOR.getCode());
         // 企业保证人信息模板文件位置
         String enterpriseGuarantorTmplPath = fileNetConfig.getBaseDir() + enterpriseGuarantorTmpl.getSectionFileUrl() + enterpriseGuarantorTmpl.getSectionFileName();
         // 插入时会导致先插入的排在后插入的后面,所以把顺序反转一下
@@ -647,8 +699,7 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
             detailDoc = AsposeWordUtil.insertDocumentAfterBookMark(detailDoc, new Document(enterpriseGuarantorIs), "insertEnterpriseGuarantor", false, false);
             enterpriseGuarantorIs.close();
         }
-        // 获取自然人保证人信息模板
-        TmplAssetReportSection personGuarantorTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_PERSON_GUARANTOR.getCode());
+
         // 自然人保证人信息模板文件位置
         String personGuarantorTmplPath = fileNetConfig.getBaseDir() + personGuarantorTmpl.getSectionFileUrl() + personGuarantorTmpl.getSectionFileName();
         // 插入时会导致先插入的排在后插入的后面,所以把顺序反转一下(企业和自然人用同一个序号排序)
@@ -665,8 +716,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         }
 
         // 设置资产情况
-        TmplAssetReportSection debtorAssetTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_DEBTOR_ASSET.getCode());
-        TmplAssetReportSection guarantorAssetTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_GUARANTOR_ASSET.getCode());
         String debtorAssetTmplPath = fileNetConfig.getBaseDir() + debtorAssetTmpl.getSectionFileUrl() + debtorAssetTmpl.getSectionFileName();
         String guarantorAssetTmplPath = fileNetConfig.getBaseDir() + guarantorAssetTmpl.getSectionFileUrl() + guarantorAssetTmpl.getSectionFileName();
         int guarantorAssetSort = crReportFillBO.getReportBaseInfo().getPersonGuarantorList().size() + enterpriseCount;
@@ -693,8 +742,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
             }
         }
 
-        // 获取诉讼情况信息模板
-        TmplAssetReportSection lawsuitTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_LAWSUIT.getCode());
         // 诉讼情况信息模板文件位置
         String lawsuitTmplPath = fileNetConfig.getBaseDir() + lawsuitTmpl.getSectionFileUrl() + lawsuitTmpl.getSectionFileName();
         // 插入时会导致先插入的排在后插入的后面,所以把顺序反转一下(企业和自然人用同一个序号排序)
@@ -710,8 +757,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
             lawsuitIs.close();
         }
 
-        // 获取诉讼情况信息模板
-        TmplAssetReportSection guarantorAdditionalDebtRepaymentSourcesTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_GUARANTOR_ADDITIONAL_DEBT_REPAYMENT_SOURCES.getCode());
         // 诉讼情况信息模板文件位置
         String guarantorAdditionalDebtRepaymentSourcesPath = fileNetConfig.getBaseDir() + guarantorAdditionalDebtRepaymentSourcesTmpl.getSectionFileUrl() + guarantorAdditionalDebtRepaymentSourcesTmpl.getSectionFileName();
         // 插入时会导致先插入的排在后插入的后面,所以把顺序反转一下(企业和自然人用同一个序号排序)
@@ -728,8 +773,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         }
 
         // 第六步:设置主体框架
-        // 获取框架模板
-        TmplAssetReport mainTmpl = tmplAssetReportMapper.getTmplByCode(ANALYSIS_MAIN.getCode());
         // 框架生成后文件位置
         String docUrl = fileNetConfig.getAssetOutputReportPath() + System.currentTimeMillis() + "_债权分析报告.docx";
         String mainPath = fileNetConfig.getBaseDir() + docUrl;
@@ -748,8 +791,6 @@ public class AssetsReportServiceImpl extends ServiceImpl<AssetsReportMapper, Ass
         // 将正文插入到框架
         AsposeWordUtil.insertDocumentAfterBookMark(mainDoc, detailDoc, "insertDetail", false, false);
 
-        // 获取目录模板
-        TmplAssetReportSection catalogueTmpl = reportSectionMapper.getTmplByCode(ANALYSIS_CATALOGUE.getCode());
         // 目录模板文件位置
         String catalogueTmplPath = fileNetConfig.getBaseDir() + catalogueTmpl.getSectionFileUrl() + catalogueTmpl.getSectionFileName();
         // 将框架读取出来