Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
b661068b
提交
b661068b
authored
3月 07, 2020
作者:
czq
浏览文件
操作
浏览文件
下载
差异文件
czq
上级
9ea322d7
681d9b9c
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
209 行增加
和
61 行删除
+209
-61
CategoryCotroller.java
...n/java/com/zjty/inspect/controller/CategoryCotroller.java
+31
-0
ConfigController.java
...in/java/com/zjty/inspect/controller/ConfigController.java
+9
-8
InspectController.java
...n/java/com/zjty/inspect/controller/InspectController.java
+3
-23
CategoryDao.java
src/main/java/com/zjty/inspect/dao/CategoryDao.java
+8
-0
ConfigParamDao.java
src/main/java/com/zjty/inspect/dao/ConfigParamDao.java
+3
-0
Technology.java
src/main/java/com/zjty/inspect/entity/Technology.java
+4
-0
CategoryService.java
src/main/java/com/zjty/inspect/service/CategoryService.java
+9
-0
ConfigService.java
src/main/java/com/zjty/inspect/service/ConfigService.java
+1
-1
InspectService.java
src/main/java/com/zjty/inspect/service/InspectService.java
+4
-0
CategoryServiceImpl.java
...va/com/zjty/inspect/service/impl/CategoryServiceImpl.java
+18
-0
ConfigServiceImpl.java
...java/com/zjty/inspect/service/impl/ConfigServiceImpl.java
+15
-4
InspectServiceImpl.java
...ava/com/zjty/inspect/service/impl/InspectServiceImpl.java
+48
-3
RuleServiceImpl.java
...n/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
+3
-3
WorkLoadUtil.java
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
+51
-17
pg.ftl
src/main/resources/templates/pg.ftl
+2
-2
没有找到文件。
src/main/java/com/zjty/inspect/controller/CategoryCotroller.java
0 → 100644
浏览文件 @
b661068b
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.service.CategoryService
;
import
com.zjty.inspect.service.ConfigService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
@RequestMapping
(
"/category"
)
@Api
(
value
=
"类型管理接口"
,
description
=
"类型管理接口,提供页面的增、删、改、查"
)
public
class
CategoryCotroller
{
@Autowired
private
CategoryService
categoryService
;
/**
* 查询所有类型
* @return
*/
@ApiOperation
(
"查询所有类型"
)
@GetMapping
public
ResponseEntity
getCategorys
(){
return
ResponseEntity
.
ok
(
categoryService
.
findAll
());
}
}
src/main/java/com/zjty/inspect/controller/ConfigController.java
浏览文件 @
b661068b
...
@@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/config"
)
@RequestMapping
(
"/config"
)
...
@@ -29,16 +31,15 @@ public class ConfigController {
...
@@ -29,16 +31,15 @@ public class ConfigController {
}
}
/**
/**
* 根据
name
修改参数
* 根据
id
修改参数
* @param
config 参数
* @param
* @param
name name
* @param
* @return
* @return
*/
*/
@PostMapping
(
value
=
"/{name}"
)
@PostMapping
(
"/updates"
)
@ApiOperation
(
"根据name修改参数"
)
@ApiOperation
(
"根据id修改参数,需要传id和value"
)
public
ResponseEntity
update
(
@RequestBody
Config
config
,
@PathVariable
String
name
){
public
ResponseEntity
update
(
@RequestBody
List
<
Config
>
configs
){
config
.
setName
(
name
);
configService
.
updateConfig
(
configs
);
configService
.
updateConfig
(
config
);
return
ResponseEntity
.
ok
(
200
);
return
ResponseEntity
.
ok
(
200
);
}
}
}
}
src/main/java/com/zjty/inspect/controller/InspectController.java
浏览文件 @
b661068b
...
@@ -103,29 +103,9 @@ public class InspectController {
...
@@ -103,29 +103,9 @@ public class InspectController {
int
support
=
technologyService
.
findAllTechnologyNotSupport
();
int
support
=
technologyService
.
findAllTechnologyNotSupport
();
reportVo
.
setTechnologiesRepair
(
support
);
reportVo
.
setTechnologiesRepair
(
support
);
log
.
info
(
"inspect:代码评估完成"
);
log
.
info
(
"inspect:代码评估完成"
);
// Map map = new HashMap();
// String filePath = inspectService.freemakerData(inspect,count,support);
// map.put("inspect", inspect);
reportVo
.
setHtmlAddress
(
null
);
// map.put("time", TimeUtil.getTime());
// HashMap<String, List<Warn>> warnMap = inspect.getWarnDetails();
// List<Technology> technologies = inspect.getTechnologies();
// Map techMap = new HashMap();
// for (Technology technology : technologies) {
// techMap.put(technology.getTechnologyName(), technology.getSupport());
// }
// map.put("techMap", techMap);
// map.put("warnMap", warnMap);
// map.put("technologies", technologies);
// try {
// String template = FreemarkerUtils.getTemplate("pg.ftl", map);
// String s = inspectService.generateHtml(template, map);
// String filePath = FileUtil.createFilePath();
// File file1 = new File("./pgbg/" + filePath + "/" + file.getName() + ".html");
// FileUtil.write(s,"./pgbg/"+filePath+"/"+file.getName()+".html");
// reportVo.setHtmlAddress(file1.getCanonicalPath());
// System.out.println("内容"+s);
// } catch (TemplateException e) {
// e.printStackTrace();
// }
Report
report
=
new
Report
();
Report
report
=
new
Report
();
String
random
=
RandomUtil
.
getRandom
();
String
random
=
RandomUtil
.
getRandom
();
report
.
setId
(
RandomUtil
.
getRandom
());
report
.
setId
(
RandomUtil
.
getRandom
());
...
...
src/main/java/com/zjty/inspect/dao/CategoryDao.java
0 → 100644
浏览文件 @
b661068b
package
com
.
zjty
.
inspect
.
dao
;
import
com.zjty.inspect.entity.Category
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
public
interface
CategoryDao
extends
JpaRepository
<
Category
,
String
>,
JpaSpecificationExecutor
<
Category
>
{
}
src/main/java/com/zjty/inspect/dao/ConfigParamDao.java
浏览文件 @
b661068b
...
@@ -3,6 +3,8 @@ package com.zjty.inspect.dao;
...
@@ -3,6 +3,8 @@ package com.zjty.inspect.dao;
import
com.zjty.inspect.entity.Config
;
import
com.zjty.inspect.entity.Config
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.Optional
;
/**
/**
* @author Mcj
* @author Mcj
* @date 2020-03-05 20:55
* @date 2020-03-05 20:55
...
@@ -10,4 +12,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
...
@@ -10,4 +12,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
public
interface
ConfigParamDao
extends
JpaRepository
<
Config
,
Integer
>
{
public
interface
ConfigParamDao
extends
JpaRepository
<
Config
,
Integer
>
{
Config
findByName
(
String
name
);
Config
findByName
(
String
name
);
Optional
<
Config
>
findById
(
String
id
);
}
}
src/main/java/com/zjty/inspect/entity/Technology.java
浏览文件 @
b661068b
...
@@ -50,6 +50,10 @@ public class Technology {
...
@@ -50,6 +50,10 @@ public class Technology {
@ApiModelProperty
(
value
=
"是否支持"
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"是否支持"
,
example
=
"1"
)
private
Integer
support
;
private
Integer
support
;
/**
* 分类id
*/
private
String
category_id
;
/**
/**
* 技术类型
* 技术类型
* 1:前端技术
* 1:前端技术
...
...
src/main/java/com/zjty/inspect/service/CategoryService.java
0 → 100644
浏览文件 @
b661068b
package
com
.
zjty
.
inspect
.
service
;
import
com.zjty.inspect.entity.Category
;
import
java.util.List
;
public
interface
CategoryService
{
List
<
Category
>
findAll
();
}
src/main/java/com/zjty/inspect/service/ConfigService.java
浏览文件 @
b661068b
...
@@ -6,6 +6,6 @@ import java.util.List;
...
@@ -6,6 +6,6 @@ import java.util.List;
public
interface
ConfigService
{
public
interface
ConfigService
{
public
void
updateConfig
(
Config
config
);
public
void
updateConfig
(
List
<
Config
>
configs
);
List
<
Config
>
findAll
();
List
<
Config
>
findAll
();
}
}
src/main/java/com/zjty/inspect/service/InspectService.java
浏览文件 @
b661068b
...
@@ -14,4 +14,8 @@ public interface InspectService {
...
@@ -14,4 +14,8 @@ public interface InspectService {
*/
*/
ReportVo
inspect
(
ReportVo
reportVo
,
InspectParameter
inspectParameter
);
ReportVo
inspect
(
ReportVo
reportVo
,
InspectParameter
inspectParameter
);
String
generateHtml
(
String
templateContent
,
Map
model
);
String
generateHtml
(
String
templateContent
,
Map
model
);
String
freemakerData
(
ReportVo
inspect
,
int
count
,
int
support
);
}
}
src/main/java/com/zjty/inspect/service/impl/CategoryServiceImpl.java
0 → 100644
浏览文件 @
b661068b
package
com
.
zjty
.
inspect
.
service
.
impl
;
import
com.zjty.inspect.dao.CategoryDao
;
import
com.zjty.inspect.entity.Category
;
import
com.zjty.inspect.service.CategoryService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
CategoryServiceImpl
implements
CategoryService
{
@Autowired
private
CategoryDao
categoryDao
;
@Override
public
List
<
Category
>
findAll
()
{
return
categoryDao
.
findAll
();
}
}
src/main/java/com/zjty/inspect/service/impl/ConfigServiceImpl.java
浏览文件 @
b661068b
...
@@ -6,17 +6,28 @@ import com.zjty.inspect.service.ConfigService;
...
@@ -6,17 +6,28 @@ import com.zjty.inspect.service.ConfigService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
@Service
@Service
public
class
ConfigServiceImpl
implements
ConfigService
{
public
class
ConfigServiceImpl
implements
ConfigService
{
@Autowired
@Autowired
private
ConfigParamDao
configParamDao
;
private
ConfigParamDao
configParamDao
;
@Override
@Override
public
void
updateConfig
(
Config
config
)
{
public
void
updateConfig
(
List
<
Config
>
configs
)
{
Config
c
=
configParamDao
.
findByName
(
config
.
getName
());
List
<
Config
>
configList
=
new
ArrayList
<>();
c
.
setValue
(
config
.
getValue
());
for
(
Config
config
:
configs
)
{
configParamDao
.
save
(
c
);
Optional
<
Config
>
optional
=
configParamDao
.
findById
(
config
.
getId
());
if
(
optional
.
isPresent
())
{
Config
c
=
optional
.
get
();
c
.
setValue
(
config
.
getValue
());
configList
.
add
(
c
);
}
}
configParamDao
.
saveAll
(
configList
);
}
}
@Override
@Override
...
...
src/main/java/com/zjty/inspect/service/impl/InspectServiceImpl.java
浏览文件 @
b661068b
package
com
.
zjty
.
inspect
.
service
.
impl
;
package
com
.
zjty
.
inspect
.
service
.
impl
;
import
com.zjty.inspect.dao.ReportDao
;
import
com.zjty.inspect.dao.ReportDao
;
import
com.zjty.inspect.entity.InspectParameter
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.entity.Report
;
import
com.zjty.inspect.entity.ReportVo
;
import
com.zjty.inspect.enums.Language
;
import
com.zjty.inspect.enums.Language
;
import
com.zjty.inspect.service.InspectService
;
import
com.zjty.inspect.service.InspectService
;
import
com.zjty.inspect.inspect.Inspector
;
import
com.zjty.inspect.inspect.Inspector
;
import
com.zjty.inspect.service.ParameterService
;
import
com.zjty.inspect.service.ParameterService
;
import
com.zjty.inspect.service.TechnologyService
;
import
com.zjty.inspect.utils.FileUtil
;
import
com.zjty.inspect.utils.FreemarkerUtils
;
import
com.zjty.inspect.utils.RandomUtil
;
import
com.zjty.inspect.utils.RandomUtil
;
import
com.zjty.inspect.utils.TimeUtil
;
import
freemarker.cache.StringTemplateLoader
;
import
freemarker.cache.StringTemplateLoader
;
import
freemarker.template.Configuration
;
import
freemarker.template.Configuration
;
import
freemarker.template.Template
;
import
freemarker.template.Template
;
import
freemarker.template.TemplateException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.ui.freemarker.FreeMarkerTemplateUtils
;
import
org.springframework.ui.freemarker.FreeMarkerTemplateUtils
;
import
java.io.File
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -33,6 +38,8 @@ public class InspectServiceImpl implements InspectService {
...
@@ -33,6 +38,8 @@ public class InspectServiceImpl implements InspectService {
@Autowired
@Autowired
private
ReportDao
reportDao
;
private
ReportDao
reportDao
;
@Autowired
private
TechnologyService
technologyService
;
@Autowired
@Autowired
private
ParameterService
parameterService
;
private
ParameterService
parameterService
;
...
@@ -64,8 +71,44 @@ public class InspectServiceImpl implements InspectService {
...
@@ -64,8 +71,44 @@ public class InspectServiceImpl implements InspectService {
return
reportVoReturn
;
return
reportVoReturn
;
}
}
/**
* 处理数据
* @return
* count 总共的关键技术
* notSupport 不支持的关键技术数量
*/
@Override
public
String
freemakerData
(
ReportVo
inspect
,
int
count
,
int
notSupport
)
{
try
{
Map
map
=
new
HashMap
();
map
.
put
(
"inspect"
,
inspect
);
map
.
put
(
"time"
,
TimeUtil
.
getTime
());
HashMap
<
String
,
List
<
Warn
>>
warnMap
=
inspect
.
getWarnDetails
();
List
<
Technology
>
technologies
=
technologyService
.
findAllTechnology
();
Map
techMap
=
new
HashMap
();
for
(
Technology
technology
:
technologies
)
{
techMap
.
put
(
technology
.
getTechnologyName
(),
technology
.
getSupport
());
}
map
.
put
(
"techMap"
,
techMap
);
map
.
put
(
"count"
,
count
);
map
.
put
(
"notSupport"
,
notSupport
);
map
.
put
(
"warnMap"
,
warnMap
);
map
.
put
(
"technologies"
,
technologies
);
String
template
=
FreemarkerUtils
.
getTemplate
(
"pg.ftl"
,
map
);
String
s
=
generateHtml
(
template
,
map
);
String
filePath
=
FileUtil
.
createFilePath
();
FileUtil
.
write
(
s
,
"/opt/inspect/freemaker/"
+
filePath
+
"/"
+
inspect
.
getProjectName
()+
".html"
);
String
fn
=
"/freemaker/"
+
filePath
+
"/"
+
inspect
.
getProjectName
()+
".html"
;
return
fn
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
//执行静态化
//执行静态化
public
String
generateHtml
(
String
templateContent
,
Map
model
){
public
String
generateHtml
(
String
templateContent
,
Map
model
){
//创建配置对象
//创建配置对象
Configuration
configuration
=
new
Configuration
(
Configuration
.
getVersion
());
Configuration
configuration
=
new
Configuration
(
Configuration
.
getVersion
());
//创建模板加载器
//创建模板加载器
...
@@ -85,4 +128,6 @@ public class InspectServiceImpl implements InspectService {
...
@@ -85,4 +128,6 @@ public class InspectServiceImpl implements InspectService {
return
null
;
return
null
;
}
}
}
}
src/main/java/com/zjty/inspect/service/impl/RuleServiceImpl.java
浏览文件 @
b661068b
...
@@ -105,8 +105,8 @@ public class RuleServiceImpl implements RuleService {
...
@@ -105,8 +105,8 @@ public class RuleServiceImpl implements RuleService {
@Override
@Override
public
Predicate
toPredicate
(
Root
<
Rule
>
root
,
CriteriaQuery
<?>
query
,
CriteriaBuilder
cb
)
{
public
Predicate
toPredicate
(
Root
<
Rule
>
root
,
CriteriaQuery
<?>
query
,
CriteriaBuilder
cb
)
{
List
<
Predicate
>
predicateList
=
new
ArrayList
<
Predicate
>();
List
<
Predicate
>
predicateList
=
new
ArrayList
<
Predicate
>();
if
(
searchMap
.
get
(
"t
arget"
)
!=
null
&&
!
""
.
equals
(
searchMap
.
get
(
"target
"
)))
{
if
(
searchMap
.
get
(
"t
echnologyName"
)
!=
null
&&
!
""
.
equals
(
searchMap
.
get
(
"technologyName
"
)))
{
predicateList
.
add
(
cb
.
like
(
root
.
get
(
"t
arget"
).
as
(
String
.
class
),
"%"
+
(
String
)
searchMap
.
get
(
"target
"
)
+
"%"
));
predicateList
.
add
(
cb
.
like
(
root
.
get
(
"t
echnologyName"
).
as
(
String
.
class
),
"%"
+
(
String
)
searchMap
.
get
(
"technologyName
"
)
+
"%"
));
}
}
return
cb
.
and
(
predicateList
.
toArray
(
new
Predicate
[
predicateList
.
size
()]));
return
cb
.
and
(
predicateList
.
toArray
(
new
Predicate
[
predicateList
.
size
()]));
...
@@ -118,7 +118,7 @@ public class RuleServiceImpl implements RuleService {
...
@@ -118,7 +118,7 @@ public class RuleServiceImpl implements RuleService {
@Override
@Override
public
void
upRule
(
RuleQo
ruleQo
)
{
public
void
upRule
(
RuleQo
ruleQo
)
{
Rule
rule1
=
ruleDao
.
findByTarget
(
ruleQo
.
getId
());
Rule
rule1
=
ruleDao
.
findByTarget
(
ruleQo
.
getId
());
if
(
rule1
=
=
null
)
{
if
(
rule1
!
=
null
)
{
return
;
return
;
}
}
rule1
.
setTarget
(
ruleQo
.
getTarget
());
rule1
.
setTarget
(
ruleQo
.
getTarget
());
...
...
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
浏览文件 @
b661068b
...
@@ -2,10 +2,7 @@ package com.zjty.inspect.utils;
...
@@ -2,10 +2,7 @@ package com.zjty.inspect.utils;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.enums.CompatibleBrowser
;
import
com.zjty.inspect.enums.*
;
import
com.zjty.inspect.enums.DatabaseType
;
import
com.zjty.inspect.enums.Framework
;
import
com.zjty.inspect.enums.MiddlewareEnum
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -48,8 +45,8 @@ public class WorkLoadUtil {
...
@@ -48,8 +45,8 @@ public class WorkLoadUtil {
Browser
browser
=
reform
.
getBrowser
();
Browser
browser
=
reform
.
getBrowser
();
if
(
browser
!=
null
)
{
if
(
browser
!=
null
)
{
//如果原浏览器包含IE,+10
//如果原浏览器包含IE,+10
System
.
out
.
println
(
JSON
.
toJSONString
(
browser
)
);
List
<
CompatibleBrowser
>
compatibleBrowsers
=
browser
.
getCompatibleBrowsers
(
);
if
(
browser
.
getCompatibleBrowsers
()
.
contains
(
CompatibleBrowser
.
IETRIDENT
))
{
if
(
compatibleBrowsers
!=
null
&&
compatibleBrowsers
.
contains
(
CompatibleBrowser
.
IETRIDENT
))
{
score
+=
10
;
score
+=
10
;
logger
.
info
(
"包含IE+10:"
+
score
);
logger
.
info
(
"包含IE+10:"
+
score
);
}
}
...
@@ -101,9 +98,12 @@ public class WorkLoadUtil {
...
@@ -101,9 +98,12 @@ public class WorkLoadUtil {
Middleware
middleware
=
reform
.
getMiddleware
();
Middleware
middleware
=
reform
.
getMiddleware
();
if
(
middleware
!=
null
)
{
if
(
middleware
!=
null
)
{
List
<
MiddlewareEnum
>
middlewareEnums
=
middleware
.
getMiddlewareEnums
();
List
<
MiddlewareEnum
>
middlewareEnums
=
middleware
.
getMiddlewareEnums
();
int
effectMidNum
=
middlewareEnums
.
size
();
int
effectMidNum
=
0
;
if
(
middlewareEnums
.
contains
(
MiddlewareEnum
.
TOMCAT
))
{
if
(
middlewareEnums
!=
null
)
{
effectMidNum
--;
effectMidNum
=
middlewareEnums
.
size
();
if
(
middlewareEnums
.
contains
(
MiddlewareEnum
.
TOMCAT
))
{
effectMidNum
--;
}
}
}
if
(
middleware
.
getOtherMiddleware
()
!=
null
&&
!
middleware
.
getOtherMiddleware
().
trim
().
equals
(
""
))
{
if
(
middleware
.
getOtherMiddleware
()
!=
null
&&
!
middleware
.
getOtherMiddleware
().
trim
().
equals
(
""
))
{
effectMidNum
++;
effectMidNum
++;
...
@@ -138,9 +138,12 @@ public class WorkLoadUtil {
...
@@ -138,9 +138,12 @@ public class WorkLoadUtil {
Database
database
=
reform
.
getDatabase
();
Database
database
=
reform
.
getDatabase
();
if
(
database
!=
null
)
{
if
(
database
!=
null
)
{
List
<
DatabaseType
>
databaseType
=
database
.
getDatabaseType
();
List
<
DatabaseType
>
databaseType
=
database
.
getDatabaseType
();
int
effectDatabaseNum
=
databaseType
.
size
();
int
effectDatabaseNum
=
0
;
if
(
databaseType
.
contains
(
DatabaseType
.
MYSQL
))
{
if
(
databaseType
!=
null
)
{
effectDatabaseNum
--;
effectDatabaseNum
=
databaseType
.
size
();
if
(
databaseType
.
contains
(
DatabaseType
.
MYSQL
))
{
effectDatabaseNum
--;
}
}
}
if
(
database
.
getOtherType
()
!=
null
&&
!
database
.
getOtherType
().
trim
().
equals
(
""
))
{
if
(
database
.
getOtherType
()
!=
null
&&
!
database
.
getOtherType
().
trim
().
equals
(
""
))
{
effectDatabaseNum
++;
effectDatabaseNum
++;
...
@@ -223,7 +226,7 @@ public class WorkLoadUtil {
...
@@ -223,7 +226,7 @@ public class WorkLoadUtil {
//f:工作量(马)
//f:工作量(马)
//r:人工费
//r:人工费
public
AssessmentReport
result
(
Reform
reform
,
AssessmentReport
report
,
double
f
,
double
r
){
public
void
result
(
Reform
reform
,
AssessmentReport
report
,
double
f
,
double
r
){
logger
.
info
(
"计算工作量,输入:"
+
JSON
.
toJSONString
(
report
));
logger
.
info
(
"计算工作量,输入:"
+
JSON
.
toJSONString
(
report
));
//总计J = F(马) * 人工费
//总计J = F(马) * 人工费
...
@@ -318,7 +321,7 @@ public class WorkLoadUtil {
...
@@ -318,7 +321,7 @@ public class WorkLoadUtil {
eDatabase
*=
(
1
+(
databaseDifficulty
.
getSafe
()==
1
?
1
:
0
)/
100
)*
eDatabase
*=
(
1
+(
databaseDifficulty
.
getSafe
()==
1
?
1
:
0
)/
100
)*
(
1
+(
databaseDifficulty
.
getSeparate
()==
1
?
1
:
0
)/
100
)*
(
1
+(
databaseDifficulty
.
getSeparate
()==
1
?
1
:
0
)/
100
)*
(
1
+(
databaseDifficulty
.
getPerformance
()==
1
?
1
:
0
)/
100
)*
(
1
+(
databaseDifficulty
.
getPerformance
()==
1
?
1
:
0
)/
100
)*
(
1
+(
databaseDifficulty
.
getOtherContent
()
!=
null
?
1
:
0
)/
100
);
(
1
+(
databaseDifficulty
.
getOtherContent
()
==
1
?
1
:
0
)/
100
);
logger
.
info
(
"数据库难度:"
+
eDatabase
);
logger
.
info
(
"数据库难度:"
+
eDatabase
);
databaseDifficulty
.
setDifficulty
(
eDatabase
);
databaseDifficulty
.
setDifficulty
(
eDatabase
);
//工作量2*j*(z-1)
//工作量2*j*(z-1)
...
@@ -367,12 +370,43 @@ public class WorkLoadUtil {
...
@@ -367,12 +370,43 @@ public class WorkLoadUtil {
report
.
getWorkload
().
getDeploy
().
setDevelopmentVolume
(
deploymentWorkload
);
report
.
getWorkload
().
getDeploy
().
setDevelopmentVolume
(
deploymentWorkload
);
report
.
getWorkload
().
getDeploy
().
setCorrectionFactor
(
deploymentCorrectionFactor
);
report
.
getWorkload
().
getDeploy
().
setCorrectionFactor
(
deploymentCorrectionFactor
);
report
.
getWorkload
().
getTotal
().
setDevelopmentVolume
(
totalWorkload
);
report
.
getWorkload
().
getTotal
().
setDevelopmentVolume
(
totalWorkload
);
return
report
;
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
WorkLoadUtil
workLoadUtil
=
new
WorkLoadUtil
();
WorkLoadUtil
workLoadUtil
=
new
WorkLoadUtil
();
workLoadUtil
.
result
(
new
Reform
(),
new
AssessmentReport
(),
1
,
1
);
String
reform
=
"{\n"
+
"\t\"mode\":1,\n"
+
"\t\"reformUrl\":\"www\",\n"
+
"\t\"adaptationUrl\":\"\",\n"
+
"\t\"projectName\":\"\",\n"
+
"\t\"uploadType\":\"\",\n"
+
"\t\"codeUrl\":\"\",\n"
+
"\t\"moduleNum\":\"\",\n"
+
"\t\"language\":\"\",\n"
+
"\t\"cost\":2.3,\n"
+
"\t\"cycle\":1,\n"
+
"\t\"serverNum\":1,\n"
+
"\t\"applicationType\":\"OA\",\n"
+
"\t\"address\":1,\n"
+
"\t\"secret\":1,\n"
+
"\t\"message\":\"\",\n"
+
"\t\"systemStructure\":{\n"
+
"\t\t\"distributed\":1,\n"
+
"\t\t\"loadBanlance\":1,\n"
+
"\t\t\"disaster\":1\n"
+
"\t},\n"
+
"\t\"browser\":{\n"
+
// "\t\t\"compatibleBrowsers\":\"IETRIDENT\",\n" +
// "\t\t\"peripheral\":1\n" +
"\t},\n"
+
"\t\"middleware\":{\n"
+
"\t\t\"web\":1\n"
+
"\t},\n"
+
"\t\"database\":{\n"
+
"\t\t\"otherType\":\"aaa\"\n"
+
"\t},\n"
+
"\t\"strategy\":1\n"
+
"}"
;
workLoadUtil
.
result
(
JSON
.
parseObject
(
reform
,
Reform
.
class
),
new
AssessmentReport
(),
1
,
1
);
}
}
}
}
src/main/resources/templates/pg.ftl
浏览文件 @
b661068b
...
@@ -224,8 +224,8 @@
...
@@ -224,8 +224,8 @@
<div
class=
"line"
></div>
<div
class=
"line"
></div>
<div
class=
"onAnaly"
id=
"thirdClick"
>
<div
class=
"onAnaly"
id=
"thirdClick"
>
<div
class=
"onAonAnalysis"
>
关键技术总共:
<span>
1000
</span></div>
<div
class=
"onAonAnalysis"
>
关键技术总共:
<span>
${count?default("0")}
</span></div>
<div
class=
"onAonAnalysis"
>
需要改造的关键技术:
<span>
1000
</span></div>
<div
class=
"onAonAnalysis"
>
需要改造的关键技术:
<span>
${notSupport?default("0")}
</span></div>
<div
class=
"onAonAnalysis"
>
泰源系统安可改造评估引擎:
<span>
版本号:10.6.9
</span></div>
<div
class=
"onAonAnalysis"
>
泰源系统安可改造评估引擎:
<span>
版本号:10.6.9
</span></div>
</div>
</div>
</div>
</div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论