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
55038a8d
Commit
55038a8d
authored
Aug 17, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改计算报表1数据逻辑
parent
c4ed7c77
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
12 deletions
+43
-12
BeforeCompareUnitCalActor.java
...tors/akka/actor/indicators/BeforeCompareUnitCalActor.java
+5
-8
IndicatorReportCtrl.java
.../keymobile/indicators/api/report/IndicatorReportCtrl.java
+3
-2
IndicatorsReportOne.java
...e/indicators/model/entity/report/IndicatorsReportOne.java
+1
-0
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+34
-2
No files found.
src/main/java/com/keymobile/indicators/akka/actor/indicators/BeforeCompareUnitCalActor.java
View file @
55038a8d
...
@@ -75,14 +75,6 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -75,14 +75,6 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
}
}
if
(
numberOfConfirm
>
1
)
{
if
(
numberOfConfirm
>
1
)
{
Map
<
String
,
String
>
compareObjMap
=
new
HashMap
<>();
Map
<
String
,
String
>
compareObjMap
=
new
HashMap
<>();
//整合指标本期同期报表数据
logger
.
info
(
"进行date:"
+
currentDate
+
" 指标本期同期报表数据整合"
);
if
(
StringUtils
.
isBlank
(
code
))
{
code
=
"43"
;
}
indicatorsReportService
.
dealReportOne
(
code
,
currentDate
);
//整合考核指标报表数据2
//整合考核指标报表数据2
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
if
(
StringUtils
.
isNotBlank
(
unitDef
.
getIndIds
())
&&
if
(
StringUtils
.
isNotBlank
(
unitDef
.
getIndIds
())
&&
...
@@ -93,6 +85,11 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -93,6 +85,11 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
for
(
String
compareObj
:
compareObjsList
)
{
for
(
String
compareObj
:
compareObjsList
)
{
compareObjMap
.
put
(
compareObj
,
compareObj
);
compareObjMap
.
put
(
compareObj
,
compareObj
);
}
}
//整合指标本期同期报表数据
indicatorsReportService
.
dealReportOne
(
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
());
//整合考核指标报表数据2
//整合考核指标报表数据2
indicatorsReportService
.
dealDriveIndReportTwoData
(
indicatorsReportService
.
dealDriveIndReportTwoData
(
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
...
...
src/main/java/com/keymobile/indicators/api/report/IndicatorReportCtrl.java
View file @
55038a8d
...
@@ -22,8 +22,9 @@ public class IndicatorReportCtrl {
...
@@ -22,8 +22,9 @@ public class IndicatorReportCtrl {
@ApiOperation
(
value
=
"整合指标本期同期报表数据"
,
notes
=
"整合指标本期同期报表数据"
)
@ApiOperation
(
value
=
"整合指标本期同期报表数据"
,
notes
=
"整合指标本期同期报表数据"
)
@PostMapping
(
value
=
"/dealReportOne"
)
@PostMapping
(
value
=
"/dealReportOne"
)
public
String
dealReportOne
(
@RequestParam
String
code
,
@RequestParam
Integer
date
)
{
public
String
dealReportOne
(
@RequestParam
String
compareUnitId
,
@RequestParam
List
<
String
>
indIds
,
indicatorsReportService
.
dealReportOne
(
code
,
date
);
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
Integer
date
)
{
indicatorsReportService
.
dealReportOne
(
compareUnitId
,
indIds
,
compareObjs
,
date
);
return
"考核指标本期同期报表数据开始整合..."
;
return
"考核指标本期同期报表数据开始整合..."
;
}
}
...
...
src/main/java/com/keymobile/indicators/model/entity/report/IndicatorsReportOne.java
View file @
55038a8d
...
@@ -29,6 +29,7 @@ public class IndicatorsReportOne {
...
@@ -29,6 +29,7 @@ public class IndicatorsReportOne {
private
String
currentValue
;
//本期值
private
String
currentValue
;
//本期值
private
String
lastSameValue
;
// 同期值
private
String
lastSameValue
;
// 同期值
private
String
valueRate
;
//同比
private
String
valueRate
;
//同比
private
String
valueRateRank
;
//同比增幅排名
private
String
currentRank
;
//本期排名
private
String
currentRank
;
//本期排名
private
String
lastSameRank
;
//同期排名
private
String
lastSameRank
;
//同期排名
private
String
currentScore
;
//本期综合评分
private
String
currentScore
;
//本期综合评分
...
...
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
55038a8d
...
@@ -175,9 +175,16 @@ public class IndicatorsReportService {
...
@@ -175,9 +175,16 @@ public class IndicatorsReportService {
//整合指标本期同期指标报表数据
//整合指标本期同期指标报表数据
@Async
@Async
public
String
dealReportOne
(
String
code
,
Integer
date
)
{
public
String
dealReportOne
(
String
compareId
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
Integer
date
)
{
for
(
String
indId
:
indIds
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"date"
,
date
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
//获取所有考核指标结果
//获取所有考核指标结果
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
.
findReportData
(
code
,
date
);
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObjIn
(
paramMap
);
List
<
IndicatorsReportOne
>
datas
=
new
ArrayList
<>();
List
<
IndicatorsReportOne
>
datas
=
new
ArrayList
<>();
for
(
DriveIndCalResultDef
calData
:
calDatas
)
{
for
(
DriveIndCalResultDef
calData
:
calDatas
)
{
//判断是否存在
//判断是否存在
...
@@ -193,7 +200,29 @@ public class IndicatorsReportService {
...
@@ -193,7 +200,29 @@ public class IndicatorsReportService {
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
);
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
);
datas
.
add
(
indReportData
);
datas
.
add
(
indReportData
);
}
}
//计算增幅排名
if
(!
datas
.
isEmpty
())
{
//获取指标正反属性
DriveIndDef
driveIndDef
=
driveIndDefMapper
.
selectByPrimaryKey
(
indId
);
if
(
driveIndDef
!=
null
)
{
String
indRule
=
driveIndDef
.
getIndRule
();
Map
<
String
,
String
>
valueRate
=
new
HashMap
<>();
for
(
IndicatorsReportOne
indReportData
:
datas
)
{
valueRate
.
put
(
indReportData
.
getCompareObj
(),
indReportData
.
getValueRate
());
}
//增幅排名
Map
<
String
,
Integer
>
valueRateRank
=
CalculateUtils
.
rankValue
(
valueRate
,
indRule
);
for
(
Map
.
Entry
<
String
,
Integer
>
map
:
valueRateRank
.
entrySet
())
{
for
(
IndicatorsReportOne
indReportData
:
datas
)
{
if
(
map
.
getKey
().
equals
(
indReportData
.
getCompareObj
()))
{
indReportData
.
setValueRateRank
(
map
.
getValue
()+
""
);
}
}
}
}
}
this
.
batchSaveOrUpdate
(
datas
);
//批量新增或修改
this
.
batchSaveOrUpdate
(
datas
);
//批量新增或修改
}
return
"deal indicators report one success"
;
return
"deal indicators report one success"
;
}
}
...
@@ -405,11 +434,14 @@ public class IndicatorsReportService {
...
@@ -405,11 +434,14 @@ public class IndicatorsReportService {
&&!
"Infinite"
.
equals
(
sameCalData
.
getValue
())
&&!
"Infinite"
.
equals
(
sameCalData
.
getValue
())
&&
!
"NaN"
.
equals
(
currentCalData
.
getValue
())
&&
!
"NaN"
.
equals
(
currentCalData
.
getValue
())
&&!
"Infinite"
.
equals
(
currentCalData
.
getValue
()))
{
&&!
"Infinite"
.
equals
(
currentCalData
.
getValue
()))
{
//如果本次考核结果排位和同期考核结果配位都存在
if
(
currentCalData
.
getRank
()!=
null
&&
sameCalData
.
getRank
()!=
null
)
{
rankMap
.
put
(
currentCalData
.
getCompareObj
(),
rankMap
.
put
(
currentCalData
.
getCompareObj
(),
String
.
valueOf
((
currentCalData
.
getRank
()-
sameCalData
.
getRank
())));
String
.
valueOf
((
currentCalData
.
getRank
()-
sameCalData
.
getRank
())));
if
((
currentCalData
.
getRank
()-
sameCalData
.
getRank
())>
0
)
{
if
((
currentCalData
.
getRank
()-
sameCalData
.
getRank
())>
0
)
{
improveNum
+=
1
;
improveNum
+=
1
;
}
}
}
break
;
break
;
}
}
}
}
...
...
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