Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
2388cbba
提交
2388cbba
authored
3月 07, 2020
作者:
wyl
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'wyl' 到 'master'
Wyl 查看合并请求
!7
上级
0c71aeba
98aed038
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
100 行增加
和
40 行删除
+100
-40
InspectController.java
...n/java/com/zjty/inspect/controller/InspectController.java
+1
-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
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
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/InspectController.java
浏览文件 @
2388cbba
...
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.core.io.Resource
;
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
;
...
...
src/main/java/com/zjty/inspect/entity/BrowserDifficulty.java
浏览文件 @
2388cbba
...
...
@@ -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
浏览文件 @
2388cbba
...
...
@@ -32,6 +32,11 @@ public class DatabaseDifficulty {
*/
private
double
difficulty
=
1.1
;
/**
* 工作量
*/
private
double
load
=
0.0
;
/**
* 依赖
*/
...
...
src/main/java/com/zjty/inspect/entity/FrameDifficulty.java
浏览文件 @
2388cbba
...
...
@@ -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
浏览文件 @
2388cbba
...
...
@@ -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
浏览文件 @
2388cbba
...
...
@@ -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
浏览文件 @
2388cbba
...
...
@@ -144,7 +144,7 @@ public class Reform {
private
Database
database
;
/**
* 迁移策略 1:休息日 2:晚间切换
* 迁移策略 1:休息日 2:晚间切换
3:短暂停止
*/
private
Integer
strategy
;
/**
...
...
src/main/java/com/zjty/inspect/utils/WorkLoadUtil.java
浏览文件 @
2388cbba
...
...
@@ -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
浏览文件 @
2388cbba
...
...
@@ -52,7 +52,7 @@ 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.username
=
root
spring.datasource.password
=
root
spring.datasource.password
=
123456
maven.home
=
/Users/mcj/apache-maven-3.6.1
maven.command
=
dependency:tree -DoutputType=txt -DoutputFile=
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论