Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
b2c9fc51
提交
b2c9fc51
authored
4月 18, 2020
作者:
孙洁清
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge branch 'lj-project' of git.yfzx.zjtys.com.cn:912-system/monitor/inspect into lj-project
# Conflicts: # src/main/java/com/zjty/inspect/utils/DocumentWordUtil.java
上级
e9a1b837
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
3 行删除
+30
-3
FreeMakerUtils.java
src/main/java/com/zjty/inspect/utils/FreeMakerUtils.java
+29
-2
WpsUtil.java
src/main/java/com/zjty/inspect/utils/WpsUtil.java
+1
-1
没有找到文件。
src/main/java/com/zjty/inspect/utils/FreeMakerUtils.java
浏览文件 @
b2c9fc51
...
...
@@ -10,7 +10,7 @@ import java.util.Map;
public
class
FreeMakerUtils
{
public
static
String
parseTpl
(
String
viewName
,
Map
<
String
,
List
<
TechnologyContent
>>
params
)
{
public
static
String
parseTpl
(
String
viewName
,
Map
params
)
{
Configuration
cfg
=
SpringContextHolder
.
getBean
(
Configuration
.
class
);
String
html
=
null
;
Template
t
=
null
;
...
...
@@ -18,7 +18,7 @@ public class FreeMakerUtils {
t
=
cfg
.
getTemplate
(
viewName
+
".ftl"
);
createWord
(
t
,
params
);
// html = FreeMarkerTemplateUtils.processTemplateIntoString(t, params);
System
.
out
.
println
(
html
);
//
System.out.println(html);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -78,5 +78,32 @@ public class FreeMakerUtils {
}
}
}
public
static
void
createStringTemplate
(
Map
map
,
String
template
){
try
{
//文件路径
String
filePath
=
"E://doc"
;
//文件名称
String
fileName
=
System
.
currentTimeMillis
()+
".doc"
;
// 输出文件
File
outFile
=
new
File
(
filePath
+
File
.
separator
+
fileName
);
// 如果输出目标文件夹不存在,则创建
if
(!
outFile
.
getParentFile
().
exists
())
{
outFile
.
getParentFile
().
mkdirs
();
}
// 将模板和数据模型合并生成文件
Writer
out
=
new
BufferedWriter
(
new
OutputStreamWriter
(
new
FileOutputStream
(
outFile
),
"UTF-8"
));
Template
t
=
new
Template
(
"template"
,
new
StringReader
(
template
),
new
Configuration
(
Configuration
.
VERSION_2_3_23
));
t
.
process
(
map
,
out
);
// 关闭流
out
.
flush
();
out
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
src/main/java/com/zjty/inspect/utils/WpsUtil.java
浏览文件 @
b2c9fc51
...
...
@@ -264,7 +264,7 @@ public class WpsUtil {
ProgramDifficulty
programDifficulty
=
difficultyAssessment
.
getProgramDifficulty
();
keyValue
.
put
(
"programDifficultyDifficulty"
,
String
.
valueOf
(
programDifficulty
.
getDifficulty
()));
keyValue
.
put
(
"programDifficultyLoad"
,
String
.
valueOf
(
programDifficulty
.
getLoad
()));
FreeMakerUtils
.
parseTpl
(
"报告模板"
,
keyValue
);
return
keyValue
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论