Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
5159e174
提交
5159e174
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
上级
42cb19ed
9ada4862
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
134 行增加
和
3 行删除
+134
-3
MvcConfig.java
src/main/java/com/zjty/inspect/config/MvcConfig.java
+2
-0
EvaluationController.java
...ava/com/zjty/inspect/controller/EvaluationController.java
+14
-0
Download.java
src/main/java/com/zjty/inspect/entity/Download.java
+17
-0
ExcelDataTemp.java
src/main/java/com/zjty/inspect/entity/ExcelDataTemp.java
+2
-1
Framework.java
src/main/java/com/zjty/inspect/enums/Framework.java
+28
-2
DocumentWordUtil.java
src/main/java/com/zjty/inspect/utils/DocumentWordUtil.java
+66
-0
ExcelUtil.java
src/main/java/com/zjty/inspect/utils/ExcelUtil.java
+3
-0
WpsUtil.java
src/main/java/com/zjty/inspect/utils/WpsUtil.java
+0
-0
application.properties
src/main/resources/application.properties
+2
-0
没有找到文件。
src/main/java/com/zjty/inspect/config/MvcConfig.java
浏览文件 @
5159e174
...
@@ -32,6 +32,8 @@ public class MvcConfig extends WebMvcConfigurationSupport {
...
@@ -32,6 +32,8 @@ public class MvcConfig extends WebMvcConfigurationSupport {
registry
.
addResourceHandler
(
"doc.html"
).
addResourceLocations
(
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"doc.html"
).
addResourceLocations
(
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/webjars/**"
)
registry
.
addResourceHandler
(
"/webjars/**"
)
.
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
.
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
registry
.
addResourceHandler
(
"/static/**"
)
.
addResourceLocations
(
"classpath:/static/"
);
}
}
@Override
@Override
...
...
src/main/java/com/zjty/inspect/controller/EvaluationController.java
浏览文件 @
5159e174
...
@@ -5,6 +5,7 @@ import com.zjty.inspect.aop.AuthAnnotation;
...
@@ -5,6 +5,7 @@ import com.zjty.inspect.aop.AuthAnnotation;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.service.EvaluationService
;
import
com.zjty.inspect.service.EvaluationService
;
import
com.zjty.inspect.utils.ExcelUtil
;
import
com.zjty.inspect.utils.ExcelUtil
;
import
com.zjty.inspect.utils.WpsUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
...
@@ -135,4 +136,17 @@ public class EvaluationController {
...
@@ -135,4 +136,17 @@ public class EvaluationController {
Page
<
Evaluation
>
pageList
=
evaluationService
.
findSearch
(
searchMap
,
page
,
size
);
Page
<
Evaluation
>
pageList
=
evaluationService
.
findSearch
(
searchMap
,
page
,
size
);
return
ResponseEntity
.
ok
(
new
PageResult
<
Evaluation
>(
pageList
.
getTotalElements
(),
pageList
.
getContent
())
);
return
ResponseEntity
.
ok
(
new
PageResult
<
Evaluation
>(
pageList
.
getTotalElements
(),
pageList
.
getContent
())
);
}
}
/**
* 修改评估报告
* @param id id
* @return
*/
@GetMapping
(
value
=
"/bg/{id}"
)
@ApiOperation
(
"修改评估报告"
)
public
ResponseEntity
findall
(
@PathVariable
String
id
){
Evaluation
evaluation
=
evaluationService
.
findById
(
id
);
Map
<
String
,
String
>
wps
=
WpsUtil
.
createWps
(
evaluation
);
return
ResponseEntity
.
ok
(
wps
);
}
}
}
src/main/java/com/zjty/inspect/entity/Download.java
0 → 100644
浏览文件 @
5159e174
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
Download
{
private
String
id
;
//主键
private
String
danjia
;
//单位
private
String
yusuan
;
//总预算金额
private
String
gong
;
//工作量
private
String
ewai
;
//额外申请
}
src/main/java/com/zjty/inspect/entity/ExcelDataTemp.java
浏览文件 @
5159e174
...
@@ -3,6 +3,7 @@ package com.zjty.inspect.entity;
...
@@ -3,6 +3,7 @@ package com.zjty.inspect.entity;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -13,5 +14,5 @@ import java.util.List;
...
@@ -13,5 +14,5 @@ import java.util.List;
public
class
ExcelDataTemp
{
public
class
ExcelDataTemp
{
private
String
name
;
private
String
name
;
private
List
<
ExcelDataEntity
>
arrayList
=
new
ArrayList
();
private
List
<
ExcelDataEntity
>
arrayList
=
new
LinkedList
<>
();
}
}
src/main/java/com/zjty/inspect/enums/Framework.java
浏览文件 @
5159e174
package
com
.
zjty
.
inspect
.
enums
;
package
com
.
zjty
.
inspect
.
enums
;
import
java.util.HashMap
;
import
java.util.Map
;
public
enum
Framework
{
public
enum
Framework
{
/**
/**
* 架构
* 架构
*/
*/
SEPARATE
(
"分离型架构"
,
1
),
SEPARATE
(
"分离型架构"
,
1
),
MIXTURE
(
"混合型架构"
,
2
)
;
MIXTURE
(
"混合型架构"
,
2
)
,
NONE
(
"无"
,
3
);
Framework
(
String
name
,
Integer
status
){
Framework
(
String
name
,
Integer
status
){
this
.
name
=
name
;
this
.
name
=
name
;
this
.
status
=
status
;
this
.
status
=
status
;
...
@@ -24,4 +27,27 @@ public enum Framework {
...
@@ -24,4 +27,27 @@ public enum Framework {
public
Integer
getStatus
()
{
public
Integer
getStatus
()
{
return
status
;
return
status
;
}
}
private
static
Map
<
String
,
Framework
>
frameWorkEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
Framework
>
frameWorkEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
Framework
frameWorkEnum
:
Framework
.
values
())
{
frameWorkEnumMap
.
put
(
frameWorkEnum
.
getName
(),
frameWorkEnum
);
frameWorkEnumCodeMap
.
put
(
frameWorkEnum
.
getStatus
(),
frameWorkEnum
);
}
}
public
static
Framework
getByName
(
String
name
){
Framework
frameWorkEnum
=
frameWorkEnumMap
.
get
(
name
);
if
(
frameWorkEnum
==
null
){
return
NONE
;
}
return
frameWorkEnum
;
}
public
static
Framework
getByCode
(
Integer
code
){
Framework
frameWorkEnum
=
frameWorkEnumCodeMap
.
get
(
code
);
if
(
frameWorkEnum
==
null
){
return
NONE
;
}
return
frameWorkEnum
;
}
}
}
src/main/java/com/zjty/inspect/utils/DocumentWordUtil.java
浏览文件 @
5159e174
package
com
.
zjty
.
inspect
.
utils
;
package
com
.
zjty
.
inspect
.
utils
;
import
com.zjty.inspect.entity.DocumentContent
;
import
com.zjty.inspect.entity.DocumentPage
;
import
com.zjty.inspect.entity.TitleHead
;
import
com.zjty.inspect.enums.DocumentTitleEnum
;
import
com.zjty.inspect.enums.DocumentTitleEnum
;
import
org.springframework.util.StringUtils
;
import
java.util.List
;
import
java.util.List
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
...
@@ -1302,4 +1306,66 @@ public class DocumentWordUtil {
...
@@ -1302,4 +1306,66 @@ public class DocumentWordUtil {
" <w:trHeight w:val=\"400\" w:h-rule=\"atLeast\"/>\n"
+
" <w:trHeight w:val=\"400\" w:h-rule=\"atLeast\"/>\n"
+
" </w:trPr>"
;
" </w:trPr>"
;
}
}
public
static
String
createDocument
(
DocumentPage
documentPage
)
{
StringBuilder
sb
=
new
StringBuilder
();
//前面部分内容
String
standard
=
DocumentWordUtil
.
standard
();
String
enddard
=
DocumentWordUtil
.
enddard
();
//标题内容
String
maintitle
=
DocumentWordUtil
.
Maintitle
();
// String subheading = DocumentWordUtil.subheading();
//标题下的内容
String
standContent
=
DocumentWordUtil
.
content
();
//表格内容
//页眉
String
header
=
documentPage
.
getHeader
();
String
s1
=
maintitle
.
replaceAll
(
"#title#"
,
header
);
sb
.
append
(
standard
);
sb
.
append
(
s1
);
List
<
TitleHead
>
titleHeads
=
documentPage
.
getTitleHeads
();
if
(
titleHeads
!=
null
&&
titleHeads
.
size
()>
0
){
for
(
TitleHead
titleHead
:
titleHeads
)
{
DocumentTitleEnum
byCode
=
DocumentTitleEnum
.
getByCode
(
titleHead
.
getParentId
());
if
(
byCode
!=
null
)
{
String
titleContent
=
DocumentWordUtil
.
subheading
(
byCode
);
//标题名称
String
name
=
titleHead
.
getName
();
if
(!
StringUtils
.
isEmpty
(
name
))
{
//标题级别
int
parentId
=
titleHead
.
getParentId
();
String
s
=
titleContent
.
replaceAll
(
"#title#"
,
name
)
.
replaceAll
(
"#parentId#"
,
String
.
valueOf
(
parentId
));
sb
.
append
(
s
);
}
List
<
DocumentContent
>
documentContents
=
titleHead
.
getDocumentContents
();
if
(
documentContents
!=
null
&&
documentContents
.
size
()
>
0
)
{
for
(
DocumentContent
documentContent
:
documentContents
)
{
if
(
documentContent
!=
null
)
{
String
content
=
documentContent
.
getContent
();
String
baseUrl
=
documentContent
.
getBaseUrl
();
String
documentTable
=
documentContent
.
getDocumentTable
();
if
(!
StringUtils
.
isEmpty
(
content
))
{
String
c
=
standContent
;
String
s
=
c
.
replaceAll
(
"#content#"
,
content
);
sb
.
append
(
s
);
}
if
(!
StringUtils
.
isEmpty
(
baseUrl
))
{
}
if
(!
StringUtils
.
isEmpty
(
documentTable
))
{
sb
.
append
(
documentTable
);
}
}
}
}
}
}
}
sb
.
append
(
enddard
);
return
sb
.
toString
();
}
}
}
src/main/java/com/zjty/inspect/utils/ExcelUtil.java
浏览文件 @
5159e174
...
@@ -472,12 +472,15 @@ public class ExcelUtil {
...
@@ -472,12 +472,15 @@ public class ExcelUtil {
public
static
List
<
ExcelDataTemp
>
parseExcel2Entity
(
Evaluation
evaluation
)
{
public
static
List
<
ExcelDataTemp
>
parseExcel2Entity
(
Evaluation
evaluation
)
{
ArrayList
<
ExcelDataTemp
>
excelDataTemps
=
new
ArrayList
<>();
ArrayList
<
ExcelDataTemp
>
excelDataTemps
=
new
ArrayList
<>();
ArrayList
<
String
>
tables
=
new
ArrayList
<>();
String
inEva
=
evaluation
.
getInEva
();
String
inEva
=
evaluation
.
getInEva
();
ExcelDataTemp
excelDataTemp
=
new
ExcelDataTemp
();
ExcelDataTemp
excelDataTemp
=
new
ExcelDataTemp
();
excelDataTemp
.
setName
(
"基本信息"
);
excelDataTemp
.
setName
(
"基本信息"
);
List
<
ExcelDataEntity
>
arrayList
=
excelDataTemp
.
getArrayList
();
List
<
ExcelDataEntity
>
arrayList
=
excelDataTemp
.
getArrayList
();
if
(
inEva
!=
null
)
{
if
(
inEva
!=
null
)
{
Reform
reform
=
JSON
.
parseObject
(
evaluation
.
getInEva
(),
Reform
.
class
);
Reform
reform
=
JSON
.
parseObject
(
evaluation
.
getInEva
(),
Reform
.
class
);
arrayList
.
add
(
exportEntity
(
"用户名"
,
reform
.
getUsername
()));
arrayList
.
add
(
exportEntity
(
"用户名"
,
reform
.
getUsername
()));
if
(
reform
.
getAssessmentType
()==
1
){
if
(
reform
.
getAssessmentType
()==
1
){
arrayList
.
add
(
exportEntity
(
"评估类型"
,
"快速评估"
));
arrayList
.
add
(
exportEntity
(
"评估类型"
,
"快速评估"
));
...
...
src/main/java/com/zjty/inspect/utils/WpsUtil.java
0 → 100644
浏览文件 @
5159e174
差异被折叠。
点击展开。
src/main/resources/application.properties
浏览文件 @
5159e174
...
@@ -66,4 +66,5 @@ spring.freemarker.template-loader-path=classpath:/templates
...
@@ -66,4 +66,5 @@ spring.freemarker.template-loader-path=classpath:/templates
#spring.redis.port=6379
#spring.redis.port=6379
##Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
##Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
#spring.redis.password=
#spring.redis.password=
#宁波项目服务器ip
address
=
120.55.57.35
address
=
120.55.57.35
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论