|
@@ -215,23 +215,19 @@ public abstract class ExportPaperAbstractService {
|
|
|
protected static Template FDSF_TMPLATE_ANSWER;
|
|
|
|
|
|
//原卷word A4 模板
|
|
|
- public static Template ORIGINAL_PAPER;
|
|
|
+ public static Template ORIGINAL_PAPER = null;
|
|
|
|
|
|
- public static Configuration CONFIGURATION;
|
|
|
+ private static Configuration CONFIGURATION;
|
|
|
|
|
|
static {
|
|
|
+ CONFIGURATION = new Configuration(Configuration.VERSION_2_3_25);
|
|
|
+ // 设置编码
|
|
|
+ CONFIGURATION.setDefaultEncoding(ENCODING);
|
|
|
+ // 设置ftl模板路径
|
|
|
+ CONFIGURATION.setClassForTemplateLoading(DocxProcessUtil.class, "/");
|
|
|
+
|
|
|
try {
|
|
|
- CONFIGURATION = new Configuration(Configuration.VERSION_2_3_25);
|
|
|
- // 设置编码
|
|
|
- CONFIGURATION.setDefaultEncoding(ENCODING);
|
|
|
- // 设置ftl模板路径
|
|
|
- CONFIGURATION.setClassForTemplateLoading(DocxProcessUtil.class, "/");
|
|
|
-
|
|
|
- CONFIGURATION = new Configuration(Configuration.VERSION_2_3_25);
|
|
|
- // 设置编码
|
|
|
- CONFIGURATION.setDefaultEncoding(ENCODING);
|
|
|
- // 设置ftl模板路径
|
|
|
- CONFIGURATION.setClassForTemplateLoading(DocxProcessUtil.class, "/");
|
|
|
+ ORIGINAL_PAPER = CONFIGURATION.getTemplate("original_paper.ftl", ENCODING);
|
|
|
|
|
|
SXSF_TEMPLATE_PAPER = CONFIGURATION.getTemplate("sxsf_paper_template.ftl", ENCODING);
|
|
|
SXSF_TEMPLATE_ANSWER = CONFIGURATION.getTemplate("sxsf_answer_template.ftl", ENCODING);
|
|
@@ -304,8 +300,6 @@ public abstract class ExportPaperAbstractService {
|
|
|
|
|
|
FDSF_TMPLATE_PAPER = CONFIGURATION.getTemplate("fdsf_paper_template.ftl", ENCODING);
|
|
|
FDSF_TMPLATE_ANSWER = CONFIGURATION.getTemplate("fdsf_answer_template.ftl", ENCODING);
|
|
|
-
|
|
|
- ORIGINAL_PAPER = CONFIGURATION.getTemplate("original_paper.ftl", ENCODING);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
}
|