Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
d2be4cfb
提交
d2be4cfb
authored
4月 20, 2020
作者:
马晨俊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mcj:
新增统计语言计算是否需要重构、列出语言统计 wps导出数据修正 前端返回格式与刘杰同步,都改成serverResponse类型
上级
2aebf2f7
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
391 行增加
和
346 行删除
+391
-346
AopIntercept.java
src/main/java/com/zjty/inspect/aop/AopIntercept.java
+1
-1
ExceptionHandlerConfig.java
.../java/com/zjty/inspect/config/ExceptionHandlerConfig.java
+11
-5
CategoryCotroller.java
...n/java/com/zjty/inspect/controller/CategoryCotroller.java
+5
-2
ConfigController.java
...in/java/com/zjty/inspect/controller/ConfigController.java
+5
-5
EvaluationController.java
...ava/com/zjty/inspect/controller/EvaluationController.java
+41
-39
InspectController.java
...n/java/com/zjty/inspect/controller/InspectController.java
+19
-85
ParamController.java
...ain/java/com/zjty/inspect/controller/ParamController.java
+5
-4
ReportController.java
...in/java/com/zjty/inspect/controller/ReportController.java
+5
-4
RuleController.java
...main/java/com/zjty/inspect/controller/RuleController.java
+33
-28
TechnologyController.java
...ava/com/zjty/inspect/controller/TechnologyController.java
+12
-12
WebSocketController.java
...java/com/zjty/inspect/controller/WebSocketController.java
+5
-3
AssessmentReport.java
src/main/java/com/zjty/inspect/entity/AssessmentReport.java
+8
-0
ReportVo.java
src/main/java/com/zjty/inspect/entity/ReportVo.java
+7
-1
ServerResponse.java
src/main/java/com/zjty/inspect/entity/ServerResponse.java
+46
-2
ApplicationType.java
src/main/java/com/zjty/inspect/enums/ApplicationType.java
+1
-0
BrowserPlugEnum.java
src/main/java/com/zjty/inspect/enums/BrowserPlugEnum.java
+20
-18
MicroServiceEnum.java
src/main/java/com/zjty/inspect/enums/MicroServiceEnum.java
+29
-27
OtherApiEnum.java
src/main/java/com/zjty/inspect/enums/OtherApiEnum.java
+29
-28
RecastMethod.java
src/main/java/com/zjty/inspect/enums/RecastMethod.java
+2
-1
Inspector.java
src/main/java/com/zjty/inspect/inspect/Inspector.java
+39
-28
EvaluationService.java
...main/java/com/zjty/inspect/service/EvaluationService.java
+1
-1
RuleService.java
src/main/java/com/zjty/inspect/service/RuleService.java
+0
-1
RuleServiceImpl.java
...n/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
+1
-6
BudgetUitl.java
src/main/java/com/zjty/inspect/utils/BudgetUitl.java
+3
-5
ExcelUtil.java
src/main/java/com/zjty/inspect/utils/ExcelUtil.java
+63
-40
没有找到文件。
src/main/java/com/zjty/inspect/aop/AopIntercept.java
浏览文件 @
d2be4cfb
...
...
@@ -52,7 +52,7 @@ public class AopIntercept {
HttpServletRequest
request
=
attributes
.
getRequest
();
String
sessionId
=
request
.
getHeader
(
"session"
);
String
url
=
"http://"
+
address
+
":12345/user/getLogin/"
+
sessionId
;
ServerResponse
serverResponse
=
restTemplate
.
getForObject
(
url
,
ServerResponse
.
class
);
ServerResponse
<
User
>
serverResponse
=
restTemplate
.
getForObject
(
url
,
ServerResponse
.
class
);
if
(
serverResponse
!=
null
&&
serverResponse
.
getCode
()!=
200
){
ResponseEntity
.
status
(
403
).
body
(
1
);
}
...
...
src/main/java/com/zjty/inspect/config/ExceptionHandlerConfig.java
浏览文件 @
d2be4cfb
package
com
.
zjty
.
inspect
.
config
;
import
com.zjty.inspect.entity.ServerResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
...
...
@@ -18,13 +19,18 @@ import java.io.IOException;
public
class
ExceptionHandlerConfig
{
@ExceptionHandler
(
value
=
HttpMessageNotReadableException
.
class
)
public
ResponseEntity
defaultErrorHandler
(
Exception
e
)
{
log
.
error
(
"
异常
{}"
,
e
);
return
ResponseEntity
.
badRequest
().
build
();
public
ServerResponse
defaultErrorHandler
(
Exception
e
)
{
log
.
error
(
"
http请求错误
{}"
,
e
);
return
ServerResponse
.
error
();
}
@ExceptionHandler
(
value
=
IOException
.
class
)
public
ResponseEntity
defaultIOHandler
(
Exception
e
)
{
public
ServerResponse
defaultIOHandler
(
Exception
e
)
{
log
.
error
(
"IO异常{}"
,
e
);
return
ResponseEntity
.
status
(
500
).
build
();
return
ServerResponse
.
error
();
}
@ExceptionHandler
(
value
=
Exception
.
class
)
public
ServerResponse
defaultLargestExceptionHandler
(
Exception
e
)
{
log
.
error
(
"最大异常{}"
,
e
);
return
ServerResponse
.
error
();
}
}
src/main/java/com/zjty/inspect/controller/CategoryCotroller.java
浏览文件 @
d2be4cfb
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.entity.ServerResponse
;
import
com.zjty.inspect.service.CategoryService
;
import
com.zjty.inspect.service.ConfigService
;
import
io.swagger.annotations.Api
;
...
...
@@ -11,6 +12,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@Slf4j
@RestController
@RequestMapping
(
"/category"
)
...
...
@@ -25,7 +28,7 @@ public class CategoryCotroller {
*/
@ApiOperation
(
"查询所有类型"
)
@GetMapping
public
ResponseEntity
getCategorys
(){
return
ResponseEntity
.
ok
(
categoryService
.
findAll
());
public
ServerResponse
<
List
>
getCategorys
(){
return
ServerResponse
.
ok
(
categoryService
.
findAll
());
}
}
src/main/java/com/zjty/inspect/controller/ConfigController.java
浏览文件 @
d2be4cfb
...
...
@@ -2,7 +2,7 @@ package com.zjty.inspect.controller;
import
com.zjty.inspect.aop.AuthAnnotation
;
import
com.zjty.inspect.entity.Config
;
import
com.zjty.inspect.entity.
RuleQo
;
import
com.zjty.inspect.entity.
ServerResponse
;
import
com.zjty.inspect.service.ConfigService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -27,8 +27,8 @@ public class ConfigController {
*/
@ApiOperation
(
"查询所有参数配置"
)
@GetMapping
public
ResponseEntity
getConfigs
(){
return
ResponseEntity
.
ok
(
configService
.
findAll
());
public
ServerResponse
<
List
<
Config
>>
getConfigs
(){
return
ServerResponse
.
ok
(
configService
.
findAll
());
}
/**
...
...
@@ -40,8 +40,8 @@ public class ConfigController {
@PostMapping
(
"/updates"
)
@ApiOperation
(
"根据id修改参数,需要传id和value"
)
@AuthAnnotation
(
code
=
{
"1300"
})
public
ResponseEntity
update
(
@RequestBody
List
<
Config
>
configs
){
public
ServerResponse
update
(
@RequestBody
List
<
Config
>
configs
){
configService
.
updateConfig
(
configs
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
}
src/main/java/com/zjty/inspect/controller/EvaluationController.java
浏览文件 @
d2be4cfb
...
...
@@ -23,12 +23,18 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Map
;
/**
* @author mcj
*/
@RestController
@RequestMapping
(
"/evaluation"
)
@Api
(
value
=
"评估报告管理接口"
,
description
=
"评估报告管理接口,提供页面的增、删、改、查"
)
public
class
EvaluationController
{
@Autowired
private
EvaluationService
evaluationService
;
private
final
EvaluationService
evaluationService
;
public
EvaluationController
(
EvaluationService
evaluationService
)
{
this
.
evaluationService
=
evaluationService
;
}
/**
...
...
@@ -39,62 +45,61 @@ public class EvaluationController {
*/
@PostMapping
@ApiOperation
(
"新增评估报告"
)
public
ResponseEntity
rule
(
@RequestBody
Evaluation
evaluation
)
{
evaluationService
.
save
(
evaluation
);
return
ResponseEntity
.
ok
(
200
);
public
ServerResponse
<
Evaluation
>
rule
(
@RequestBody
Evaluation
evaluation
)
{
Evaluation
newEvaluation
=
evaluationService
.
save
(
evaluation
);
return
ServerResponse
.
ok
(
newEvaluation
);
}
@ApiOperation
(
"根据用户名查询最新的报告输出"
)
@GetMapping
(
value
=
"/eva"
)
public
ResponseEntity
getName
(
@RequestParam
String
name
,
@RequestParam
String
id
)
{
if
(
StringUtils
.
isEmpty
(
id
)
||
id
.
equals
(
"null"
))
{
public
ServerResponse
<
AssessmentReport
>
getName
(
@RequestParam
String
name
,
@RequestParam
String
id
)
{
if
(
StringUtils
.
isEmpty
(
id
)
||
"null"
.
equals
(
id
))
{
Evaluation
e
=
evaluationService
.
findByName
(
name
);
if
(
e
!=
null
)
{
AssessmentReport
assessmentReport
=
JSON
.
parseObject
(
e
.
getOutEva
(),
AssessmentReport
.
class
);
return
ResponseEntity
.
ok
(
assessmentReport
);
return
ServerResponse
.
ok
(
assessmentReport
);
}
return
ResponseEntity
.
ok
(
null
);
return
ServerResponse
.
ok
(
null
);
}
Evaluation
evaluation
=
evaluationService
.
findById
(
id
);
if
(
evaluation
!=
null
)
{
AssessmentReport
assessmentReport
=
JSON
.
parseObject
(
evaluation
.
getOutEva
(),
AssessmentReport
.
class
);
return
ResponseEntity
.
ok
(
assessmentReport
);
return
ServerResponse
.
ok
(
assessmentReport
);
}
return
ResponseEntity
.
ok
(
null
);
return
ServerResponse
.
ok
(
null
);
}
@ApiOperation
(
"根据id查询输入"
)
@GetMapping
(
value
=
"/in/{name}"
)
//@AuthAnnotation(code = {"000800"})
public
ResponseEntity
getInName
(
@PathVariable
String
name
)
{
public
ServerResponse
<
Reform
>
getInName
(
@PathVariable
String
name
)
{
Evaluation
evaluation
=
evaluationService
.
findById
(
name
);
if
(
evaluation
!=
null
)
{
Reform
reform
=
JSON
.
parseObject
(
evaluation
.
getInEva
(),
Reform
.
class
);
return
ResponseEntity
.
ok
(
reform
);
return
ServerResponse
.
ok
(
reform
);
}
return
ResponseEntity
.
ok
(
null
);
return
ServerResponse
.
ok
(
null
);
}
@ApiOperation
(
"根据id查询输入"
)
@GetMapping
(
value
=
"/all/{id}"
)
@AuthAnnotation
(
code
=
{
"000800"
})
public
ResponseEntity
getInId
(
@PathVariable
String
id
)
{
public
ServerResponse
<
Evaluation
>
getInId
(
@PathVariable
String
id
)
{
Evaluation
evaluation
=
evaluationService
.
findById
(
id
);
if
(
evaluation
!=
null
)
{
return
ResponseEntity
.
ok
(
evaluation
);
return
ServerResponse
.
ok
(
evaluation
);
}
return
ResponseEntity
.
ok
(
null
);
return
ServerResponse
.
ok
(
null
);
}
@ApiOperation
(
"根据报告id查询excel输入"
)
@GetMapping
(
value
=
"/in/excel/{id}"
)
public
ResponseEntity
exportInName
(
@PathVariable
String
id
)
{
public
ServerResponse
<
List
<
ExcelDataTemp
>>
exportInName
(
@PathVariable
String
id
)
{
Evaluation
evaluation
=
evaluationService
.
findById
(
id
);
if
(
evaluation
!=
null
)
{
List
<
ExcelDataTemp
>
excelDataTemp
=
ExcelUtil
.
parseExcel2Entity
(
evaluation
);
return
ResponseEntity
.
ok
(
excelDataTemp
);
return
ServerResponse
.
ok
(
excelDataTemp
);
}
else
{
return
ResponseEntity
.
ok
(
new
ArrayList
<
ExcelDataTemp
>());
return
ServerResponse
.
ok
(
new
ArrayList
<
>());
}
}
...
...
@@ -103,29 +108,27 @@ public class EvaluationController {
*
* @param evaluation 规则封装
* @param id id
* @return
*/
@PostMapping
(
value
=
"/{id}"
)
@ApiOperation
(
"修改评估报告"
)
@AuthAnnotation
(
code
=
{
"000800"
})
public
ResponseEntity
update
(
@RequestBody
Evaluation
evaluation
,
@PathVariable
String
id
)
{
public
ServerResponse
<
Integer
>
update
(
@RequestBody
Evaluation
evaluation
,
@PathVariable
String
id
)
{
evaluation
.
setId
(
id
);
evaluationService
.
update
(
evaluation
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
/**
* 根据id删除评估报告
*
* @param id id
* @return
*/
@ApiOperation
(
"根据id删除评估报告"
)
@DeleteMapping
(
value
=
"/{id}"
)
@AuthAnnotation
(
code
=
{
"000800"
})
public
ResponseEntity
deleteById
(
@PathVariable
String
id
)
{
public
ServerResponse
<
Integer
>
deleteById
(
@PathVariable
String
id
)
{
evaluationService
.
delete
(
id
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
/**
...
...
@@ -143,23 +146,23 @@ public class EvaluationController {
})
@RequestMapping
(
value
=
"/search/{page}/{size}"
,
method
=
RequestMethod
.
POST
)
@AuthAnnotation
(
code
=
{
"000800"
})
public
ResponseEntity
findSearch
(
@RequestBody
Map
searchMap
,
@PathVariable
int
page
,
@PathVariable
int
size
)
{
public
ServerResponse
<
PageResult
<
Evaluation
>>
findSearch
(
@RequestBody
Map
<
String
,
String
>
searchMap
,
@PathVariable
int
page
,
@PathVariable
int
size
)
{
Page
<
Evaluation
>
pageList
=
evaluationService
.
findSearch
(
searchMap
,
page
,
size
);
return
ResponseEntity
.
ok
(
new
PageResult
<
Evaluation
>(
pageList
.
getTotalElements
(),
pageList
.
getContent
()));
return
ServerResponse
.
ok
(
new
PageResult
<
>(
pageList
.
getTotalElements
(),
pageList
.
getContent
()));
}
/**
*
修改评估报告
*
获取评估报告内的输出,转换为map结构
*
* @param id id
* @return
* @return
wps
*/
@GetMapping
(
value
=
"/
bg
/{id}"
)
@ApiOperation
(
"
修改评估报告
"
)
public
ResponseEntity
finda
ll
(
@PathVariable
String
id
)
{
@GetMapping
(
value
=
"/
map
/{id}"
)
@ApiOperation
(
"
获取评估报告内的map
"
)
public
ServerResponse
<
Map
<
String
,
String
>>
findA
ll
(
@PathVariable
String
id
)
{
Evaluation
evaluation
=
evaluationService
.
findById
(
id
);
Map
<
String
,
String
>
wps
=
WpsUtil
.
createWps
(
evaluation
);
return
ResponseEntity
.
ok
(
wps
);
return
ServerResponse
.
ok
(
wps
);
}
@ApiOperation
(
"下载报告"
)
@ApiImplicitParams
({
...
...
@@ -171,7 +174,7 @@ public class EvaluationController {
@ApiImplicitParam
(
name
=
"agree"
,
value
=
"0不同意 1同意"
)
})
@PostMapping
(
"/downloadWps"
)
public
ResponseEntity
download
(
@RequestBody
Download
download
){
public
ServerResponse
download
(
@RequestBody
Download
download
){
// return ResponseEntity.ok("http://120.55.57.35:12345/static/uplaods/a36b17568d4e466dacf9f088a29b4dbc.docx");
// return ResponseEntity.ok("http://120.55.57.35:8078/static/defult.docx");
Evaluation
evaluation
=
evaluationService
.
findById
(
download
.
getId
());
...
...
@@ -193,9 +196,8 @@ public class EvaluationController {
}
String
w
=
FreeMakerUtils
.
parseTpl
(
"报告模板"
,
wps
);
if
(
w
==
null
){
return
ResponseEntity
.
status
(
500
).
build
(
);
return
ServerResponse
.
error
(
500
);
}
return
ResponseEntity
.
ok
(
w
);
// return ResponseEntity.ok("http://192.168.1.104:8078/static/defult.docx");
return
ServerResponse
.
ok
(
w
);
}
}
src/main/java/com/zjty/inspect/controller/InspectController.java
浏览文件 @
d2be4cfb
...
...
@@ -10,19 +10,11 @@ import com.zjty.inspect.utils.*;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.tomcat.util.http.fileupload.FileItem
;
import
org.apache.tomcat.util.http.fileupload.FileItemFactory
;
import
org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory
;
import
org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.io.File
;
import
java.util.*
;
...
...
@@ -51,8 +43,6 @@ public class InspectController {
@Autowired
private
ConfigParamDao
configParamDao
;
@Value
(
"${upload.location}"
)
private
String
uploadPath
;
@Autowired
private
AsyncTask
asyncTask
;
...
...
@@ -81,7 +71,7 @@ public class InspectController {
*/
@PostMapping
(
"/path"
)
@ApiOperation
(
"上传代码进行评估"
)
public
ResponseEntity
inspect
(
Integer
years
,
Integer
systemFund
,
Integer
modules
public
ServerResponse
<
ReportVo
>
inspect
(
Integer
years
,
Integer
systemFund
,
Integer
modules
,
String
valid
,
Integer
framework
,
Integer
safety
,
Integer
disaster
,
Integer
data
,
Integer
admin
,
String
projectName
,
Integer
tables
,
String
databaseType
,
Integer
content
,
Integer
method
,
String
username
,
MultipartFile
multfile
)
throws
IOException
{
...
...
@@ -126,11 +116,11 @@ public class InspectController {
report
.
setId
(
RandomUtil
.
getRandom
());
report
.
setHtmlAddress
(
reportVo
.
getHtmlAddress
());
reportService
.
saveReport
(
report
);
return
ResponseEntity
.
ok
(
inspect
);
return
ServerResponse
.
ok
(
inspect
);
}
@PostMapping
(
"/rapidAssessment"
)
public
ResponseEntity
rapidAssessment
(
@RequestBody
Reform
reform
)
throws
IOException
{
public
ServerResponse
rapidAssessment
(
@RequestBody
Reform
reform
)
throws
IOException
{
String
in
=
JSON
.
toJSONString
(
reform
);
Evaluation
evaluation
=
new
Evaluation
();
evaluation
.
setInEva
(
in
);
...
...
@@ -146,9 +136,9 @@ public class InspectController {
}
//获取admin
Config
adminConfig
=
configParamDao
.
findByName
(
"admin"
);
Integer
admin
;
int
admin
;
if
(
adminConfig
!=
null
)
{
admin
=
Integer
.
valueOf
(
adminConfig
.
getValue
());
admin
=
Integer
.
parseInt
(
adminConfig
.
getValue
());
}
else
{
admin
=
2
;
}
...
...
@@ -160,7 +150,7 @@ public class InspectController {
framework
=
2
;
}
//应用类型
Integer
content
=
0
;
int
content
=
0
;
List
<
Integer
>
applicationType
=
reform
.
getApplicationType
();
if
(
applicationType
==
null
||
applicationType
.
size
()
==
0
)
{
content
=
-
1
;
...
...
@@ -256,6 +246,8 @@ public class InspectController {
assessmentReport
.
setOrgName
(
inspect
.
getFileName
());
//评估时间
assessmentReport
.
setTime
(
inspect
.
getCreateDate
());
//设置项目中有的所有语言
assessmentReport
.
setLanguages
(
reportVo
.
getLanguages
());
//样式调整
int
css
=
0
;
//API数量
...
...
@@ -384,98 +376,40 @@ public class InspectController {
evaluation
.
setAuthority
(
reform
.
getAuthority
());
Evaluation
save
=
evaluationService
.
save
(
evaluation
);
if
(
save
==
null
){
return
ResponseEntity
.
status
(
400
).
build
();
return
ServerResponse
.
badRequest
();
}
return
ResponseEntity
.
ok
(
save
.
getId
());
return
ServerResponse
.
ok
(
save
.
getId
());
}
@PostMapping
(
"/uploads
aaa
"
)
private
ResponseEntity
uploads
(
@RequestParam
(
value
=
"file"
)
MultipartFile
multfile
)
{
@PostMapping
(
"/uploads"
)
private
ServerResponse
uploads
(
@RequestParam
(
value
=
"file"
)
MultipartFile
multfile
)
{
try
{
File
file
=
FileUtil
.
saveToLocal
(
multfile
);
String
name
=
file
.
getName
();
String
path
=
file
.
getCanonicalPath
();
return
ResponseEntity
.
ok
(
new
com
.
zjty
.
inspect
.
entity
.
File
(
name
,
path
));
return
ServerResponse
.
ok
(
new
com
.
zjty
.
inspect
.
entity
.
File
(
name
,
path
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
return
ResponseEntity
.
status
(
500
).
build
(
);
return
ServerResponse
.
error
(
500
);
}
}
@ApiOperation
(
"大文件分片上传"
)
// @PostMapping("/chunkUpload")
@PostMapping
(
"/uploads"
)
public
ResponseEntity
fileChunkUpload
(
MultipartFileParam
param
,
HttpServletRequest
request
,
HttpServletResponse
response
){
System
.
out
.
println
(
"77777777777777777777"
);
//自己的业务获取存储路径,可以换成自己的
// OSSInformation ossInformation = ossInformationService.queryOne();
// String root = ossInformation.getRoot();
String
root
=
uploadPath
;
//验证文件夹规则,不能包含特殊字符
java
.
io
.
File
file
=
new
java
.
io
.
File
(
root
);
// createDirectoryQuietly(file);
System
.
out
.
println
(
"88888888888888"
);
String
path
=
file
.
getAbsolutePath
();
response
.
setContentType
(
"text/html;charset=UTF-8"
);
// response.setStatus对接前端插件
// 200, 201, 202: 当前块上传成功,不需要重传。
// 404, 415. 500, 501: 当前块上传失败,会取消整个文件上传。
// 其他状态码: 出错了,但是会自动重试上传。
try
{
/**
* 判断前端Form表单格式是否支持文件上传
*/
boolean
isMultipart
=
ServletFileUpload
.
isMultipartContent
(
request
);
if
(!
isMultipart
){
//这里是我向前端发送数据的代码,可理解为 return 数据; 具体的就不贴了
System
.
out
.
println
(
"不支持的表单格式"
);
return
ResponseEntity
.
status
(
404
).
body
(
"不支持的表单格式"
);
}
else
{
param
.
setTaskId
(
param
.
getIdentifier
());
System
.
out
.
println
(
"2222222222222222"
);
File
myfile
=
inspectService
.
chunkUploadByMappedByteBuffer
(
param
,
path
);
//service层
System
.
out
.
println
(
"666666666666"
);
if
(
myfile
!=
null
){
String
name
=
myfile
.
getName
();
String
myPath
=
myfile
.
getCanonicalPath
();
return
ResponseEntity
.
ok
(
new
com
.
zjty
.
inspect
.
entity
.
File
(
name
,
myPath
));
}
else
{
return
ResponseEntity
.
ok
(
"继续断点传续!"
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
// System.out.println("上传文件失败");
// response.setStatus(415);
return
ResponseEntity
.
status
(
415
).
body
(
"上传文件失败"
);
}
}
@PostMapping
(
"/gitdownload"
)
private
ResponseEntity
gitDownloads
(
String
gitAddress
,
String
username
,
String
password
)
{
private
ServerResponse
gitDownloads
(
String
gitAddress
,
String
username
,
String
password
)
{
try
{
String
gitPath
=
GitLabUtil
.
downLoadProject
(
gitAddress
,
username
,
password
);
return
ResponseEntity
.
ok
(
gitPath
);
return
ServerResponse
.
ok
(
gitPath
);
}
catch
(
Exception
e
)
{
return
ResponseEntity
.
status
(
400
).
build
();
return
ServerResponse
.
badRequest
();
}
}
@PostMapping
(
"/importExcelToRapidAssessment"
)
private
ResponseEntity
uploadFileToInspect
(
MultipartFile
file
,
String
username
)
throws
IOException
{
private
ServerResponse
<
Reform
>
uploadFileToInspect
(
MultipartFile
file
,
String
username
)
throws
IOException
{
Reform
reform
=
ExcelUtil
.
parseExcel
(
file
.
getInputStream
(),
file
.
getOriginalFilename
());
reform
.
setUsername
(
username
);
System
.
out
.
println
(
"1"
);
return
ResponseEntity
.
ok
(
reform
);
return
ServerResponse
.
ok
(
reform
);
}
}
src/main/java/com/zjty/inspect/controller/ParamController.java
浏览文件 @
d2be4cfb
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.entity.InspectParameter
;
import
com.zjty.inspect.entity.ServerResponse
;
import
com.zjty.inspect.service.ParameterService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -22,15 +23,15 @@ public class ParamController {
@GetMapping
@ApiOperation
(
"获取参数"
)
public
ResponseEntity
getParam
(
String
id
){
return
ResponseEntity
.
ok
(
parameterService
.
getParameterById
(
id
));
public
ServerResponse
getParam
(
String
id
){
return
ServerResponse
.
ok
(
parameterService
.
getParameterById
(
id
));
}
@PostMapping
@ApiOperation
(
"保存参数"
)
public
ResponseEntity
saveParam
(
@RequestBody
InspectParameter
inspectParameter
){
public
ServerResponse
saveParam
(
@RequestBody
InspectParameter
inspectParameter
){
parameterService
.
saveParameter
(
inspectParameter
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
}
src/main/java/com/zjty/inspect/controller/ReportController.java
浏览文件 @
d2be4cfb
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.entity.ServerResponse
;
import
com.zjty.inspect.service.ReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -25,13 +26,13 @@ public class ReportController {
@GetMapping
(
"/page/{page}"
)
@ApiOperation
(
"根据页码获取数据"
)
public
ResponseEntity
getReportByPage
(
@PathVariable
int
page
){
return
ResponseEntity
.
ok
(
reportService
.
findReportByPage
(
page
));
public
ServerResponse
getReportByPage
(
@PathVariable
int
page
){
return
ServerResponse
.
ok
(
reportService
.
findReportByPage
(
page
));
}
@GetMapping
(
"/id/{id}"
)
@ApiOperation
(
"根据id获取数据"
)
public
ResponseEntity
getReportById
(
@PathVariable
String
id
){
return
ResponseEntity
.
ok
(
reportService
.
findReportById
(
id
));
public
ServerResponse
getReportById
(
@PathVariable
String
id
){
return
ServerResponse
.
ok
(
reportService
.
findReportById
(
id
));
}
}
src/main/java/com/zjty/inspect/controller/RuleController.java
浏览文件 @
d2be4cfb
...
...
@@ -19,13 +19,14 @@ import java.util.Map;
/**
* 规则库设置
*
* @author Mcj
* @date 2020-02-26 14:42
*/
@Slf4j
@RestController
@RequestMapping
(
"/rule"
)
@Api
(
value
=
"规则页面管理接口"
,
description
=
"规则页面管理接口,提供页面的增、删、改、查"
)
@Api
(
value
=
"规则页面管理接口"
,
description
=
"规则页面管理接口,提供页面的增、删、改、查"
)
public
class
RuleController
{
@Autowired
...
...
@@ -34,81 +35,85 @@ public class RuleController {
/**
* test
* 新增规则
*
* @param
* @return
*/
@PostMapping
@ApiOperation
(
"新增规则"
)
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ResponseEntity
rule
(
@RequestBody
Rule
rule
){
log
.
info
(
"规则{}"
,
rule
);
Rule
rule1
=
ruleService
.
addRulePlus
(
rule
);
if
(
rule1
!=
null
){
return
ResponseEntity
.
ok
(
rule1
);
}
return
ResponseEntity
.
status
(
500
).
build
();
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ServerResponse
<
Rule
>
rule
(
@RequestBody
Rule
rule
)
{
log
.
info
(
"规则{}"
,
rule
);
Rule
newRule
=
ruleService
.
addRulePlus
(
rule
);
return
ServerResponse
.
ok
(
newRule
);
}
/**
* 修改规则
*
* @param rule 规则封装
* @return
*/
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
"修改规则"
)
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ResponseEntity
update
(
@RequestBody
Rule
rule
)
{
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ServerResponse
update
(
@RequestBody
Rule
rule
)
{
ruleService
.
upRulePlus
(
rule
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
/**
* 根据id删除规则
*
* @param id
* @return
*/
@ApiOperation
(
"根据数据封装删除规则"
)
@DeleteMapping
(
value
=
"/{id}"
)
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ResponseEntity
deleteByQo
(
@PathVariable
String
id
)
{
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ServerResponse
deleteByQo
(
@PathVariable
String
id
)
{
ruleService
.
deleteRulePlus
(
id
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
/**
* 分页+多条件查询
*
* @param searchMap 查询条件封装
* @param page 页码
* @param size 页大小
* @param page
页码
* @param size
页大小
* @return 分页结果
*/
@ApiOperation
(
"分页查询页面列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"int"
)
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"int"
)
})
@RequestMapping
(
value
=
"/search/{page}/{size}"
,
method
=
RequestMethod
.
POST
)
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ResponseEntity
findSearch
(
@RequestBody
Map
searchMap
,
@PathVariable
int
page
,
@PathVariable
int
size
)
{
@RequestMapping
(
value
=
"/search/{page}/{size}"
,
method
=
RequestMethod
.
POST
)
@AuthAnnotation
(
code
=
{
"001200"
,
"001400"
})
public
ServerResponse
<
PageResult
<
Rule
>>
findSearch
(
@RequestBody
Map
searchMap
,
@PathVariable
int
page
,
@PathVariable
int
size
)
{
Page
<
Rule
>
pageList
=
ruleService
.
findSearch
(
searchMap
,
page
,
size
);
return
ResponseEntity
.
ok
(
new
PageResult
<
Rule
>(
pageList
.
getTotalElements
(),
pageList
.
getContent
())
);
return
ServerResponse
.
ok
(
new
PageResult
<>(
pageList
.
getTotalElements
(),
pageList
.
getContent
())
);
}
/**
* 导出所有规则
*
* @return 规则
*/
@ApiOperation
(
"导出所有规则"
)
@GetMapping
(
"/export"
)
public
ResponseEntity
exportAllRules
()
{
public
ServerResponse
exportAllRules
()
{
String
path
=
ruleService
.
exportData
();
return
ResponseEntity
.
ok
(
path
);
return
ServerResponse
.
ok
(
path
);
}
@PostMapping
(
"/importRules"
)
@ApiOperation
(
"导入所有规则"
)
@AuthAnnotation
(
code
=
{
"001200"
})
public
ResponseEntity
importRules
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
ServerResponse
importRules
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
ruleService
.
importRules
(
file
);
return
null
;
return
ServerResponse
.
ok
(
""
)
;
}
}
src/main/java/com/zjty/inspect/controller/TechnologyController.java
浏览文件 @
d2be4cfb
...
...
@@ -36,14 +36,14 @@ public class TechnologyController {
*/
@GetMapping
@ApiOperation
(
"获取所有关键技术"
)
public
ResponseEntity
getTechnologies
(){
return
ResponseEntity
.
ok
(
technologyService
.
findAllTechnology
());
public
ServerResponse
getTechnologies
(){
return
ServerResponse
.
ok
(
technologyService
.
findAllTechnology
());
}
@GetMapping
(
"/names"
)
@ApiOperation
(
"获取所有关键技术name"
)
@AuthAnnotation
(
code
=
{
"001100"
})
public
ResponseEntity
getTechnologiesName
(){
return
ResponseEntity
.
ok
(
technologyService
.
findAllTechnologyNames
());
public
ServerResponse
getTechnologiesName
(){
return
ServerResponse
.
ok
(
technologyService
.
findAllTechnologyNames
());
}
/**
...
...
@@ -53,8 +53,8 @@ public class TechnologyController {
@GetMapping
(
value
=
"/{name}"
)
@ApiOperation
(
"根据name获取所有关键技术"
)
@AuthAnnotation
(
code
=
{
"001100"
})
public
ResponseEntity
getTechnologies
(
@PathVariable
String
name
){
return
ResponseEntity
.
ok
(
technologyService
.
findAllTechnology
(
name
));
public
ServerResponse
getTechnologies
(
@PathVariable
String
name
){
return
ServerResponse
.
ok
(
technologyService
.
findAllTechnology
(
name
));
}
/**
* 添加关键技术
...
...
@@ -63,18 +63,18 @@ public class TechnologyController {
@PostMapping
(
"/add"
)
@ApiOperation
(
"新添加关键技术"
)
@AuthAnnotation
(
code
=
{
"001100"
})
public
ResponseEntity
addTechnologies
(
@RequestBody
Technology
technology
){
public
ServerResponse
addTechnologies
(
@RequestBody
Technology
technology
){
technologyService
.
add
(
technology
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
@PostMapping
(
value
=
"/{id}"
)
@ApiOperation
(
"修改关键技术"
)
@AuthAnnotation
(
code
=
{
"001100"
})
public
ResponseEntity
update
(
@RequestBody
Technology
technology
,
@PathVariable
String
id
){
public
ServerResponse
update
(
@RequestBody
Technology
technology
,
@PathVariable
String
id
){
technology
.
setId
(
id
);
technologyService
.
update
(
technology
);
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
/**
* 分页+多条件查询
...
...
@@ -90,9 +90,9 @@ public class TechnologyController {
})
@RequestMapping
(
value
=
"/search/{page}/{size}"
,
method
=
RequestMethod
.
POST
)
@AuthAnnotation
(
code
=
{
"001100"
})
public
ResponseEntity
findSearch
(
@RequestBody
Map
searchMap
,
@PathVariable
int
page
,
@PathVariable
int
size
){
public
ServerResponse
<
PageResult
>
findSearch
(
@RequestBody
Map
searchMap
,
@PathVariable
int
page
,
@PathVariable
int
size
){
Page
<
Technology
>
pageList
=
technologyService
.
findSearch
(
searchMap
,
page
,
size
);
return
ResponseEntity
.
ok
(
new
PageResult
<
Technology
>(
pageList
.
getTotalElements
(),
pageList
.
getContent
())
);
return
ServerResponse
.
ok
(
new
PageResult
<
Technology
>(
pageList
.
getTotalElements
(),
pageList
.
getContent
())
);
}
}
src/main/java/com/zjty/inspect/controller/WebSocketController.java
浏览文件 @
d2be4cfb
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.config.WebSocketServer
;
import
com.zjty.inspect.entity.ServerResponse
;
import
com.zjty.inspect.thread.task.AsyncTask
;
import
com.zjty.inspect.utils.ExceptionMessage
;
import
io.swagger.annotations.Api
;
...
...
@@ -43,7 +44,7 @@ public class WebSocketController {
*/
@ApiOperation
(
value
=
"推送数据到所有的WebSocket客户端"
,
notes
=
"推送数据到所有的WebSocket客户端"
)
@RequestMapping
(
value
=
"/push/{msg}"
,
method
=
RequestMethod
.
GET
)
public
ResponseEntity
pushToAll
(
@PathVariable
(
"msg"
)
String
msg
){
public
ServerResponse
pushToAll
(
@PathVariable
(
"msg"
)
String
msg
){
try
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"msg"
,
msg
);
...
...
@@ -51,8 +52,8 @@ public class WebSocketController {
}
catch
(
Exception
e
)
{
String
info
=
ExceptionMessage
.
getStackTraceInfo
(
e
);
logger
.
error
(
"推送消息到客户端报错:"
+
info
);
return
ResponseEntity
.
ok
(
"推送消息到客户端报错:"
+
info
);
return
ServerResponse
.
error
(
"推送消息到客户端报错:"
+
info
);
}
return
ResponseEntity
.
ok
(
200
);
return
ServerResponse
.
ok
(
200
);
}
}
\ No newline at end of file
src/main/java/com/zjty/inspect/entity/AssessmentReport.java
浏览文件 @
d2be4cfb
...
...
@@ -6,7 +6,9 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* <h4>Description : 评估报告</h4>
...
...
@@ -65,6 +67,12 @@ public class AssessmentReport {
@ApiModelProperty
(
value
=
"语言"
,
example
=
"1"
)
private
Integer
language
;
/**
* 项目中所有语言
*/
@ApiModelProperty
(
value
=
"语言"
,
example
=
"1"
)
private
List
<
Integer
>
languages
=
new
ArrayList
<>();
/**
* 类型预算 1:适配、2:改造
*/
...
...
src/main/java/com/zjty/inspect/entity/ReportVo.java
浏览文件 @
d2be4cfb
...
...
@@ -55,9 +55,15 @@ public class ReportVo {
/**
* 语言
*/
@ApiModelProperty
(
value
=
"
权限
"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"
语言
"
,
example
=
"1"
)
private
Integer
language
;
/**
* 语言
*/
@ApiModelProperty
(
value
=
"语言"
,
example
=
"1"
)
private
List
<
Integer
>
languages
;
/**
* 生成报告存储地址
*/
...
...
src/main/java/com/zjty/inspect/entity/ServerResponse.java
浏览文件 @
d2be4cfb
package
com
.
zjty
.
inspect
.
entity
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @author Mcj
* @date 2020-04-03 09:41
*/
@Data
public
class
ServerResponse
implements
Serializable
{
private
User
data
;
public
class
ServerResponse
<
T
>
implements
Serializable
{
/**
* 错误码
*/
@JSONField
(
ordinal
=
1
)
private
Integer
code
;
/**
* 提示信息
*/
@JSONField
(
ordinal
=
2
)
private
String
msg
;
/**
* 具体的内容
*/
@JSONField
(
ordinal
=
3
)
private
T
data
;
public
ServerResponse
(
Integer
code
,
String
msg
,
T
t
){
this
.
code
=
code
;
this
.
data
=
t
;
this
.
msg
=
msg
;
}
public
ServerResponse
(
Integer
code
,
String
msg
){
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
static
<
T
>
ServerResponse
error
(
Object
data
){
return
new
ServerResponse
(
400
,
"请求失败"
,
data
);
}
public
static
<
T
>
ServerResponse
noAuthority
(){
return
new
ServerResponse
(
403
,
"没有权限"
,
""
);
}
public
static
<
T
>
ServerResponse
badRequest
(){
return
new
ServerResponse
(
400
,
"请求失败"
,
""
);
}
public
static
<
T
>
ServerResponse
<
T
>
ok
(
T
data
)
{
return
new
ServerResponse
(
200
,
"成功"
,
data
);
}
public
static
<
T
>
ServerResponse
error
(){
return
new
ServerResponse
(
500
,
"服务器出错"
,
""
);
}
}
src/main/java/com/zjty/inspect/enums/ApplicationType.java
浏览文件 @
d2be4cfb
...
...
@@ -45,6 +45,7 @@ public enum ApplicationType {
private
Integer
code
;
private
String
name
;
private
Integer
other
;
ApplicationType
()
{
}
...
...
src/main/java/com/zjty/inspect/enums/BrowserPlugEnum.java
浏览文件 @
d2be4cfb
...
...
@@ -9,26 +9,27 @@ import java.util.Map;
@ApiModel
(
value
=
"浏览器插件"
)
@Getter
public
enum
BrowserPlugEnum
{
NONE
(-
1
,
"无"
),
DOWNLOAD
(
1
,
"下载/上传"
),
PRINT
(
2
,
"打印调用"
),
SCAN
(
3
,
"扫描调用"
),
YIWEIMA
(
4
,
"一维码/二维码调用"
),
OCR
(
5
,
"OCR调用:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
MOBILE
(
6
,
"移动设备同步:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
TEXT
(
7
,
"在线文本编辑类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
TABLE
(
8
,
"在线表单编辑类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
CHART
(
9
,
"在线统计图表展现类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
VIDEO
(
10
,
"在线视频播放类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
THREED
(
11
,
"在线3D建模、渲染、展现:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
GIS
(
12
,
"在线GIS类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
),
PERIPHERAL
(
13
,
"外设调用"
),
ANIMATION
(
14
,
"动画"
),
FLASH
(
14
,
"Flash"
),
OTHER
(
13
,
"其他:请在备注中填写插件名和版本,如需填写多个,请以逗号分隔"
);
NONE
(-
1
,
"无"
,
0
),
DOWNLOAD
(
1
,
"下载/上传"
,
0
),
PRINT
(
2
,
"打印调用"
,
0
),
SCAN
(
3
,
"扫描调用"
,
0
),
YIWEIMA
(
4
,
"一维码/二维码调用"
,
0
),
OCR
(
5
,
"OCR调用:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
MOBILE
(
6
,
"移动设备同步:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
TEXT
(
7
,
"在线文本编辑类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
TABLE
(
8
,
"在线表单编辑类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
CHART
(
9
,
"在线统计图表展现类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
VIDEO
(
10
,
"在线视频播放类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
THREED
(
11
,
"在线3D建模、渲染、展现:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
GIS
(
12
,
"在线GIS类:请在备注中填写插件名,如需填写多个,请以逗号分隔"
,
1
),
PERIPHERAL
(
13
,
"外设调用"
,
0
),
ANIMATION
(
14
,
"动画"
,
0
),
FLASH
(
14
,
"Flash"
,
0
),
OTHER
(
13
,
"其他:请在备注中填写插件名和版本,如需填写多个,请以逗号分隔"
,
1
);
private
Integer
code
;
private
String
name
;
private
Integer
other
;
private
static
Map
<
String
,
BrowserPlugEnum
>
browserPlugEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
BrowserPlugEnum
>
browserPlugCodeEnumMap
=
new
HashMap
<>();
...
...
@@ -41,9 +42,10 @@ public enum BrowserPlugEnum {
BrowserPlugEnum
()
{
}
BrowserPlugEnum
(
Integer
code
,
String
name
)
{
BrowserPlugEnum
(
Integer
code
,
String
name
,
Integer
other
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
other
=
other
;
}
public
static
BrowserPlugEnum
getByName
(
String
name
){
BrowserPlugEnum
browserPlugEnum
=
browserPlugEnumMap
.
get
(
name
);
...
...
src/main/java/com/zjty/inspect/enums/MicroServiceEnum.java
浏览文件 @
d2be4cfb
...
...
@@ -9,34 +9,35 @@ import java.util.Map;
@ApiModel
(
value
=
"微服务"
)
@Getter
public
enum
MicroServiceEnum
{
NONE
(-
1
,
"无"
),
FLUME
(
0
,
"Flume"
),
ZOOKEEPER
(
1
,
"Zookeeper"
),
RIBBON
(
2
,
"Ribbon"
),
HYSTIX
(
3
,
"Hystix"
),
HBASE
(
4
,
"HBASE"
),
HIVE
(
5
,
"Hive"
),
SPARKSTROM
(
6
,
"Spark Strom"
),
RESTTEMPLATE
(
7
,
"RestTemplate"
),
KVM
(
8
,
"KVM"
),
OPENSTACK
(
9
,
"Openstack"
),
KUBERNETES
(
10
,
"Kubernetes"
),
DOCKER
(
11
,
"Docker"
),
EXMOBI
(
12
,
"Exmobi"
),
DATAV
(
13
,
"DataV"
),
RAYDATA
(
14
,
"RayData"
),
BIANMU
(
15
,
"编目服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
DITU
(
16
,
"地图类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
TUBIAO
(
17
,
"图表视图类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
SHIBIE
(
18
,
"识别类微服务:请在备注中填写"
),
NEIRONG
(
19
,
"内容审查类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
FENXI
(
20
,
"智能分析类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
DATA
(
21
,
"数据引用类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
IOQUICK
(
22
,
"流媒体加速类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
JIAMI
(
23
,
"加密类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
),
OTHER
(
24
,
"其他:请在备注中填写,如需填写多个,请以逗号分隔"
);
NONE
(-
1
,
"无"
,
0
),
FLUME
(
0
,
"Flume"
,
0
),
ZOOKEEPER
(
1
,
"Zookeeper"
,
0
),
RIBBON
(
2
,
"Ribbon"
,
0
),
HYSTIX
(
3
,
"Hystix"
,
0
),
HBASE
(
4
,
"HBASE"
,
0
),
HIVE
(
5
,
"Hive"
,
0
),
SPARKSTROM
(
6
,
"Spark Strom"
,
0
),
RESTTEMPLATE
(
7
,
"RestTemplate"
,
0
),
KVM
(
8
,
"KVM"
,
0
),
OPENSTACK
(
9
,
"Openstack"
,
0
),
KUBERNETES
(
10
,
"Kubernetes"
,
0
),
DOCKER
(
11
,
"Docker"
,
0
),
EXMOBI
(
12
,
"Exmobi"
,
0
),
DATAV
(
13
,
"DataV"
,
0
),
RAYDATA
(
14
,
"RayData"
,
0
),
BIANMU
(
15
,
"编目服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
DITU
(
16
,
"地图类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
TUBIAO
(
17
,
"图表视图类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
SHIBIE
(
18
,
"识别类微服务:请在备注中填写"
,
1
),
NEIRONG
(
19
,
"内容审查类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
FENXI
(
20
,
"智能分析类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
DATA
(
21
,
"数据引用类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
IOQUICK
(
22
,
"流媒体加速类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
JIAMI
(
23
,
"加密类微服务:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
OTHER
(
24
,
"其他:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
);
private
Integer
code
;
private
String
name
;
private
Integer
other
;
MicroServiceEnum
()
{
}
...
...
@@ -46,9 +47,10 @@ public enum MicroServiceEnum {
microServiceEnumMap
.
put
(
microServiceEnum
.
getName
(),
microServiceEnum
);
}
}
MicroServiceEnum
(
Integer
code
,
String
name
)
{
MicroServiceEnum
(
Integer
code
,
String
name
,
Integer
other
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
other
=
other
;
}
public
static
MicroServiceEnum
getByName
(
String
name
){
MicroServiceEnum
microServiceEnum
=
microServiceEnumMap
.
get
(
name
);
...
...
src/main/java/com/zjty/inspect/enums/OtherApiEnum.java
浏览文件 @
d2be4cfb
...
...
@@ -6,36 +6,37 @@ import java.util.HashMap;
import
java.util.Map
;
@Getter
public
enum
OtherApiEnum
{
NONE
(-
1
,
"无"
),
JNDI
(
0
,
"JNDI"
),
ML
(
1
,
"其他命名与目录类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
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
(
10
,
"其他搜索引擎类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
LOGSTASH
(
11
,
"Logstash"
),
LOG
(
12
,
"其他分析日志类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
KIBANA
(
13
,
"Kibana"
),
FXKS
(
14
,
"其他分析可视化类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
REDIS
(
15
,
"Redis"
),
JIQ
(
16
,
"其他集群类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
ARCGIS
(
17
,
"ARCGIS"
),
GIS
(
18
,
"其他GIS类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
EDIT
(
19
,
"在线编辑API:请在备注中填写,如需填写多个,请以逗号分隔"
),
TUBIAO
(
20
,
"统计图表类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
BF
(
21
,
"播放类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
YJ
(
22
,
"硬件驱动类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
OCR
(
23
,
"OCR识别类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
JIAMI
(
24
,
"加密类API:请在备注中填写,如需填写多个,请以逗号分隔"
),
OTHER
(
25
,
"其他:请在备注中填写,如需填写多个,请以逗号分隔"
);
NONE
(-
1
,
"无"
,
0
),
JNDI
(
0
,
"JNDI"
,
0
),
ML
(
1
,
"其他命名与目录类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
JMS
(
2
,
"JMS"
,
0
),
RestFul
(
3
,
"RestFul"
,
0
),
XX
(
4
,
"其他消息类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
AMQP
(
5
,
"AMQP"
,
0
),
KAFKA
(
6
,
"Kafka API"
,
0
),
MQTT
(
7
,
"MQTT"
,
0
),
ROUTE
(
8
,
"其他消息路由类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
ES
(
9
,
"ES"
,
0
),
YQ
(
10
,
"其他搜索引擎类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
LOGSTASH
(
11
,
"Logstash"
,
0
),
LOG
(
12
,
"其他分析日志类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
KIBANA
(
13
,
"Kibana"
,
0
),
FXKS
(
14
,
"其他分析可视化类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
REDIS
(
15
,
"Redis"
,
0
),
JIQ
(
16
,
"其他集群类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
ARCGIS
(
17
,
"ARCGIS"
,
0
),
GIS
(
18
,
"其他GIS类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
EDIT
(
19
,
"在线编辑API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
TUBIAO
(
20
,
"统计图表类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
BF
(
21
,
"播放类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
YJ
(
22
,
"硬件驱动类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
OCR
(
23
,
"OCR识别类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
JIAMI
(
24
,
"加密类API:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
),
OTHER
(
25
,
"其他:请在备注中填写,如需填写多个,请以逗号分隔"
,
1
);
private
Integer
code
;
private
String
name
;
private
Integer
other
;
private
static
Map
<
String
,
OtherApiEnum
>
otherApiEnumMap
=
new
HashMap
<>();
private
static
Map
<
Integer
,
OtherApiEnum
>
otherApiCodeEnumMap
=
new
HashMap
<>();
...
...
@@ -50,7 +51,7 @@ public enum OtherApiEnum {
OtherApiEnum
()
{
}
OtherApiEnum
(
Integer
code
,
String
name
)
{
OtherApiEnum
(
Integer
code
,
String
name
,
Integer
other
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
...
...
src/main/java/com/zjty/inspect/enums/RecastMethod.java
浏览文件 @
d2be4cfb
...
...
@@ -6,7 +6,8 @@ public enum RecastMethod {
* 架构
*/
RECONSITUTION
(
"适配重构"
,
1
),
MODIFICATION
(
"代码修改"
,
2
);
MODIFICATION
(
"代码修改"
,
2
),
NOMODIFICATION
(
"无需代码修改"
,
3
);
RecastMethod
(
String
name
,
Integer
status
){
this
.
name
=
name
;
...
...
src/main/java/com/zjty/inspect/inspect/Inspector.java
浏览文件 @
d2be4cfb
...
...
@@ -126,10 +126,9 @@ public class Inspector {
* 配置文件后缀
* xml:list【路径】
*/
private
Map
<
String
,
List
<
Path
>>
configFileTypePathsMapping
=
new
HashMap
<>(
512
);
private
Map
<
String
,
List
<
Path
>>
ruleSuffixFilePathMap
;
private
Map
<
String
,
List
<
Rule
>>
ruleSuffixMap
;
private
Map
<
String
,
List
<
Path
>>
ruleSuffixFilePathMap
=
new
HashMap
<>(
512
)
;
private
Map
<
String
,
List
<
Rule
>>
ruleSuffixMap
=
new
HashMap
<>(
512
)
;
/**
* 规则关联的技术
...
...
@@ -152,7 +151,7 @@ public class Inspector {
*
* @return 报告
*/
public
ReportVo
inspect
()
throws
IOException
{
public
ReportVo
inspect
()
{
//初始化成员变量
initData
();
//扫描文件,进行文件分类
...
...
@@ -166,11 +165,11 @@ public class Inspector {
setReportLanguageAndFrame
();
//根据扫描结果以及用户配置得出需要使用的规则及技术
ruleTransform
(
inspectParameter
.
getRecastMethod
());
//扫描
配置
文件
//扫描
源代码
文件
forEachFilesMap
();
//将得到的告警信息根据技术id进行转换
Set
<
String
>
idSet
=
warns
.
stream
().
map
(
Warn:
:
getTechnologyId
).
collect
(
Collectors
.
toSet
());
List
<
Technology
>
technologies
=
technologyDao
.
findAllById
(
idSet
);
Set
<
String
>
technologyIds
=
warns
.
stream
().
map
(
Warn:
:
getTechnologyId
).
collect
(
Collectors
.
toSet
());
List
<
Technology
>
technologies
=
technologyDao
.
findAllById
(
technologyIds
);
//计算技术金额
Integer
technologyFund
=
0
;
...
...
@@ -230,10 +229,7 @@ public class Inspector {
}
}
}
}
}
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
//指定后缀到文件匹配关键字
...
...
@@ -241,7 +237,7 @@ public class Inspector {
int
fileSize
=
0
;
List
<
Integer
>
collect
=
ruleSuffixFilePathMap
.
entrySet
().
stream
().
map
(
Map
.
Entry
::
getValue
).
map
(
List:
:
size
).
collect
(
Collectors
.
toList
());
for
(
Integer
integer
:
collect
)
{
fileSize
=
fileSize
+
integer
;
fileSize
=
fileSize
+
integer
;
}
for
(
Map
.
Entry
<
String
,
List
<
Path
>>
entry
:
ruleSuffixFilePathMap
.
entrySet
())
{
//entry,key为后缀,value为文件列表
...
...
@@ -250,6 +246,10 @@ public class Inspector {
List
<
Rule
>
rules
=
ruleSuffixMap
.
get
(
key
);
for
(
Path
path1
:
entry
.
getValue
())
{
try
{
fileNum
=
fileNum
+
1
;
map
.
put
(
"totalFile"
,
fileNum
+
"/"
+
fileSize
);
System
.
out
.
println
(
fileNum
+
"/"
+
fileSize
);
asyncTask
.
sendMessageToAll
(
map
);
//如果文件类型为jar活着class则不读取
if
(
path1
.
toAbsolutePath
().
toString
().
endsWith
(
"jar"
)
||
path1
.
toAbsolutePath
().
toString
().
endsWith
(
"class"
))
{
continue
;
...
...
@@ -263,10 +263,7 @@ public class Inspector {
}
catch
(
IOException
e
)
{
log
.
error
(
"解析{}出错,异常信息为{}"
,
path1
.
toAbsolutePath
().
toString
(),
e
.
getMessage
());
}
fileNum
=
fileNum
+
1
;
map
.
put
(
"totalFile"
,
fileNum
+
"/"
+
fileSize
);
System
.
out
.
println
(
fileNum
+
"/"
+
fileSize
);
asyncTask
.
sendMessageToAll
(
map
);
}
}
}
...
...
@@ -293,23 +290,34 @@ public class Inspector {
languageEnums
.
add
(
language
);
}
}
List
<
LanguageEnum
>
languageEnums1
=
languageEnums
.
stream
()
//设置是否需要重构
List
<
LanguageEnum
>
newLanguageEnums
=
languageEnums
.
stream
()
.
filter
(
e
->
e
.
getCode
()
!=
4
&
e
.
getCode
()
!=
5
&
e
.
getCode
()
!=
6
)
.
collect
(
Collectors
.
toList
());
if
(!
languageEnums1
.
isEmpty
())
{
if
(!
newLanguageEnums
.
isEmpty
())
{
report
.
setRecastMethod
(
RecastMethod
.
RECONSITUTION
.
getStatus
());
log
.
info
(
"inspect:代码解析完成,建议进行适配重构"
);
}
else
{
report
.
setRecastMethod
(
RecastMethod
.
MODIFICATION
.
getStatus
());
log
.
info
(
"inspect:代码解析完成,建议进行代码修改"
);
List
<
LanguageEnum
>
enums
=
languageEnums
.
stream
()
.
filter
(
e
->
e
.
getCode
()
!=
4
&
e
.
getCode
()
!=
6
)
.
collect
(
Collectors
.
toList
());
if
(
enums
.
isEmpty
()){
report
.
setRecastMethod
(
RecastMethod
.
MODIFICATION
.
getStatus
());
log
.
info
(
"inspect:代码解析完成,无需进行代码修改"
);
}
else
{
report
.
setRecastMethod
(
RecastMethod
.
NOMODIFICATION
.
getStatus
());
log
.
info
(
"inspect:代码解析完成,建议进行代码修改"
);
}
}
List
<
Integer
>
languageCodes
=
languageEnums
.
stream
()
.
map
(
LanguageEnum:
:
getCode
)
.
collect
(
Collectors
.
toList
());
//设置语言
report
.
setLanguage
(
most
==
null
?
LanguageEnum
.
NONE
.
getCode
()
:
mostStatus
);
report
.
setLanguages
(
languageCodes
);
//设置架构
report
.
setFramework
(
languageMatchMap
.
get
(
"jsp"
).
i
>
0
?
Framework
.
MIXTURE
.
getStatus
()
:
Framework
.
SEPARATE
.
getStatus
());
//设置是否需要重构
}
/**
...
...
@@ -322,7 +330,7 @@ public class Inspector {
private
void
ruleTransform
(
Integer
status
)
{
//如果需要改造则查询所有规则
if
(
status
==
1
)
{
this
.
ruleList
=
ruleService
.
mcjAllRule
();
this
.
ruleList
=
ruleService
.
findRules
();
}
else
{
//只查询前端技术
List
<
Technology
>
front
=
technologyDao
.
findAllByBackorfrontEquals
(
1
);
...
...
@@ -356,6 +364,9 @@ public class Inspector {
}
}
/**
* 数据清空
*/
private
void
initData
()
{
//查询技术,构造支持与非支持技术对象,3个对象
//配置语言 map结构
...
...
@@ -363,10 +374,10 @@ public class Inspector {
fileLine
=
0
;
fileNum
=
0
;
dependencyVo
=
new
DependencyVo
();
ruleSuffixFilePathMap
=
new
HashMap
<>
();
ruleSuffixMap
=
new
HashMap
<>
();
technologyHashMap
=
new
HashMap
<>
();
supportWarns
=
new
ArrayList
<>
();
ruleSuffixFilePathMap
.
clear
();
ruleSuffixMap
.
clear
();
technologyHashMap
.
clear
();
supportWarns
.
clear
();
warns
.
clear
();
rules
.
clear
();
//配置 config文件 结构
...
...
@@ -378,7 +389,7 @@ public class Inspector {
}
private
void
statisticsConfigFile
()
{
this
.
configFileTypePathsMapping
=
new
HashMap
<>
();
this
.
configFileTypePathsMapping
.
clear
();
configFileTypePathsMapping
.
put
(
"xml"
,
new
ArrayList
<>());
configFileTypePathsMapping
.
put
(
"json"
,
new
ArrayList
<>());
configFileTypePathsMapping
.
put
(
"gradle"
,
new
ArrayList
<>());
...
...
@@ -407,7 +418,7 @@ public class Inspector {
*/
private
void
initRule
()
{
//查询所有规则,第一遍扫描文件需要
this
.
ruleList
=
ruleService
.
mcjAllRule
();
this
.
ruleList
=
ruleService
.
findRules
();
//根据后缀名,收集文件进行操作
for
(
Rule
rule
:
ruleList
)
{
if
(!
ruleSuffixFilePathMap
.
containsKey
(
rule
.
getSuffix
()))
{
...
...
src/main/java/com/zjty/inspect/service/EvaluationService.java
浏览文件 @
d2be4cfb
...
...
@@ -10,7 +10,7 @@ public interface EvaluationService {
Evaluation
save
(
Evaluation
evaluation
);
void
update
(
Evaluation
evaluation
);
void
delete
(
String
id
);
Page
<
Evaluation
>
findSearch
(
Map
searchMap
,
int
page
,
int
size
);
Page
<
Evaluation
>
findSearch
(
Map
<
String
,
String
>
searchMap
,
int
page
,
int
size
);
Evaluation
findById
(
String
id
);
Evaluation
findByName
(
String
name
);
}
src/main/java/com/zjty/inspect/service/RuleService.java
浏览文件 @
d2be4cfb
...
...
@@ -54,5 +54,4 @@ public interface RuleService {
void
importRules
(
MultipartFile
file
);
List
<
Rule
>
mcjAllRule
();
}
src/main/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
浏览文件 @
d2be4cfb
...
...
@@ -56,7 +56,7 @@ public class RuleServiceImpl implements RuleService {
private
RuleCollectionDao
ruleCollectionDao
;
@Override
public
List
<
Rule
>
mcjAllRule
()
{
public
List
<
Rule
>
findRules
()
{
List
<
Rule
>
rules
=
ruleDao
.
findAll
();
List
<
Rule
>
ruleList
=
new
ArrayList
<>();
if
(
rules
!=
null
&&
rules
.
size
()
>
0
)
{
...
...
@@ -258,11 +258,6 @@ public class RuleServiceImpl implements RuleService {
return
rules
;
}
@Override
public
List
<
Rule
>
findRules
()
{
return
ruleDao
.
findAll
();
}
@Override
public
List
<
RuleCollection
>
findByName
(
String
name
)
{
List
<
RuleCollection
>
rules
=
ruleCollectionDao
.
findAllByTargetLike
(
"%"
+
name
+
"%"
);
...
...
src/main/java/com/zjty/inspect/utils/BudgetUitl.java
浏览文件 @
d2be4cfb
...
...
@@ -130,23 +130,21 @@ public class BudgetUitl {
if
(
inspectParameter
.
getRecastMethod
()==
1
){
//用户需要适配
if
(
report
.
getRecastMethod
()==
1
){
double
refactorProportion1
=
Double
.
valueOf
(
doubleHashMap
.
get
(
2
));
double
refactorProportion1
=
Double
.
parseDouble
(
doubleHashMap
.
get
(
2
));
inspectParameter
.
setProportion
(
refactorProportion1
);
Budget
budget1
=
getCodeRefactor
(
"代码重构预算"
,
inspectParameter
.
getProportion
(),
pow
,
systemFund
,
fund
,
moneyRate
,
coefficient
);
budgetVo
.
getBudget
().
add
(
budget1
);
return
budgetVo
;
}
double
refactorProportion
=
Double
.
valueOf
(
doubleHashMap
.
get
(
4
));
double
refactorProportion
=
Double
.
parseDouble
(
doubleHashMap
.
get
(
4
));
inspectParameter
.
setProportion
(
refactorProportion
);
Budget
budget
=
getCodeRefactor
(
"代码修改预算"
,
inspectParameter
.
getProportion
(),
pow
,
systemFund
,
fund
,
moneyRate
,
coefficient
);
budgetVo
.
getBudget
().
add
(
budget
);
}
else
{
double
refactorProportion
=
Double
.
valueOf
(
doubleHashMap
.
get
(
3
));
double
refactorProportion
=
Double
.
parseDouble
(
doubleHashMap
.
get
(
3
));
inspectParameter
.
setProportion
(
refactorProportion
);
Budget
budget
=
getCodeRefactor
(
"代码适配预算"
,
inspectParameter
.
getProportion
(),
pow
,
systemFund
,
fund
,
moneyRate
,
coefficient
);
budgetVo
.
getBudget
().
add
(
budget
);
}
return
budgetVo
;
}
...
...
src/main/java/com/zjty/inspect/utils/ExcelUtil.java
浏览文件 @
d2be4cfb
...
...
@@ -69,6 +69,8 @@ public class ExcelUtil {
if
(
split
.
length
>
1
)
{
reform
.
setUnitContent
(
split
[
0
]);
reform
.
setUnitPhone
(
split
[
1
]);
}
else
if
(
split
.
length
==
1
){
reform
.
setUnitContent
(
split
[
0
]);
}
reform
.
setUnitName
(
unitName
);
...
...
@@ -97,9 +99,11 @@ public class ExcelUtil {
reform
.
setAddress
(
yesOrNo
(
address
));
String
nativeContent
=
getExcelCell
(
7
,
4
,
sheetAt
);
String
[]
nativeUnit
=
nativeContent
.
split
(
"\n"
);
if
(
nativeUnit
.
length
>
0
)
{
if
(
nativeUnit
.
length
>
1
)
{
reform
.
setLocalContact
(
nativeUnit
[
0
]);
reform
.
setLocalPhone
(
nativeUnit
[
1
]);
}
else
if
(
nativeUnit
.
length
>
0
){
reform
.
setLocalContact
(
nativeUnit
[
0
]);
}
String
secret
=
getExcelCell
(
8
,
2
,
sheetAt
);
...
...
@@ -117,30 +121,8 @@ public class ExcelUtil {
String
type
=
getExcelCell
(
12
,
2
,
sheetAt
);
ArrayList
<
Integer
>
applicationType
=
new
ArrayList
<>();
switch
(
type
)
{
case
"办公OA应用类"
:
applicationType
.
add
(
1
);
break
;
case
"门户、信息发布、综合入口服务类"
:
applicationType
.
add
(
2
);
break
;
case
"申报、填报、审批等公共行政服务类"
:
applicationType
.
add
(
4
);
break
;
case
"数据收集、分析、态势感知等大数据应用类"
:
applicationType
.
add
(
5
);
break
;
case
"地图、定位等GIS服务类"
:
applicationType
.
add
(
6
);
break
;
case
"视频、图形等流媒体应用类"
:
applicationType
.
add
(
7
);
break
;
case
"3D、模型等视觉建模应用类"
:
applicationType
.
add
(
8
);
break
;
}
ApplicationType
appType
=
ApplicationType
.
getByName
(
type
);
applicationType
.
add
(
appType
.
getCode
());
reform
.
setApplicationType
(
applicationType
);
String
module
=
getExcelCell
(
13
,
2
,
sheetAt
);
...
...
@@ -164,6 +146,11 @@ public class ExcelUtil {
BaseDes
devFramework
=
new
BaseDes
();
FrameWorkEnum
frameWorkEnum
=
FrameWorkEnum
.
getByName
(
framework
);
if
(
frameWorkEnum
!=
null
)
{
if
(
frameWorkEnum
.
getCode
()==
15
){
devFramework
.
setName
(
remark
);
}
else
{
devFramework
.
setName
(
frameWorkEnum
.
getName
());
}
devFramework
.
setCode
(
frameWorkEnum
.
getCode
());
devFramework
.
setVersion
(
version
);
devFramework
.
setDes
(
remark
);
...
...
@@ -184,8 +171,12 @@ public class ExcelUtil {
BaseDes
font
=
new
BaseDes
();
FontTechnologyEnum
fontTechnologyEnum
=
FontTechnologyEnum
.
getByName
(
framework
);
if
(
fontTechnologyEnum
!=
null
)
{
if
(
fontTechnologyEnum
.
getCode
()==
15
){
font
.
setName
(
remark
);
}
else
{
font
.
setName
(
fontTechnologyEnum
.
getName
());
}
font
.
setCode
(
fontTechnologyEnum
.
getCode
());
font
.
setName
(
framework
);
font
.
setDes
(
remark
);
font
.
setVersion
(
version
);
fontTechnologies
.
add
(
font
);
...
...
@@ -206,8 +197,12 @@ public class ExcelUtil {
cs
.
setVersion
(
version
);
CSTechnologyEnum
csTechnologyEnum
=
CSTechnologyEnum
.
getByName
(
framework
);
if
(
csTechnologyEnum
!=
null
)
{
if
(
csTechnologyEnum
.
getCode
()==
10
){
cs
.
setName
(
remark
);
}
else
{
cs
.
setName
(
csTechnologyEnum
.
getName
());
}
cs
.
setCode
(
csTechnologyEnum
.
getCode
());
cs
.
setName
(
csTechnologyEnum
.
getName
());
fontDevTechnologies
.
add
(
cs
);
}
}
...
...
@@ -225,7 +220,11 @@ public class ExcelUtil {
BaseDes
opGA
=
new
BaseDes
();
OpgaEnum
opgaEnum
=
OpgaEnum
.
getByName
(
framework
);
if
(
opgaEnum
!=
null
)
{
opGA
.
setName
(
framework
);
if
(
opgaEnum
.
getCode
()==
4
){
opGA
.
setName
(
remark
);
}
else
{
opGA
.
setName
(
framework
);
}
opGA
.
setCode
(
opgaEnum
.
getCode
());
opGA
.
setVersion
(
version
);
opGA
.
setDes
(
remark
);
...
...
@@ -249,7 +248,11 @@ public class ExcelUtil {
BaseDes
devLanguage
=
new
BaseDes
();
LanguageEnum
languageEnum
=
LanguageEnum
.
getByName
(
lan
);
if
(
languageEnum
!=
null
)
{
devLanguage
.
setName
(
languageEnum
.
getName
());
if
(
languageEnum
.
getCode
()==
12
){
devLanguage
.
setName
(
languageEnum
.
getName
());
}
else
{
devLanguage
.
setName
(
remark
);
}
devLanguage
.
setCode
(
languageEnum
.
getCode
());
devLanguage
.
setVersion
(
version
);
devLanguage
.
setDes
(
remark
);
...
...
@@ -273,7 +276,11 @@ public class ExcelUtil {
if
(
middlewareEnum
!=
null
)
{
BaseDes
baseDes
=
new
BaseDes
();
baseDes
.
setDes
(
remark
);
baseDes
.
setName
(
middlewareEnum
.
name
());
if
(
middlewareEnum
.
getCode
()==
15
){
baseDes
.
setName
(
remark
);
}
else
{
baseDes
.
setName
(
middlewareEnum
.
name
());
}
baseDes
.
setCode
(
middlewareEnum
.
getCode
());
baseDes
.
setVersion
(
version
);
middlewareEnums
.
add
(
baseDes
);
...
...
@@ -291,10 +298,15 @@ public class ExcelUtil {
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
OtherApi
otherApi
=
new
OtherApi
();
otherApi
.
setApiName
(
api
);
OtherApiEnum
otherApiEnum
=
OtherApiEnum
.
getByName
(
api
);
if
(
otherApiEnum
.
getOther
()==
1
){
otherApi
.
setApiName
(
remark
);
}
else
{
otherApi
.
setApiName
(
api
);
}
otherApi
.
setDes
(
remark
);
otherApi
.
setVersion
(
version
);
otherApi
.
setCode
(
String
.
valueOf
(
OtherApiEnum
.
getByName
(
api
)
.
getCode
()));
otherApi
.
setCode
(
String
.
valueOf
(
otherApiEnum
.
getCode
()));
otherApis
.
add
(
otherApi
);
}
middleware
.
setOtherApis
(
otherApis
);
...
...
@@ -310,8 +322,12 @@ public class ExcelUtil {
BaseDes
microService
=
new
BaseDes
();
MicroServiceEnum
microServiceEnum
=
MicroServiceEnum
.
getByName
(
name
);
if
(
microServiceEnum
!=
null
)
{
if
(
microServiceEnum
.
getOther
()==
1
){
microService
.
setName
(
remark
);
}
else
{
microService
.
setName
(
microServiceEnum
.
getName
());
}
microService
.
setCode
(
microServiceEnum
.
getCode
());
microService
.
setName
(
microServiceEnum
.
getName
());
microService
.
setDes
(
remark
);
microService
.
setVersion
(
version
);
microServices
.
add
(
microService
);
...
...
@@ -371,10 +387,14 @@ public class ExcelUtil {
String
brows
=
getExcelCell
(
i
,
2
,
sheetAt
);
String
version
=
getExcelCell
(
i
,
3
,
sheetAt
);
String
remark
=
getExcelCell
(
i
,
4
,
sheetAt
);
CompatibleBrowser
name
=
CompatibleBrowser
.
getByName
(
brows
);
CompatibleBrowser
compatibleBrowser
=
CompatibleBrowser
.
getByName
(
brows
);
BaseDes
baseDes
=
new
BaseDes
();
baseDes
.
setName
(
name
.
toString
());
baseDes
.
setCode
(
name
.
getCode
());
if
(
compatibleBrowser
.
getCode
()==
3
){
baseDes
.
setName
(
remark
);
}
else
{
baseDes
.
setName
(
compatibleBrowser
.
getName
());
}
baseDes
.
setCode
(
compatibleBrowser
.
getCode
());
baseDes
.
setVersion
(
version
);
baseDes
.
setDes
(
remark
);
compatibleBrowsers
.
add
(
baseDes
);
...
...
@@ -392,9 +412,13 @@ public class ExcelUtil {
browserPlug
.
setVersion
(
version
);
browserPlug
.
setDes
(
remark
);
BrowserPlugEnum
byName
=
BrowserPlugEnum
.
getByName
(
plugin
);
browserPlug
.
setName
(
byName
.
getName
());
browserPlug
.
setCode
(
byName
.
getCode
());
BrowserPlugEnum
browserPlugEnum
=
BrowserPlugEnum
.
getByName
(
plugin
);
if
(
browserPlugEnum
.
getOther
()==
1
){
browserPlug
.
setName
(
remark
);
}
else
{
browserPlug
.
setName
(
browserPlugEnum
.
getName
());
}
browserPlug
.
setCode
(
browserPlugEnum
.
getCode
());
switch
(
plugin
)
{
case
"在线文本编辑类:请在备注中填写插件名和版本"
:
break
;
...
...
@@ -480,7 +504,6 @@ public class ExcelUtil {
if
(
inEva
!=
null
)
{
Reform
reform
=
JSON
.
parseObject
(
evaluation
.
getInEva
(),
Reform
.
class
);
arrayList
.
add
(
exportEntity
(
"用户名"
,
reform
.
getUsername
()));
if
(
reform
.
getAssessmentType
()==
1
){
arrayList
.
add
(
exportEntity
(
"评估类型"
,
"快速评估"
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论