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
a5439382
Commit
a5439382
authored
Sep 17, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改报表2获取具体末三判断逻辑
parent
97f3ab17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
49 deletions
+18
-49
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+3
-3
CalculateUtils.java
...n/java/com/keymobile/indicators/utils/CalculateUtils.java
+15
-46
No files found.
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
a5439382
...
@@ -853,15 +853,15 @@ public class IndicatorsReportService {
...
@@ -853,15 +853,15 @@ public class IndicatorsReportService {
rankAfterThree
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankAfterThree
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankAfterThreeDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
rankAfterThreeDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
//author:zhangkb time:2020-9-16 desc:填充具体末名次单位
//author:zhangkb time:2020-9-16 desc:填充具体末名次单位
if
(
entry
.
getValue
()!=
null
&&
entry
.
getValue
(
)==
1
)
{
if
(
entry
.
getValue
()!=
null
&&
(
rankMap
.
size
()-
entry
.
getValue
()+
1
)==
1
)
{
rankLastOne
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankLastOne
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankLastOneDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
rankLastOneDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
}
}
if
(
entry
.
getValue
()!=
null
&&
entry
.
getValue
(
)==
2
)
{
if
(
entry
.
getValue
()!=
null
&&
(
rankMap
.
size
()-
entry
.
getValue
()+
1
)==
2
)
{
rankLastTwo
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankLastTwo
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankLastTwoDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
rankLastTwoDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
}
}
if
(
entry
.
getValue
()!=
null
&&
entry
.
getValue
(
)==
3
)
{
if
(
entry
.
getValue
()!=
null
&&
(
rankMap
.
size
()-
entry
.
getValue
()+
1
)==
3
)
{
rankLastThree
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankLastThree
.
append
(
entry
.
getKey
()).
append
(
";"
);
rankLastThreeDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
rankLastThreeDesc
.
append
(
objDescMap
.
get
(
entry
.
getKey
())).
append
(
";"
);
}
}
...
...
src/main/java/com/keymobile/indicators/utils/CalculateUtils.java
View file @
a5439382
...
@@ -366,51 +366,20 @@ public class CalculateUtils {
...
@@ -366,51 +366,20 @@ public class CalculateUtils {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
Integer
>
objSort
=
new
HashMap
<>();
map
.
put
(
"4302"
,
"48.0000"
);
objSort
.
put
(
"4301"
,
1
);
objSort
.
put
(
"4302"
,
2
);
objSort
.
put
(
"4303"
,
3
);
map
.
put
(
"4308"
,
"24.0000"
);
objSort
.
put
(
"4304"
,
4
);
objSort
.
put
(
"4305"
,
5
);
objSort
.
put
(
"4306"
,
6
);
map
.
put
(
"4304"
,
"24.0000"
);
objSort
.
put
(
"4307"
,
7
);
objSort
.
put
(
"4308"
,
8
);
objSort
.
put
(
"4309"
,
9
);
map
.
put
(
"4310"
,
"43.9100"
);
objSort
.
put
(
"4310"
,
10
);
objSort
.
put
(
"4311"
,
11
);
objSort
.
put
(
"4312"
,
12
);
map
.
put
(
"4331"
,
"48.0000"
);
objSort
.
put
(
"4313"
,
13
);
objSort
.
put
(
"4331"
,
14
);
map
.
put
(
"4312"
,
"48.0000"
);
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
map
.
put
(
"4313"
,
"24.0000"
);
map
.
put
(
"430402"
,
4
);
map
.
put
(
"4303"
,
"39.8400"
);
map
.
put
(
"430405"
,
2
);
map
.
put
(
"4309"
,
"48.0000"
);
map
.
put
(
"430404"
,
5
);
map
.
put
(
"4307"
,
"48.0000"
);
map
.
put
(
"430407"
,
3
);
map
.
put
(
"4301"
,
"48.0000"
);
map
.
put
(
"430409"
,
1
);
map
.
put
(
"4306"
,
"48.0000"
);
map
=
CalculateUtils
.
sortMapByValue
(
map
,
1
);
//按照value从大到小排序
map
.
put
(
"4305"
,
"48.0000"
);
Map
<
String
,
Object
>
resultRankMap
=
CalculateUtils
.
rankByObjSort
(
map
,
objSort
);
map
.
put
(
"4311"
,
"39.8400"
);
System
.
out
.
println
(
resultRankMap
);
CalculateUtils
cal
=
new
CalculateUtils
();
// System.out.println(cal.isValidformula("([1001]+[1002])-[1004]"));
Map
<
String
,
Integer
>
result
=
cal
.
rankValue
(
map
,
"1"
);
result
=
cal
.
sortMapByValue
(
result
,
1
);
System
.
out
.
println
(
result
);
//
// String formula = "([1001]+[1002])/2";
// Map<String,String> map = new HashMap<>();
// map.put("1001", "3");
// map.put("1002", "5");
// formula = formula.replace("[1001]", "3");
// formula = formula.replace("[1002]", "5");
String
ss
=
"1755"
;
String
formula
=
"(ss/2299-1)*100"
;
if
(
ss
.
indexOf
(
"."
)<
0
)
{
ss
+=
".00"
;
}
formula
=
formula
.
replace
(
"ss"
,
ss
);
String
result1
=
AviatorEvaluator
.
execute
(
formula
).
toString
();
// String result2 = cal.calculateFormula(formula, map);
System
.
out
.
println
(
result1
);
// System.out.println(result2);
// Double b = (double) Math.abs(34-50);
// System.out.println(b);
// List<String> listA = new ArrayList<>();
// listA.add("a");
// listA.add("b");
// listA.add("c");
// List<String> listB = new ArrayList<>();
// listA.retainAll(listB);
// System.out.println(listA);
}
}
}
}
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