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
3710b5da
Commit
3710b5da
authored
Jan 26, 2021
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
850f686c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+21
-5
No files found.
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
3710b5da
...
@@ -407,17 +407,16 @@ public class IndScorecardService {
...
@@ -407,17 +407,16 @@ public class IndScorecardService {
//求公式最大值FMAX
//求公式最大值FMAX
if
(
formula
.
indexOf
(
"FMAX"
)>=
0
){
if
(
formula
.
indexOf
(
"FMAX"
)>=
0
){
int
maxIndex
=
formula
.
indexOf
(
"FMAX"
);
int
maxIndex
=
formula
.
indexOf
(
"FMAX"
);
String
sub
=
formula
.
substring
(
maxIndex
);
formulaTmp
=
sub
.
substring
(
0
,
sub
.
indexOf
(
")"
)+
1
);
formulaTmp
=
getFun
(
formula
,
maxIndex
);
//formula公式,currentDriveResult结果,true 最大值
//formula公式,currentDriveResult结果,true 最大值
fValue
=
getFValue
(
formulaTmp
,
currentDriveResult
,
acsType
,
true
);
fValue
=
getFValue
(
formulaTmp
,
currentDriveResult
,
acsType
,
true
);
formula
=
formula
.
replace
(
formulaTmp
,
String
.
valueOf
(
fValue
));
formula
=
formula
.
replace
(
formulaTmp
,
String
.
valueOf
(
fValue
));
}
}
//求公式最小值FMIN
//求公式最小值FMIN
if
(
formula
.
indexOf
(
"FMIN"
)>=
0
){
if
(
formula
.
indexOf
(
"FMIN"
)>=
0
){
int
maxIndex
=
formula
.
indexOf
(
"FMIN"
);
int
minIndex
=
formula
.
indexOf
(
"FMIN"
);
String
sub
=
formula
.
substring
(
maxIndex
);
formulaTmp
=
getFun
(
formula
,
minIndex
);
formulaTmp
=
sub
.
substring
(
0
,
sub
.
indexOf
(
")"
)+
1
);
//formula公式,currentDriveResult结果,true 最大值
//formula公式,currentDriveResult结果,true 最大值
fValue
=
getFValue
(
formulaTmp
,
currentDriveResult
,
acsType
,
false
);
fValue
=
getFValue
(
formulaTmp
,
currentDriveResult
,
acsType
,
false
);
formula
=
formula
.
replace
(
formulaTmp
,
String
.
valueOf
(
fValue
));
formula
=
formula
.
replace
(
formulaTmp
,
String
.
valueOf
(
fValue
));
...
@@ -539,7 +538,24 @@ public class IndScorecardService {
...
@@ -539,7 +538,24 @@ public class IndScorecardService {
}
}
return
fValue
;
return
fValue
;
}
}
//获取要求最大值的公式表达式
private
String
getFun
(
String
formula
,
int
maxIndex
){
String
sub
=
formula
.
substring
(
maxIndex
);
int
tmp
=
1
,
endIndex
=
sub
.
indexOf
(
")"
);
for
(
int
i
=
sub
.
indexOf
(
'('
)+
1
;
i
<
sub
.
length
();
i
++){
char
c
=
sub
.
charAt
(
i
);
if
(
c
==
'('
){
tmp
++;
}
else
if
(
c
==
')'
){
tmp
--;
}
if
(
tmp
==
0
){
endIndex
=
i
;
}
}
return
sub
.
substring
(
0
,
endIndex
+
1
);
}
private
IndScorecard
changeJson
(
IndScorecard
scorecard
)
{
private
IndScorecard
changeJson
(
IndScorecard
scorecard
)
{
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
if
(
StringUtils
.
isNotBlank
(
scorecard
.
getAddScoreItemJson
()))
{
if
(
StringUtils
.
isNotBlank
(
scorecard
.
getAddScoreItemJson
()))
{
...
...
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