Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangkb
indicators
Commits
1258fea5
Commit
1258fea5
authored
Sep 15, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单位评分规则添加积分总和计算
parent
612570c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+18
-1
No files found.
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
View file @
1258fea5
...
...
@@ -213,6 +213,8 @@ public class ScoreRuleService {
objResult
.
setImproveValue
(
"0.0"
);
objResult
.
setDate
(
date
);
double
scoreSumValue
=
0.0
;
String
calFormula
=
scoreRule
.
getCalFormula
();
//计算综合评分分数
String
improveCalFormula
=
scoreRule
.
getCalFormula
();
//计算改善提升分数
if
(
StringUtils
.
isNotBlank
(
calFormula
))
{
...
...
@@ -234,15 +236,21 @@ public class ScoreRuleService {
if
(
"0"
.
equals
(
scoreRule
.
getScoreType
()))
{
if
(!
"NaN"
.
equals
(
calresultOp
.
getValue
())
&&
!
"Infinite"
.
equals
(
calresultOp
.
getValue
()))
{
calFormula
=
calFormula
.
replace
(
"["
+
indId
+
"]"
,
calresultOp
.
getValue
());
//算积分总和
scoreSumValue
+=
Double
.
parseDouble
(
calresultOp
.
getValue
());
}
else
{
calFormula
=
calFormula
.
replace
(
"["
+
indId
+
"]"
,
"0.0"
);
}
}
else
if
(
"1"
.
equals
(
scoreRule
.
getScoreType
()))
{
//1 指标得分分数参与计算(综合评分和改善提升分开算)
calFormula
=
calFormula
.
replace
(
"["
+
indId
+
"]"
,
calresultOp
.
getValue
());
calFormula
=
calFormula
.
replace
(
"["
+
indId
+
"]"
,
calresultOp
.
getScore
());
//算积分总和
scoreSumValue
+=
Double
.
parseDouble
(
calresultOp
.
getScore
());
if
(!
"No"
.
equals
(
calresultOp
.
getImproveScore
())
&&
StringUtils
.
isNotBlank
(
calresultOp
.
getImproveScore
()))
{
improveCalFormula
=
improveCalFormula
.
replace
(
"["
+
indId
+
"]"
,
calresultOp
.
getImproveScore
());
//算积分总和
scoreSumValue
+=
Double
.
parseDouble
(
calresultOp
.
getImproveScore
());
}
else
{
improveCalFormula
=
improveCalFormula
.
replace
(
"["
+
indId
+
"]"
,
"0.0"
);
}
...
...
@@ -254,8 +262,12 @@ public class ScoreRuleService {
double
improveScore
=
Double
.
parseDouble
(
calresultOp
.
getImproveScore
());
double
sum
=
indScore
+
improveScore
;
score
=
String
.
valueOf
(
sum
);
//算积分总和
scoreSumValue
+=
sum
;
}
else
{
score
=
calresultOp
.
getScore
();
//算积分总和
scoreSumValue
+=
Double
.
parseDouble
(
score
);
}
calFormula
=
calFormula
.
replace
(
"["
+
indId
+
"]"
,
score
);
}
...
...
@@ -287,6 +299,7 @@ public class ScoreRuleService {
objResult
.
setImproveValue
(
improveValue
);
}
}
objResult
.
setScoreSumValue
(
String
.
format
(
"%.4f"
,
new
BigDecimal
(
scoreSumValue
)));
return
objResult
;
}
...
...
@@ -304,6 +317,7 @@ public class ScoreRuleService {
findByCompareObjAndDate
(
compareObj
,
date
,
code
);
double
scoreValue
=
0.0
;
double
improveValue
=
0.0
;
double
scoreSumValue
=
0.0
;
if
(!
calResults
.
isEmpty
())
{
//auth:zhangkb time:2020-7-15 desc:填充对标对象描述
objResult
.
setCompareObjDesc
(
calResults
.
get
(
0
).
getCompareObjDesc
());
...
...
@@ -315,11 +329,14 @@ public class ScoreRuleService {
Map
<
String
,
Double
>
calScores
=
this
.
calIndTypeScore
(
scoreRule
,
indTypeWeight
,
calResults
);
scoreValue
+=
(
calScores
.
get
(
"score"
)*
Double
.
parseDouble
(
indTypeWeight
.
getWeight
())/
100
);
improveValue
+=
(
calScores
.
get
(
"improve"
)*
Double
.
parseDouble
(
indTypeWeight
.
getWeight
())/
100
);
//author:zhangkb time:2020-9-15 desc:score和improve相加做为积分总和
scoreSumValue
+=
calScores
.
get
(
"score"
)+
calScores
.
get
(
"improve"
);
}
}
}
objResult
.
setScoreValue
(
String
.
format
(
"%.4f"
,
new
BigDecimal
(
scoreValue
)));
objResult
.
setImproveValue
(
String
.
format
(
"%.4f"
,
new
BigDecimal
(
improveValue
)));
objResult
.
setScoreSumValue
(
String
.
format
(
"%.4f"
,
new
BigDecimal
(
scoreSumValue
)));
return
objResult
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment