Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
e9a1b837
提交
e9a1b837
authored
4月 17, 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
上级
5159e174
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
299 行增加
和
72 行删除
+299
-72
DocumentServiceImpl.java
...va/com/zjty/inspect/service/impl/DocumentServiceImpl.java
+1
-3
DocumentWordUtil.java
src/main/java/com/zjty/inspect/utils/DocumentWordUtil.java
+264
-60
WpsUtil.java
src/main/java/com/zjty/inspect/utils/WpsUtil.java
+34
-9
没有找到文件。
src/main/java/com/zjty/inspect/service/impl/DocumentServiceImpl.java
浏览文件 @
e9a1b837
...
@@ -42,9 +42,7 @@ public class DocumentServiceImpl implements DocumentService {
...
@@ -42,9 +42,7 @@ public class DocumentServiceImpl implements DocumentService {
String
name
=
titleHead
.
getName
();
String
name
=
titleHead
.
getName
();
if
(!
StringUtils
.
isEmpty
(
name
))
{
if
(!
StringUtils
.
isEmpty
(
name
))
{
//标题级别
//标题级别
int
parentId
=
titleHead
.
getParentId
();
String
s
=
titleContent
.
replaceAll
(
"#title#"
,
name
);
String
s
=
titleContent
.
replaceAll
(
"#title#"
,
name
)
.
replaceAll
(
"#parentId#"
,
String
.
valueOf
(
parentId
));
sb
.
append
(
s
);
sb
.
append
(
s
);
}
}
List
<
DocumentContent
>
documentContents
=
titleHead
.
getDocumentContents
();
List
<
DocumentContent
>
documentContents
=
titleHead
.
getDocumentContents
();
...
...
src/main/java/com/zjty/inspect/utils/DocumentWordUtil.java
浏览文件 @
e9a1b837
...
@@ -2,6 +2,7 @@ package com.zjty.inspect.utils;
...
@@ -2,6 +2,7 @@ package com.zjty.inspect.utils;
import
com.zjty.inspect.entity.DocumentContent
;
import
com.zjty.inspect.entity.DocumentContent
;
import
com.zjty.inspect.entity.DocumentPage
;
import
com.zjty.inspect.entity.DocumentPage
;
import
com.zjty.inspect.entity.TechnologyContent
;
import
com.zjty.inspect.entity.TitleHead
;
import
com.zjty.inspect.entity.TitleHead
;
import
com.zjty.inspect.enums.DocumentTitleEnum
;
import
com.zjty.inspect.enums.DocumentTitleEnum
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -96,47 +97,25 @@ public class DocumentWordUtil {
...
@@ -96,47 +97,25 @@ public class DocumentWordUtil {
}
}
public
static
String
getTableString
(
List
<
String
>
tables
,
int
col
){
public
static
String
getTableString
(
List
<
TechnologyContent
>
tables
,
String
technologyName
,
String
stra
){
int
i
=
8818
/
col
;
//key 表格标题,value 内容
//key 表格标题,value 内容
String
standtab
=
standtab
();
String
s3
=
tableTile
(
technologyName
,
stra
);
String
tabtr
=
tabtr
();
String
s4
=
Matcher
.
quoteReplacement
(
s3
);
String
tatr
=
Matcher
.
quoteReplacement
(
tabtr
);
String
tabtb
=
tabtb
();
String
tatb
=
Matcher
.
quoteReplacement
(
tabtb
);
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb1
=
new
StringBuilder
(
);
sb
.
append
(
s4
);
for
(
int
j
=
0
;
j
<
tables
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
tables
.
size
();
j
++)
{
if
(
j
==
0
){
String
gettb
=
gettb
(
tables
.
get
(
j
));
String
gettr
=
gettb
(
tatr
,
i
,
tables
.
get
(
j
));
String
s1
=
Matcher
.
quoteReplacement
(
gettb
);
sb
.
append
(
gettr
);
sb
.
append
(
s1
);
continue
;
}
System
.
out
.
println
(
tabtb
);
String
gettb
=
gettb
(
tatb
,
i
,
tables
.
get
(
j
));
sb1
.
append
(
gettb
);
}
}
String
sta
=
Matcher
.
quoteReplacement
(
standtab
);
sb
.
append
(
"</w:tbl>"
);
String
s1
=
Matcher
.
quoteReplacement
(
sb
.
toString
());
return
sb
.
toString
();
String
s2
=
Matcher
.
quoteReplacement
(
sb1
.
toString
());
String
s
=
sta
.
replaceAll
(
"#tc1#"
,
s1
).
replaceAll
(
"#tb1#"
,
s2
);
System
.
out
.
println
(
s
);
return
s
;
}
}
public
static
String
gettb
(
String
tb
,
int
i
,
String
key
){
public
static
String
gettb
(
TechnologyContent
technologyContent
){
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
String
biaoge
=
biaoge
();
String
biaoge
=
biaoge
(
technologyContent
);
sb
.
append
(
biaoge
);
sb
.
append
(
biaoge
);
String
keys
=
Matcher
.
quoteReplacement
(
key
);
String
[]
split
=
keys
.
split
(
","
);
for
(
String
s
:
split
)
{
System
.
out
.
println
(
s
);
String
s1
=
tb
.
replaceAll
(
"#target#"
,
s
);
String
s2
=
s1
.
replaceAll
(
"#colW#"
,
""
+
i
);
sb
.
append
(
s2
);
}
sb
.
append
(
"</w:tr>"
);
return
sb
.
toString
();
return
sb
.
toString
();
}
}
...
@@ -485,6 +464,165 @@ public class DocumentWordUtil {
...
@@ -485,6 +464,165 @@ public class DocumentWordUtil {
" <w:docGrid w:type=\"lines\" w:line-pitch=\"312\"/>\n"
+
" <w:docGrid w:type=\"lines\" w:line-pitch=\"312\"/>\n"
+
" </w:sectPr>"
;
" </w:sectPr>"
;
}
}
public
static
String
tableTile
(
String
technologyName
,
String
strategy
){
return
"<w:p>\n"
+
" <w:pPr>\n"
+
" <w:pStyle w:val=\"4\"/>\n"
+
" <w:listPr>\n"
+
" <w:ilvl w:val=\"2\"/>\n"
+
" <w:ilfo w:val=\"1\"/>\n"
+
" </w:listPr>\n"
+
" </w:pPr>\n"
+
" <aml:annotation aml:id=\"18\" w:type=\"Word.Bookmark.Start\" w:name=\"_Toc37973773\"/>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>可优化的项</w:t>\n"
+
" </w:r>\n"
+
" <aml:annotation aml:id=\"18\" w:type=\"Word.Bookmark.End\"/>\n"
+
" </w:p>\n"
+
" <w:p>\n"
+
" <w:pPr>\n"
+
" <w:tabs>\n"
+
" <w:tab w:val=\"left\" w:pos=\"5422\"/>\n"
+
" </w:tabs>\n"
+
" </w:pPr>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>关键技术:"
+
technologyName
+
"</w:t>\n"
+
" </w:r>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" </w:rPr>\n"
+
" <w:tab/>\n"
+
" </w:r>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>替换策略:"
+
strategy
+
"</w:t>\n"
+
" </w:r>\n"
+
" </w:p>"
+
"<w:tbl>\n"
+
" <w:tblPr>\n"
+
" <w:tblStyle w:val=\"a13\"/>\n"
+
" <w:tblW w:w=\"0\" w:type=\"auto\"/>\n"
+
" <w:tblInd w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:tblBorders>\n"
+
" <w:top w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:left w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:bottom w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:right w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:insideH w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:insideV w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" </w:tblBorders>\n"
+
" <w:tblCellMar>\n"
+
" <w:top w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:left w:w=\"108\" w:type=\"dxa\"/>\n"
+
" <w:bottom w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:right w:w=\"108\" w:type=\"dxa\"/>\n"
+
" </w:tblCellMar>\n"
+
" </w:tblPr>\n"
+
" <w:tblGrid>\n"
+
" <w:gridCol w:w=\"1161\"/>\n"
+
" <w:gridCol w:w=\"6515\"/>\n"
+
" <w:gridCol w:w=\"846\"/>\n"
+
" </w:tblGrid>\n"
+
" <w:tr>\n"
+
" <w:tblPrEx>\n"
+
" <w:tblBorders>\n"
+
" <w:top w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:left w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:bottom w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:right w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:insideH w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:insideV w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" </w:tblBorders>\n"
+
" <w:tblCellMar>\n"
+
" <w:top w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:left w:w=\"108\" w:type=\"dxa\"/>\n"
+
" <w:bottom w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:right w:w=\"108\" w:type=\"dxa\"/>\n"
+
" </w:tblCellMar>\n"
+
" </w:tblPrEx>\n"
+
" <w:trPr/>\n"
+
" <w:tc>\n"
+
" <w:tcPr>\n"
+
" <w:tcW w:w=\"579\" w:type=\"dxa\"/>\n"
+
" <w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>\n"
+
" </w:tcPr>\n"
+
" <w:p>\n"
+
" <w:pPr>\n"
+
" <w:spacing w:line=\"240\" w:line-rule=\"auto\"/>\n"
+
" <w:jc w:val=\"center\"/>\n"
+
" <w:rPr>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" </w:pPr>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>关键字</w:t>\n"
+
" </w:r>\n"
+
" </w:p>\n"
+
" </w:tc>\n"
+
" <w:tc>\n"
+
" <w:tcPr>\n"
+
" <w:tcW w:w=\"7484\" w:type=\"dxa\"/>\n"
+
" <w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>\n"
+
" </w:tcPr>\n"
+
" <w:p>\n"
+
" <w:pPr>\n"
+
" <w:spacing w:line=\"240\" w:line-rule=\"auto\"/>\n"
+
" <w:jc w:val=\"center\"/>\n"
+
" <w:rPr>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" </w:pPr>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>所在文件</w:t>\n"
+
" </w:r>\n"
+
" </w:p>\n"
+
" </w:tc>\n"
+
" <w:tc>\n"
+
" <w:tcPr>\n"
+
" <w:tcW w:w=\"459\" w:type=\"dxa\"/>\n"
+
" <w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>\n"
+
" </w:tcPr>\n"
+
" <w:p>\n"
+
" <w:pPr>\n"
+
" <w:spacing w:line=\"240\" w:line-rule=\"auto\"/>\n"
+
" <w:jc w:val=\"center\"/>\n"
+
" <w:rPr>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" </w:pPr>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>位置</w:t>\n"
+
" </w:r>\n"
+
" </w:p>\n"
+
" </w:tc>\n"
+
" </w:tr>\n"
;
}
public
static
String
enddard
(){
public
static
String
enddard
(){
return
"<w:sectPr>\n"
+
return
"<w:sectPr>\n"
+
" <w:hdr w:type=\"odd\">\n"
+
" <w:hdr w:type=\"odd\">\n"
+
...
@@ -1277,34 +1415,100 @@ public class DocumentWordUtil {
...
@@ -1277,34 +1415,100 @@ public class DocumentWordUtil {
" <wx:sect>\n"
;
" <wx:sect>\n"
;
return
str
;
return
str
;
}
}
public
static
String
biaoge
(){
public
static
String
biaoge
(
TechnologyContent
content
){
return
"<w:tr>\n"
+
return
"<w:tr>\n"
+
" <w:tblPrEx>\n"
+
" <w:tblPrEx>\n"
+
" <w:tblBorders>\n"
+
" <w:tblBorders>\n"
+
" <w:top w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:top w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:left\n"
+
" <w:left w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:bottom w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:bottom w:val=\"single\" w:sz=\"4\"\n"
+
" <w:right w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" wx:bdrwidth=\"10\" w:space=\"0\"\n"
+
" <w:insideH w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" w:color=\"auto\"/>\n"
+
" <w:insideV w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:right\n"
+
" </w:tblBorders>\n"
+
" w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" <w:tblCellMar>\n"
+
" <w:insideH w:val=\"single\" w:sz=\"4\"\n"
+
" <w:top w:w=\"0\" w:type=\"dxa\"/>\n"
+
" wx:bdrwidth=\"10\" w:space=\"0\"\n"
+
" <w:left w:w=\"108\" w:type=\"dxa\"/>\n"
+
" w:color=\"auto\"/>\n"
+
" <w:bottom w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:insideV\n"
+
" <w:right w:w=\"108\" w:type=\"dxa\"/>\n"
+
" w:val=\"single\" w:sz=\"4\" wx:bdrwidth=\"10\" w:space=\"0\" w:color=\"auto\"/>\n"
+
" </w:tblCellMar>\n"
+
" </w:tblBorders>\n"
+
" </w:tblPrEx>\n"
+
" <w:tblCellMar>\n"
+
" <w:trPr>\n"
+
" <w:top w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:trHeight w:val=\"756\" w:h-rule=\"atLeast\"/>\n"
+
" <w:left w:w=\"108\" w:type=\"dxa\"/>\n"
+
" </w:trPr>\n"
+
" <w:bottom w:w=\"0\" w:type=\"dxa\"/>\n"
+
" <w:tc>\n"
+
" <w:right w:w=\"108\" w:type=\"dxa\"/>\n"
+
" <w:tcPr>\n"
+
" </w:tblCellMar>\n"
+
" <w:tcW w:w=\"0\" w:type=\"auto\"/>\n"
+
" </w:tblPrEx>\n"
+
" <w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>\n"
+
" <w:trPr>\n"
+
" </w:tcPr>\n"
+
" <w:trHeight w:val=\"400\" w:h-rule=\"atLeast\"/>\n"
+
" <w:p>\n"
+
" </w:trPr>"
;
" <w:pPr>\n"
+
" <w:spacing w:line=\"240\" w:line-rule=\"auto\"/>\n"
+
" <w:jc w:val=\"center\"/>\n"
+
" <w:rPr>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" </w:pPr>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>"
+
content
.
getKeyWord
()+
"</w:t>\n"
+
" </w:r>\n"
+
" </w:p>\n"
+
" </w:tc>\n"
+
" <w:tc>\n"
+
" <w:tcPr>\n"
+
" <w:tcW w:w=\"0\" w:type=\"auto\"/>\n"
+
" <w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>\n"
+
" </w:tcPr>\n"
+
" <w:p>\n"
+
" <w:pPr>\n"
+
" <w:spacing w:line=\"240\" w:line-rule=\"auto\"/>\n"
+
" <w:jc w:val=\"center\"/>\n"
+
" <w:rPr>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" </w:pPr>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>"
+
content
.
getFile
()+
"</w:t>\n"
+
" </w:r>\n"
+
" </w:p>\n"
+
" </w:tc>\n"
+
" <w:tc>\n"
+
" <w:tcPr>\n"
+
" <w:tcW w:w=\"0\" w:type=\"auto\"/>\n"
+
" <w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>\n"
+
" </w:tcPr>\n"
+
" <w:p>\n"
+
" <w:pPr>\n"
+
" <w:spacing w:line=\"240\" w:line-rule=\"auto\"/>\n"
+
" <w:jc w:val=\"center\"/>\n"
+
" <w:rPr>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" </w:pPr>\n"
+
" <w:r>\n"
+
" <w:rPr>\n"
+
" <w:rFonts w:hint=\"fareast\"/>\n"
+
" <w:sz w:val=\"21\"/>\n"
+
" <w:sz-cs w:val=\"21\"/>\n"
+
" </w:rPr>\n"
+
" <w:t>"
+
content
.
getPosition
()+
"</w:t>\n"
+
" </w:r>\n"
+
" </w:p>\n"
+
" </w:tc>\n"
+
" </w:tr>"
;
}
}
public
static
String
createDocument
(
DocumentPage
documentPage
)
{
public
static
String
createDocument
(
DocumentPage
documentPage
)
{
...
...
src/main/java/com/zjty/inspect/utils/WpsUtil.java
浏览文件 @
e9a1b837
...
@@ -6,10 +6,7 @@ import com.zjty.inspect.enums.*;
...
@@ -6,10 +6,7 @@ import com.zjty.inspect.enums.*;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author Mcj
* @author Mcj
...
@@ -19,6 +16,7 @@ import java.util.Map;
...
@@ -19,6 +16,7 @@ import java.util.Map;
public
class
WpsUtil
{
public
class
WpsUtil
{
public
static
Map
<
String
,
String
>
createWps
(
Evaluation
evaluation
)
{
public
static
Map
<
String
,
String
>
createWps
(
Evaluation
evaluation
)
{
HashMap
<
String
,
List
<
TechnologyContent
>>
teMap
=
new
HashMap
<>();
Reform
reform
=
JSON
.
parseObject
(
evaluation
.
getInEva
(),
Reform
.
class
);
Reform
reform
=
JSON
.
parseObject
(
evaluation
.
getInEva
(),
Reform
.
class
);
AssessmentReport
assessmentReport
=
JSON
.
parseObject
(
evaluation
.
getOutEva
(),
AssessmentReport
.
class
);
AssessmentReport
assessmentReport
=
JSON
.
parseObject
(
evaluation
.
getOutEva
(),
AssessmentReport
.
class
);
HashMap
<
String
,
String
>
keyValue
=
new
HashMap
<>();
HashMap
<
String
,
String
>
keyValue
=
new
HashMap
<>();
...
@@ -139,6 +137,7 @@ public class WpsUtil {
...
@@ -139,6 +137,7 @@ public class WpsUtil {
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
format
=
simpleDateFormat
.
format
(
assessmentReport
.
getTime
());
String
format
=
simpleDateFormat
.
format
(
assessmentReport
.
getTime
());
keyValue
.
put
(
"inspectTime"
,
format
);
keyValue
.
put
(
"inspectTime"
,
format
);
keyValue
.
put
(
"createTime"
,
System
.
currentTimeMillis
()+
""
);
keyValue
.
put
(
"difficulty"
,
String
.
valueOf
(
assessmentReport
.
getDifficulty
()));
keyValue
.
put
(
"difficulty"
,
String
.
valueOf
(
assessmentReport
.
getDifficulty
()));
keyValue
.
put
(
"budget"
,
assessmentReport
.
getBudget
());
keyValue
.
put
(
"budget"
,
assessmentReport
.
getBudget
());
...
@@ -166,6 +165,32 @@ public class WpsUtil {
...
@@ -166,6 +165,32 @@ public class WpsUtil {
keyValue
.
put
(
"technologyContentStrategy"
+
i
+
1
+
"-"
+
i1
+
1
,
getMode
(
technologyContent
.
getStrategy
()));
keyValue
.
put
(
"technologyContentStrategy"
+
i
+
1
+
"-"
+
i1
+
1
,
getMode
(
technologyContent
.
getStrategy
()));
}
}
}
}
for
(
TechnologyReport
technologyReport
:
technologyReports
)
{
teMap
.
put
(
technologyReport
.
getTechnology
(),
technologyReport
.
getTechnologyContents
());
}
Set
<
String
>
strings
=
teMap
.
keySet
();
StringBuilder
youhua
=
new
StringBuilder
();
StringBuilder
xiugai
=
new
StringBuilder
();
StringBuilder
weizhi
=
new
StringBuilder
();
for
(
String
string
:
strings
)
{
if
(
string
.
contains
(
"优化"
)){
List
<
TechnologyContent
>
technologyContents
=
teMap
.
get
(
string
);
String
str
=
DocumentWordUtil
.
getTableString
(
technologyContents
,
string
,
"优化"
);
youhua
.
append
(
str
);
}
else
if
(
string
.
contains
(
"不支持"
)){
List
<
TechnologyContent
>
technologyContents
=
teMap
.
get
(
string
);
String
str
=
DocumentWordUtil
.
getTableString
(
technologyContents
,
string
,
"重新开发"
);
xiugai
.
append
(
str
);
}
else
if
(
string
.
contains
(
"未知"
)){
List
<
TechnologyContent
>
technologyContents
=
teMap
.
get
(
string
);
String
str
=
DocumentWordUtil
.
getTableString
(
technologyContents
,
string
,
"验证修改或重新开发"
);
weizhi
.
append
(
str
);
}
}
keyValue
.
put
(
"teyouhua"
,
youhua
.
toString
());
keyValue
.
put
(
"texiugai"
,
xiugai
.
toString
());
keyValue
.
put
(
"teweizhi"
,
weizhi
.
toString
());
Workload
workload
=
assessmentReport
.
getWorkload
();
Workload
workload
=
assessmentReport
.
getWorkload
();
keyValue
.
put
(
"workloadDes"
,
workload
.
getDes
());
keyValue
.
put
(
"workloadDes"
,
workload
.
getDes
());
keyValue
.
put
(
"workloadCost"
,
String
.
valueOf
(
workload
.
getCost
()));
keyValue
.
put
(
"workloadCost"
,
String
.
valueOf
(
workload
.
getCost
()));
...
@@ -244,11 +269,11 @@ public class WpsUtil {
...
@@ -244,11 +269,11 @@ public class WpsUtil {
}
}
public
static
DocumentContent
setDocumentTable
(
List
<
String
>
data
,
int
col
){
public
static
DocumentContent
setDocumentTable
(
List
<
String
>
data
,
int
col
){
String
tableString
=
DocumentWordUtil
.
getTableString
(
data
,
col
);
//
String tableString = DocumentWordUtil.getTableString(data, col);
DocumentContent
documentContent
=
new
DocumentContent
();
//
DocumentContent documentContent = new DocumentContent();
//
设置进head标题下面的表格中
//
设置进head标题下面的表格中
documentContent
.
setDocumentTable
(
tableString
);
//
documentContent.setDocumentTable(tableString);
return
documentContent
;
return
null
;
}
}
public
static
List
<
DocumentContent
>
setDocumentContents
(
DocumentContent
documentContent
){
public
static
List
<
DocumentContent
>
setDocumentContents
(
DocumentContent
documentContent
){
ArrayList
<
DocumentContent
>
documentContents
=
new
ArrayList
<>();
ArrayList
<
DocumentContent
>
documentContents
=
new
ArrayList
<>();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论