Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
0c3aaf5f
提交
0c3aaf5f
authored
4月 13, 2020
作者:
马晨俊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mcj:更新导入excel表格
上级
0e3fb22d
显示空白字符变更
内嵌
并排
正在显示
36 个修改的文件
包含
552 行增加
和
235 行删除
+552
-235
MvcConfig.java
src/main/java/com/zjty/inspect/config/MvcConfig.java
+4
-4
EvaluationController.java
...ava/com/zjty/inspect/controller/EvaluationController.java
+26
-4
InspectController.java
...n/java/com/zjty/inspect/controller/InspectController.java
+20
-9
ExcelDataDao.java
src/main/java/com/zjty/inspect/dao/ExcelDataDao.java
+9
-0
AssessmentReport.java
src/main/java/com/zjty/inspect/entity/AssessmentReport.java
+13
-0
BrowserPlug.java
src/main/java/com/zjty/inspect/entity/BrowserPlug.java
+1
-0
CSDevTechnology.java
src/main/java/com/zjty/inspect/entity/CSDevTechnology.java
+1
-0
Details.java
src/main/java/com/zjty/inspect/entity/Details.java
+3
-0
DevLanguage.java
src/main/java/com/zjty/inspect/entity/DevLanguage.java
+1
-0
ExcelDataEntity.java
src/main/java/com/zjty/inspect/entity/ExcelDataEntity.java
+17
-0
ExcelDataTemp.java
src/main/java/com/zjty/inspect/entity/ExcelDataTemp.java
+17
-0
ExcelEntity.java
src/main/java/com/zjty/inspect/entity/ExcelEntity.java
+23
-0
FontDevTechnology.java
src/main/java/com/zjty/inspect/entity/FontDevTechnology.java
+1
-5
MicroService.java
src/main/java/com/zjty/inspect/entity/MicroService.java
+1
-0
OpGA.java
src/main/java/com/zjty/inspect/entity/OpGA.java
+1
-0
Reform.java
src/main/java/com/zjty/inspect/entity/Reform.java
+14
-5
ApplicationType.java
src/main/java/com/zjty/inspect/enums/ApplicationType.java
+24
-1
BrowserPlugEnum.java
src/main/java/com/zjty/inspect/enums/BrowserPlugEnum.java
+7
-5
CSTechnologyEnum.java
src/main/java/com/zjty/inspect/enums/CSTechnologyEnum.java
+7
-6
CompatibleBrowser.java
src/main/java/com/zjty/inspect/enums/CompatibleBrowser.java
+7
-5
DatabaseType.java
src/main/java/com/zjty/inspect/enums/DatabaseType.java
+6
-2
FontTechnologyEnum.java
src/main/java/com/zjty/inspect/enums/FontTechnologyEnum.java
+7
-3
FrameWorkEnum.java
src/main/java/com/zjty/inspect/enums/FrameWorkEnum.java
+7
-3
LanguageEnum.java
src/main/java/com/zjty/inspect/enums/LanguageEnum.java
+8
-3
MainLanguageEnum.java
src/main/java/com/zjty/inspect/enums/MainLanguageEnum.java
+7
-3
MicroServiceEnum.java
src/main/java/com/zjty/inspect/enums/MicroServiceEnum.java
+2
-3
MiddlewareEnum.java
src/main/java/com/zjty/inspect/enums/MiddlewareEnum.java
+6
-4
OperateSystem.java
src/main/java/com/zjty/inspect/enums/OperateSystem.java
+6
-3
OpgaEnum.java
src/main/java/com/zjty/inspect/enums/OpgaEnum.java
+7
-5
OtherApiEnum.java
src/main/java/com/zjty/inspect/enums/OtherApiEnum.java
+34
-29
RpoEnum.java
src/main/java/com/zjty/inspect/enums/RpoEnum.java
+20
-0
RtoEnum.java
src/main/java/com/zjty/inspect/enums/RtoEnum.java
+25
-3
EvaluationService.java
...main/java/com/zjty/inspect/service/EvaluationService.java
+2
-0
EvaluationServiceImpl.java
.../com/zjty/inspect/service/impl/EvaluationServiceImpl.java
+8
-0
ExcelUtil.java
src/main/java/com/zjty/inspect/utils/ExcelUtil.java
+206
-129
WorkLoadUtil.java
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
+4
-1
没有找到文件。
src/main/java/com/zjty/inspect/config/MvcConfig.java
浏览文件 @
0c3aaf5f
...
...
@@ -23,10 +23,10 @@ public class MvcConfig extends WebMvcConfigurationSupport {
// 多个拦截器组成一个拦截器链
// addPathPatterns 用于添加拦截规则,/**表示拦截所有请求
// excludePathPatterns 用户排除拦截
registry
.
addInterceptor
(
loginInterceptor
)
.
addPathPatterns
(
"/**"
)
.
excludePathPatterns
(
"/swagger-resources/**"
,
"/webjars/**"
,
"/v2/**"
,
"/swagger-ui.html/**"
,
"/doc.html"
);
;
//
registry.addInterceptor(loginInterceptor)
//
.addPathPatterns("/**")
//
.excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**","/doc.html");
//
;
super
.
addInterceptors
(
registry
);
}
@Override
...
...
src/main/java/com/zjty/inspect/controller/EvaluationController.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.zjty.inspect.entity.AssessmentReport
;
import
com.zjty.inspect.entity.Evaluation
;
import
com.zjty.inspect.entity.PageResult
;
import
com.zjty.inspect.entity.Reform
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.service.EvaluationService
;
import
com.zjty.inspect.utils.ExcelUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -25,6 +23,8 @@ public class EvaluationController {
@Autowired
private
EvaluationService
evaluationService
;
/**
* 新增评估报告
* @param evaluation 评估报告
...
...
@@ -64,6 +64,28 @@ public class EvaluationController {
}
return
ResponseEntity
.
ok
(
null
);
}
@ApiOperation
(
"根据id查询输入"
)
@GetMapping
(
value
=
"/all/{id}"
)
public
ResponseEntity
getInId
(
@PathVariable
String
id
)
{
Evaluation
evaluation
=
evaluationService
.
findById
(
id
);
if
(
evaluation
!=
null
){
return
ResponseEntity
.
ok
(
evaluation
);
}
return
ResponseEntity
.
ok
(
null
);
}
@ApiOperation
(
"根据报告id查询excel输入"
)
@GetMapping
(
value
=
"/in/excel/{id}"
)
public
ResponseEntity
exportInName
(
@PathVariable
String
id
)
{
Evaluation
evaluation
=
evaluationService
.
findById
(
id
);
if
(
evaluation
!=
null
){
ExcelDataTemp
excelDataTemp
=
ExcelUtil
.
parseExcel2Entity
(
evaluation
);
return
ResponseEntity
.
ok
(
excelDataTemp
);
}
else
{
return
ResponseEntity
.
ok
(
new
ExcelDataTemp
());
}
}
/**
* 修改评估报告
* @param evaluation 规则封装
...
...
src/main/java/com/zjty/inspect/controller/InspectController.java
浏览文件 @
0c3aaf5f
...
...
@@ -3,6 +3,7 @@ package com.zjty.inspect.controller;
import
com.alibaba.fastjson.JSON
;
import
com.zjty.inspect.aop.AuthAnnotation
;
import
com.zjty.inspect.dao.ConfigParamDao
;
import
com.zjty.inspect.dao.ExcelDataDao
;
import
com.zjty.inspect.dao.TechnologyDao
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.service.*
;
...
...
@@ -13,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.tomcat.util.http.fileupload.disk.DiskFileItem
;
import
org.aspectj.lang.annotation.Around
;
import
org.eclipse.jgit.api.errors.GitAPIException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.Resource
;
...
...
@@ -38,6 +40,7 @@ import java.util.*;
@RequestMapping
(
"/inspect"
)
@Api
(
value
=
"评估接口管理接口"
,
description
=
"评估管理接口,提供页面的增、删、改、查"
)
public
class
InspectController
{
@Autowired
private
InspectService
inspectService
;
@Autowired
...
...
@@ -51,6 +54,8 @@ public class InspectController {
@Autowired
private
ConfigParamDao
configParamDao
;
@Autowired
private
ExcelDataDao
excelDataDao
;
//应用类型转换:小型0
Integer
[]
small
=
{
3
,
4
};
//应用类型转换:中型2
...
...
@@ -127,6 +132,10 @@ public class InspectController {
@PostMapping
(
"/rapidAssessment"
)
public
ResponseEntity
rapidAssessment
(
@RequestBody
Reform
reform
)
throws
IOException
{
//输入参数
File
file
=
new
File
(
reform
.
getCodeUrl
()+
"/参数.xlsx"
);
if
(!
file
.
exists
()){
reform
=
ExcelUtil
.
parseExcel
(
new
FileInputStream
(
file
),
file
.
getName
());
}
String
in
=
JSON
.
toJSONString
(
reform
);
Evaluation
evaluation
=
new
Evaluation
();
evaluation
.
setInEva
(
in
);
...
...
@@ -207,11 +216,6 @@ public class InspectController {
reportVo
.
setDatabaseType
(
null
);
ReportVo
inspect
=
inspectService
.
inspect
(
reportVo
,
inspectParameter
);
log
.
info
(
"inspect:代码评估完成"
);
Report
report
=
new
Report
();
String
random
=
RandomUtil
.
getRandom
();
report
.
setId
(
RandomUtil
.
getRandom
());
report
.
setHtmlAddress
(
reportVo
.
getHtmlAddress
());
reportService
.
saveReport
(
report
);
/*
马晨俊运算结束
*/
...
...
@@ -229,7 +233,11 @@ public class InspectController {
//架构
assessmentReport
.
setFramework
(
inspect
.
getFramework
());
//语言
if
(
""
.
equals
(
reform
.
getDevelopLanguageSystem
().
getName
()))
{
assessmentReport
.
setLanguage
(
inspect
.
getLanguage
());
}
else
{
assessmentReport
.
setLanguage
(
reform
.
getDevelopLanguageSystem
().
getCode
());
}
//适配还是改造
assessmentReport
.
setType
(
reform
.
getMode
());
SysScale
sysScale
=
new
SysScale
();
...
...
@@ -371,6 +379,8 @@ public class InspectController {
workLoadUtil
.
result
(
reform
,
assessmentReport
,
f
,
1.5
);
//输出参数
assessmentReport
.
setLocalContact
(
reform
.
getLocalContact
());
String
out
=
JSON
.
toJSONString
(
assessmentReport
);
evaluation
.
setOutEva
(
out
);
evaluation
.
setUsername
(
reform
.
getUsername
());
...
...
@@ -402,11 +412,12 @@ public class InspectController {
return
ResponseEntity
.
status
(
400
).
build
();
}
}
@PostMapping
(
"/importExcelToRapidAssessment"
)
private
ResponseEntity
uploadFileToInspect
(
MultipartFile
file
,
String
username
)
throws
IOException
{
Reform
reform
=
ExcelUtil
.
parseExcel
(
file
);
private
ResponseEntity
uploadFileToInspect
(
MultipartFile
file
,
String
username
)
throws
IOException
{
Reform
reform
=
ExcelUtil
.
parseExcel
(
file
.
getInputStream
(),
file
.
getOriginalFilename
()
);
reform
.
setUsername
(
username
);
ResponseEntity
responseEntity
=
this
.
rapidAssessment
(
reform
);
return
responseEntity
;
reform
.
setProjectName
(
"excel表格导入"
);
return
ResponseEntity
.
ok
(
reform
)
;
}
}
src/main/java/com/zjty/inspect/dao/ExcelDataDao.java
0 → 100644
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
dao
;
import
com.zjty.inspect.entity.ExcelDataEntity
;
import
com.zjty.inspect.entity.ExcelEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
ExcelDataDao
extends
JpaRepository
<
ExcelEntity
,
String
>
{
ExcelEntity
findByEvaluationIdEquals
(
String
id
);
}
src/main/java/com/zjty/inspect/entity/AssessmentReport.java
浏览文件 @
0c3aaf5f
...
...
@@ -30,7 +30,20 @@ public class AssessmentReport {
* 单位名称
*/
private
String
orgName
;
/**
* 单位联系方式
*/
private
String
orgPhone
;
/**
* 本地开发单位联系人
*/
private
String
localContact
;
/**
* 本地开发单位联系方式
*/
private
String
localPhone
;
/**
* 系统名称
*/
...
...
src/main/java/com/zjty/inspect/entity/BrowserPlug.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
com.zjty.inspect.enums.BrowserPlugEnum
;
import
lombok.Data
;
@Data
...
...
src/main/java/com/zjty/inspect/entity/CSDevTechnology.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
com.zjty.inspect.enums.CSTechnologyEnum
;
import
lombok.Data
;
@Data
...
...
src/main/java/com/zjty/inspect/entity/Details.java
浏览文件 @
0c3aaf5f
...
...
@@ -61,4 +61,7 @@ public class Details {
*/
@ApiModelProperty
(
value
=
"版本"
)
private
String
edition
;
@ApiModelProperty
(
value
=
"内存"
)
private
String
memory
;
}
src/main/java/com/zjty/inspect/entity/DevLanguage.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
com.zjty.inspect.enums.LanguageEnum
;
import
lombok.Data
;
@Data
...
...
src/main/java/com/zjty/inspect/entity/ExcelDataEntity.java
0 → 100644
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.Data
;
import
javax.persistence.Entity
;
/**
* @author Mcj
* @date 2020-04-11 15:08
*/
@Data
public
class
ExcelDataEntity
{
private
String
name
;
private
String
value
;
private
String
remark
;
private
String
version
;
}
src/main/java/com/zjty/inspect/entity/ExcelDataTemp.java
0 → 100644
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author Mcj
* @date 2020-04-11 15:07
*/
@Data
public
class
ExcelDataTemp
{
private
String
name
;
private
List
<
ExcelDataEntity
>
arrayList
=
new
ArrayList
();
}
src/main/java/com/zjty/inspect/entity/ExcelEntity.java
0 → 100644
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
/**
* @author Mcj
* @date 2020-04-11 15:13
*/
@Data
@Entity
public
class
ExcelEntity
{
@Id
private
String
id
;
private
String
evaluationId
;
@Column
(
columnDefinition
=
"TEXT"
)
private
String
jsonData
;
}
src/main/java/com/zjty/inspect/entity/FontDevTechnology.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
jdk.nashorn.internal.scripts.JS
;
import
com.zjty.inspect.enums.FontTechnologyEnum
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Setter
;
import
javax.swing.text.html.CSS
;
import
javax.swing.text.html.HTML
;
@Data
public
class
FontDevTechnology
{
...
...
src/main/java/com/zjty/inspect/entity/MicroService.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
com.zjty.inspect.enums.MicroServiceEnum
;
import
lombok.Data
;
@Data
...
...
src/main/java/com/zjty/inspect/entity/OpGA.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
entity
;
import
com.zjty.inspect.enums.OpgaEnum
;
import
lombok.Data
;
@Data
...
...
src/main/java/com/zjty/inspect/entity/Reform.java
浏览文件 @
0c3aaf5f
...
...
@@ -20,9 +20,6 @@ import java.util.List;
@NoArgsConstructor
@ApiModel
(
value
=
"应用系统改造替换表单"
)
public
class
Reform
{
/*
基础
*/
/**
* admin 是否是管理员
...
...
@@ -89,7 +86,6 @@ public class Reform {
@ApiModelProperty
(
value
=
"原开发费用"
,
example
=
"1"
)
private
Integer
cost
=
-
1
;
/**
* 开发单位是否在本地int 1:是 2:否 -1不清楚
*/
...
...
@@ -99,8 +95,13 @@ public class Reform {
/**
* 本地开发单位联系方式
*/
@ApiModelProperty
(
value
=
"本地开发单位联系
方式
"
)
@ApiModelProperty
(
value
=
"本地开发单位联系
人
"
)
private
String
localContact
;
/**
* 本地开发单位联系方式
*/
@ApiModelProperty
(
value
=
"本地开发单位联系方式"
)
private
String
localPhone
;
/**
* 是否为涉密信息系统 int 1:是 2:否
...
...
@@ -201,6 +202,14 @@ public class Reform {
*/
@ApiModelProperty
(
value
=
"单位名称"
)
private
String
unitName
;
/**
* 单位联系方式
*/
private
String
unitPhone
;
/**
* 单位联系人
*/
private
String
unitContent
;
/**
* 原应用是否通过等级保护/分级保护应用测评
* -1、我不清楚 1、是 2、否
...
...
src/main/java/com/zjty/inspect/enums/ApplicationType.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
enums
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* <h4>Description : 应用类型</h4>
*
* @author : M@tr!x [xhyrzldf@foxmail.com]
* @Date : 2020-03-05 16:54
*/
@Getter
public
enum
ApplicationType
{
OA
(
0
,
"办公OA应用类"
),
MENHU
(
1
,
"门户、信息发布、综合入口服务类"
),
...
...
@@ -34,7 +40,6 @@ public enum ApplicationType {
XIAOXIN
(
24
,
"具备上述多项功能的小型平台"
),
ZHONXIN
(
25
,
"具备上述多项功能的中型平台"
),
DAXIN
(
26
,
"具备上述多项功能的特大型平台"
)
;
private
Integer
code
;
...
...
@@ -47,4 +52,22 @@ public enum ApplicationType {
this
.
code
=
code
;
this
.
name
=
name
;
}
private
static
Map
<
String
,
ApplicationType
>
applicationTypeHashMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
ApplicationType
>
applicationTypeCodeHashMap
=
new
HashMap
<>();
static
{
for
(
ApplicationType
applicationType
:
ApplicationType
.
values
())
{
applicationTypeHashMap
.
put
(
applicationType
.
name
,
applicationType
);
applicationTypeCodeHashMap
.
put
(
applicationType
.
code
,
applicationType
);
}
}
public
static
ApplicationType
getByName
(
String
name
){
ApplicationType
applicationType
=
applicationTypeHashMap
.
get
(
name
);
return
applicationType
;
}
public
static
ApplicationType
getByCode
(
Integer
code
){
ApplicationType
applicationType
=
applicationTypeCodeHashMap
.
get
(
code
);
return
applicationType
;
}
}
src/main/java/com/zjty/inspect/en
tity
/BrowserPlugEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/BrowserPlugEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
java.util.HashMap
;
...
...
@@ -31,9 +30,12 @@ public enum BrowserPlugEnum {
private
Integer
code
;
private
String
name
;
private
static
Map
<
String
,
BrowserPlugEnum
>
browserPlugEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
BrowserPlugEnum
>
browserPlugCodeEnumMap
=
new
HashMap
<>();
static
{
for
(
BrowserPlugEnum
browserPlugEnum
:
BrowserPlugEnum
.
values
())
{
browserPlugEnumMap
.
put
(
browserPlugEnum
.
getName
(),
browserPlugEnum
);
browserPlugCodeEnumMap
.
put
(
browserPlugEnum
.
getCode
(),
browserPlugEnum
);
}
}
BrowserPlugEnum
()
{
...
...
@@ -45,10 +47,10 @@ public enum BrowserPlugEnum {
}
public
static
BrowserPlugEnum
getByName
(
String
name
){
BrowserPlugEnum
browserPlugEnum
=
browserPlugEnumMap
.
get
(
name
);
if
(
browserPlugEnum
==
null
){
return
null
;
return
browserPlugEnum
;
}
public
static
BrowserPlugEnum
getByCode
(
Integer
code
){
BrowserPlugEnum
browserPlugEnum
=
browserPlugCodeEnumMap
.
get
(
code
);
return
browserPlugEnum
;
}
}
src/main/java/com/zjty/inspect/en
tity
/CSTechnologyEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/CSTechnologyEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Getter
;
import
java.applet.Applet
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -25,13 +24,14 @@ public enum CSTechnologyEnum {
private
String
name
;
private
static
Map
<
String
,
CSTechnologyEnum
>
csTechnologyEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
CSTechnologyEnum
>
csTechnologyEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
CSTechnologyEnum
csTechnologyEnum
:
CSTechnologyEnum
.
values
())
{
csTechnologyEnumMap
.
put
(
csTechnologyEnum
.
getName
(),
csTechnologyEnum
);
csTechnologyEnumCodeMap
.
put
(
csTechnologyEnum
.
getCode
(),
csTechnologyEnum
);
}
}
CSTechnologyEnum
()
{
}
CSTechnologyEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
...
...
@@ -40,9 +40,10 @@ public enum CSTechnologyEnum {
public
static
CSTechnologyEnum
getByName
(
String
name
){
CSTechnologyEnum
csTechnologyEnum
=
csTechnologyEnumMap
.
get
(
name
);
if
(
csTechnologyEnum
==
null
){
return
QITA
;
return
csTechnologyEnum
;
}
public
static
CSTechnologyEnum
getByCode
(
Integer
code
){
CSTechnologyEnum
csTechnologyEnum
=
csTechnologyEnumCodeMap
.
get
(
code
);
return
csTechnologyEnum
;
}
}
src/main/java/com/zjty/inspect/enums/CompatibleBrowser.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
enums
;
import
com.zjty.inspect.entity.FontTechnologyEnum
;
import
lombok.Getter
;
import
java.util.HashMap
;
...
...
@@ -30,12 +29,13 @@ public enum CompatibleBrowser {
private
Integer
code
;
private
String
name
;
CompatibleBrowser
()
{
}
private
static
Map
<
String
,
CompatibleBrowser
>
compatibleBrowserMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
CompatibleBrowser
>
compatibleBrowserCodeMap
=
new
HashMap
<>();
static
{
for
(
CompatibleBrowser
compatibleBrowser
:
CompatibleBrowser
.
values
())
{
compatibleBrowserMap
.
put
(
compatibleBrowser
.
getName
(),
compatibleBrowser
);
compatibleBrowserCodeMap
.
put
(
compatibleBrowser
.
getCode
(),
compatibleBrowser
);
}
}
CompatibleBrowser
(
Integer
code
,
String
name
)
{
...
...
@@ -45,9 +45,10 @@ public enum CompatibleBrowser {
public
static
CompatibleBrowser
getByName
(
String
name
)
{
CompatibleBrowser
compatibleBrowser
=
compatibleBrowserMap
.
get
(
name
);
if
(
compatibleBrowser
==
null
)
{
return
NONE
;
return
compatibleBrowser
;
}
public
static
CompatibleBrowser
getByCode
(
Integer
code
)
{
CompatibleBrowser
compatibleBrowser
=
compatibleBrowserCodeMap
.
get
(
code
);
return
compatibleBrowser
;
}
}
\ No newline at end of file
src/main/java/com/zjty/inspect/enums/DatabaseType.java
浏览文件 @
0c3aaf5f
...
...
@@ -47,9 +47,12 @@ public enum DatabaseType {
DatabaseType
()
{
}
private
static
Map
<
String
,
DatabaseType
>
databaseTypeMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
DatabaseType
>
databaseTypeCodeMap
=
new
HashMap
<>();
static
{
for
(
DatabaseType
databaseType
:
DatabaseType
.
values
())
{
databaseTypeMap
.
put
(
databaseType
.
getName
(),
databaseType
);
databaseTypeCodeMap
.
put
(
databaseType
.
getCode
(),
databaseType
);
}
}
DatabaseType
(
Integer
code
,
String
name
)
{
...
...
@@ -58,9 +61,10 @@ public enum DatabaseType {
}
public
static
DatabaseType
getByName
(
String
name
)
{
DatabaseType
databaseType
=
databaseTypeMap
.
get
(
name
);
if
(
databaseType
==
null
)
{
return
OTHER
;
return
databaseType
;
}
public
static
DatabaseType
getByCode
(
Integer
code
)
{
DatabaseType
databaseType
=
databaseTypeCodeMap
.
get
(
code
);
return
databaseType
;
}
}
src/main/java/com/zjty/inspect/en
tity
/FontTechnologyEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/FontTechnologyEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Getter
;
...
...
@@ -33,9 +33,12 @@ public enum FontTechnologyEnum {
FontTechnologyEnum
()
{
}
private
static
Map
<
String
,
FontTechnologyEnum
>
fontTechnologyEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
FontTechnologyEnum
>
fontTechnologyEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
FontTechnologyEnum
fontTechnologyEnum
:
FontTechnologyEnum
.
values
())
{
fontTechnologyEnumMap
.
put
(
fontTechnologyEnum
.
getName
(),
fontTechnologyEnum
);
fontTechnologyEnumCodeMap
.
put
(
fontTechnologyEnum
.
code
,
fontTechnologyEnum
);
}
}
FontTechnologyEnum
(
String
name
,
int
code
)
{
...
...
@@ -45,9 +48,10 @@ public enum FontTechnologyEnum {
public
static
FontTechnologyEnum
getByName
(
String
name
){
FontTechnologyEnum
fontTechnologyEnum
=
fontTechnologyEnumMap
.
get
(
name
);
if
(
fontTechnologyEnum
==
null
){
return
QITA
;
return
fontTechnologyEnum
;
}
public
static
FontTechnologyEnum
getByCode
(
Integer
code
){
FontTechnologyEnum
fontTechnologyEnum
=
fontTechnologyEnumCodeMap
.
get
(
code
);
return
fontTechnologyEnum
;
}
}
src/main/java/com/zjty/inspect/en
tity
/FrameWorkEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/FrameWorkEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Getter
;
...
...
@@ -31,9 +31,12 @@ public enum FrameWorkEnum {
FrameWorkEnum
()
{
}
private
static
Map
<
String
,
FrameWorkEnum
>
frameWorkEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
FrameWorkEnum
>
frameWorkEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
FrameWorkEnum
frameWorkEnum
:
FrameWorkEnum
.
values
())
{
frameWorkEnumMap
.
put
(
frameWorkEnum
.
getName
(),
frameWorkEnum
);
frameWorkEnumCodeMap
.
put
(
frameWorkEnum
.
getCode
(),
frameWorkEnum
);
}
}
FrameWorkEnum
(
Integer
code
,
String
name
)
{
...
...
@@ -43,9 +46,10 @@ public enum FrameWorkEnum {
public
static
FrameWorkEnum
getByName
(
String
name
){
FrameWorkEnum
frameWorkEnum
=
frameWorkEnumMap
.
get
(
name
);
if
(
frameWorkEnum
==
null
){
return
QITA
;
return
frameWorkEnum
;
}
public
static
FrameWorkEnum
getByCode
(
Integer
code
){
FrameWorkEnum
frameWorkEnum
=
frameWorkEnumCodeMap
.
get
(
code
);
return
frameWorkEnum
;
}
}
src/main/java/com/zjty/inspect/en
tity
/LanguageEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/LanguageEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Getter
;
...
...
@@ -30,9 +30,13 @@ public enum LanguageEnum {
LanguageEnum
()
{
}
private
static
Map
<
String
,
LanguageEnum
>
languageEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
LanguageEnum
>
languageEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
LanguageEnum
languageEnum
:
LanguageEnum
.
values
())
{
languageEnumMap
.
put
(
languageEnum
.
getName
(),
languageEnum
);
languageEnumCodeMap
.
put
(
languageEnum
.
getCode
(),
languageEnum
);
}
}
LanguageEnum
(
Integer
code
,
String
name
)
{
...
...
@@ -42,9 +46,10 @@ public enum LanguageEnum {
public
static
LanguageEnum
getByName
(
String
name
){
LanguageEnum
languageEnum
=
languageEnumMap
.
get
(
name
);
if
(
languageEnum
==
null
){
return
QITA
;
return
languageEnum
;
}
public
static
LanguageEnum
getByCode
(
Integer
code
){
LanguageEnum
languageEnum
=
languageEnumCodeMap
.
get
(
code
);
return
languageEnum
;
}
}
src/main/java/com/zjty/inspect/en
tity
/MainLanguageEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/MainLanguageEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Getter
;
...
...
@@ -28,9 +28,12 @@ public enum MainLanguageEnum {
MainLanguageEnum
()
{
}
private
static
Map
<
String
,
MainLanguageEnum
>
mainLanguageEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
MainLanguageEnum
>
mainLanguageEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
MainLanguageEnum
mainLanguageEnum
:
MainLanguageEnum
.
values
())
{
mainLanguageEnumMap
.
put
(
mainLanguageEnum
.
getName
(),
mainLanguageEnum
);
mainLanguageEnumCodeMap
.
put
(
mainLanguageEnum
.
getCode
(),
mainLanguageEnum
);
}
}
MainLanguageEnum
(
Integer
code
,
String
name
)
{
...
...
@@ -40,9 +43,10 @@ public enum MainLanguageEnum {
public
static
MainLanguageEnum
getByName
(
String
name
){
MainLanguageEnum
mainLanguageEnum
=
mainLanguageEnumMap
.
get
(
name
);
if
(
mainLanguageEnum
==
null
){
return
QITA
;
return
mainLanguageEnum
;
}
public
static
MainLanguageEnum
getByCode
(
Integer
code
){
MainLanguageEnum
mainLanguageEnum
=
mainLanguageEnumMap
.
get
(
code
);
return
mainLanguageEnum
;
}
}
src/main/java/com/zjty/inspect/en
tity
/MicroServiceEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/MicroServiceEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Getter
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -54,7 +53,7 @@ public enum MicroServiceEnum {
public
static
MicroServiceEnum
getByName
(
String
name
){
MicroServiceEnum
microServiceEnum
=
microServiceEnumMap
.
get
(
name
);
if
(
microServiceEnum
==
null
){
return
OTHER
;
return
null
;
}
return
microServiceEnum
;
}
...
...
src/main/java/com/zjty/inspect/enums/MiddlewareEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
enums
;
import
com.zjty.inspect.entity.FontTechnologyEnum
;
import
com.zjty.inspect.entity.OpgaEnum
;
import
lombok.Getter
;
import
java.util.HashMap
;
...
...
@@ -36,9 +34,12 @@ public enum MiddlewareEnum {
private
Integer
code
;
private
String
name
;
private
static
Map
<
String
,
MiddlewareEnum
>
middlewareEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
MiddlewareEnum
>
middlewareEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
MiddlewareEnum
middlewareEnum
:
MiddlewareEnum
.
values
())
{
middlewareEnumMap
.
put
(
middlewareEnum
.
getName
(),
middlewareEnum
);
middlewareEnumCodeMap
.
put
(
middlewareEnum
.
getCode
(),
middlewareEnum
);
}
}
MiddlewareEnum
()
{
...
...
@@ -50,9 +51,10 @@ public enum MiddlewareEnum {
}
public
static
MiddlewareEnum
getByName
(
String
name
){
MiddlewareEnum
middlewareEnum
=
middlewareEnumMap
.
get
(
name
);
if
(
middlewareEnum
==
null
){
return
null
;
return
middlewareEnum
;
}
public
static
MiddlewareEnum
getByCode
(
Integer
code
){
MiddlewareEnum
middlewareEnum
=
middlewareEnumCodeMap
.
get
(
code
);
return
middlewareEnum
;
}
}
src/main/java/com/zjty/inspect/enums/OperateSystem.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
enums
;
import
com.zjty.inspect.entity.FontTechnologyEnum
;
import
lombok.Getter
;
import
java.util.HashMap
;
...
...
@@ -48,9 +47,12 @@ public enum OperateSystem {
OperateSystem
()
{
}
private
static
Map
<
String
,
OperateSystem
>
operateSystemMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
OperateSystem
>
operateSystemCodeMap
=
new
HashMap
<>();
static
{
for
(
OperateSystem
operateSystem
:
OperateSystem
.
values
())
{
operateSystemMap
.
put
(
operateSystem
.
getName
(),
operateSystem
);
operateSystemCodeMap
.
put
(
operateSystem
.
getCode
(),
operateSystem
);
}
}
OperateSystem
(
Integer
code
,
String
name
)
{
...
...
@@ -59,9 +61,10 @@ public enum OperateSystem {
}
public
static
OperateSystem
getByName
(
String
name
){
OperateSystem
operateSystem
=
operateSystemMap
.
get
(
name
);
if
(
operateSystem
==
null
){
return
null
;
return
operateSystem
;
}
public
static
OperateSystem
getByCode
(
String
name
){
OperateSystem
operateSystem
=
operateSystemCodeMap
.
get
(
name
);
return
operateSystem
;
}
}
src/main/java/com/zjty/inspect/en
tity
/OpgaEnum.java
→
src/main/java/com/zjty/inspect/en
ums
/OpgaEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
en
tity
;
package
com
.
zjty
.
inspect
.
en
ums
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Getter
;
...
...
@@ -18,13 +18,14 @@ public enum OpgaEnum {
private
Integer
code
;
private
String
name
;
private
static
Map
<
String
,
OpgaEnum
>
opgaEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
OpgaEnum
>
opgaEnumCodeMap
=
new
HashMap
<>();
static
{
for
(
OpgaEnum
opgaEnum
:
OpgaEnum
.
values
())
{
opgaEnumMap
.
put
(
opgaEnum
.
getName
(),
opgaEnum
);
opgaEnumCodeMap
.
put
(
opgaEnum
.
getCode
(),
opgaEnum
);
}
}
OpgaEnum
()
{
}
OpgaEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
...
...
@@ -33,9 +34,10 @@ public enum OpgaEnum {
public
static
OpgaEnum
getByName
(
String
name
){
OpgaEnum
opgaEnum
=
opgaEnumMap
.
get
(
name
);
if
(
opgaEnum
==
null
){
return
OpgaEnum
.
QITA
;
return
opgaEnum
;
}
public
static
OpgaEnum
getByCode
(
Integer
code
){
OpgaEnum
opgaEnum
=
opgaEnumCodeMap
.
get
(
code
);
return
opgaEnum
;
}
}
src/main/java/com/zjty/inspect/enums/OtherApiEnum.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
enums
;
import
com.zjty.inspect.entity.MainLanguageEnum
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
public
enum
OtherApiEnum
{
无
(
1
,
"无"
),
JNDI
(
1
,
"JNDI"
),
无
(
-
1
,
"无"
),
JNDI
(
0
,
"JNDI"
),
ML
(
1
,
"其他命名与目录类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
JMS
(
1
,
"JMS"
),
RestFul
(
1
,
"RestFul"
),
XX
(
1
,
"其他消息类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
AMQP
(
1
,
"AMQP"
),
KAFKA
(
1
,
"Kafka API"
),
MQTT
(
1
,
"MQTT"
),
ROUTE
(
1
,
"其他消息路由类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
ES
(
1
,
"ES"
),
YQ
(
1
,
"其他搜索引擎类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
LOGSTASH
(
1
,
"Logstash"
),
LOG
(
1
,
"其他分析日志类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
KIBANA
(
1
,
"Kibana"
),
FXKS
(
1
,
"其他分析可视化类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
REDIS
(
1
,
"Redis"
),
JIQ
(
1
,
"其他集群类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
ARCGIS
(
1
,
"ARCGIS"
),
GIS
(
1
,
"其他GIS类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
EDIT
(
1
,
"在线编辑API:请在备注中填写,如需填写多个,请以逗号分隔"
),
TUBIAO
(
1
,
"统计图表类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
BF
(
1
,
"播放类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
YJ
(
1
,
"硬件驱动类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
OCR
(
1
,
"OCR识别类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
JIAMI
(
1
,
"加密类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
OTHER
(
1
,
"其他:请在备注中填写,如需填写多个请以逗号分隔"
);
JMS
(
2
,
"JMS"
),
RestFul
(
3
,
"RestFul"
),
XX
(
4
,
"其他消息类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
AMQP
(
5
,
"AMQP"
),
KAFKA
(
6
,
"Kafka API"
),
MQTT
(
7
,
"MQTT"
),
ROUTE
(
8
,
"其他消息路由类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
ES
(
9
,
"ES"
),
YQ
(
1
0
,
"其他搜索引擎类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
LOGSTASH
(
1
1
,
"Logstash"
),
LOG
(
1
2
,
"其他分析日志类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
KIBANA
(
1
3
,
"Kibana"
),
FXKS
(
1
4
,
"其他分析可视化类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
REDIS
(
1
5
,
"Redis"
),
JIQ
(
1
6
,
"其他集群类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
ARCGIS
(
1
7
,
"ARCGIS"
),
GIS
(
1
8
,
"其他GIS类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
EDIT
(
1
9
,
"在线编辑API:请在备注中填写,如需填写多个,请以逗号分隔"
),
TUBIAO
(
20
,
"统计图表类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
BF
(
2
1
,
"播放类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
YJ
(
22
,
"硬件驱动类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
OCR
(
23
,
"OCR识别类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
JIAMI
(
24
,
"加密类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
OTHER
(
25
,
"其他:请在备注中填写,如需填写多个请以逗号分隔"
);
private
Integer
code
;
private
String
name
;
private
static
Map
<
String
,
OtherApiEnum
>
otherApiEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
OtherApiEnum
>
otherApiCodeEnumMap
=
new
HashMap
<>();
static
{
for
(
OtherApiEnum
otherApiEnum
:
OtherApiEnum
.
values
())
{
otherApiEnumMap
.
put
(
otherApiEnum
.
getName
(),
otherApiEnum
);
}
for
(
OtherApiEnum
otherApiEnum
:
OtherApiEnum
.
values
())
{
otherApiCodeEnumMap
.
put
(
otherApiEnum
.
getCode
(),
otherApiEnum
);
}
}
OtherApiEnum
()
{
}
...
...
@@ -52,9 +56,10 @@ public enum OtherApiEnum {
}
public
static
OtherApiEnum
getByName
(
String
name
){
OtherApiEnum
otherApiEnum
=
otherApiEnumMap
.
get
(
name
);
if
(
otherApiEnum
==
null
){
return
null
;
return
otherApiEnum
;
}
public
static
OtherApiEnum
getByCode
(
Integer
code
){
OtherApiEnum
otherApiEnum
=
otherApiCodeEnumMap
.
get
(
code
);
return
otherApiEnum
;
}
}
src/main/java/com/zjty/inspect/enums/RpoEnum.java
浏览文件 @
0c3aaf5f
...
...
@@ -2,6 +2,9 @@ package com.zjty.inspect.enums;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
public
enum
RpoEnum
{
QLM
(
0
,
"与RTO时间的前60秒同步"
),
...
...
@@ -12,6 +15,23 @@ public enum RpoEnum {
GJ
(
5
,
"允许丢失割接准备时期+恢复期间所产生的数据"
),
GJALL
(
6
,
"允许丢失割接前备份以外的所有数据"
);
private
static
Map
<
String
,
RpoEnum
>
rpoEnumHashMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
RpoEnum
>
rpoCodeEnumHashMap
=
new
HashMap
<>();
static
{
for
(
RpoEnum
rpoEnum
:
RpoEnum
.
values
())
{
rpoEnumHashMap
.
put
(
rpoEnum
.
getName
(),
rpoEnum
);
rpoCodeEnumHashMap
.
put
(
rpoEnum
.
getCode
(),
rpoEnum
);
}
}
public
static
RpoEnum
getByName
(
String
name
){
RpoEnum
rpoEnum
=
rpoEnumHashMap
.
get
(
name
);
return
rpoEnum
;
}
public
static
RpoEnum
getByCode
(
Integer
code
){
RpoEnum
rpoEnum
=
rpoCodeEnumHashMap
.
get
(
code
);
return
rpoEnum
;
}
private
Integer
code
;
private
String
name
;
...
...
src/main/java/com/zjty/inspect/enums/RtoEnum.java
浏览文件 @
0c3aaf5f
...
...
@@ -2,25 +2,47 @@ package com.zjty.inspect.enums;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
public
enum
RtoEnum
{
YI
(
0
,
"1-60秒"
),
SHI
(
1
,
"10分钟内"
),
//平滑过渡
//平滑过渡
SHI
(
1
,
"10分钟内"
),
SAN
(
2
,
"30分钟内"
),
LIU
(
3
,
"60分钟内"
),
Y
(
4
,
"1-5小时"
),
WU
(
5
,
"5-10小时"
),
ERS
(
6
,
"24小时内"
),
SIB
(
7
,
"48小时内"
),
QI
(
8
,
"72小时内"
),
//暂停服务
ZH
(
9
,
"一周内"
);
//休息日或晚间替换
//暂停服务
QI
(
8
,
"72小时内"
),
//休息日或晚间替换
ZH
(
9
,
"一周内"
);
private
Integer
code
;
private
String
name
;
RtoEnum
()
{
}
private
static
Map
<
String
,
RtoEnum
>
rtoEnumHashMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
RtoEnum
>
rtoCodeEnumHashMap
=
new
HashMap
<>();
static
{
for
(
RtoEnum
rtoEnum
:
RtoEnum
.
values
())
{
rtoEnumHashMap
.
put
(
rtoEnum
.
getName
(),
rtoEnum
);
rtoCodeEnumHashMap
.
put
(
rtoEnum
.
getCode
(),
rtoEnum
);
}
}
public
static
RtoEnum
getByName
(
String
name
){
RtoEnum
rpoEnum
=
rtoEnumHashMap
.
get
(
name
);
return
rpoEnum
;
}
public
static
RtoEnum
getByCode
(
Integer
code
){
RtoEnum
rpoEnum
=
rtoEnumHashMap
.
get
(
code
);
return
rpoEnum
;
}
RtoEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
...
...
src/main/java/com/zjty/inspect/service/EvaluationService.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
service
;
import
com.zjty.inspect.entity.Evaluation
;
import
com.zjty.inspect.entity.ExcelEntity
;
import
com.zjty.inspect.entity.Rule
;
import
org.springframework.data.domain.Page
;
...
...
@@ -16,4 +17,5 @@ public interface EvaluationService {
Evaluation
findById
(
String
id
);
Evaluation
findByName
(
String
name
);
ExcelEntity
findExcelEntityById
(
String
id
);
}
src/main/java/com/zjty/inspect/service/impl/EvaluationServiceImpl.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
service
.
impl
;
import
com.zjty.inspect.dao.EvaluationDao
;
import
com.zjty.inspect.dao.ExcelDataDao
;
import
com.zjty.inspect.entity.Evaluation
;
import
com.zjty.inspect.entity.ExcelEntity
;
import
com.zjty.inspect.entity.Rule
;
import
com.zjty.inspect.service.EvaluationService
;
import
com.zjty.inspect.utils.TimeUtil
;
...
...
@@ -31,6 +33,8 @@ public class EvaluationServiceImpl implements EvaluationService {
@Autowired
private
EvaluationDao
evaluationDao
;
@Autowired
private
ExcelDataDao
excelDataDao
;
@Override
public
Evaluation
save
(
Evaluation
evaluation
)
{
if
(
StringUtils
.
isEmpty
(
evaluation
.
getInEva
()))
{
...
...
@@ -96,6 +100,10 @@ public class EvaluationServiceImpl implements EvaluationService {
return
null
;
}
@Override
public
ExcelEntity
findExcelEntityById
(
String
id
)
{
return
excelDataDao
.
findByEvaluationIdEquals
(
id
);
}
/**
* 动态条件构建
...
...
src/main/java/com/zjty/inspect/utils/ExcelUtil.java
浏览文件 @
0c3aaf5f
package
com
.
zjty
.
inspect
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.enums.CompatibleBrowser
;
import
com.zjty.inspect.enums.DatabaseType
;
import
com.zjty.inspect.enums.MiddlewareEnum
;
import
com.zjty.inspect.enums.OperateSystem
;
import
com.zjty.inspect.enums.*
;
import
org.apache.poi.hssf.usermodel.HSSFSheet
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.Cell
;
...
...
@@ -12,10 +10,7 @@ import org.apache.poi.ss.usermodel.Row;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
...
...
@@ -32,30 +27,90 @@ public class ExcelUtil {
private
static
String
xlsx
=
"xlsx"
;
private
static
String
xls
=
"xls"
;
public
static
Reform
parseExcel
(
MultipartFile
f1
)
{
public
static
Reform
parseExcel
(
InputStream
fileInputStream
,
String
fileName
)
{
Reform
reform
=
new
Reform
();
try
{
InputStream
fileInputStream
=
f1
.
getInputStream
();
String
[]
split
=
Objects
.
requireNonNull
(
f1
.
getOriginalFilename
()).
split
(
"\\."
);
String
[]
split
=
Objects
.
requireNonNull
(
fileName
).
split
(
"\\."
);
if
(
xlsx
.
equals
(
split
[
1
]))
{
XSSFWorkbook
xwb
=
new
XSSFWorkbook
(
fileInputStream
);
//3、得到Excel工作表对象
XSSFSheet
sheetAt
=
xwb
.
getSheetAt
(
0
);
Reform
reform
=
getReform
(
sheetAt
);
return
reform
;
reform
=
getReform
(
sheetAt
);
}
else
if
(
xls
.
equals
(
split
[
1
]))
{
HSSFWorkbook
xwb
=
new
HSSFWorkbook
(
fileInputStream
);
//3、得到Excel工作表对象
HSSFSheet
sheetAt
=
xwb
.
getSheetAt
(
0
);
Reform
reform
=
getReform
(
sheetAt
);
return
reform
;
reform
=
getReform
(
sheetAt
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
new
Reform
();
return
reform
;
}
public
static
ExcelDataTemp
parseExcel2Entity
(
Evaluation
evaluation
)
{
String
inEva
=
evaluation
.
getInEva
();
ExcelDataTemp
excelDataTemp
=
new
ExcelDataTemp
();
if
(
inEva
!=
null
)
{
Reform
reform
=
JSON
.
parseObject
(
evaluation
.
getInEva
(),
Reform
.
class
);
exportEntity
(
"用户名"
,
reform
.
getUsername
());
exportEntity
(
"评估类型"
,
reform
.
getAssessmentType
());
exportEntity
(
"替换方式"
,
reform
.
getMode
());
exportEntity
(
"系统名称"
,
reform
.
getProjectName
());
exportEntity
(
"代码地址"
,
reform
.
getCodeUrl
());
exportEntity
(
"文件名称"
,
reform
.
getCodeName
());
exportEntity
(
"git地址"
,
reform
.
getGitUrl
());
exportEntity
(
"模块数量"
,
reform
.
getModuleNum
());
exportEntity
(
"原开发费用"
,
reform
.
getCost
());
exportEntity
(
"开发单位是否在本地"
,
reform
.
getAddress
());
exportEntity
(
"开发单位联系人"
,
reform
.
getLocalContact
());
exportEntity
(
"开发单位联系方式"
,
reform
.
getLocalPhone
());
exportEntity
(
"是否涉密系统"
,
flipYesOrNo
(
reform
.
getSecret
()));
exportEntity
(
"容灾能力"
,
flipYesOrNo
(
reform
.
getDisasterTolerance
()));
exportEntity
(
"安全能力"
,
flipYesOrNo
(
reform
.
getSafe
()));
exportEntity
(
"架构"
,
flipYesOrNo
(
reform
.
getFramework
()));
exportEntity
(
"运行时间"
,
reform
.
getTime
());
exportEntity
(
"运行时间"
,
reform
.
getTime
());
exportEntity
(
"数据库表数量"
,
reform
.
getTableNum
());
exportEntity
(
"数据库数据量"
,
reform
.
getDatabaseNum
());
List
<
Integer
>
applicationType
=
reform
.
getApplicationType
();
for
(
Integer
type
:
applicationType
)
{
ApplicationType
applicationType1
=
ApplicationType
.
getByCode
(
type
);
exportEntity
(
"该应用类型"
,
applicationType1
.
getName
());
}
SystemStructure
systemStructure
=
reform
.
getSystemStructure
();
Details
application
=
systemStructure
.
getApplication
();
exportEntity
(
"应用服务器部署位置"
,
getDeploy
(
application
.
getDeploy
()));
}
return
excelDataTemp
;
}
private
static
ExcelDataTemp
getExcelInData
(
Sheet
sheetAt
)
{
int
firstRowNum
=
sheetAt
.
getFirstRowNum
();
int
lastRowNum
=
sheetAt
.
getLastRowNum
();
ArrayList
<
ExcelDataEntity
>
excelDataEntities
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<=
lastRowNum
;
i
++)
{
ExcelDataEntity
excelDataEntity
=
new
ExcelDataEntity
();
String
content
=
getExcelCell
(
i
,
1
,
sheetAt
);
excelDataEntity
.
setName
(
content
);
String
value
=
getExcelCell
(
i
,
2
,
sheetAt
);
excelDataEntity
.
setValue
(
value
);
String
remark
=
getExcelCell
(
i
,
3
,
sheetAt
);
excelDataEntity
.
setRemark
(
remark
);
String
version
=
getExcelCell
(
i
,
4
,
sheetAt
);
excelDataEntity
.
setVersion
(
version
);
excelDataEntities
.
add
(
excelDataEntity
);
}
ExcelDataTemp
excelDataTemp
=
new
ExcelDataTemp
();
excelDataTemp
.
setArrayList
(
excelDataEntities
);
return
excelDataTemp
;
}
private
static
String
getExcelCell
(
int
rowNum
,
int
cellNum
,
Sheet
sheetAt
)
{
...
...
@@ -68,6 +123,15 @@ public class ExcelUtil {
Reform
reform
=
new
Reform
();
//单位名称
String
unitName
=
getExcelCell
(
2
,
2
,
sheetAt
);
reform
.
setUnitName
(
unitName
);
//单位联系方式
String
unitPhone
=
getExcelCell
(
2
,
4
,
sheetAt
);
String
[]
split
=
unitPhone
.
split
(
"\n"
);
if
(
split
.
length
>
1
)
{
reform
.
setUnitContent
(
split
[
0
]);
reform
.
setUnitPhone
(
split
[
1
]);
}
reform
.
setUnitName
(
unitName
);
//系统名称
...
...
@@ -79,7 +143,7 @@ public class ExcelUtil {
String
cycle
=
getExcelCell
(
5
,
2
,
sheetAt
);
String
s
=
cycle
.
replaceAll
(
"年"
,
""
);
reform
.
setCycle
(
returnNum
(
s
)
*
12
);
reform
.
setCycle
(
returnNum
(
s
)
*
12
);
String
time
=
getExcelCell
(
6
,
2
,
sheetAt
);
if
(!
""
.
equals
(
time
))
{
...
...
@@ -93,10 +157,11 @@ public class ExcelUtil {
}
String
address
=
getExcelCell
(
7
,
2
,
sheetAt
);
reform
.
setAddress
(
yesOrNo
(
address
));
String
phone
=
getExcelCell
(
7
,
4
,
sheetAt
);
String
[]
split
=
phone
.
split
(
"\n"
);
if
(
split
.
length
>
0
)
{
reform
.
setLocalContact
(
phone
);
String
nativeContent
=
getExcelCell
(
7
,
4
,
sheetAt
);
String
[]
nativeUnit
=
nativeContent
.
split
(
"\n"
);
if
(
nativeUnit
.
length
>
0
)
{
reform
.
setLocalContact
(
nativeUnit
[
0
]);
reform
.
setLocalPhone
(
nativeUnit
[
1
]);
}
String
secret
=
getExcelCell
(
8
,
2
,
sheetAt
);
...
...
@@ -169,12 +234,14 @@ public class ExcelUtil {
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
BaseDes
devFramework
=
new
BaseDes
();
Integer
code
=
FrameWorkEnum
.
getByName
(
framework
).
getCode
();
devFramework
.
setCode
(
code
);
FrameWorkEnum
frameWorkEnum
=
FrameWorkEnum
.
getByName
(
framework
);
if
(
frameWorkEnum
!=
null
)
{
devFramework
.
setCode
(
frameWorkEnum
.
getCode
());
devFramework
.
setVersion
(
version
);
devFramework
.
setDes
(
remark
);
devFrameworks
.
add
(
devFramework
);
}
}
developLanguageSystem
.
setDevFrameworks
(
devFrameworks
);
...
...
@@ -187,13 +254,15 @@ public class ExcelUtil {
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
BaseDes
csDevTechnology
=
new
BaseDes
();
CSTechnologyEnum
byName
=
CSTechnologyEnum
.
getByName
(
framework
);
csDevTechnology
.
setCode
(
byName
.
getCode
());
CSTechnologyEnum
csTechnologyEnum
=
CSTechnologyEnum
.
getByName
(
framework
);
if
(
csTechnologyEnum
!=
null
)
{
csDevTechnology
.
setCode
(
csTechnologyEnum
.
getCode
());
csDevTechnology
.
setName
(
framework
);
csDevTechnology
.
setDes
(
remark
);
csDevTechnology
.
setVersion
(
version
);
csDevTechnologies
.
add
(
csDevTechnology
);
}
}
developLanguageSystem
.
setCsDevTechnologies
(
csDevTechnologies
);
List
<
BaseDes
>
fontDevTechnologies
=
new
ArrayList
<>();
...
...
@@ -207,11 +276,13 @@ public class ExcelUtil {
BaseDes
fontDevTechnology
=
new
BaseDes
();
fontDevTechnology
.
setDes
(
remark
);
fontDevTechnology
.
setVersion
(
version
);
FontTechnologyEnum
byName
=
FontTechnologyEnum
.
getByName
(
framework
);
fontDevTechnology
.
setCode
(
byName
.
getCode
());
fontDevTechnology
.
setName
(
byName
.
getName
());
FontTechnologyEnum
fontTechnologyEnum
=
FontTechnologyEnum
.
getByName
(
framework
);
if
(
fontTechnologyEnum
!=
null
)
{
fontDevTechnology
.
setCode
(
fontTechnologyEnum
.
getCode
());
fontDevTechnology
.
setName
(
fontTechnologyEnum
.
getName
());
fontDevTechnologies
.
add
(
fontDevTechnology
);
}
}
developLanguageSystem
.
setFontDevTechnologies
(
fontDevTechnologies
);
List
<
BaseDes
>
opGAS
=
new
ArrayList
<>();
...
...
@@ -223,13 +294,15 @@ public class ExcelUtil {
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
BaseDes
opGA
=
new
BaseDes
();
OpgaEnum
byName
=
OpgaEnum
.
getByName
(
framework
);
OpgaEnum
opgaEnum
=
OpgaEnum
.
getByName
(
framework
);
if
(
opgaEnum
!=
null
)
{
opGA
.
setName
(
framework
);
opGA
.
setCode
(
byName
.
getCode
());
opGA
.
setCode
(
opgaEnum
.
getCode
());
opGA
.
setVersion
(
version
);
opGA
.
setDes
(
remark
);
opGAS
.
add
(
opGA
);
}
}
developLanguageSystem
.
setOpGAs
(
opGAS
);
String
language
=
getExcelCell
(
39
,
2
,
sheetAt
);
...
...
@@ -245,15 +318,18 @@ public class ExcelUtil {
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
BaseDes
devLanguage
=
new
BaseDes
();
LanguageEnum
byName
=
LanguageEnum
.
getByName
(
lan
);
devLanguage
.
setName
(
byName
.
getName
());
devLanguage
.
setCode
(
byName
.
getCode
());
LanguageEnum
languageEnum
=
LanguageEnum
.
getByName
(
lan
);
if
(
languageEnum
!=
null
)
{
devLanguage
.
setName
(
languageEnum
.
getName
());
devLanguage
.
setCode
(
languageEnum
.
getCode
());
devLanguage
.
setVersion
(
version
);
devLanguage
.
setDes
(
remark
);
devLanguages
.
add
(
devLanguage
);
}
}
developLanguageSystem
.
setDevLanguages
(
devLanguages
);
reform
.
setDevelopLanguageSystem
(
developLanguageSystem
);
/**
* 中间件/API
*/
...
...
@@ -261,11 +337,14 @@ public class ExcelUtil {
List
<
MiddlewareEnum
>
middlewareEnums
=
new
ArrayList
<>();
for
(
int
i
=
46
;
i
<
51
;
i
++)
{
String
middleware1
=
getExcelCell
(
i
,
2
,
sheetAt
);
MiddlewareEnum
byName
=
MiddlewareEnum
.
getByName
(
middleware1
);
middlewareEnums
.
add
(
byName
);
if
(!
""
.
equals
(
middleware1
))
{
MiddlewareEnum
middlewareEnum
=
MiddlewareEnum
.
getByName
(
middleware1
);
if
(
middlewareEnum
!=
null
)
{
middlewareEnums
.
add
(
middlewareEnum
);
}
}
}
middleware
.
setMiddlewareEnums
(
middlewareEnums
);
reform
.
setMiddleware
(
middleware
);
ArrayList
<
OtherApi
>
otherApis
=
new
ArrayList
<>();
for
(
int
i
=
51
;
i
<
61
;
i
++)
{
...
...
@@ -286,30 +365,34 @@ public class ExcelUtil {
List
<
BaseDes
>
microServices
=
new
ArrayList
<>();
for
(
int
i
=
62
;
i
<
72
;
i
++)
{
String
name
=
getExcelCell
(
i
,
2
,
sheetAt
);
if
(
""
.
equals
(
name
))
{
if
(
name
==
null
||
""
.
equals
(
name
))
{
continue
;
}
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
BaseDes
microService
=
new
BaseDes
();
MicroServiceEnum
byName
=
MicroServiceEnum
.
getByName
(
name
);
microService
.
setCode
(
byName
.
getCode
());
microService
.
setName
(
byName
.
getName
());
MicroServiceEnum
microServiceEnum
=
MicroServiceEnum
.
getByName
(
name
);
if
(
microServiceEnum
!=
null
)
{
microService
.
setCode
(
microServiceEnum
.
getCode
());
microService
.
setName
(
microServiceEnum
.
getName
());
microService
.
setDes
(
remark
);
microService
.
setVersion
(
version
);
microServices
.
add
(
microService
);
}
}
middleware
.
setMicroServices
(
microServices
);
reform
.
setMiddleware
(
middleware
);
//数据库相关
Database
database1
=
new
Database
();
ArrayList
<
DatabaseType
>
databaseTypes
=
new
ArrayList
<>();
for
(
int
i
=
74
;
i
<
77
;
i
++)
{
String
database
=
getExcelCell
(
i
,
2
,
sheetAt
);
if
(!
""
.
equals
(
database
))
{
DatabaseType
byName
=
DatabaseType
.
getByName
(
database
);
databaseTypes
.
add
(
byName
);
}
}
database1
.
setDatabaseType
(
databaseTypes
);
String
tableNum
=
getExcelCell
(
77
,
2
,
sheetAt
);
...
...
@@ -353,18 +436,20 @@ public class ExcelUtil {
}
browser
.
setCompatibleBrowsers
(
compatibleBrowsers
);
ArrayList
<
B
rowserPlug
>
browserPlugs
=
new
ArrayList
<>();
ArrayList
<
B
aseDes
>
browserPlugs
=
new
ArrayList
<>();
for
(
int
i
=
98
;
i
<=
108
;
i
++)
{
String
plugin
=
getExcelCell
(
i
,
2
,
sheetAt
);
B
rowserPlug
browserPlug
=
new
BrowserPlug
();
B
aseDes
browserPlug
=
new
BaseDes
();
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
browserPlug
.
setVersion
(
version
);
browserPlug
.
setDes
(
remark
);
BrowserPlugEnum
byName
=
BrowserPlugEnum
.
getByName
(
plugin
);
browserPlug
.
setBrowserPlugEnum
(
byName
);
browserPlug
.
setName
(
byName
.
getName
());
browserPlug
.
setCode
(
byName
.
getCode
());
switch
(
plugin
)
{
case
"在线文本编辑类:请在备注中填写插件名和版本"
:
break
;
...
...
@@ -384,101 +469,41 @@ public class ExcelUtil {
}
browserPlugs
.
add
(
browserPlug
);
}
browser
.
setBrowserPlugs
(
browserPlugs
);
reform
.
setBrowser
(
browser
);
SystemStructure
systemStructure
=
new
SystemStructure
();
Details
ecsdetails
=
new
Details
();
String
ecs
=
getExcelCell
(
113
,
2
,
sheetAt
);
if
(
"本地"
.
equals
(
ecs
))
{
ecsdetails
.
setDeploy
(
1
);
}
else
if
(
"政务云"
.
equals
(
ecs
))
{
ecsdetails
.
setDeploy
(
2
);
}
String
ecssys
=
getExcelCell
(
113
,
4
,
sheetAt
);
OperateSystem
byName
=
OperateSystem
.
getByName
(
ecssys
);
ecsdetails
.
setOperateSystem
(
byName
);
String
num
=
getExcelCell
(
113
,
3
,
sheetAt
);
ecsdetails
.
setNum
(
returnNum
(
num
));
String
cpu
=
getExcelCell
(
113
,
5
,
sheetAt
);
ecsdetails
.
setCpuNum
(
returnNum
(
cpu
));
String
ghz
=
getExcelCell
(
113
,
6
,
sheetAt
);
ecsdetails
.
setGhz
(
ghz
);
String
gb
=
getExcelCell
(
113
,
7
,
sheetAt
);
ecsdetails
.
setSpace
(
returnNum
(
cpu
));
String
space
=
getExcelCell
(
113
,
8
,
sheetAt
);
ecsdetails
.
setSpace
(
returnDouble
(
space
));
systemStructure
.
setApplication
(
ecsdetails
);
Details
rdsdetails
=
new
Details
();
String
rds
=
getExcelCell
(
114
,
2
,
sheetAt
);
if
(
"本地"
.
equals
(
rds
))
{
rdsdetails
.
setDeploy
(
1
);
}
else
if
(
"政务云"
.
equals
(
rds
))
{
rdsdetails
.
setDeploy
(
2
);
}
String
rdssys
=
getExcelCell
(
114
,
4
,
sheetAt
);
OperateSystem
rdsByName
=
OperateSystem
.
getByName
(
rdssys
);
rdsdetails
.
setOperateSystem
(
rdsByName
);
String
num1
=
getExcelCell
(
113
,
3
,
sheetAt
);
rdsdetails
.
setNum
(
returnNum
(
num1
));
String
cpu1
=
getExcelCell
(
113
,
5
,
sheetAt
);
rdsdetails
.
setCpuNum
(
returnNum
(
cpu1
));
String
ghz1
=
getExcelCell
(
113
,
6
,
sheetAt
);
rdsdetails
.
setGhz
(
ghz1
);
String
space1
=
getExcelCell
(
113
,
8
,
sheetAt
);
rdsdetails
.
setSpace
(
returnDouble
(
space1
));
systemStructure
.
setDatabase
(
rdsdetails
);
Details
nasdetails
=
new
Details
(
);
String
nas
=
getExcelCell
(
115
,
2
,
sheetAt
);
Details
sysDetails
=
getSysDetails
(
113
,
2
,
sheetAt
);
systemStructure
.
setApplication
(
sysDetails
);
if
(
"本地"
.
equals
(
nas
))
{
nasdetails
.
setDeploy
(
1
);
}
else
if
(
"政务云"
.
equals
(
nas
))
{
nasdetails
.
setDeploy
(
2
);
}
String
nassys
=
getExcelCell
(
115
,
4
,
sheetAt
);
OperateSystem
nasByName
=
OperateSystem
.
getByName
(
nassys
);
nasdetails
.
setOperateSystem
(
nasByName
);
String
num2
=
getExcelCell
(
113
,
3
,
sheetAt
);
nasdetails
.
setNum
(
returnNum
(
num2
));
String
cpu2
=
getExcelCell
(
113
,
5
,
sheetAt
);
nasdetails
.
setCpuNum
(
returnNum
(
cpu2
));
String
ghz2
=
getExcelCell
(
113
,
6
,
sheetAt
);
nasdetails
.
setGhz
(
ghz2
);
String
space2
=
getExcelCell
(
113
,
8
,
sheetAt
);
nasdetails
.
setSpace
(
returnDouble
(
space2
));
Details
rdsdetails
=
getSysDetails
(
114
,
2
,
sheetAt
);
systemStructure
.
setDatabase
(
rdsdetails
);
Details
nasdetails
=
getSysDetails
(
115
,
2
,
sheetAt
);
systemStructure
.
setStorage
(
nasdetails
);
Details
slbdetails
=
new
Details
();
String
slb
=
getExcelCell
(
116
,
2
,
sheetAt
);
if
(
"本地"
.
equals
(
slb
))
{
slbdetails
.
setDeploy
(
1
);
}
else
if
(
"政务云"
.
equals
(
slb
))
{
slbdetails
.
setDeploy
(
2
);
}
String
slbsys
=
getExcelCell
(
116
,
4
,
sheetAt
);
OperateSystem
slbByName
=
OperateSystem
.
getByName
(
slbsys
);
slbdetails
.
setOperateSystem
(
slbByName
);
Details
slbdetails
=
getSysDetails
(
116
,
2
,
sheetAt
);
systemStructure
.
setSlb
(
slbdetails
);
String
num3
=
getExcelCell
(
113
,
3
,
sheetAt
);
ecsdetails
.
setNum
(
returnNum
(
num3
));
String
cpu3
=
getExcelCell
(
113
,
5
,
sheetAt
);
ecsdetails
.
setCpuNum
(
returnNum
(
cpu3
));
String
ghz3
=
getExcelCell
(
113
,
6
,
sheetAt
);
ecsdetails
.
setGhz
(
ghz3
);
String
space3
=
getExcelCell
(
113
,
8
,
sheetAt
);
ecsdetails
.
setSpace
(
returnDouble
(
space3
));
Details
cdndetails
=
getSysDetails
(
117
,
2
,
sheetAt
);
systemStructure
.
setCdn
(
cdndetails
);
systemStructure
.
setSlb
(
slbdetails
);
Details
vpsdetails
=
getSysDetails
(
118
,
2
,
sheetAt
);
systemStructure
.
setVps
(
vpsdetails
);
reform
.
setSystemStructure
(
systemStructure
);
String
rpo
=
getExcelCell
(
121
,
2
,
sheetAt
);
RpoEnum
rpoEnum
=
RpoEnum
.
getByName
(
rpo
);
if
(
rpoEnum
!=
null
)
{
reform
.
setRpo
(
rpoEnum
.
getCode
());
}
String
rto
=
getExcelCell
(
122
,
2
,
sheetAt
);
RtoEnum
rtoEnum
=
RtoEnum
.
getByName
(
rto
);
if
(
rtoEnum
!=
null
)
{
reform
.
setRto
(
rtoEnum
.
getCode
());
}
return
reform
;
}
...
...
@@ -492,6 +517,15 @@ public class ExcelUtil {
}
}
private
static
String
flipYesOrNo
(
Integer
target
)
{
if
(
target
==
1
)
{
return
"是"
;
}
else
if
(
target
==
2
)
{
return
"否"
;
}
else
{
return
"我不清楚"
;
}
}
private
static
int
returnNum
(
String
target
)
{
if
(!
""
.
equals
(
target
))
{
return
Integer
.
valueOf
(
target
);
...
...
@@ -508,10 +542,53 @@ public class ExcelUtil {
}
}
public
static
void
main
(
String
[]
args
)
{
MultipartFile
f
=
null
;
private
static
String
getDeploy
(
Integer
target
){
if
(
target
==
1
){
return
"本地"
;
}
else
if
(
target
==
2
){
return
"政务云"
;
}
else
{
return
"我不清楚"
;
}
}
private
static
Details
getSysDetails
(
int
rowNum
,
int
cellNum
,
Sheet
sheetAt
)
{
Details
details
=
new
Details
();
String
slb
=
getExcelCell
(
rowNum
,
cellNum
,
sheetAt
);
if
(
"本地"
.
equals
(
slb
))
{
details
.
setDeploy
(
1
);
}
else
if
(
"政务云"
.
equals
(
slb
))
{
details
.
setDeploy
(
2
);
}
String
slbsys
=
getExcelCell
(
rowNum
,
cellNum
+
1
,
sheetAt
);
OperateSystem
slbByName
=
OperateSystem
.
getByName
(
slbsys
);
details
.
setOperateSystem
(
slbByName
);
String
num3
=
getExcelCell
(
rowNum
,
cellNum
+
2
,
sheetAt
);
details
.
setNum
(
returnNum
(
num3
));
String
cpu3
=
getExcelCell
(
rowNum
,
cellNum
+
3
,
sheetAt
);
details
.
setCpuNum
(
returnNum
(
cpu3
));
String
ghz3
=
getExcelCell
(
rowNum
,
cellNum
+
4
,
sheetAt
);
details
.
setGhz
(
ghz3
);
String
space3
=
getExcelCell
(
rowNum
,
cellNum
+
5
,
sheetAt
);
details
.
setSpace
(
returnDouble
(
space3
));
return
details
;
}
public
static
void
main
(
String
[]
args
)
{
ArrayList
<
Object
>
objects
=
new
ArrayList
<>();
objects
.
add
(
null
);
System
.
out
.
println
(
objects
.
size
());
}
private
static
ExcelDataEntity
exportEntity
(
String
name
,
Object
value
)
{
ExcelDataEntity
excelDataEntity
=
new
ExcelDataEntity
();
excelDataEntity
.
setName
(
name
);
if
(
value
!=
null
)
{
excelDataEntity
.
setValue
(
value
.
toString
());
}
return
excelDataEntity
;
}
}
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
浏览文件 @
0c3aaf5f
...
...
@@ -494,7 +494,10 @@ public class WorkLoadUtil {
String
workloadDes
=
"本系统通过选择"
+
type
+
"方式部署到国产化安全自主可控环境上。代码层面的关键工作量包含"
+
nf
.
format
(
totalWorkload
)+
"人工月(包含对不可预见的估算)"
;
report
.
getWorkload
().
setDes
(
workloadDes
);
double
multipleHardrage
=
totalWorkload
*
r
/
f
;
report
.
getDifficultyAssessment
().
setDes
(
"本系统通过源代码评估,及用户额外信息提供,认为综合难度系数:"
+
Double
.
valueOf
(
nf
.
format
(
multipleHardrage
)));
if
(
Double
.
isNaN
(
multipleHardrage
)){
multipleHardrage
=
0
;
}
//report.getDifficultyAssessment().setDes("本系统通过源代码评估,及用户额外信息提供,认为综合难度系数:"+Double.valueOf(nf.format(multipleHardrage)));
report
.
setDifficulty
(
Double
.
valueOf
(
nf
.
format
(
multipleHardrage
)));
/**
* 人工单价、基础工作量(人月)、难度系数、额外申请(万元)、预算费用 的计算值
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论