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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
ShortboardRuleService.java
...e/indicators/service/hytobacco/ShortboardRuleService.java
+35
-10
No files found.
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardRuleService.java
View file @
8a063d84
...
@@ -272,6 +272,8 @@ public class ShortboardRuleService {
...
@@ -272,6 +272,8 @@ public class ShortboardRuleService {
}
}
}
}
}
}
//如果有填浮动值
if
(
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
()))
{
//分析filterCalResults
//分析filterCalResults
for
(
DriveIndCalResultDef
filterCalResult
:
filterCalResults
)
{
for
(
DriveIndCalResultDef
filterCalResult
:
filterCalResults
)
{
//判断是比较差还是百分比
//判断是比较差还是百分比
...
@@ -314,6 +316,11 @@ public class ShortboardRuleService {
...
@@ -314,6 +316,11 @@ public class ShortboardRuleService {
}
}
}
}
}
}
}
else
{
if
(!
filterCalResults
.
isEmpty
())
{
realCalResults
.
addAll
(
filterCalResults
);
}
}
}
}
return
realCalResults
;
return
realCalResults
;
}
}
...
@@ -337,7 +344,7 @@ public class ShortboardRuleService {
...
@@ -337,7 +344,7 @@ public class ShortboardRuleService {
if
(!
calResults
.
isEmpty
())
{
if
(!
calResults
.
isEmpty
())
{
maxValue
=
calResults
.
get
(
0
).
getValue
();
maxValue
=
calResults
.
get
(
0
).
getValue
();
}
}
if
(
maxValue
!=
null
)
{
if
(
maxValue
!=
null
&&
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
())
)
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
&&
!
"0.0000"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
&&
!
"0.0000"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
...
@@ -358,6 +365,10 @@ public class ShortboardRuleService {
...
@@ -358,6 +365,10 @@ public class ShortboardRuleService {
}
}
}
}
}
}
}
else
{
if
(
maxValue
!=
null
&&
calResults
.
size
()>=
2
)
{
realCalResults
.
addAll
(
calResults
.
subList
(
1
,
calResults
.
size
()));
}
}
}
}
}
return
realCalResults
;
return
realCalResults
;
...
@@ -381,13 +392,14 @@ public class ShortboardRuleService {
...
@@ -381,13 +392,14 @@ public class ShortboardRuleService {
String
minValue
=
null
;
String
minValue
=
null
;
if
(!
calResults
.
isEmpty
())
{
if
(!
calResults
.
isEmpty
())
{
for
(
int
i
=(
calResults
.
size
()-
1
);
i
>=
0
;
i
--)
{
for
(
int
i
=(
calResults
.
size
()-
1
);
i
>=
0
;
i
--)
{
if
(!
"NaN"
.
equals
(
calResults
.
get
(
i
).
getValue
())
&&
!
"Infinite"
.
equals
(
calResults
.
get
(
i
).
getValue
())
if
(!
"NaN"
.
equals
(
calResults
.
get
(
i
).
getValue
())
&&
&&
!
"0.0000"
.
equals
(
calResults
.
get
(
i
).
getValue
())
&&
!
"0
"
.
equals
(
calResults
.
get
(
i
).
getValue
()))
{
!
"Infinite
"
.
equals
(
calResults
.
get
(
i
).
getValue
()))
{
minValue
=
calResults
.
get
(
i
).
getValue
();
minValue
=
calResults
.
get
(
i
).
getValue
();
break
;
}
}
}
}
}
}
if
(
minValue
!=
null
)
{
if
(
minValue
!=
null
&&
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
())
)
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
&&
!
"0.0000"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
&&
!
"0.0000"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
...
@@ -408,6 +420,10 @@ public class ShortboardRuleService {
...
@@ -408,6 +420,10 @@ public class ShortboardRuleService {
}
}
}
}
}
}
}
else
{
if
(
minValue
!=
null
&&
calResults
.
size
()>=
2
)
{
realCalResults
.
addAll
(
calResults
.
subList
(
0
,
calResults
.
size
()-
1
));
}
}
}
}
}
return
realCalResults
;
return
realCalResults
;
...
@@ -465,13 +481,9 @@ public class ShortboardRuleService {
...
@@ -465,13 +481,9 @@ public class ShortboardRuleService {
findByIndIdAndDateAndCompareObj
(
driveId
,(
date
-
100
),
compareObj
,
code
);
findByIndIdAndDateAndCompareObj
(
driveId
,(
date
-
100
),
compareObj
,
code
);
if
(
currentIndCalResult
!=
null
&&
sameIndCalResult
!=
null
)
{
if
(
currentIndCalResult
!=
null
&&
sameIndCalResult
!=
null
)
{
if
(!
"NaN"
.
equals
(
currentIndCalResult
.
getValue
())
&&
if
(!
"NaN"
.
equals
(
currentIndCalResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
currentIndCalResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
currentIndCalResult
.
getValue
()))
{
!
"0.0000"
.
equals
(
currentIndCalResult
.
getValue
())
&&
!
"0"
.
equals
(
currentIndCalResult
.
getValue
()))
{
if
(!
"NaN"
.
equals
(
sameIndCalResult
.
getValue
())
&&
if
(!
"NaN"
.
equals
(
sameIndCalResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
sameIndCalResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
sameIndCalResult
.
getValue
()))
{
!
"0.0000"
.
equals
(
sameIndCalResult
.
getValue
())
&&
!
"0"
.
equals
(
sameIndCalResult
.
getValue
()))
{
if
(
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
()))
{
if
(
StringUtils
.
isNotBlank
(
shortboardItem
.
getValue
()))
{
//判断规则选择是大于还是小于
//判断规则选择是大于还是小于
if
(
"0"
.
equals
(
shortboardItem
.
getCalType
()))
{
//大于
if
(
"0"
.
equals
(
shortboardItem
.
getCalType
()))
{
//大于
...
@@ -513,6 +525,19 @@ public class ShortboardRuleService {
...
@@ -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