Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
876b55e4
提交
876b55e4
authored
3月 07, 2020
作者:
马晨俊
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git.yfzx.zjtys.com.cn:912-system/monitor/inspect
上级
4acf2aac
2e1f7b9f
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
363 行增加
和
44 行删除
+363
-44
EvaluationController.java
...ava/com/zjty/inspect/controller/EvaluationController.java
+79
-0
InspectController.java
...n/java/com/zjty/inspect/controller/InspectController.java
+18
-4
EvaluationDao.java
src/main/java/com/zjty/inspect/dao/EvaluationDao.java
+10
-0
BrowserDifficulty.java
src/main/java/com/zjty/inspect/entity/BrowserDifficulty.java
+5
-0
DatabaseDifficulty.java
...main/java/com/zjty/inspect/entity/DatabaseDifficulty.java
+5
-0
Evaluation.java
src/main/java/com/zjty/inspect/entity/Evaluation.java
+45
-0
FrameDifficulty.java
src/main/java/com/zjty/inspect/entity/FrameDifficulty.java
+5
-0
MiddlewareDifficulty.java
...in/java/com/zjty/inspect/entity/MiddlewareDifficulty.java
+5
-0
ProgramDifficulty.java
src/main/java/com/zjty/inspect/entity/ProgramDifficulty.java
+5
-0
Reform.java
src/main/java/com/zjty/inspect/entity/Reform.java
+1
-1
EvaluationService.java
...main/java/com/zjty/inspect/service/EvaluationService.java
+16
-0
CategoryServiceImpl.java
...va/com/zjty/inspect/service/impl/CategoryServiceImpl.java
+2
-0
ConfigServiceImpl.java
...java/com/zjty/inspect/service/impl/ConfigServiceImpl.java
+2
-0
EvaluationServiceImpl.java
.../com/zjty/inspect/service/impl/EvaluationServiceImpl.java
+92
-0
WorkLoadUtil.java
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
+72
-38
application.properties
src/main/resources/application.properties
+1
-1
没有找到文件。
src/main/java/com/zjty/inspect/controller/EvaluationController.java
0 → 100644
浏览文件 @
876b55e4
package
com
.
zjty
.
inspect
.
controller
;
import
com.zjty.inspect.entity.Evaluation
;
import
com.zjty.inspect.entity.PageResult
;
import
com.zjty.inspect.entity.RuleQo
;
import
com.zjty.inspect.service.EvaluationService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Map
;
@RestController
@RequestMapping
(
"/evaluation"
)
@Api
(
value
=
"评估报告管理接口"
,
description
=
"评估报告管理接口,提供页面的增、删、改、查"
)
public
class
EvaluationController
{
@Autowired
private
EvaluationService
evaluationService
;
/**
* 新增评估报告
* @param evaluation 评估报告
* @return
*/
@PostMapping
@ApiOperation
(
"新增评估报告"
)
public
ResponseEntity
rule
(
@RequestBody
Evaluation
evaluation
){
evaluationService
.
save
(
evaluation
);
return
ResponseEntity
.
ok
(
200
);
}
/**
* 修改评估报告
* @param evaluation 规则封装
* @param id id
* @return
*/
@PostMapping
(
value
=
"/{id}"
)
@ApiOperation
(
"修改评估报告"
)
public
ResponseEntity
update
(
@RequestBody
Evaluation
evaluation
,
@PathVariable
String
id
){
evaluation
.
setId
(
id
);
evaluationService
.
update
(
evaluation
);
return
ResponseEntity
.
ok
(
200
);
}
/**
* 根据id删除评估报告
* @param id id
* @return
*/
@ApiOperation
(
"根据id删除评估报告"
)
@DeleteMapping
(
value
=
"/{id}"
)
public
ResponseEntity
deleteById
(
@PathVariable
String
id
){
evaluationService
.
delete
(
id
);
return
ResponseEntity
.
ok
(
200
);
}
/**
* 分页+多条件查询
* @param searchMap 查询条件封装
* @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"
)
})
@RequestMapping
(
value
=
"/search/{page}/{size}"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
findSearch
(
@RequestBody
Map
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
())
);
}
}
src/main/java/com/zjty/inspect/controller/InspectController.java
浏览文件 @
876b55e4
...
...
@@ -3,10 +3,7 @@ package com.zjty.inspect.controller;
import
com.alibaba.fastjson.JSON
;
import
com.zjty.inspect.dao.TechnologyDao
;
import
com.zjty.inspect.entity.*
;
import
com.zjty.inspect.service.InspectService
;
import
com.zjty.inspect.service.ParameterService
;
import
com.zjty.inspect.service.ReportService
;
import
com.zjty.inspect.service.TechnologyService
;
import
com.zjty.inspect.service.*
;
import
com.zjty.inspect.utils.*
;
import
freemarker.template.TemplateException
;
import
io.swagger.annotations.Api
;
...
...
@@ -16,8 +13,11 @@ import org.apache.commons.io.FileUtils;
import
org.apache.tomcat.util.http.fileupload.disk.DiskFileItem
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.Resource
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
...
...
@@ -37,6 +37,8 @@ import java.util.*;
public
class
InspectController
{
@Autowired
private
InspectService
inspectService
;
@Autowired
private
EvaluationService
evaluationService
;
@Autowired
private
TechnologyService
technologyService
;
...
...
@@ -230,6 +232,7 @@ public class InspectController {
List
<
TechnologyContent
>
technologyContents
=
new
ArrayList
<>();
for
(
Warn
warn:
warns
)
{
TechnologyContent
technologyContent
=
new
TechnologyContent
();
//technologyContent.setLocal(warn.get);
technologyContent
.
setFile
(
warn
.
getFilePath
());
technologyContent
.
setKeyWord
(
warn
.
getRule
());
technologyContent
.
setPosition
(
warn
.
getLineNum
().
toString
());
...
...
@@ -334,11 +337,22 @@ public class InspectController {
assessmentReport
.
setDifficultyAssessment
(
difficultyAssessment
);
WorkLoadUtil
workLoadUtil
=
new
WorkLoadUtil
();
//r:人工费
RestTemplate
restTemplate
=
new
RestTemplate
();
//restTemplate.exchange("localhost:8079/config", HttpMethod.GET,new HttpEntity<>())
//计算f
Budget
budget
=
inspect
.
getBudgets
().
getBudget
().
get
(
0
);
double
f
=
budget
.
getProportion
()*
budget
.
getSysFund
()*
budget
.
getMoneyRate
()*
budget
.
getCoefficient
();
System
.
out
.
println
(
"F:"
+
f
);
workLoadUtil
.
result
(
reform
,
assessmentReport
,
f
,
120
);
Evaluation
evaluation
=
new
Evaluation
();
//输入参数
String
in
=
JSON
.
toJSONString
(
reform
);
//输出参数
String
out
=
JSON
.
toJSONString
(
assessmentReport
);
evaluation
.
setInEva
(
in
);
evaluation
.
setOutEva
(
out
);
evaluation
.
setUsername
(
reform
.
getUsername
());
evaluationService
.
save
(
evaluation
);
return
ResponseEntity
.
ok
(
assessmentReport
);
}
...
...
src/main/java/com/zjty/inspect/dao/EvaluationDao.java
0 → 100644
浏览文件 @
876b55e4
package
com
.
zjty
.
inspect
.
dao
;
import
com.zjty.inspect.entity.Evaluation
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
public
interface
EvaluationDao
extends
JpaRepository
<
Evaluation
,
String
>,
JpaSpecificationExecutor
<
Evaluation
>
{
Evaluation
findByUsernameAndIdNot
(
String
username
,
String
id
);
}
src/main/java/com/zjty/inspect/entity/BrowserDifficulty.java
浏览文件 @
876b55e4
...
...
@@ -29,6 +29,11 @@ public class BrowserDifficulty {
*/
private
double
difficulty
=
1.1
;
/**
* 工作量
*/
private
double
load
=
0.0
;
/**
* 样式
*/
...
...
src/main/java/com/zjty/inspect/entity/DatabaseDifficulty.java
浏览文件 @
876b55e4
...
...
@@ -32,6 +32,11 @@ public class DatabaseDifficulty {
*/
private
double
difficulty
=
1.1
;
/**
* 工作量
*/
private
double
load
=
0.0
;
/**
* 依赖
*/
...
...
src/main/java/com/zjty/inspect/entity/Evaluation.java
0 → 100644
浏览文件 @
876b55e4
package
com
.
zjty
.
inspect
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.annotations.Generated
;
import
org.hibernate.annotations.GenerationTime
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
java.sql.Timestamp
;
import
java.util.Date
;
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Data
@ApiModel
(
description
=
"评估报告管理类"
)
public
class
Evaluation
{
@Id
@Column
(
length
=
48
)
private
String
id
;
private
String
username
;
@Column
(
columnDefinition
=
"TEXT"
)
private
String
inEva
;
@Column
(
columnDefinition
=
"TEXT"
)
private
String
outEva
;
/**
* 数据创建时间
*/
@Column
(
name
=
"create_time"
,
columnDefinition
=
"TIMESTAMP DEFAULT CURRENT_TIMESTAMP"
,
insertable
=
false
,
updatable
=
false
)
@CreatedDate
private
Date
createDate
;
/**
* 数据更新时间
*/
@Column
(
name
=
"update_time"
,
columnDefinition
=
"TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
,
insertable
=
false
)
@LastModifiedDate
private
Date
updateDate
;
}
src/main/java/com/zjty/inspect/entity/FrameDifficulty.java
浏览文件 @
876b55e4
...
...
@@ -30,6 +30,11 @@ public class FrameDifficulty {
*/
private
double
difficulty
=
1.1
;
/**
* 工作量
*/
private
double
load
=
0.0
;
/**
* 详情 1:混合 2:前后端分离
*/
...
...
src/main/java/com/zjty/inspect/entity/MiddlewareDifficulty.java
浏览文件 @
876b55e4
...
...
@@ -32,6 +32,11 @@ public class MiddlewareDifficulty {
*/
private
double
difficulty
=
1.1
;
/**
* 工作量
*/
private
double
load
=
0.0
;
/**
* 依赖详情
*/
...
...
src/main/java/com/zjty/inspect/entity/ProgramDifficulty.java
浏览文件 @
876b55e4
...
...
@@ -32,6 +32,11 @@ public class ProgramDifficulty {
*/
private
double
difficulty
=
1.1
;
/**
* 工作量
*/
private
double
load
=
0.0
;
/**
* 依赖详情
*/
...
...
src/main/java/com/zjty/inspect/entity/Reform.java
浏览文件 @
876b55e4
...
...
@@ -144,7 +144,7 @@ public class Reform {
private
Database
database
;
/**
* 迁移策略 1:休息日 2:晚间切换
* 迁移策略 1:休息日 2:晚间切换
3:短暂停止
*/
private
Integer
strategy
;
/**
...
...
src/main/java/com/zjty/inspect/service/EvaluationService.java
0 → 100644
浏览文件 @
876b55e4
package
com
.
zjty
.
inspect
.
service
;
import
com.zjty.inspect.entity.Evaluation
;
import
com.zjty.inspect.entity.Rule
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
import
java.util.Map
;
public
interface
EvaluationService
{
void
save
(
Evaluation
evaluation
);
void
update
(
Evaluation
evaluation
);
void
delete
(
String
id
);
Page
<
Evaluation
>
findSearch
(
Map
searchMap
,
int
page
,
int
size
);
}
src/main/java/com/zjty/inspect/service/impl/CategoryServiceImpl.java
浏览文件 @
876b55e4
...
...
@@ -5,9 +5,11 @@ 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
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
CategoryServiceImpl
implements
CategoryService
{
@Autowired
private
CategoryDao
categoryDao
;
...
...
src/main/java/com/zjty/inspect/service/impl/ConfigServiceImpl.java
浏览文件 @
876b55e4
...
...
@@ -5,12 +5,14 @@ import com.zjty.inspect.entity.Config;
import
com.zjty.inspect.service.ConfigService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
ConfigServiceImpl
implements
ConfigService
{
@Autowired
...
...
src/main/java/com/zjty/inspect/service/impl/EvaluationServiceImpl.java
0 → 100644
浏览文件 @
876b55e4
package
com
.
zjty
.
inspect
.
service
.
impl
;
import
com.zjty.inspect.dao.EvaluationDao
;
import
com.zjty.inspect.entity.Evaluation
;
import
com.zjty.inspect.entity.Rule
;
import
com.zjty.inspect.service.EvaluationService
;
import
com.zjty.inspect.utils.TimeUtil
;
import
com.zjty.inspect.utils.UUIDUtil
;
import
io.netty.util.internal.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
EvaluationServiceImpl
implements
EvaluationService
{
@Autowired
private
EvaluationDao
evaluationDao
;
@Override
public
void
save
(
Evaluation
evaluation
)
{
String
uuid
=
UUIDUtil
.
getUUID
();
evaluation
.
setId
(
uuid
);
Evaluation
evaluation1
=
evaluationDao
.
findByUsernameAndIdNot
(
evaluation
.
getUsername
(),
evaluation
.
getId
());
if
(
evaluation1
!=
null
){
return
;
}
evaluationDao
.
save
(
evaluation
);
}
@Override
public
void
update
(
Evaluation
evaluation
)
{
Evaluation
evaluation1
=
evaluationDao
.
findByUsernameAndIdNot
(
evaluation
.
getUsername
(),
evaluation
.
getId
());
if
(
evaluation1
!=
null
){
return
;
}
if
(
StringUtil
.
isNullOrEmpty
(
evaluation
.
getInEva
()))
{
return
;
}
if
(
StringUtil
.
isNullOrEmpty
(
evaluation
.
getOutEva
()))
{
return
;
}
evaluationDao
.
save
(
evaluation
);
}
@Override
public
void
delete
(
String
id
)
{
evaluationDao
.
deleteById
(
id
);
}
@Override
public
Page
<
Evaluation
>
findSearch
(
Map
searchMap
,
int
page
,
int
size
)
{
Specification
<
Evaluation
>
specification
=
createSpecification
(
searchMap
);
PageRequest
pageRequest
=
PageRequest
.
of
(
page
-
1
,
size
);
return
evaluationDao
.
findAll
(
specification
,
pageRequest
);
}
/**
* 动态条件构建
*
* @param searchMap
* @return
*/
private
Specification
<
Evaluation
>
createSpecification
(
Map
searchMap
)
{
return
new
Specification
<
Evaluation
>()
{
@Override
public
Predicate
toPredicate
(
Root
<
Evaluation
>
root
,
CriteriaQuery
<?>
query
,
CriteriaBuilder
cb
)
{
List
<
Predicate
>
predicateList
=
new
ArrayList
<
Predicate
>();
if
(
searchMap
.
get
(
"username"
)
!=
null
&&
!
""
.
equals
(
searchMap
.
get
(
"username"
)))
{
predicateList
.
add
(
cb
.
like
(
root
.
get
(
"username"
).
as
(
String
.
class
),
"%"
+
(
String
)
searchMap
.
get
(
"username"
)
+
"%"
));
}
return
cb
.
and
(
predicateList
.
toArray
(
new
Predicate
[
predicateList
.
size
()]));
}
};
}
}
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
浏览文件 @
876b55e4
...
...
@@ -228,11 +228,23 @@ public class WorkLoadUtil {
//f:工作量(马)
//r:人工费
public
void
result
(
Reform
reform
,
AssessmentReport
report
,
double
f
,
double
r
){
double
calculate
=
0
;
//calculate(reform);
switch
(
reform
.
getStrategy
()){
case
1
:
calculate
=
0
;
break
;
case
2
:
//平滑过渡
calculate
=
50
;
break
;
case
3
:
//短暂停止
calculate
=
20
;
break
;
}
logger
.
info
(
"计算工作量,输入:"
+
JSON
.
toJSONString
(
report
));
//总计J = F(马) * 人工费
double
j
=
f
/
r
;
logger
.
info
(
"总计J:"
+
j
);
logger
.
info
(
"
f:"
+
f
+
"r:"
+
r
+
"
总计J:"
+
j
);
/*
计算以下三项,拼接字符串,完成关键技术及替换策略建议:
*/
...
...
@@ -242,6 +254,7 @@ public class WorkLoadUtil {
String
string
=
"本系统通过源代码评估适配关键技术"
+
report
.
getTechnologyList
().
getTechnologyReports
().
size
()+
"项,"
+
"其中本地程序开发修改项"
+
report
.
getDifficultyAssessment
().
getProgramDifficulty
().
getDependOnNum
().
size
()+
"项,"
+
"中间件依赖修改项"
+
report
.
getDifficultyAssessment
().
getMiddlewareDifficulty
().
getDependOnNum
().
size
()+
"个...."
;
report
.
getWorkload
().
setDes
(
string
);
/*
先计算难度,再算基础工作量
*/
...
...
@@ -255,12 +268,13 @@ public class WorkLoadUtil {
logger
.
info
(
"系统部署架构难度-用户额外:"
+
eFramework
);
frameDifficulty
.
setMessage
(
eFramework
);
//系统部署架构综合难度 p*e
double
multipleFramework
=
pFramework
*
eFramework
;
logger
.
info
(
"系统部署架构难度-综合:"
+
multipleFramework
);
double
multipleFramework
=
/*Math.sqrt(*/
pFramework
*
eFramework
/*)*/
;
logger
.
info
(
"系统部署架构难度-综合
(两个难度相乘)
:"
+
multipleFramework
);
frameDifficulty
.
setDifficulty
(
multipleFramework
);
//工作量2*j*(z-1)
double
frameworkWorkload
=
2
*
j
*(
multipleFramework
-
1
);
logger
.
info
(
"系统部署工作量:"
+
frameworkWorkload
);
logger
.
info
(
"系统部署工作量:2*j"
+
j
+
"*(综合难度-1):"
+
frameworkWorkload
);
frameDifficulty
.
setLoad
(
frameworkWorkload
);
BrowserDifficulty
browserDifficulty
=
report
.
getDifficultyAssessment
().
getBrowserDifficulty
();
//浏览器难度P(0.001*样式数量+0.01*API数量+0.01*插件数量+1) max=1.3
...
...
@@ -269,39 +283,40 @@ public class WorkLoadUtil {
logger
.
info
(
"浏览器难度-评估:"
+
pBrowser
);
browserDifficulty
.
setSystemEvaluation
(
pBrowser
);
//浏览器难度e(1+需求分数/100)*(1+需求分数/100) max=1.3
double
eBrowser
=
(
1
+(
browserDifficulty
.
getGeography
()!=
null
&&
browserDifficulty
.
getGeography
()==
1
?
1
:
0
)/
100
)*
(
1
+(
browserDifficulty
.
getPeripheral
()!=
null
&&
browserDifficulty
.
getPeripheral
()==
1
?
1
:
0
)/
100
)*
(
1
+(
browserDifficulty
.
getAnimation
()!=
null
&&
browserDifficulty
.
getAnimation
()==
1
?
1
:
0
)/
100
)*
(
1
+(
browserDifficulty
.
getThreeD
()!=
null
&&
browserDifficulty
.
getThreeD
()==
1
?
1
:
0
)/
100
)*
(
1
+(
browserDifficulty
.
getDocument
()!=
null
&&
browserDifficulty
.
getDocument
()==
1
?
1
:
0
)/
100
)*
(
1
+(
browserDifficulty
.
getMedia
()!=
null
&&
browserDifficulty
.
getMedia
()==
1
?
1
:
0
)/
100
)*
(
1
+(
browserDifficulty
.
getFlash
()!=
null
&&
browserDifficulty
.
getFlash
()==
1
?
1
:
0
)/
100
)*
(
1
+(
browserDifficulty
.
getOtherDemand
()!=
null
&&
browserDifficulty
.
getOtherDemand
()==
1
?
1
:
0
)/
100
);
double
eBrowser
=
(
1
.0
+(
browserDifficulty
.
getGeography
()!=
null
&&
browserDifficulty
.
getGeography
()==
1.0
?
1
:
0
)/
100
)*
(
1
.0
+(
browserDifficulty
.
getPeripheral
()!=
null
&&
browserDifficulty
.
getPeripheral
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
browserDifficulty
.
getAnimation
()!=
null
&&
browserDifficulty
.
getAnimation
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
browserDifficulty
.
getThreeD
()!=
null
&&
browserDifficulty
.
getThreeD
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
browserDifficulty
.
getDocument
()!=
null
&&
browserDifficulty
.
getDocument
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
browserDifficulty
.
getMedia
()!=
null
&&
browserDifficulty
.
getMedia
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
browserDifficulty
.
getFlash
()!=
null
&&
browserDifficulty
.
getFlash
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
browserDifficulty
.
getOtherDemand
()!=
null
&&
browserDifficulty
.
getOtherDemand
()==
1
?
1.0
:
0
)/
100
);
eBrowser
=
eBrowser
>
1.3
?
1.3
:
eBrowser
;
logger
.
info
(
"浏览器难度-用户额外:"
+
eBrowser
);
browserDifficulty
.
setMessage
(
eBrowser
);
//浏览器综合难度 p*e开根号
double
multipleBrowser
=
Math
.
sqrt
(
pBrowser
*
eBrowser
);
logger
.
info
(
"浏览器难度-综合:"
+
multipleBrowser
);
logger
.
info
(
"浏览器难度-综合
(两个难度相乘开根号)
:"
+
multipleBrowser
);
browserDifficulty
.
setDifficulty
(
multipleBrowser
);
//工作量2*j*(z-1)
double
browserWorkload
=
2
*
j
*(
1
-
multipleBrowser
);
logger
.
info
(
"系统部署工作量:"
+
browserWorkload
);
double
browserWorkload
=
2
*
j
*(
multipleBrowser
-
1
);
logger
.
info
(
"浏览器工作量:2*j"
+
j
+
"*(综合难度-1):"
+
browserWorkload
);
browserDifficulty
.
setLoad
(
browserWorkload
);
MiddlewareDifficulty
middlewareDifficulty
=
report
.
getDifficultyAssessment
().
getMiddlewareDifficulty
();
//中间件系统评估P (1+0.001*依赖数量)*(1+0.001*依赖数量)
double
pMiddle
=
1
;
for
(
DependOnNum
dependOnNum:
middlewareDifficulty
.
getDependOnNum
()){
pMiddle
*=(
1
+
0.001
*
dependOnNum
.
getNum
());
pMiddle
*=(
1
.0
+
0.001
*
dependOnNum
.
getNum
());
}
pMiddle
=
pMiddle
>
1.3
?
1.3
:
pMiddle
;
logger
.
info
(
"中间件难度-评估:"
+
pMiddle
);
middlewareDifficulty
.
setSystemEvaluation
(
pMiddle
);
//中间件系统评估e (1+需求分数/100)*(1+需求分数/100) max=1.3
double
emiddle
=
(
1
+(
middlewareDifficulty
.
getWeb
()==
1
?
1
:
0
)/
100
)*
(
1
+(
middlewareDifficulty
.
getJms
()==
1
?
1
:
0
)/
100
)*
(
1
+(
middlewareDifficulty
.
getJndi
()==
1
?
1
:
0
)/
100
)*
(
1
+(
middlewareDifficulty
.
getRoute
()==
1
?
1
:
0
)/
100
);
double
emiddle
=
(
1
.0
+(
middlewareDifficulty
.
getWeb
()==
1.0
?
1
:
0
)/
100
)*
(
1
.0
+(
middlewareDifficulty
.
getJms
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
middlewareDifficulty
.
getJndi
()==
1
?
1.0
:
0
)/
100
)*
(
1
.0
+(
middlewareDifficulty
.
getRoute
()==
1
?
1.0
:
0
)/
100
);
emiddle
=
emiddle
>
1.3
?
1.3
:
emiddle
;
logger
.
info
(
"中间件难度-用户额外:"
+
emiddle
);
middlewareDifficulty
.
setMessage
(
emiddle
);
...
...
@@ -311,23 +326,22 @@ public class WorkLoadUtil {
middlewareDifficulty
.
setDifficulty
(
multipleMiddle
);
//工作量2*j*(z-1)
double
middleWorkload
=
2
*
j
*(
multipleMiddle
-
1
);
logger
.
info
(
"中间件工作量:"
+
middleWorkload
);
logger
.
info
(
"中间件工作量:2*j"
+
j
+
"*(综合难度-1):"
+
middleWorkload
);
middlewareDifficulty
.
setLoad
(
middleWorkload
);
DatabaseDifficulty
databaseDifficulty
=
report
.
getDifficultyAssessment
().
getDatabaseDifficulty
();
//数据库e (1+需求/100)*...*(1+需求/100)
double
eDatabase
=
1
;
for
(
DependOnNum
dependOnNum:
databaseDifficulty
.
getDependOnNum
()){
eDatabase
*=
(
1
+
1
/
100
);
}
eDatabase
*=
(
1
+(
databaseDifficulty
.
getSafe
()==
1
?
1
:
0
)/
100
)*
(
1
+(
databaseDifficulty
.
getSeparate
()==
1
?
1
:
0
)/
100
)*
(
1
+(
databaseDifficulty
.
getPerformance
()==
1
?
1
:
0
)/
100
)*
(
1
+(
Objects
.
equals
(
databaseDifficulty
.
getOtherContent
(),
""
)
?
1
:
0
)/
100
);
eDatabase
*=
(
1.0
+(
databaseDifficulty
.
getSafe
()==
1
?
1.0
:
0
)/
100
)*
(
1.0
+(
databaseDifficulty
.
getSeparate
()==
1
?
1.0
:
0
)/
100
)*
(
1.0
+(
databaseDifficulty
.
getPerformance
()==
1
?
1.0
:
0
)/
100
)*
(
1.0
+((
databaseDifficulty
.
getOtherContent
()!=
null
&&!
databaseDifficulty
.
getOtherContent
().
trim
().
equals
(
""
))
?
1.0
:
0
)/
100
);
logger
.
info
(
"数据库难度:"
+
eDatabase
);
databaseDifficulty
.
setDifficulty
(
eDatabase
);
//工作量2*j*(z-1)
double
databaseWorkload
=
2
*
j
*(
eDatabase
-
1
);
logger
.
info
(
"系统部署工作量:"
+
databaseWorkload
);
logger
.
info
(
"数据库工作量2*j"
+
j
+
"*(综合难度-1):"
+
databaseWorkload
);
databaseDifficulty
.
setLoad
(
databaseWorkload
);
//本地程序e (1+0.2)数量次幂 max=1.5
ProgramDifficulty
programDifficulty
=
report
.
getDifficultyAssessment
().
getProgramDifficulty
();
...
...
@@ -337,40 +351,60 @@ public class WorkLoadUtil {
programDifficulty
.
setDifficulty
(
eProgram
);
//工作量2*j*(z-1)
double
programWorkload
=
2
*
j
*(
eProgram
-
1
);
logger
.
info
(
"系统部署工作量:"
+
programWorkload
);
logger
.
info
(
"本地程序工作量2*j"
+
j
+
"*(综合难度-1):"
+
programWorkload
);
programDifficulty
.
setLoad
(
programWorkload
);
//综合难度未知***************************
double
multipleHardrage
=
0.0
;
report
.
getDifficultyAssessment
().
setDes
(
"本系统通过源代码评估,及用户额外信息提供,认为综合难度系数:"
+
multipleHardrage
);
/*
基础工作量评估
*/
//开发修正系数 (本地难度系数-1)+(浏览器难度系数-1)
double
developmentCorrectionFactor
=
eProgram
-
1
+
multipleBrowser
-
1
;
logger
.
info
(
"开发修正系数 (本地难度系数-1)+(浏览器难度系数-1):"
+
developmentCorrectionFactor
);
report
.
getWorkload
().
getDevelopment
().
setCorrectionFactor
(
developmentCorrectionFactor
);
//测试修正系数 (系统部署难度-1)+(浏览器-1)
double
testCorrectionFactor
=
multipleFramework
-
1
+
multipleBrowser
-
1
;
logger
.
info
(
"测试修正系数 (系统部署难度-1)+(浏览器-1):"
+
testCorrectionFactor
);
report
.
getWorkload
().
getTest
().
setCorrectionFactor
(
testCorrectionFactor
);
//部署修正系数 (迁移)/100+(系统部署-1)+中间件部署-1+数据库部署-1
double
deploymentCorrectionFactor
=
calculate
(
reform
)
/
100
+
multipleFramework
-
1
+
multipleMiddle
-
1
+
eDatabase
-
1
;
double
deploymentCorrectionFactor
=
calculate
/
100
+
multipleFramework
-
1
+
multipleMiddle
-
1
+
eDatabase
-
1
;
logger
.
info
(
"部署修正系数 (迁移)/100+(系统部署-1)+中间件部署-1+数据库部署-1:"
+
deploymentCorrectionFactor
);
report
.
getWorkload
().
getDeploy
().
setCorrectionFactor
(
deploymentCorrectionFactor
);
//开发的开发量 J*(开发修正系数+0.4)
double
developmentWorkload
=
j
*(
developmentCorrectionFactor
+
0.4
);
logger
.
info
(
"开发的开发量 J*(开发修正系数+0.4):"
+
developmentWorkload
);
report
.
getWorkload
().
getDevelopment
().
setDevelopmentVolume
(
developmentWorkload
);
//测试的开发量 J*(测试修正系数+0.3)
double
testWorkload
=
j
*(
testCorrectionFactor
+
0.3
);
logger
.
info
(
"测试的开发量 J*(测试修正系数+0.3):"
+
testWorkload
);
report
.
getWorkload
().
getTest
().
setDevelopmentVolume
(
testWorkload
);
//部署的开发量 J*(部署修正系数+0.3)
double
deploymentWorkload
=
j
*(
deploymentCorrectionFactor
+
0.3
);
logger
.
info
(
"部署的开发量 J*(部署修正系数+0.3):"
+
deploymentWorkload
);
report
.
getWorkload
().
getDeploy
().
setDevelopmentVolume
(
deploymentWorkload
);
//合计的开发量 总数
double
totalWorkload
=
developmentWorkload
+
testWorkload
+
deploymentWorkload
;
logger
.
info
(
"合计的开发量 总数:"
+
totalWorkload
);
report
.
getWorkload
().
getDevelopment
().
setDevelopmentVolume
(
developmentWorkload
);
report
.
getWorkload
().
getDevelopment
().
setCorrectionFactor
(
developmentCorrectionFactor
);
report
.
getWorkload
().
getTest
().
setDevelopmentVolume
(
testWorkload
);
report
.
getWorkload
().
getTest
().
setCorrectionFactor
(
testCorrectionFactor
);
report
.
getWorkload
().
getDeploy
().
setDevelopmentVolume
(
deploymentWorkload
);
report
.
getWorkload
().
getDeploy
().
setCorrectionFactor
(
deploymentCorrectionFactor
);
report
.
getWorkload
().
getTotal
().
setDevelopmentVolume
(
totalWorkload
);
/**
* 人工单价、基础工作量(人月)、难度系数、额外申请(万元)、预算费用 的计算值
*/
report
.
getManufacturingCost
().
getArtificial
().
setCalculation
(
r
);
report
.
getManufacturingCost
().
getArtificial
().
setAdjustment
(
r
);
report
.
getManufacturingCost
().
getWorkLoad
().
setCalculation
(
totalWorkload
);
report
.
getManufacturingCost
().
getWorkLoad
().
setAdjustment
(
totalWorkload
);
report
.
getManufacturingCost
().
getDegreeOfDifficulty
().
setCalculation
(
multipleHardrage
);
report
.
getManufacturingCost
().
getDegreeOfDifficulty
().
setAdjustment
(
multipleHardrage
);
report
.
getManufacturingCost
().
getApply
().
setCalculation
(
reform
.
getApply
().
getCost
());
report
.
getManufacturingCost
().
getApply
().
setAdjustment
(
0
);
report
.
getManufacturingCost
().
getBudgetaryCost
().
setCalculation
(
r
*
totalWorkload
+
reform
.
getApply
().
getCost
());
report
.
getManufacturingCost
().
getBudgetaryCost
().
setAdjustment
(
r
*
totalWorkload
);
logger
.
info
(
"人工费:"
+
r
+
"万元"
);
logger
.
info
(
"额外申请"
+
reform
.
getApply
().
getCost
()+
"万元"
);
logger
.
info
(
"费用总计"
+(
r
*
totalWorkload
+
reform
.
getApply
().
getCost
()));
}
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/resources/application.properties
浏览文件 @
876b55e4
...
...
@@ -50,7 +50,7 @@ spring.resources.static-locations=classpath:/uploads/
# mysql\u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://192.168.1.249:3306/bservice?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.url
=
jdbc:mysql://
localhost
:3306/adaptation?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.url
=
jdbc:mysql://
120.55.57.35
:3306/adaptation?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.username
=
root
spring.datasource.password
=
root
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论