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
8a063d84
Commit
8a063d84
authored
Oct 20, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改根据短板筛选规则筛选短板单位后台接口逻辑。
parent
0016669c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
42 deletions
+67
-42
ShortboardRuleService.java
...e/indicators/service/hytobacco/ShortboardRuleService.java
+67
-42
No files found.
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardRuleService.java
View file @
8a063d84
...
...
@@ -272,47 +272,54 @@ public class ShortboardRuleService {
}
}
}
//分析filterCalResults
for
(
DriveIndCalResultDef
filterCalResult
:
filterCalResults
)
{
//判断是比较差还是百分比
if
(
"0"
.
equals
(
shortboardItem
.
getAnalysisType
()))
{
//绝对值
//判断有没有实际的平均值
if
(
filterCalResult
.
getValue
()!=
null
&&
filterCalResult
.
getActualAverage
()!=
null
&&!
"0.0"
.
equals
(
filterCalResult
.
getActualAverage
()))
{
//获取差值绝对值
Double
differ
=
Math
.
abs
(
Double
.
parseDouble
(
filterCalResult
.
getActualAverage
())
-
Double
.
parseDouble
(
filterCalResult
.
getValue
()));
if
(
differ
>
Double
.
parseDouble
(
shortboardItem
.
getValue
()))
{
realCalResults
.
add
(
filterCalResult
);
}
}
else
{
//获取差值绝对值
if
(
filterCalResult
.
getAverage
()!=
null
&&
filterCalResult
.
getValue
()!=
null
){
Double
differ
=
Math
.
abs
(
Double
.
parseDouble
(
filterCalResult
.
getAverage
())
//如果有填浮动值
if
(
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
()))
{
//分析filterCalResults
for
(
DriveIndCalResultDef
filterCalResult
:
filterCalResults
)
{
//判断是比较差还是百分比
if
(
"0"
.
equals
(
shortboardItem
.
getAnalysisType
()))
{
//绝对值
//判断有没有实际的平均值
if
(
filterCalResult
.
getValue
()!=
null
&&
filterCalResult
.
getActualAverage
()!=
null
&&!
"0.0"
.
equals
(
filterCalResult
.
getActualAverage
()))
{
//获取差值绝对值
Double
differ
=
Math
.
abs
(
Double
.
parseDouble
(
filterCalResult
.
getActualAverage
())
-
Double
.
parseDouble
(
filterCalResult
.
getValue
()));
if
(
differ
>
Double
.
parseDouble
(
shortboardItem
.
getValue
()))
{
realCalResults
.
add
(
filterCalResult
);
}
}
}
else
{
//获取差值绝对值
if
(
filterCalResult
.
getAverage
()!=
null
&&
filterCalResult
.
getValue
()!=
null
){
Double
differ
=
Math
.
abs
(
Double
.
parseDouble
(
filterCalResult
.
getAverage
())
-
Double
.
parseDouble
(
filterCalResult
.
getValue
()));
if
(
differ
>
Double
.
parseDouble
(
shortboardItem
.
getValue
()))
{
realCalResults
.
add
(
filterCalResult
);
}
}
}
}
else
{
//百分比
//判断有没有实际的平均值
if
(
filterCalResult
.
getActualAverage
()!=
null
&&!
"0.0"
.
equals
(
filterCalResult
.
getActualAverage
()))
{
Double
percentage
=
Math
.
abs
(
Double
.
parseDouble
(
CalculateUtils
.
calGowth
(
filterCalResult
.
getValue
(),
filterCalResult
.
getActualAverage
(),
driveIndDef
.
getGrowCalType
())));
if
(
percentage
>
Double
.
parseDouble
(
shortboardItem
.
getValue
()))
{
realCalResults
.
add
(
filterCalResult
);
}
}
else
{
Double
percentage
=
Math
.
abs
(
Double
.
parseDouble
(
CalculateUtils
.
calGowth
(
filterCalResult
.
getValue
(),
filterCalResult
.
getAverage
(),
driveIndDef
.
getGrowCalType
())));
if
(
percentage
>
Double
.
parseDouble
(
shortboardItem
.
getValue
()))
{
realCalResults
.
add
(
filterCalResult
);
}
else
{
//百分比
//判断有没有实际的平均值
if
(
filterCalResult
.
getActualAverage
()!=
null
&&!
"0.0"
.
equals
(
filterCalResult
.
getActualAverage
()))
{
Double
percentage
=
Math
.
abs
(
Double
.
parseDouble
(
CalculateUtils
.
calGowth
(
filterCalResult
.
getValue
(),
filterCalResult
.
getActualAverage
(),
driveIndDef
.
getGrowCalType
())));
if
(
percentage
>
Double
.
parseDouble
(
shortboardItem
.
getValue
()))
{
realCalResults
.
add
(
filterCalResult
);
}
}
else
{
Double
percentage
=
Math
.
abs
(
Double
.
parseDouble
(
CalculateUtils
.
calGowth
(
filterCalResult
.
getValue
(),
filterCalResult
.
getAverage
(),
driveIndDef
.
getGrowCalType
())));
if
(
percentage
>
Double
.
parseDouble
(
shortboardItem
.
getValue
()))
{
realCalResults
.
add
(
filterCalResult
);
}
}
}
}
}
else
{
if
(!
filterCalResults
.
isEmpty
())
{
realCalResults
.
addAll
(
filterCalResults
);
}
}
}
return
realCalResults
;
...
...
@@ -337,7 +344,7 @@ public class ShortboardRuleService {
if
(!
calResults
.
isEmpty
())
{
maxValue
=
calResults
.
get
(
0
).
getValue
();
}
if
(
maxValue
!=
null
)
{
if
(
maxValue
!=
null
&&
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
())
)
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
&&
!
"0.0000"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
...
...
@@ -358,6 +365,10 @@ public class ShortboardRuleService {
}
}
}
}
else
{
if
(
maxValue
!=
null
&&
calResults
.
size
()>=
2
)
{
realCalResults
.
addAll
(
calResults
.
subList
(
1
,
calResults
.
size
()));
}
}
}
return
realCalResults
;
...
...
@@ -381,13 +392,14 @@ public class ShortboardRuleService {
String
minValue
=
null
;
if
(!
calResults
.
isEmpty
())
{
for
(
int
i
=(
calResults
.
size
()-
1
);
i
>=
0
;
i
--)
{
if
(!
"NaN"
.
equals
(
calResults
.
get
(
i
).
getValue
())
&&
!
"Infinite"
.
equals
(
calResults
.
get
(
i
).
getValue
())
&&
!
"0.0000"
.
equals
(
calResults
.
get
(
i
).
getValue
())
&&
!
"0
"
.
equals
(
calResults
.
get
(
i
).
getValue
()))
{
if
(!
"NaN"
.
equals
(
calResults
.
get
(
i
).
getValue
())
&&
!
"Infinite
"
.
equals
(
calResults
.
get
(
i
).
getValue
()))
{
minValue
=
calResults
.
get
(
i
).
getValue
();
break
;
}
}
}
if
(
minValue
!=
null
)
{
if
(
minValue
!=
null
&&
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
())
)
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
&&
!
"0.0000"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
...
...
@@ -408,6 +420,10 @@ public class ShortboardRuleService {
}
}
}
}
else
{
if
(
minValue
!=
null
&&
calResults
.
size
()>=
2
)
{
realCalResults
.
addAll
(
calResults
.
subList
(
0
,
calResults
.
size
()-
1
));
}
}
}
return
realCalResults
;
...
...
@@ -465,13 +481,9 @@ public class ShortboardRuleService {
findByIndIdAndDateAndCompareObj
(
driveId
,(
date
-
100
),
compareObj
,
code
);
if
(
currentIndCalResult
!=
null
&&
sameIndCalResult
!=
null
)
{
if
(!
"NaN"
.
equals
(
currentIndCalResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
currentIndCalResult
.
getValue
())
&&
!
"0.0000"
.
equals
(
currentIndCalResult
.
getValue
())
&&
!
"0"
.
equals
(
currentIndCalResult
.
getValue
()))
{
!
"Infinite"
.
equals
(
currentIndCalResult
.
getValue
()))
{
if
(!
"NaN"
.
equals
(
sameIndCalResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
sameIndCalResult
.
getValue
())
&&
!
"0.0000"
.
equals
(
sameIndCalResult
.
getValue
())
&&
!
"0"
.
equals
(
sameIndCalResult
.
getValue
()))
{
!
"Infinite"
.
equals
(
sameIndCalResult
.
getValue
()))
{
if
(
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
()))
{
//判断规则选择是大于还是小于
if
(
"0"
.
equals
(
shortboardItem
.
getCalType
()))
{
//大于
...
...
@@ -513,6 +525,19 @@ public class ShortboardRuleService {
}
}
}
}
else
{
//判断规则选择是大于还是小于
if
(
"0"
.
equals
(
shortboardItem
.
getCalType
()))
{
//大于
if
(
Double
.
parseDouble
(
currentIndCalResult
.
getValue
())>
Double
.
parseDouble
(
sameIndCalResult
.
getValue
()))
{
realCalResults
.
add
(
currentIndCalResult
);
}
}
else
{
//小于
if
(
Double
.
parseDouble
(
currentIndCalResult
.
getValue
())<
Double
.
parseDouble
(
sameIndCalResult
.
getValue
()))
{
realCalResults
.
add
(
currentIndCalResult
);
}
}
}
}
}
...
...
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