Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
91296989
提交
91296989
authored
3月 06, 2020
作者:
czq
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git.yfzx.zjtys.com.cn:912-system/monitor/inspect into czq
上级
991472e0
8cf638f1
隐藏空白字符变更
内嵌
并排
正在显示
39 个修改的文件
包含
955 行增加
和
256 行删除
+955
-256
InspectController.java
...n/java/com/zjty/inspect/controller/InspectController.java
+57
-29
ReportController.java
...in/java/com/zjty/inspect/controller/ReportController.java
+37
-0
RuleController.java
...main/java/com/zjty/inspect/controller/RuleController.java
+10
-1
ConfigParamDao.java
src/main/java/com/zjty/inspect/dao/ConfigParamDao.java
+12
-0
ReportDao.java
src/main/java/com/zjty/inspect/dao/ReportDao.java
+7
-0
RuleDao.java
src/main/java/com/zjty/inspect/dao/RuleDao.java
+11
-0
TechnologyDao.java
src/main/java/com/zjty/inspect/dao/TechnologyDao.java
+21
-1
BudgetVo.java
src/main/java/com/zjty/inspect/entity/BudgetVo.java
+20
-0
Category.java
src/main/java/com/zjty/inspect/entity/Category.java
+19
-0
CoefficientModel.java
src/main/java/com/zjty/inspect/entity/CoefficientModel.java
+4
-1
CoefficientModelVo.java
...main/java/com/zjty/inspect/entity/CoefficientModelVo.java
+25
-0
Config.java
src/main/java/com/zjty/inspect/entity/Config.java
+24
-0
InspectParameter.java
src/main/java/com/zjty/inspect/entity/InspectParameter.java
+30
-8
Page.java
src/main/java/com/zjty/inspect/entity/Page.java
+41
-0
Report.java
src/main/java/com/zjty/inspect/entity/Report.java
+3
-36
ReportManage.java
src/main/java/com/zjty/inspect/entity/ReportManage.java
+14
-0
ReportVo.java
src/main/java/com/zjty/inspect/entity/ReportVo.java
+18
-9
RuleQo.java
src/main/java/com/zjty/inspect/entity/RuleQo.java
+3
-1
Technology.java
src/main/java/com/zjty/inspect/entity/Technology.java
+8
-1
DependenceManagement.java
...ain/java/com/zjty/inspect/enums/DependenceManagement.java
+19
-2
Framework.java
src/main/java/com/zjty/inspect/enums/Framework.java
+27
-0
Language.java
src/main/java/com/zjty/inspect/enums/Language.java
+36
-7
RecastMethod.java
src/main/java/com/zjty/inspect/enums/RecastMethod.java
+27
-0
Inspector.java
src/main/java/com/zjty/inspect/inspect/Inspector.java
+46
-24
ParameterService.java
src/main/java/com/zjty/inspect/service/ParameterService.java
+1
-1
ReportService.java
src/main/java/com/zjty/inspect/service/ReportService.java
+8
-4
RuleService.java
src/main/java/com/zjty/inspect/service/RuleService.java
+1
-0
TechnologyService.java
...main/java/com/zjty/inspect/service/TechnologyService.java
+14
-0
InspectServiceImpl.java
...ava/com/zjty/inspect/service/impl/InspectServiceImpl.java
+24
-11
ReportServiceImpl.java
...java/com/zjty/inspect/service/impl/ReportServiceImpl.java
+37
-7
RuleServiceImpl.java
...n/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
+39
-13
TechnologyServiceImpl.java
.../com/zjty/inspect/service/impl/TechnologyServiceImpl.java
+25
-0
BudgetUitl.java
src/main/java/com/zjty/inspect/utils/BudgetUitl.java
+114
-34
FileUtil.java
src/main/java/com/zjty/inspect/utils/FileUtil.java
+52
-14
RandomUtil.java
src/main/java/com/zjty/inspect/utils/RandomUtil.java
+40
-0
TimeUtil.java
src/main/java/com/zjty/inspect/utils/TimeUtil.java
+9
-2
application-dev.properties
src/main/resources/application-dev.properties
+4
-1
application.properties
src/main/resources/application.properties
+4
-1
pg.ftl
src/main/resources/templates/pg.ftl
+64
-48
没有找到文件。
src/main/java/com/zjty/inspect/controller/InspectController.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.entity.InspectParameter
;
import
com.zjty.inspect.entity.ReportVo
;
import
com.zjty.inspect.entity.Warn
;
import
com.zjty.inspect.dao.TechnologyDao
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.service.InspectService
;
import
com.zjty.inspect.service.ParameterService
;
import
com.zjty.inspect.service.ReportService
;
import
com.zjty.inspect.service.TechnologyService
;
import
com.zjty.inspect.utils.*
;
import
freemarker.template.TemplateException
;
import
io.swagger.annotations.Api
;
...
...
@@ -33,7 +35,14 @@ public class InspectController {
@Autowired
private
InspectService
inspectService
;
@Autowired
private
TechnologyService
technologyService
;
@Autowired
private
ParameterService
parameterService
;
@Autowired
private
ReportService
reportService
;
/**
* 上传代码进行评估
* @param years 系统开发时间
...
...
@@ -52,52 +61,71 @@ public class InspectController {
@PostMapping
(
"/path"
)
@ApiOperation
(
"上传代码进行评估"
)
public
ResponseEntity
inspect
(
Integer
years
,
Integer
systemFund
,
Integer
modules
,
String
valid
,
Double
framework
,
Double
safety
,
Double
disaster
,
Integer
data
,
Integer
admin
,
String
projectName
,
String
fileName
,
MultipartFile
multfile
)
throws
IOException
{
,
String
valid
,
Integer
framework
,
Integer
safety
,
Integer
disaster
,
Integer
data
,
Integer
admin
,
String
projectName
,
Integer
tables
,
String
databaseType
,
Integer
method
,
MultipartFile
multfile
)
throws
IOException
{
File
file
=
FileUtil
.
saveToLocal
(
multfile
);
InspectParameter
inspectParameter
=
new
InspectParameter
();
inspectParameter
.
setSourceAddress
(
file
.
getPath
());
inspectParameter
.
setSourceAddress
(
file
.
get
Canonical
Path
());
inspectParameter
.
setSystemFund
(
systemFund
);
inspectParameter
.
setAdmin
(
admin
);
inspectParameter
.
setModules
(
modules
);
inspectParameter
.
setSafety
(
safety
);
inspectParameter
.
setTables
(
tables
);
inspectParameter
.
setValid
(
valid
);
inspectParameter
.
setYears
(
years
);
inspectParameter
.
setDisaster
(
disaster
);
inspectParameter
.
setData
(
data
);
inspectParameter
.
setFramework
(
framework
);
inspectParameter
.
setPath
(
file
.
getCanonicalPath
());
inspectParameter
.
setRecastMethod
(
method
);
inspectParameter
.
setId
(
UUIDUtil
.
getUUID
());
ReportVo
reportVo
=
new
ReportVo
();
int
count
=
technologyService
.
findAllTechnologyCount
();
reportVo
.
setTechnologiesNum
(
count
);
int
support
=
technologyService
.
findAllTechnologyNotSupport
();
reportVo
.
setTechnologiesRepair
(
support
);
reportVo
.
setId
(
TimeUtil
.
getNowDate
());
reportVo
.
setId
(
RandomUtil
.
getRandom
());
reportVo
.
setUploadType
(
"文件上传"
);
reportVo
.
setFileName
(
file
Name
);
reportVo
.
setFileName
(
file
.
getName
()
);
reportVo
.
setProjectName
(
projectName
);
reportVo
.
setSourceAddress
(
file
.
getCanonicalPath
());
reportVo
.
setDatabaseType
(
databaseType
);
ReportVo
inspect
=
inspectService
.
inspect
(
reportVo
,
inspectParameter
);
// Map map=new HashMap();
// map.put("inspect",inspect);
// HashMap<String, List<Warn>> warnDetails = inspect.getWarnDetails();
// map.put("warnDetails",warnDetails);
// try {
// String template = FreemarkerUtils.getTemplate("pg.ftl", map);
// String s = inspectService.generateHtml(template, map);
// } catch (TemplateException e) {
// e.printStackTrace();
// }
Map
map
=
new
HashMap
();
map
.
put
(
"inspect"
,
inspect
);
map
.
put
(
"time"
,
TimeUtil
.
getTime
());
HashMap
<
String
,
List
<
Warn
>>
warnMap
=
inspect
.
getWarnDetails
();
List
<
Technology
>
technologies
=
inspect
.
getTechnologies
();
Map
techMap
=
new
HashMap
();
for
(
Technology
technology
:
technologies
)
{
techMap
.
put
(
technology
.
getTechnologyName
(),
technology
.
getSupport
());
}
map
.
put
(
"techMap"
,
techMap
);
map
.
put
(
"warnMap"
,
warnMap
);
map
.
put
(
"technologies"
,
technologies
);
try
{
String
template
=
FreemarkerUtils
.
getTemplate
(
"pg.ftl"
,
map
);
String
s
=
inspectService
.
generateHtml
(
template
,
map
);
String
filePath
=
FileUtil
.
createFilePath
();
File
file1
=
new
File
(
"./pgbg/"
+
filePath
+
"/"
+
file
.
getName
()
+
".html"
);
FileUtil
.
write
(
s
,
"./pgbg/"
+
filePath
+
"/"
+
file
.
getName
()+
".html"
);
reportVo
.
setHtmlAddress
(
file1
.
getCanonicalPath
());
System
.
out
.
println
(
"内容"
+
s
);
}
catch
(
TemplateException
e
)
{
e
.
printStackTrace
();
}
Report
report
=
new
Report
();
String
random
=
RandomUtil
.
getRandom
();
report
.
setId
(
RandomUtil
.
getRandom
());
report
.
setHtmlAddress
(
reportVo
.
getHtmlAddress
());
reportService
.
saveReport
(
report
);
inspectParameter
.
setReportId
(
random
);
parameterService
.
saveParameter
(
inspectParameter
);
return
ResponseEntity
.
ok
(
inspect
);
}
...
...
@@ -111,13 +139,13 @@ public class InspectController {
public
ResponseEntity
inspect1
(
@RequestBody
InspectParameter
inspectParameter
){
String
path
=
GitLabUtil
.
downLoadProject
(
inspectParameter
.
getGitAddress
(),
inspectParameter
.
getGitName
());
inspectParameter
.
setId
(
UUIDUtil
.
getUUID
());
inspectParameter
.
set
Path
(
path
);
inspectParameter
.
set
SourceAddress
(
path
);
ReportVo
reportVo
=
new
ReportVo
();
reportVo
.
setUploadType
(
"git下载"
);
reportVo
.
setSourceAddress
(
path
);
reportVo
.
setGitAddress
(
inspectParameter
.
getGitAddress
());
inspectService
.
inspect
(
reportVo
,
inspectParameter
);
return
ResponseEntity
.
ok
(
200
);
ReportVo
inspect
=
inspectService
.
inspect
(
reportVo
,
inspectParameter
);
return
ResponseEntity
.
ok
(
inspect
);
}
@PostMapping
(
"/frontend"
)
...
...
src/main/java/com/zjty/inspect/controller/ReportController.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.service.ReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author Mcj
* @date 2020-03-05 19:22
*/
@RestController
@RequestMapping
(
"/report"
)
@Api
(
value
=
"报告管理页面接口"
,
description
=
"报告管理页面接口,提供页面的增、删、改、查"
)
public
class
ReportController
{
@Autowired
private
ReportService
reportService
;
@GetMapping
(
"/page/{page}"
)
@ApiOperation
(
"根据页码获取数据"
)
public
ResponseEntity
getReportByPage
(
@PathVariable
int
page
){
return
ResponseEntity
.
ok
(
reportService
.
findReportByPage
(
page
));
}
@GetMapping
(
"/id/{id}"
)
@ApiOperation
(
"根据id获取数据"
)
public
ResponseEntity
getReportById
(
@PathVariable
String
id
){
return
ResponseEntity
.
ok
(
reportService
.
findReportById
(
id
));
}
}
src/main/java/com/zjty/inspect/controller/RuleController.java
浏览文件 @
91296989
...
...
@@ -79,7 +79,16 @@ public class RuleController {
return
ResponseEntity
.
ok
(
ruleService
.
findAll
());
}
/**
* 查询所有规则
* @return 规则
*/
@ApiOperation
(
"查询所有规则"
)
@GetMapping
(
"/test"
)
public
ResponseEntity
test
(){
ruleService
.
test
();
return
ResponseEntity
.
ok
(
200
);
}
/**
* 分页+多条件查询
* @param searchMap 查询条件封装
...
...
src/main/java/com/zjty/inspect/dao/ConfigParamDao.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
dao
;
import
com.zjty.inspect.entity.Config
;
import
org.springframework.data.jpa.repository.JpaRepository
;
/**
* @author Mcj
* @date 2020-03-05 20:55
*/
public
interface
ConfigParamDao
extends
JpaRepository
<
Config
,
Integer
>
{
}
src/main/java/com/zjty/inspect/dao/ReportDao.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
dao
;
import
com.zjty.inspect.entity.Report
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
ReportDao
extends
JpaRepository
<
Report
,
String
>
{
}
src/main/java/com/zjty/inspect/dao/RuleDao.java
浏览文件 @
91296989
...
...
@@ -24,4 +24,15 @@ public interface RuleDao extends JpaRepository<Rule,String>,JpaSpecificationExec
Rule
findAllByTargetEqualsAndTechnologyIdEquals
(
String
target
,
String
techId
);
List
<
Rule
>
findAllByTargetLike
(
String
target
);
Rule
findByTarget
(
String
target
);
Rule
findByTargetAndSuffixEquals
(
String
target
,
String
suffix
);
/**
* 根据技术id查询规则
* @param ids 技术id
* @return
*/
List
<
Rule
>
findAllByTechnologyIdIn
(
List
<
String
>
ids
);
}
src/main/java/com/zjty/inspect/dao/TechnologyDao.java
浏览文件 @
91296989
...
...
@@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import
org.springframework.data.jpa.repository.Query
;
import
java.util.List
;
import
java.util.Optional
;
public
interface
TechnologyDao
extends
JpaRepository
<
Technology
,
String
>,
JpaSpecificationExecutor
<
Technology
>
{
...
...
@@ -15,7 +16,12 @@ public interface TechnologyDao extends JpaRepository<Technology,String>, JpaSpec
* @return Technology
*/
Technology
findAllByTechnologyNameEquals
(
String
name
);
Optional
<
Technology
>
findById
(
String
id
);
/**
* 模糊查询技术名称
* @param name
* @return
*/
List
<
Technology
>
findAllByTechnologyNameLike
(
String
name
);
/**
...
...
@@ -28,4 +34,18 @@ public interface TechnologyDao extends JpaRepository<Technology,String>, JpaSpec
@Query
(
"select technologyName from Technology "
)
List
<
String
>
getTechnologyNames
();
/**
* 查询不支持的技术个数
* @param support 是否支持
* @return
*/
int
countAllBySupportIsNot
(
Integer
support
);
/**
* 查询前端或者后端依赖技术
* @param backOrFront
* @return
*/
List
<
Technology
>
findAllByBackorfrontEquals
(
String
backOrFront
);
}
src/main/java/com/zjty/inspect/entity/BudgetVo.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 预算
* @author Mcj
* @date 2020-02-27 19:05
*/
@Data
public
class
BudgetVo
{
private
List
<
Budget
>
budget
=
new
ArrayList
<>();
private
List
<
CoefficientModelVo
>
coefficientModelVos
=
new
ArrayList
<>();
}
src/main/java/com/zjty/inspect/entity/Category.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
public
class
Category
{
@Id
@Column
(
length
=
48
)
private
String
id
;
private
String
typeName
;
}
src/main/java/com/zjty/inspect/entity/CoefficientModel.java
浏览文件 @
91296989
...
...
@@ -45,7 +45,10 @@ public class CoefficientModel {
private
Integer
scale
;
public
Double
countCoefficient
(
Double
data
)
{
public
Double
countCoefficient
(
Integer
data
)
{
if
(
data
==
null
){
return
1
D
;
}
if
(
data
<
min
){
return
1
+
belowCoefficient
;
}
else
if
(
data
>
max
){
...
...
src/main/java/com/zjty/inspect/entity/CoefficientModelVo.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.Data
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
/**
* 系数计算
*
* @author Mcj
*/
@Data
public
class
CoefficientModelVo
{
/**
* 系数名称
*/
private
String
name
;
/**
* 系数
*/
private
double
value
;
}
src/main/java/com/zjty/inspect/entity/Config.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
public
class
Config
{
@Id
@Column
(
length
=
48
)
private
String
id
;
private
String
name
;
private
String
value
;
private
Integer
type
;
private
String
des
;
private
String
arrs
;
}
src/main/java/com/zjty/inspect/entity/InspectParameter.java
浏览文件 @
91296989
...
...
@@ -51,10 +51,25 @@ public class InspectParameter {
* 数据量
*/
private
Integer
data
;
/**
* 代码量
*/
private
Integer
codeSize
;
/**
* 内容
*/
private
Integer
content
;
/**
* 架构
*/
private
Double
framework
;
private
Integer
framework
;
/**
* 数据库表数量
*/
private
Integer
tables
;
/**
* 安全能力
...
...
@@ -62,7 +77,7 @@ public class InspectParameter {
* 2:弱
* 3:强
*/
private
Double
safety
;
private
Integer
safety
;
/**
* 容灾
...
...
@@ -70,7 +85,7 @@ public class InspectParameter {
* 2:有0,无-0.05
* 3:有0,无-0.1
*/
private
Double
disaster
;
private
Integer
disaster
;
/**
* git地址
...
...
@@ -87,11 +102,6 @@ public class InspectParameter {
*/
private
String
reportAddress
;
/**
* 预算报告地址
*/
private
String
budgetAddress
;
/**
* git上传地址
*/
...
...
@@ -113,4 +123,16 @@ public class InspectParameter {
* 0:否
*/
private
Integer
admin
;
/**
* 方式
* 1:修改
* 2:适配:
*/
private
Integer
recastMethod
;
/**
* 报告id
*/
private
String
reportId
;
}
src/main/java/com/zjty/inspect/entity/Page.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
entity
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author Mcj
* @date 2020-03-05 19:24
*/
public
class
Page
<
T
>
{
private
int
totalPage
;
private
int
totalElement
;
private
List
<
T
>
objects
=
new
ArrayList
<
T
>();
public
void
add
(
T
t
){
objects
.
add
(
t
);
}
public
void
addAll
(
List
<
T
>
t
){
objects
.
addAll
(
t
);
}
public
void
setTotalPage
(
int
totalPage
)
{
this
.
totalPage
=
totalPage
;
}
public
void
setTotalElement
(
int
totalElement
)
{
this
.
totalElement
=
totalElement
;
}
public
int
getTotalPage
()
{
return
totalPage
;
}
public
int
getTotalElement
()
{
return
totalElement
;
}
public
List
<
T
>
getObjects
()
{
return
objects
;
}
}
src/main/java/com/zjty/inspect/entity/Report.java
浏览文件 @
91296989
...
...
@@ -13,45 +13,19 @@ import java.sql.Timestamp;
* 报告
* @author mcj
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
Report
{
/**
* git源代码地址
*/
private
String
gitAddress
;
/**
* 架构,整合型还是分离型,根据jsp数量决定
*/
private
String
framework
;
/**
* 代码管理方式,
*/
private
String
manager
;
/**
* 语言
*/
private
String
language
;
@Id
private
String
id
;
/**
* 生成报告存储地址
*/
private
String
htmlAddress
;
/**
* 适配方式
* 1:适配
* 2:重构
*/
@Column
(
length
=
5
)
private
Integer
recastMethod
;
//前端适配预算
//代码重构预算
//代码修改预算
...
...
@@ -69,11 +43,4 @@ public class Report {
@Column
(
name
=
"update_time"
,
columnDefinition
=
"TIMESTAMP DEFAULT CURRENT_TIMESTAMP"
,
insertable
=
false
)
@Generated
(
GenerationTime
.
ALWAYS
)
private
Timestamp
updateDate
;
public
enum
DependenceManagement
{
MAVEN
,
GRADLE
,
ANT
}
public
enum
Language
{
JAVA
,
PYTHON
,
CPP
,
JSP
,
ASP
,
ONLYVIEW
,
UNKNOW
,
JAVASCRIPT
,
GO
,
VUE
,
HTML
}
}
src/main/java/com/zjty/inspect/entity/ReportManage.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.Data
;
/**
* @author Mcj
* @date 2020-03-05 19:49
*/
@Data
public
class
ReportManage
{
Report
report
;
InspectParameter
inspectParameter
;
}
src/main/java/com/zjty/inspect/entity/ReportVo.java
浏览文件 @
91296989
...
...
@@ -35,12 +35,12 @@ public class ReportVo {
/**
* 架构,整合型还是分离型,根据jsp数量决定
*/
private
String
framework
;
private
Integer
framework
;
/**
* 代码管理方式,
*/
private
String
manager
;
private
Integer
manager
;
/**
* 数据库类型
...
...
@@ -50,7 +50,7 @@ public class ReportVo {
/**
* 语言
*/
private
String
language
;
private
Integer
language
;
/**
* 生成报告存储地址
...
...
@@ -59,11 +59,10 @@ public class ReportVo {
/**
* 适配方式
* 1:适配
* 2:
重构
* 1:适配
重构
* 2:
代码修改
*/
@Column
(
length
=
5
)
private
String
recastMethod
;
private
Integer
recastMethod
;
/**
* 源代码地址
...
...
@@ -73,7 +72,7 @@ public class ReportVo {
/**
* 预算详情
*/
private
List
<
Budget
>
budgets
;
private
BudgetVo
budgets
;
/**
* 依赖
...
...
@@ -85,12 +84,22 @@ public class ReportVo {
*/
private
List
<
Technology
>
technologies
;
private
HashMap
<
String
,
Technology
>
technologyNameMap
=
new
HashMap
<>();
/**
* 告警点
*/
private
HashMap
<
String
,
List
<
Warn
>>
warnDetails
;
/**
* 关键技术个数
*/
private
Integer
technologiesNum
;
/**
* 需要改造的技术
*/
private
Integer
technologiesRepair
;
/**
* 评估时间
*/
...
...
src/main/java/com/zjty/inspect/entity/RuleQo.java
浏览文件 @
91296989
...
...
@@ -2,6 +2,8 @@ package com.zjty.inspect.entity;
import
lombok.Data
;
import
java.util.List
;
/**
* 规则
* @author Mcj
...
...
@@ -21,7 +23,7 @@ public class RuleQo {
/**
* 匹配的文件后缀
*/
private
String
suffix
;
private
List
<
String
>
suffix
;
/**
* 适配技术id
...
...
src/main/java/com/zjty/inspect/entity/Technology.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.hibernate.annotations.Generated
;
import
org.hibernate.annotations.GenerationTime
;
...
...
@@ -17,6 +19,7 @@ import java.sql.Timestamp;
@Entity
@Data
@ApiModel
(
description
=
"关键技术类"
)
public
class
Technology
{
@Id
...
...
@@ -36,6 +39,7 @@ public class Technology {
/**
* 金额(万元)
*/
@ApiModelProperty
(
value
=
"金额"
,
example
=
"123"
)
private
Integer
fund
;
/**
...
...
@@ -43,6 +47,7 @@ public class Technology {
* 2:不支持
* 3:未知
*/
@ApiModelProperty
(
value
=
"是否支持"
,
example
=
"1"
)
private
Integer
support
;
/**
...
...
@@ -50,7 +55,9 @@ public class Technology {
* 1:前端技术
* 2:后端技术
*/
private
Integer
backOrFront
=
2
;
@ApiModelProperty
(
value
=
"技术类型"
,
example
=
"2"
)
@Column
(
name
=
"back_or_front"
)
private
Integer
backorfront
=
2
;
/**
* 数据创建时间
*/
...
...
src/main/java/com/zjty/inspect/enums/DependenceManagement.java
浏览文件 @
91296989
...
...
@@ -11,10 +11,27 @@ public enum DependenceManagement {
/**
* maven方式
*/
MAVEN
,
MAVEN
(
"maven"
,
1
)
,
/**
* gradle方式
*/
GRADLE
,
GRADLE
(
"gradle"
,
2
);
DependenceManagement
(
String
name
,
Integer
status
){
this
.
name
=
name
;
this
.
status
=
status
;
}
private
String
name
;
private
Integer
status
;
public
String
getName
()
{
return
name
;
}
public
Integer
getStatus
()
{
return
status
;
}
}
src/main/java/com/zjty/inspect/enums/Framework.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
enums
;
public
enum
Framework
{
/**
* 架构
*/
分离型架构
(
"分离型架构"
,
1
),
混合型架构
(
"混合型架构"
,
2
);
Framework
(
String
name
,
Integer
status
){
this
.
name
=
name
;
this
.
status
=
status
;
}
private
String
name
;
private
Integer
status
;
public
String
getName
()
{
return
name
;
}
public
Integer
getStatus
()
{
return
status
;
}
}
src/main/java/com/zjty/inspect/enums/Language.java
浏览文件 @
91296989
...
...
@@ -9,29 +9,58 @@ public enum Language {
/**
* java类型
*/
JAVA
,
C
井
(
"c#"
,
8
),
JAVA
(
"java"
,
1
),
/**
* java类型
*/
VUE
(
"java"
,
2
),
/**
* java类型
*/
CPP
(
"cpp"
,
2
),
/**
* pyth类型
*/
PYTHON
,
PYTHON
(
"python"
,
3
)
,
/**
* asp
*/
ASP
,
ASP
(
"asp"
,
4
)
,
/**
* js
*/
JAVASCRIPT
,
JAVASCRIPT
(
"js"
,
5
)
,
/**
* go
*/
GO
,
GO
(
"go"
,
6
)
,
/**
* html
*/
HTML
,
UNKNOW
,
HTML
(
"html"
,
7
),
UNKNOW
(
"unknowun"
,
9
);
Language
(
String
name
,
Integer
status
){
this
.
name
=
name
;
this
.
status
=
status
;
}
private
String
name
;
private
Integer
status
;
public
String
getName
()
{
return
name
;
}
public
Integer
getStatus
()
{
return
status
;
}
}
src/main/java/com/zjty/inspect/enums/RecastMethod.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
enums
;
public
enum
RecastMethod
{
/**
* 架构
*/
适配重构
(
"适配重构"
,
1
),
代码修改
(
"代码修改"
,
2
);
RecastMethod
(
String
name
,
Integer
status
){
this
.
name
=
name
;
this
.
status
=
status
;
}
private
String
name
;
private
Integer
status
;
public
String
getName
()
{
return
name
;
}
public
Integer
getStatus
()
{
return
status
;
}
}
src/main/java/com/zjty/inspect/inspect/Inspector.java
浏览文件 @
91296989
...
...
@@ -2,6 +2,10 @@ package com.zjty.inspect.inspect;
import
com.zjty.inspect.dao.*
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.enums.DependenceManagement
;
import
com.zjty.inspect.enums.Framework
;
import
com.zjty.inspect.enums.Language
;
import
com.zjty.inspect.enums.RecastMethod
;
import
com.zjty.inspect.utils.*
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
@@ -15,8 +19,6 @@ import java.io.IOException;
import
java.nio.file.*
;
import
java.nio.file.attribute.BasicFileAttributes
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -55,7 +57,7 @@ public class Inspector {
* key:mysql-connect : *
* mysql-connect:*
* mysql-connect:.java
*
*
<p>
* value:随意
*/
private
HashMap
<
String
,
Rule
>
ruleMap
=
new
HashMap
<>();
...
...
@@ -78,6 +80,7 @@ public class Inspector {
*/
private
InspectParameter
inspectParameter
;
private
double
codeSize
=
0
;
/**
* 报告对象
*/
...
...
@@ -95,7 +98,7 @@ public class Inspector {
* key:properties
* value:[{/Users/path},{/Users/path}]
*/
private
Map
<
String
,
Report
.
Language
>
suffixLanguageMapping
=
new
HashMap
<>();
private
Map
<
String
,
Language
>
suffixLanguageMapping
=
new
HashMap
<>();
/**
* 规则列表
...
...
@@ -129,18 +132,15 @@ public class Inspector {
* @return 报告
*/
public
ReportVo
inspect
()
{
ruleSuffixFileMap
=
new
HashMap
<>();
ruleSuffixFileMap
=
new
HashMap
<>();
ruleSuffixMap
=
new
HashMap
<>();
warns
.
clear
();
rules
.
clear
();
//查询技术,构造支持与非支持技术对象
findExistTechnology
();
//统计项目组成文件构成
statisticsLanguage
();
this
.
ruleList
=
ruleDao
.
findAll
();
//统计项目组成文件构成
//统计配置文件地址
statisticsConfigFile
();
//查询所有规则
ruleTransform
();
try
{
//以下为计算文件名称匹配正则表达式
FileSystem
aDefault
=
FileSystems
.
getDefault
();
...
...
@@ -175,6 +175,8 @@ public class Inspector {
for
(
Map
.
Entry
<
String
,
PathMatcher
>
entry
:
languageSuffixMatcherMapping
.
entrySet
())
{
//通过正则表达式匹配.java类型后缀文件,并+1
if
(
entry
.
getValue
().
matches
(
file
))
{
long
length
=
file
.
toFile
().
length
();
codeSize
+=
length
/
1024
;
languageMatchMap
.
get
(
entry
.
getKey
()).
plus
();
}
}
...
...
@@ -223,7 +225,7 @@ public class Inspector {
pomDependency
.
setSupport
(
1
);
}
else
{
//为普通用户上传,依赖需要检查是否支持。
int
i
=
valiWarn
(
ruleList
,
file
,
patten
,
0
);
int
i
=
valiWarn
(
ruleList
,
file
,
patten
,
0
);
//如果值为0则代表是有不支持技术到匹配
pomDependency
.
setSupport
(
i
);
}
...
...
@@ -245,6 +247,7 @@ public class Inspector {
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
inspectParameter
.
setCodeSize
((
int
)
codeSize
);
return
analysis
();
}
...
...
@@ -257,6 +260,11 @@ public class Inspector {
public
ReportVo
analysis
()
{
DependencyVo
dependencyVo
=
new
DependencyVo
();
setReportLanguageAndFrame
();
//查询技术,构造支持与非支持技术对象
findExistTechnology
();
//查询所有规则
ruleTransform
(
report
.
getRecastMethod
());
//解析配置文件集合
for
(
Map
.
Entry
<
String
,
List
<
Path
>>
entry
:
configFileTypePathsMapping
.
entrySet
())
{
switch
(
entry
.
getKey
())
{
...
...
@@ -267,7 +275,7 @@ public class Inspector {
for
(
Path
path
:
entry
.
getValue
())
{
if
(
path
.
getFileName
().
endsWith
(
"pom.xml"
))
{
// TODO: 2020-02-28 解析maven树文件,设置依赖保存到redis
report
.
setManager
(
Report
.
DependenceManagement
.
MAVEN
.
name
());
report
.
setManager
(
DependenceManagement
.
MAVEN
.
getStatus
());
ProjectPom
projectPom
=
analysisFile
.
analysisPom
(
path
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
...
...
@@ -282,7 +290,7 @@ public class Inspector {
for
(
Path
path
:
entry
.
getValue
())
{
if
(
path
.
getFileName
().
endsWith
(
"build.gradle"
))
{
ProjectPom
projectPom
=
new
ProjectPom
();
report
.
setManager
(
Report
.
DependenceManagement
.
GRADLE
.
name
());
report
.
setManager
(
DependenceManagement
.
GRADLE
.
getStatus
());
List
<
PomDependency
>
pomDependencies
=
AnalysisFile
.
analysisGradle
(
path
);
projectPom
.
setDependencies
(
pomDependencies
);
//设置依赖
...
...
@@ -330,7 +338,7 @@ public class Inspector {
}
//计算预算
if
(
inspectParameter
.
getValid
()
!=
null
)
{
List
<
Budget
>
budget
=
budgetUitl
.
getBudget
(
fund
,
inspectParameter
);
BudgetVo
budget
=
budgetUitl
.
getBudget
(
fund
,
report
,
inspectParameter
);
report
.
setBudgets
(
budget
);
inspectParameter
.
setId
(
UUIDUtil
.
getUUID
());
parameterDao
.
save
(
inspectParameter
);
...
...
@@ -349,37 +357,51 @@ public class Inspector {
HashMap
<
String
,
List
<
Warn
>>
warnMap
=
getWarnMap
(
map
);
ruleDao
.
saveAll
(
rules
);
report
.
setWarnDetails
(
warnMap
);
report
.
setTechnologyNameMap
(
map
);
return
report
;
}
private
void
setReportLanguageAndFrame
()
{
String
most
=
null
;
int
mostStatus
=
0
;
int
maxnum
=
0
;
//统计文件最多的
for
(
Map
.
Entry
<
String
,
Counter
>
entry
:
languageMatchMap
.
entrySet
())
{
if
(
entry
.
getValue
().
getNumber
()
>
maxnum
)
{
most
=
suffixLanguageMapping
.
get
(
entry
.
getKey
()).
name
();
Language
language
=
Language
.
valueOf
(
most
);
mostStatus
=
language
.
getStatus
();
maxnum
=
entry
.
getValue
().
getNumber
();
}
}
//设置语言
report
.
setLanguage
(
most
==
null
?
Report
.
Language
.
UNKNOW
.
name
()
:
most
);
report
.
setLanguage
(
most
==
null
?
Language
.
UNKNOW
.
getStatus
()
:
mostStatus
);
//设置架构
report
.
setFramework
(
languageMatchMap
.
get
(
"jsp"
).
i
>
0
?
"混合型架构"
:
"分离型架构"
);
report
.
setFramework
(
languageMatchMap
.
get
(
"jsp"
).
i
>
0
?
Framework
.
混合型架构
.
getStatus
()
:
Framework
.
分离型架构
.
getStatus
()
);
//设置是否需要重构
if
(
languageMatchMap
.
get
(
"jsp"
).
i
==
0
&
languageMatchMap
.
get
(
"java"
).
i
==
0
)
{
report
.
setRecastMethod
(
"建议重构"
);
report
.
setRecastMethod
(
RecastMethod
.
适配重构
.
getStatus
()
);
}
else
{
report
.
setRecastMethod
(
"建议适配"
);
report
.
setRecastMethod
(
RecastMethod
.
代码修改
.
getStatus
()
);
}
}
/**
* rule所需要数据装配
*/
private
void
ruleTransform
()
{
this
.
ruleList
=
ruleDao
.
findAll
();
private
void
ruleTransform
(
int
i
)
{
if
(
i
==
1
){
List
<
Technology
>
front
=
technologyDao
.
findAllByBackorfrontEquals
(
"1"
);
List
<
String
>
ids
=
front
.
stream
().
map
(
Technology:
:
getId
).
collect
(
Collectors
.
toList
());
this
.
ruleList
=
ruleDao
.
findAllByTechnologyIdIn
(
ids
);
}
else
{
if
(
inspectParameter
.
getRecastMethod
()==
1
){
this
.
ruleList
=
ruleDao
.
findAll
();
}
else
{
List
<
Technology
>
front
=
technologyDao
.
findAllByBackorfrontEquals
(
"1"
);
List
<
String
>
ids
=
front
.
stream
().
map
(
Technology:
:
getId
).
collect
(
Collectors
.
toList
());
this
.
ruleList
=
ruleDao
.
findAllByTechnologyIdIn
(
ids
);
}
}
Set
<
String
>
id
=
ruleList
.
stream
().
map
(
Rule:
:
getTechnologyId
).
collect
(
Collectors
.
toSet
());
List
<
Technology
>
technologies
=
technologyDao
.
findAllByIdIn
(
new
ArrayList
<>(
id
));
for
(
Technology
technology
:
technologies
)
{
...
...
@@ -393,10 +415,10 @@ public class Inspector {
}
//根据后缀名进行规则收集
for
(
Rule
rule
:
ruleList
)
{
if
(!
ruleSuffixMap
.
containsKey
(
rule
.
getSuffix
()))
{
if
(!
ruleSuffixMap
.
containsKey
(
rule
.
getSuffix
()))
{
ruleSuffixMap
.
put
(
rule
.
getSuffix
(),
new
ArrayList
<>());
ruleSuffixMap
.
get
(
rule
.
getSuffix
()).
add
(
rule
);
}
else
{
}
else
{
ruleSuffixMap
.
get
(
rule
.
getSuffix
()).
add
(
rule
);
}
}
...
...
@@ -514,7 +536,7 @@ public class Inspector {
}
else
if
(
technologyHashMap
.
get
(
rule
.
getTechnologyId
()).
getSupport
()
==
3
)
{
warns
.
add
(
warn
);
supportStatus
=
3
;
}
else
if
(
technologyHashMap
.
get
(
rule
.
getTechnologyId
()).
getSupport
()
==
1
)
{
}
else
if
(
technologyHashMap
.
get
(
rule
.
getTechnologyId
()).
getSupport
()
==
1
)
{
warns
.
add
(
warn
);
supportStatus
=
1
;
}
...
...
src/main/java/com/zjty/inspect/service/ParameterService.java
浏览文件 @
91296989
...
...
@@ -16,7 +16,7 @@ public interface ParameterService {
public
void
saveParameter
(
InspectParameter
inspectParameter
);
/**
*
保存
参数
*
根据id获取
参数
* @param id id
*/
public
InspectParameter
getParameterById
(
String
id
);
...
...
src/main/java/com/zjty/inspect/service/ReportService.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
service
;
import
com.zjty.inspect.entity.ReportVo
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
import
com.zjty.inspect.entity.Page
;
import
com.zjty.inspect.entity.Report
;
import
com.zjty.inspect.entity.ReportManage
;
public
interface
ReportService
{
public
Page
findReportByPage
(
int
page
);
public
ReportManage
findReportById
(
String
id
);
void
saveReport
(
Report
report
);
}
src/main/java/com/zjty/inspect/service/RuleService.java
浏览文件 @
91296989
...
...
@@ -44,4 +44,5 @@ public interface RuleService {
List
<
Rule
>
findByName
(
String
name
);
Page
<
Rule
>
findSearch
(
Map
searchMap
,
int
page
,
int
size
);
void
test
();
}
src/main/java/com/zjty/inspect/service/TechnologyService.java
浏览文件 @
91296989
...
...
@@ -30,4 +30,18 @@ public interface TechnologyService {
void
update
(
Technology
technology
);
Page
<
Technology
>
findSearch
(
Map
searchMap
,
int
page
,
int
size
);
/**
* 查询全部技术个数
* @return 查询技术数量
*/
int
findAllTechnologyCount
();
/**
* 查询不支持的技术个数
* @return 查询技术数量
*/
int
findAllTechnologyNotSupport
();
Technology
findByid
(
String
technologyId
);
}
src/main/java/com/zjty/inspect/service/impl/InspectServiceImpl.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
service
.
impl
;
import
com.zjty.inspect.dao.ReportDao
;
import
com.zjty.inspect.entity.InspectParameter
;
import
com.zjty.inspect.entity.Report
;
import
com.zjty.inspect.entity.ReportVo
;
import
com.zjty.inspect.enums.Language
;
import
com.zjty.inspect.service.InspectService
;
import
com.zjty.inspect.inspect.Inspector
;
import
com.zjty.inspect.service.ParameterService
;
import
com.zjty.inspect.utils.RandomUtil
;
import
freemarker.cache.StringTemplateLoader
;
import
freemarker.template.Configuration
;
import
freemarker.template.Template
;
...
...
@@ -26,29 +30,38 @@ public class InspectServiceImpl implements InspectService {
@Autowired
Inspector
inspector
;
@Autowired
private
ReportDao
reportDao
;
@Autowired
private
ParameterService
parameterService
;
@Transactional
@Override
public
ReportVo
inspect
(
ReportVo
reportVo
,
InspectParameter
inspectParameter
)
{
//统计文件后缀数量
Map
<
String
,
Report
.
Language
>
suffixLanguageMapping
=
new
HashMap
<>();
suffixLanguageMapping
.
put
(
"java"
,
Report
.
Language
.
JAVA
);
suffixLanguageMapping
.
put
(
"vue"
,
Report
.
Language
.
VUE
);
suffixLanguageMapping
.
put
(
"cpp"
,
Report
.
Language
.
CPP
);
suffixLanguageMapping
.
put
(
"py"
,
Report
.
Language
.
PYTHON
);
suffixLanguageMapping
.
put
(
"jsp"
,
Report
.
Language
.
JAVA
);
suffixLanguageMapping
.
put
(
"go"
,
Report
.
Language
.
GO
);
suffixLanguageMapping
.
put
(
"js"
,
Report
.
Language
.
JAVASCRIPT
);
suffixLanguageMapping
.
put
(
"html"
,
Report
.
Language
.
HTML
);
Map
<
String
,
Language
>
suffixLanguageMapping
=
new
HashMap
<>();
suffixLanguageMapping
.
put
(
"java"
,
Language
.
JAVA
);
suffixLanguageMapping
.
put
(
"aspx"
,
Language
.
C
井
);
suffixLanguageMapping
.
put
(
"cs"
,
Language
.
C
井
);
suffixLanguageMapping
.
put
(
"resx"
,
Language
.
C
井
);
suffixLanguageMapping
.
put
(
"vue"
,
Language
.
VUE
);
suffixLanguageMapping
.
put
(
"cpp"
,
Language
.
CPP
);
suffixLanguageMapping
.
put
(
"py"
,
Language
.
PYTHON
);
suffixLanguageMapping
.
put
(
"jsp"
,
Language
.
JAVA
);
suffixLanguageMapping
.
put
(
"go"
,
Language
.
GO
);
suffixLanguageMapping
.
put
(
"js"
,
Language
.
JAVASCRIPT
);
suffixLanguageMapping
.
put
(
"html"
,
Language
.
HTML
);
//构造成员变量
inspector
.
setInspectParameter
(
inspectParameter
);
//构造报告vo
inspector
.
setReport
(
reportVo
);
//需要重构
inspector
.
setSuffixLanguageMapping
(
suffixLanguageMapping
);
ReportVo
report
=
inspector
.
inspect
();
ReportVo
reportVoReturn
=
inspector
.
inspect
();
return
report
;
return
report
VoReturn
;
}
//执行静态化
...
...
src/main/java/com/zjty/inspect/service/impl/ReportServiceImpl.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
service
.
impl
;
import
com.zjty.inspect.dao.ReportDao
;
import
com.zjty.inspect.dao.TechnologyDao
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.service.ParameterService
;
import
com.zjty.inspect.service.ReportService
;
import
com.zjty.inspect.utils.RedisUtil
;
import
freemarker.cache.StringTemplateLoader
;
import
freemarker.template.Configuration
;
import
freemarker.template.Template
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.ui.freemarker.FreeMarkerTemplateUtils
;
import
java.util.Map
;
import
java.util.Optional
;
/**
* @author Mcj
...
...
@@ -24,14 +27,12 @@ public class ReportServiceImpl implements ReportService {
@Autowired
private
TechnologyDao
technologyDao
;
@Autowired
private
RedisUtil
redisUtil
;
public
ReportVo
set
(
Report
report
){
@Autowired
private
ParameterService
parameterService
;
return
new
ReportVo
();
}
@Autowired
private
ReportDao
reportDao
;
//执行静态化
private
String
generateHtml
(
String
templateContent
,
Map
model
){
...
...
@@ -54,4 +55,33 @@ public class ReportServiceImpl implements ReportService {
return
null
;
}
@Override
public
Page
findReportByPage
(
int
page
)
{
PageRequest
of
=
PageRequest
.
of
(
page
-
1
,
10
);
org
.
springframework
.
data
.
domain
.
Page
<
Report
>
all
=
reportDao
.
findAll
(
of
);
Page
<
Report
>
reportPage
=
new
Page
<>();
reportPage
.
setTotalElement
((
int
)
all
.
getTotalElements
());
reportPage
.
setTotalPage
(
all
.
getTotalPages
());
reportPage
.
addAll
(
all
.
getContent
());
return
reportPage
;
}
@Override
public
ReportManage
findReportById
(
String
id
)
{
Optional
<
Report
>
report
=
reportDao
.
findById
(
id
);
ReportManage
reportManage
=
new
ReportManage
();
if
(
report
.
isPresent
()){
reportManage
.
setReport
(
report
.
get
());
InspectParameter
inspectParameter
=
parameterService
.
getParameterById
(
report
.
get
().
getId
());
reportManage
.
setInspectParameter
(
inspectParameter
);
}
return
reportManage
;
}
@Override
public
void
saveReport
(
Report
report
)
{
reportDao
.
save
(
report
);
}
}
src/main/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
浏览文件 @
91296989
...
...
@@ -6,6 +6,7 @@ import com.zjty.inspect.entity.Technology;
import
com.zjty.inspect.entity.Rule
;
import
com.zjty.inspect.entity.RuleQo
;
import
com.zjty.inspect.service.RuleService
;
import
com.zjty.inspect.service.TechnologyService
;
import
com.zjty.inspect.utils.UUIDUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
...
...
@@ -39,7 +40,18 @@ public class RuleServiceImpl implements RuleService {
*/
@Autowired
private
RuleDao
ruleDao
;
@Autowired
private
TechnologyService
technologyService
;
@Override
public
void
test
(){
List
<
Rule
>
rules
=
ruleDao
.
findAll
();
for
(
Rule
rule
:
rules
)
{
Technology
technology
=
technologyService
.
findByid
(
rule
.
getTechnologyId
());
rule
.
setTechnologyName
(
technology
.
getTechnologyName
());
}
ruleDao
.
saveAll
(
rules
);
}
/**
* 新增规则
*
...
...
@@ -47,13 +59,20 @@ public class RuleServiceImpl implements RuleService {
*/
@Override
public
void
addRule
(
RuleQo
ruleQo
)
{
// TODO: 2020-02-27 适配技术与扫描关键字关联
Rule
rule
=
new
Rule
();
rule
.
setTarget
(
ruleQo
.
getTarget
());
rule
.
setSuffix
(
ruleQo
.
getSuffix
());
rule
.
setTechnologyId
(
ruleQo
.
getTechnologyId
());
rule
.
setId
(
UUIDUtil
.
getUUID
());
ruleDao
.
save
(
rule
);
for
(
String
suffix
:
ruleQo
.
getSuffix
())
{
Rule
rule1
=
ruleDao
.
findByTargetAndSuffixEquals
(
ruleQo
.
getTarget
(),
suffix
);
if
(
rule1
!=
null
){
return
;
}
Rule
rule
=
new
Rule
();
rule
.
setTarget
(
ruleQo
.
getTarget
());
rule
.
setSuffix
(
suffix
);
rule
.
setTechnologyId
(
ruleQo
.
getTechnologyId
());
rule
.
setTechnologyName
(
ruleQo
.
getTechnologyName
());
rule
.
setId
(
UUIDUtil
.
getUUID
());
ruleDao
.
save
(
rule
);
}
}
/**
...
...
@@ -96,12 +115,19 @@ public class RuleServiceImpl implements RuleService {
@Override
public
void
upRule
(
RuleQo
ruleQo
)
{
Rule
rule
=
new
Rule
();
rule
.
setTarget
(
ruleQo
.
getTarget
());
rule
.
setSuffix
(
ruleQo
.
getSuffix
());
rule
.
setTechnologyId
(
ruleQo
.
getTechnologyId
());
rule
.
setId
(
ruleQo
.
getId
());
ruleDao
.
save
(
rule
);
for
(
String
suffix
:
ruleQo
.
getSuffix
())
{
Rule
rule1
=
ruleDao
.
findByTarget
(
ruleQo
.
getTarget
());
if
(
rule1
!=
null
){
return
;
}
Rule
rule
=
new
Rule
();
rule
.
setTarget
(
ruleQo
.
getTarget
());
rule
.
setSuffix
(
suffix
);
rule
.
setTechnologyId
(
ruleQo
.
getTechnologyId
());
rule
.
setTechnologyName
(
ruleQo
.
getTechnologyName
());
rule
.
setId
(
ruleQo
.
getId
());
ruleDao
.
save
(
rule
);
}
}
@Override
...
...
src/main/java/com/zjty/inspect/service/impl/TechnologyServiceImpl.java
浏览文件 @
91296989
...
...
@@ -19,6 +19,7 @@ import javax.persistence.criteria.Root;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
/**
* 适配技术
...
...
@@ -89,6 +90,10 @@ public class TechnologyServiceImpl implements TechnologyService {
return
technologyDao
.
findAllByTechnologyNameLike
(
"%"
+
name
+
"%"
);
}
/**
* 更新技术细节
* @param technology
*/
@Override
public
void
update
(
Technology
technology
)
{
technologyDao
.
save
(
technology
);
...
...
@@ -100,6 +105,26 @@ public class TechnologyServiceImpl implements TechnologyService {
PageRequest
pageRequest
=
PageRequest
.
of
(
page
-
1
,
size
);
return
technologyDao
.
findAll
(
specification
,
pageRequest
);
}
@Override
public
int
findAllTechnologyCount
()
{
return
(
int
)
technologyDao
.
count
();
}
@Override
public
int
findAllTechnologyNotSupport
()
{
return
technologyDao
.
countAllBySupportIsNot
(
1
);
}
@Override
public
Technology
findByid
(
String
technologyId
)
{
Optional
<
Technology
>
optional
=
technologyDao
.
findById
(
technologyId
);
if
(
optional
.
isPresent
()){
return
optional
.
get
();
}
return
null
;
}
/**
* 动态条件构建
* @param searchMap
...
...
src/main/java/com/zjty/inspect/utils/BudgetUitl.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
utils
;
import
com.zjty.inspect.dao.CoefficientModelDao
;
import
com.zjty.inspect.entity.Budget
;
import
com.zjty.inspect.entity.CoefficientModel
;
import
com.zjty.inspect.entity.InspectParameter
;
import
com.zjty.inspect.dao.ConfigParamDao
;
import
com.zjty.inspect.entity.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -20,6 +20,8 @@ import java.util.stream.Collectors;
@Component
public
class
BudgetUitl
{
@Autowired
private
ConfigParamDao
configParamDao
;
@Autowired
private
CoefficientModelDao
coefficientModelDao
;
...
...
@@ -27,12 +29,22 @@ public class BudgetUitl {
/**
* 获取预算数据
* @param fund 技术费用
* @param report
* @param inspectParameter 计算所需数据
* @return
*/
public
List
<
Budget
>
getBudget
(
Integer
fund
,
InspectParameter
inspectParameter
){
inspectParameter
.
setMoneyRate
(
1.04
);
inspectParameter
.
setProportion
(
0.6
);
public
BudgetVo
getBudget
(
Integer
fund
,
ReportVo
report
,
InspectParameter
inspectParameter
){
BudgetVo
budgetVo
=
new
BudgetVo
();
// TODO: 2020-03-05 查询年复利率,查询修改,适配和重构占比
List
<
Config
>
all
=
configParamDao
.
findAll
();
HashMap
<
Integer
,
String
>
doubleHashMap
=
new
HashMap
<>();
for
(
Config
config
:
all
)
{
if
(!
doubleHashMap
.
containsKey
(
config
.
getType
())){
doubleHashMap
.
put
(
config
.
getType
(),
config
.
getValue
());
}
}
int
scale
;
Integer
systemFund
=
inspectParameter
.
getSystemFund
();
if
(
systemFund
==
0
){
...
...
@@ -46,58 +58,126 @@ public class BudgetUitl {
}
else
{
scale
=
3
;
}
Budget
budget
=
new
Budget
();
budget
.
setBudgetName
(
"代码重构预算"
);
inspectParameter
.
setMoneyRate
(
Double
.
valueOf
(
doubleHashMap
.
get
(
1
)));
Double
moneyRate
=
inspectParameter
.
getMoneyRate
();
int
i
=
2020
-
inspectParameter
.
getYears
();
double
pow
=
Math
.
pow
(
moneyRate
,
i
);
//不带修正系数资金
double
v
=
inspectParameter
.
getProportion
()
*
pow
*
systemFund
+
fund
;
int
years
=
inspectParameter
.
getYears
();
double
pow
=
Math
.
pow
(
moneyRate
,
years
);
//带修正系数资金
ArrayList
<
String
>
strings
=
new
ArrayList
<>();
Double
v1
=
v
;
strings
.
add
(
"安全能力"
);
strings
.
add
(
"容灾能力"
);
strings
.
add
(
"架构"
);
strings
.
add
(
"数据量"
);
strings
.
add
(
"模块数"
);
strings
.
add
(
"数据库表"
);
strings
.
add
(
"代码量"
);
strings
.
add
(
"内容"
);
double
coefficient
=
1
;
List
<
CoefficientModel
>
nameIn
=
coefficientModelDao
.
findAllByNameIn
(
strings
);
List
<
CoefficientModel
>
collect
=
nameIn
.
stream
().
filter
(
a
->
a
.
getScale
()
==
scale
).
collect
(
Collectors
.
toList
());
for
(
CoefficientModel
model
:
collect
)
{
CoefficientModelVo
coefficientModelVo
=
new
CoefficientModelVo
();
coefficientModelVo
.
setName
(
model
.
getName
());
if
(
"架构"
.
equals
(
model
.
getName
())){
Double
aDouble
=
model
.
countCoefficient
(
inspectParameter
.
getFramework
());
v1
*=
aDouble
;
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getFramework
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
else
if
(
"容灾能力"
.
equals
(
model
.
getName
())){
Double
aDouble
=
model
.
countCoefficient
(
inspectParameter
.
getDisaster
());
v1
*=
aDouble
;
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getDisaster
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
else
if
(
"安全能力"
.
equals
(
model
.
getName
())){
Double
aDouble
=
model
.
countCoefficient
(
inspectParameter
.
getSafety
());
v1
*=
aDouble
;
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getSafety
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
else
if
(
"数据量"
.
equals
(
model
.
getName
())){
Double
aDouble
=
model
.
countCoefficient
(
Double
.
valueOf
(
inspectParameter
.
getData
()));
v1
*=
aDouble
;
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getData
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
else
if
(
"模块数"
.
equals
(
model
.
getName
())){
Double
aDouble
=
model
.
countCoefficient
(
Double
.
valueOf
(
inspectParameter
.
getModules
()));
v1
*=
aDouble
;
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getModules
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
else
if
(
"数据库表"
.
equals
(
model
.
getName
())){
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getTables
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
else
if
(
"代码量"
.
equals
(
model
.
getName
())){
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getCodeSize
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
else
if
(
"内容"
.
equals
(
model
.
getName
())){
Double
value
=
model
.
countCoefficient
(
inspectParameter
.
getContent
());
coefficientModelVo
.
setValue
(
value
);
coefficient
*=
value
;
}
budgetVo
.
getCoefficientModelVos
().
add
(
coefficientModelVo
);
}
if
(
v
<
v1
){
budget
.
setFund
(
v
+
"--"
+
v1
);
}
else
if
(
v
>
v1
){
budget
.
setFund
(
v1
+
"--"
+
v
);
if
(
inspectParameter
.
getRecastMethod
()==
1
){
//用户需要适配
double
refactorProportion
=
Double
.
valueOf
(
doubleHashMap
.
get
(
4
));
inspectParameter
.
setProportion
(
refactorProportion
);
Budget
codeRefactor
=
new
Budget
();
codeRefactor
.
setBudgetName
(
"代码修改预算"
);
double
fundNotRepair
=
inspectParameter
.
getProportion
()
*
pow
*
systemFund
+
fund
;
double
fundRepair
=
fundNotRepair
*
coefficient
;
if
(
fundNotRepair
<
fundRepair
){
codeRefactor
.
setFund
(
fundNotRepair
+
"--"
+
fundRepair
);
}
else
if
(
fundNotRepair
>
fundRepair
){
codeRefactor
.
setFund
(
fundRepair
+
"--"
+
fundNotRepair
);
}
else
{
codeRefactor
.
setFund
(
fundRepair
+
"--"
+
fundNotRepair
);
}
codeRefactor
.
setFundDetail
(
"普通业务开发费用:"
+
fundNotRepair
);
codeRefactor
.
setFundDetail
(
"普通业务开发费用(修正):"
+
fundRepair
);
codeRefactor
.
setFundDetail
(
"关键适配技术成本:"
+
fund
);
budgetVo
.
getBudget
().
add
(
codeRefactor
);
if
(
report
.
getRecastMethod
()==
1
){
double
refactorProportion1
=
Double
.
valueOf
(
doubleHashMap
.
get
(
2
));
inspectParameter
.
setProportion
(
refactorProportion1
);
Budget
codeRefactor1
=
new
Budget
();
codeRefactor1
.
setBudgetName
(
"代码重构预算"
);
double
fundNotRepair1
=
inspectParameter
.
getProportion
()
*
pow
*
systemFund
+
fund
;
double
fundRepair1
=
fundNotRepair1
*
coefficient
;
if
(
fundNotRepair1
<
fundRepair1
){
codeRefactor1
.
setFund
(
fundNotRepair1
+
"--"
+
fundRepair1
);
}
else
if
(
fundNotRepair1
>
fundRepair1
){
codeRefactor1
.
setFund
(
fundRepair1
+
"--"
+
fundNotRepair1
);
}
else
{
codeRefactor1
.
setFund
(
fundRepair1
+
"--"
+
fundNotRepair1
);
}
codeRefactor1
.
setFundDetail
(
"普通业务开发费用:"
+
fundNotRepair1
);
codeRefactor1
.
setFundDetail
(
"普通业务开发费用(修正):"
+
fundRepair1
);
codeRefactor1
.
setFundDetail
(
"关键适配技术成本:"
+
fund
);
budgetVo
.
getBudget
().
add
(
codeRefactor1
);
}
}
else
{
budget
.
setFund
(
v1
+
"--"
+
v
);
double
refactorProportion
=
Double
.
valueOf
(
doubleHashMap
.
get
(
3
));
inspectParameter
.
setProportion
(
refactorProportion
);
Budget
codeRefactor1
=
new
Budget
();
codeRefactor1
.
setBudgetName
(
"代码修改预算"
);
double
fundNotRepair1
=
inspectParameter
.
getProportion
()
*
pow
*
systemFund
+
fund
;
double
fundRepair1
=
fundNotRepair1
*
coefficient
;
if
(
fundNotRepair1
<
fundRepair1
){
codeRefactor1
.
setFund
(
fundNotRepair1
+
"--"
+
fundRepair1
);
}
else
if
(
fundNotRepair1
>
fundRepair1
){
codeRefactor1
.
setFund
(
fundRepair1
+
"--"
+
fundNotRepair1
);
}
else
{
codeRefactor1
.
setFund
(
fundRepair1
+
"--"
+
fundNotRepair1
);
}
codeRefactor1
.
setFundDetail
(
"普通业务开发费用:"
+
fundNotRepair1
);
codeRefactor1
.
setFundDetail
(
"普通业务开发费用(修正):"
+
fundRepair1
);
codeRefactor1
.
setFundDetail
(
"关键适配技术成本:"
+
fund
);
budgetVo
.
getBudget
().
add
(
codeRefactor1
);
}
budget
.
setFundDetail
(
"普通业务开发费用:"
+
v
);
budget
.
setFundDetail
(
"普通业务开发费用(修正):"
+
v1
);
budget
.
setFundDetail
(
"关键适配技术成本:"
+
fund
);
ArrayList
<
Budget
>
budgets
=
new
ArrayList
<>();
budgets
.
add
(
budget
);
return
budgets
;
return
budgetVo
;
}
}
src/main/java/com/zjty/inspect/utils/FileUtil.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
utils
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.github.junrar.Archive
;
import
com.github.junrar.rarfile.FileHeader
;
import
lombok.extern.slf4j.Slf4j
;
import
net.lingala.zip4j.core.ZipFile
;
import
org.dom4j.Document
;
import
org.dom4j.io.SAXReader
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
@Slf4j
public
class
FileUtil
{
static
int
BUFFER_SIZE
=
1024
;
public
static
String
createFilePath
(){
//"./"+name+"/"+split1[0]
String
[]
split
=
UUIDUtil
.
getUUID
().
split
(
"-"
);
String
time
=
LocalDate
.
now
().
toString
();
String
filePath
=
time
+
"/"
+
split
[
0
];
return
filePath
;
}
/**
* 保存文件到本地
...
...
@@ -113,16 +117,50 @@ public class FileUtil {
log
.
error
(
"unpack rar file fail...."
,
e
.
getMessage
(),
e
);
}
}
/**
* 将内容写人文件中
* @param content 写入内容
* @param path 文件路径(如:F:/a/b/test.txt)
*/
public
static
void
write
(
String
content
,
String
path
)
{
// 检测文件夹是否存在,不存在则创建文件夹和文件
createFile
(
path
);
FileWriter
writer
=
null
;
try
{
writer
=
new
FileWriter
(
path
);
writer
.
write
(
content
);
writer
.
flush
();
writer
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
System
.
out
.
println
(
LocalDate
.
now
().
toString
());
String
[]
split1
=
UUIDUtil
.
getUUID
().
split
(
"-"
);
System
.
out
.
println
(
split1
[
0
]);
// FileUtil.unPackZip(new File("/Users/mcj/Downloads/acq-server.zip"),"", "./");
//FileUtils.deleteDirectory(new File("./acq-server"));
SAXReader
reader
=
new
SAXReader
();
Document
document
=
null
;
/**
* 创建文件
* @param path 文件路径
* @return 文件路径(如:F:/a/b/test.txt)
*/
private
static
File
createFile
(
String
path
)
{
// 创建文件夹
if
(
path
.
contains
(
"/"
))
{
String
[]
split
=
path
.
split
(
"/"
);
String
fileName
=
split
[
split
.
length
-
1
];
String
dirPath
=
path
.
replace
(
fileName
,
""
);
File
dir
=
new
File
(
dirPath
);
if
(!
dir
.
exists
())
{
dir
.
mkdirs
();
}
}
File
file
=
new
File
(
path
);
if
(!
file
.
exists
())
{
try
{
file
.
createNewFile
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
file
;
}
}
src/main/java/com/zjty/inspect/utils/RandomUtil.java
0 → 100644
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
utils
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.Stack
;
/**
* @author Mcj
* @date 2020-03-05 19:20
*/
public
class
RandomUtil
{
public
synchronized
static
String
getRandom
()
{
String
digths
=
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
;
int
base
=
digths
.
length
();
long
now
=
System
.
currentTimeMillis
();
try
{
Thread
.
sleep
(
1
);}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();}
StringBuffer
str
=
new
StringBuffer
(
""
);
Stack
<
Character
>
s
=
new
Stack
<
Character
>();
while
(
now
!=
0
){
s
.
push
(
digths
.
charAt
((
int
)(
now
%
base
)));
now
/=
base
;
}
while
(!
s
.
isEmpty
()){
str
.
append
(
s
.
pop
());
}
StringBuilder
stringBuilder
=
new
StringBuilder
();
LocalDateTime
date
=
LocalDateTime
.
now
();
String
[]
split
=
UUIDUtil
.
getUUID
().
split
(
"-"
);
stringBuilder
.
append
(
date
.
getYear
())
.
append
(
date
.
getMonth
())
.
append
(
date
.
getDayOfMonth
())
.
append
(
date
.
getHour
()
)
.
append
(
date
.
getMinute
())
.
append
(
date
.
getSecond
())
.
append
(
split
[
0
]);
return
stringBuilder
.
toString
();
}
}
src/main/java/com/zjty/inspect/utils/TimeUtil.java
浏览文件 @
91296989
package
com
.
zjty
.
inspect
.
utils
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
public
class
TimeUtil
{
public
static
String
getNowDate
(){
...
...
@@ -19,9 +21,14 @@ public class TimeUtil {
return
stringBuilder
.
toString
();
}
public
static
String
getTime
(){
Date
d
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
System
.
out
.
println
(
"当前时间:"
+
sdf
.
format
(
d
));
return
sdf
.
format
(
d
);
}
public
static
void
main
(
String
[]
args
)
{
String
nowDate
=
TimeUtil
.
getNowDate
();
System
.
out
.
println
(
nowDate
);
System
.
out
.
println
(
getTime
()
);
}
}
src/main/resources/application-dev.properties
浏览文件 @
91296989
...
...
@@ -58,7 +58,10 @@ spring.datasource.password=root
maven.home
=
/usr/share/maven
maven.command
=
dependency:tree -DoutputType=txt -DoutputFile=
maven.treefile
=
./tree
spring.freemarker.charset
=
UTF-8
spring.freemarker.suffix
=
.ftl
spring.freemarker.content-type
=
text/html; charset=utf-8
spring.freemarker.template-loader-path
=
classpath:/templates
#spring.redis.host=127.0.0.1
##Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
#spring.redis.port=6379
...
...
src/main/resources/application.properties
浏览文件 @
91296989
...
...
@@ -57,7 +57,10 @@ spring.datasource.password=root
maven.home
=
/Users/mcj/apache-maven-3.6.1
maven.command
=
dependency:tree -DoutputType=txt -DoutputFile=
maven.treefile
=
./hello
spring.freemarker.charset
=
UTF-8
spring.freemarker.suffix
=
.ftl
spring.freemarker.content-type
=
text/html; charset=utf-8
spring.freemarker.template-loader-path
=
classpath:/templates
#spring.redis.host=127.0.0.1
##Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
#spring.redis.port=6379
...
...
src/main/resources/templates/pg.ftl
浏览文件 @
91296989
...
...
@@ -74,6 +74,16 @@
right
:
40px
;
top
:
30px
;
}
.onClick
{
width
:
0
;
height
:
0
;
border-width
:
17px
17px
0
;
border-style
:
solid
;
border-color
:
grey
transparent
transparent
;
/*灰 透明 透明 */
margin
:
40px
auto
;
position
:
relative
;
top
:
20px
;
}
.key-title
{
color
:
#d32d2d
;
...
...
@@ -87,6 +97,7 @@
table
{
width
:
100%
;
}
.table-body
{
width
:
100%
;
height
:
300px
;
overflow-y
:
scroll
;}
td
{
text-align
:
center
;
height
:
30px
;
...
...
@@ -114,7 +125,7 @@
}
.className
{
transform
:
rotate
(
180deg
);
transform
:
rotate
(
180deg
)
!important
;
}
</style>
</head>
...
...
@@ -123,20 +134,20 @@
<p
class=
"detailContentT"
>
应用系统信创评估详情
</p>
<div
class=
"systemName"
>
<img
src=
"./img/system.png"
alt=
""
>
<div
class=
"nav-title"
>
系统名称:
<span>
${
projectName
}
</span></div>
<div
class=
"nav-time"
>
评估时间:
<span>
${
createDate
}
</span></div>
<div
class=
"nav-title"
>
系统名称:
<span>
${
inspect.projectName?default("")
}
</span></div>
<div
class=
"nav-time"
>
评估时间:
<span>
${
time?default("")
}
</span></div>
<div
class=
"clearfloat"
></div>
<div
class=
"line"
></div>
<div
class=
"systemNameCon"
>
<div>
编号:
<span>
${
createDate
}
</span></div>
<div>
上传类型:
<span>
${
uploadType
}
</span></div>
<div>
文件名:
<span>
${
fileName
}
</span></div>
<div>
架构:
<span>
${
framework
}
</span></div>
<div>
编号:
<span>
${
inspect.id?default("")
}
</span></div>
<div>
上传类型:
<span>
${
inspect.uploadType?default("")
}
</span></div>
<div>
文件名:
<span>
${
inspect.fileName?default("")
}
</span></div>
<div>
架构:
<span>
${
inspect.framework?default("")
}
</span></div>
</div>
<div
class=
"systemNameCon"
>
<div>
数据库类型:
<span>
${
databaseType
}
</span></div>
<div>
依赖管理工具:
<span>
${
manager
}
</span></div>
<div>
语言:
<span>
${
language
}
</span></div>
<div>
数据库类型:
<span>
${
inspect.databaseType?default("")
}
</span></div>
<div>
依赖管理工具:
<span>
${
inspect.manager?default("")
}
</span></div>
<div>
语言:
<span>
${
inspect.language?default("")
}
</span></div>
<div></div>
</div>
<div
class=
"systemNameCon"
>
...
...
@@ -145,14 +156,28 @@
</div>
<div
class=
"keyTec"
>
<
#
if
warnDetails
??
>
<
#
list
warnDetails
as
warn
>
<
#
assign
keys=
warnMap?keys/
>
<
#
list
keys
as
key
>
<
#
assign
warns=
warnMap[key]/
>
<div
class=
"first"
>
<div
class=
"first-title"
>
<img
src=
"./img/key.png"
alt=
""
>
<div
class=
"nav-title key-title"
>
关键技术:
<span>
${warn.}Java依赖(支持国产化)
</span>
<span>
需替换
</span>
</div>
<div
class=
"nav-title
<#if techMap[key]==1>
keySecond-title
<#elseif techMap[key]==2>
key-title
<#else>
keyThird-title
</#if>"
>
关键技术:
<span>
${key?default("")}
</div>
<div
class=
"rightPic"
>
<img
onclick=
"showDiv()"
id=
"pic"
src=
"./img/down.png"
alt=
""
>
<!--<img onclick="showDiv()" id="pic" src="./img/down.png" alt="">-->
<div
id=
"pic"
onclick=
"showDiv()"
>
<span
class=
"onClick"
></span>
</div>
</div>
</div>
...
...
@@ -164,47 +189,38 @@
<th>
所在文件
</th>
<th>
行数
</th>
</tr>
<tr>
<td>
mysql
</td>
<td>
pp.xl
</td>
<td>
100
</td>
</tr>
<tr>
<td>
mysql
</td>
<td>
pp.xl
</td>
<td>
100
</td>
</tr>
<tr>
<td>
mysql
</td>
<td>
pp.xl
</td>
<td>
100
</td>
<
#
list
warns
as
warn
>
<tr
>
<td
class=
"<#if techMap[key]==1>
keySecond-title
<#elseif techMap[key]==2>
key-title
<#else>
keyThird-title
</#if> "
>
${warn.rule?default("")}
</td>
<td
class=
"<#if techMap[key]==1>
keySecond-title
<#elseif techMap[key]==2>
key-title
<#else>
keyThird-title
</#if> "
>
${warn.filePath?default("")}
</td>
<td
class=
" <#if techMap[key]==1>
keySecond-title
<#elseif techMap[key]==2>
key-title
<#else>
keyThird-title
</#if>"
>
${warn.lineNum?default("")}
</td>
</tr>
</
#
list>
</table>
</div>
</div>
</
#
list>
</
#
if>
<div
class=
"second"
>
<div
class=
"first-title"
>
<img
src=
"./img/key.png"
alt=
""
>
<div
class=
"nav-title keySecond-title"
>
关键技术:
<span>
Java依赖(支持国产化)
</span>
<span>
无需替换
</span>
</div>
<div
class=
"rightPic"
>
<img
id=
"pic1"
onclick=
"showDiv1()"
src=
"./img/down.png"
alt=
""
>
</div>
</div>
<div
class=
"line"
></div>
<div
id=
"secondClick"
>
</div>
</div>
<div
class=
"third"
>
<div
class=
"first-title"
>
<img
src=
"./img/key.png"
alt=
""
>
<div
class=
"nav-title keyThird-title"
>
关键技术:
<span>
Java依赖(支持国产化)
</span>
<span>
未知
</span>
</div>
<div
class=
"rightPic "
>
<img
id=
"pic2"
onclick=
"showDiv2()"
src=
"./img/down.png"
alt=
""
>
</div>
</div>
<div
class=
"line"
></div>
<div
class=
"onAnaly"
id=
"thirdClick"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论