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
ab53a148
Commit
ab53a148
authored
Aug 17, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对标计算添加报表数据汇总
parent
960af7f1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
25 deletions
+51
-25
BeforeCompareUnitCalActor.java
...tors/akka/actor/indicators/BeforeCompareUnitCalActor.java
+48
-16
CompareUnitCalActor.java
...indicators/akka/actor/indicators/CompareUnitCalActor.java
+0
-6
StartCompareUnitCalMsg.java
...ators/akka/message/indicators/StartCompareUnitCalMsg.java
+1
-1
DriveIndCalResultCtrl.java
...obile/indicators/api/hytobacco/DriveIndCalResultCtrl.java
+1
-1
DriveIndCalResultService.java
...ndicators/service/hytobacco/DriveIndCalResultService.java
+0
-1
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+1
-0
No files found.
src/main/java/com/keymobile/indicators/akka/actor/indicators/BeforeCompareUnitCalActor.java
View file @
ab53a148
package
com
.
keymobile
.
indicators
.
akka
.
actor
.
indicators
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -20,7 +23,7 @@ import akka.actor.Props;
public
class
BeforeCompareUnitCalActor
extends
AbstractActor
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BeforeCompareUnitCalActor
.
class
);
private
IndicatorsReportService
indReportService
=
SpringUtil
.
getBean
(
IndicatorsReportService
.
class
);
private
IndicatorsReportService
ind
icators
ReportService
=
SpringUtil
.
getBean
(
IndicatorsReportService
.
class
);
private
int
numberOfConfirm
=
0
;
//定义返回确认消息的子actor
...
...
@@ -28,21 +31,23 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
private
List
<
CompareUnitDef
>
sameCompareUnitDef
=
new
ArrayList
<>();
private
String
code
;
//机构编码
private
List
<
CompareUnitDef
>
currentCompareUnitDef
=
new
ArrayList
<>();
private
Integer
sameDate
=
0
;
private
Integer
currentDate
=
0
;
private
String
code
=
null
;
@Override
public
Receive
createReceive
()
{
return
receiveBuilder
()
.
match
(
StartCompareUnitCalMsg
.
class
,
beforeCompareUnitCalMsg
->
{
List
<
CompareUnitDef
>
compareUnitDefs
=
beforeCompareUnitCalMsg
.
getCompareInitDefs
();
code
=
beforeCompareUnitCalMsg
.
getCode
();
sameCompareUnitDef
.
addAll
(
compareUnitDefs
);
if
(
StringUtils
.
isNotBlank
(
code
))
{
//同期基础项报告1报表整合
logger
.
info
(
"进行date:"
+
compareUnitDefs
.
get
(
0
).
getDate
()+
" 的对标单元基础项报告汇总"
);
indReportService
.
dealReportOne
(
code
,
compareUnitDefs
.
get
(
0
).
getDate
());
}
logger
.
info
(
"进行date:"
+
compareUnitDefs
.
get
(
0
).
getDate
()+
" 的对标单元计算....."
);
sameDate
=
compareUnitDefs
.
get
(
0
).
getDate
();
code
=
beforeCompareUnitCalMsg
.
getCode
();
logger
.
info
(
"进行date:"
+
sameDate
+
" 的对标单元计算....."
);
//计算同期对标单元
StartCompareUnitCalMsg
startCompareUnitCalMsg
=
new
StartCompareUnitCalMsg
(
compareUnitDefs
);
ActorRef
startCompareUnitCalActor
=
this
.
getContext
().
actorOf
(
Props
.
create
(
...
...
@@ -53,19 +58,14 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
if
(++
numberOfConfirm
>=
sameExeSize
)
{
//全部先执行的子actor全部返回
if
(
numberOfConfirm
==
1
)
{
//执行本期对标单元计算
List
<
CompareUnitDef
>
currentCompareUnitDef
=
new
ArrayList
<>();
for
(
CompareUnitDef
unitDef
:
sameCompareUnitDef
)
{
Integer
date
=
unitDef
.
getDate
()+
100
;
//修改对标时间为本期
unitDef
.
setDate
(
date
);
currentCompareUnitDef
.
add
(
unitDef
);
}
if
(!
currentCompareUnitDef
.
isEmpty
())
{
if
(
StringUtils
.
isNotBlank
(
code
))
{
//本期基础项报告1报表整合
logger
.
info
(
"进行date:"
+
currentCompareUnitDef
.
get
(
0
).
getDate
()+
" 的对标单元基础项报告汇总"
);
indReportService
.
dealReportOne
(
code
,
currentCompareUnitDef
.
get
(
0
).
getDate
());
}
logger
.
info
(
"进行date:"
+
currentCompareUnitDef
.
get
(
0
).
getDate
()+
" 的对标单元计算....."
);
currentDate
=
currentCompareUnitDef
.
get
(
0
).
getDate
();
logger
.
info
(
"进行date:"
+
currentDate
+
" 的对标单元计算....."
);
//计算同期对标单元
StartCompareUnitCalMsg
startCompareUnitCalMsg
=
new
StartCompareUnitCalMsg
(
currentCompareUnitDef
);
ActorRef
startCompareUnitCalActor
=
this
.
getContext
().
actorOf
(
Props
.
create
(
...
...
@@ -74,6 +74,38 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
}
}
if
(
numberOfConfirm
>
1
)
{
Map
<
String
,
String
>
compareObjMap
=
new
HashMap
<>();
//整合指标本期同期报表数据
logger
.
info
(
"进行date:"
+
currentDate
+
" 指标本期同期报表数据整合"
);
if
(
StringUtils
.
isBlank
(
code
))
{
code
=
"43"
;
}
indicatorsReportService
.
dealReportOne
(
code
,
currentDate
);
//整合考核指标报表数据2
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
if
(
StringUtils
.
isNotBlank
(
unitDef
.
getIndIds
())
&&
StringUtils
.
isNotBlank
(
unitDef
.
getCompareObjs
()))
{
//用map整合对标机构
List
<
String
>
compareObjsList
=
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
));
for
(
String
compareObj
:
compareObjsList
)
{
compareObjMap
.
put
(
compareObj
,
compareObj
);
}
//整合考核指标报表数据2
indicatorsReportService
.
dealDriveIndReportTwoData
(
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
());
}
}
//整合基础项本期同期报表数据
logger
.
info
(
"进行date:"
+
currentDate
+
" 基础项本期同期报表数据整合"
);
if
(!
compareObjMap
.
isEmpty
())
{
List
<
String
>
compareObjs
=
new
ArrayList
<
String
>(
compareObjMap
.
keySet
());
indicatorsReportService
.
dealBaseIndReportOneData
(
currentDate
,
compareObjs
);
}
logger
.
info
(
"本期同期对标单元计算完成"
);
}
}
...
...
src/main/java/com/keymobile/indicators/akka/actor/indicators/CompareUnitCalActor.java
View file @
ab53a148
...
...
@@ -17,7 +17,6 @@ import com.keymobile.indicators.model.entity.indicators.CompareUnitDef;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRule
;
import
com.keymobile.indicators.service.hytobacco.CompareUnitCalLogService
;
import
com.keymobile.indicators.service.hytobacco.ScoreRuleService
;
import
com.keymobile.indicators.service.report.IndicatorsReportService
;
import
com.keymobile.indicators.utils.SpringUtil
;
import
akka.actor.AbstractActor
;
...
...
@@ -31,8 +30,6 @@ public class CompareUnitCalActor extends AbstractActor{
private
CompareUnitCalLogService
compareUnitCalLogService
=
SpringUtil
.
getBean
(
CompareUnitCalLogService
.
class
);
private
IndicatorsReportService
indicatorsReportService
=
SpringUtil
.
getBean
(
IndicatorsReportService
.
class
);
private
int
numberOfConfirm
=
0
;
//定义返回确认消息的子actor
private
int
indIdSize
=
0
;
//对标指标个数
...
...
@@ -138,9 +135,6 @@ public class CompareUnitCalActor extends AbstractActor{
date
,
scoreRule
.
getId
());
}
}
//整合考核指标报表数据2
indicatorsReportService
.
dealDriveIndReportTwoData
(
compareId
,
indIdsList
,
compareObjsList
,
date
);
//记录日志
if
(
compCalLog
!=
null
)
{
...
...
src/main/java/com/keymobile/indicators/akka/message/indicators/StartCompareUnitCalMsg.java
View file @
ab53a148
...
...
@@ -14,7 +14,7 @@ public class StartCompareUnitCalMsg implements Serializable{
private
List
<
CompareUnitDef
>
compareInitDefs
=
new
ArrayList
<>();
private
String
code
;
//机构编码
private
String
code
;
public
StartCompareUnitCalMsg
(
List
<
CompareUnitDef
>
compareInitDefs
)
{
this
.
compareInitDefs
.
addAll
(
compareInitDefs
);
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/DriveIndCalResultCtrl.java
View file @
ab53a148
...
...
@@ -38,7 +38,7 @@ public class DriveIndCalResultCtrl {
@ApiOperation
(
value
=
"对标单元综合计算"
,
notes
=
"对标单元综合计算"
)
@PostMapping
(
value
=
"/compareUnitListCal"
)
public
void
compareUnitListCal
(
@RequestBody
List
<
CompareUnitDef
>
compareUnitList
,
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
{
@RequestParam
String
code
)
{
StringBuilder
compUnitDefString
=
new
StringBuilder
(
""
);
for
(
CompareUnitDef
compUnitDef
:
compareUnitList
)
{
compUnitDefString
.
append
(
compUnitDef
.
getCompareId
()).
append
(
";"
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCalResultService.java
View file @
ab53a148
...
...
@@ -82,7 +82,6 @@ public class DriveIndCalResultService {
//启动回流actor
final
ActorSystem
system
=
ActorSystem
.
create
(
"CompareUnitCalAkka"
);
//创建akka
StartCompareUnitCalMsg
startCompareUnitCalMsg
=
new
StartCompareUnitCalMsg
(
sameCompareUnitList
);
//设置编码
startCompareUnitCalMsg
.
setCode
(
code
);
ActorRef
beforeCompareUnitCalActor
=
system
.
actorOf
(
Props
.
create
(
BeforeCompareUnitCalActor
.
class
,()->
new
BeforeCompareUnitCalActor
()));
...
...
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
ab53a148
...
...
@@ -99,6 +99,7 @@ public class IndicatorsReportService {
}
}
@Async
public
void
dealDriveIndReportTwoData
(
String
compareUnitId
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
Integer
date
)
{
List
<
IndicatorsReportTwo
>
dataList
=
new
ArrayList
<>();
...
...
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