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
fd87055a
Commit
fd87055a
authored
Dec 12, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对标单元计算添加对标单元目录信息保存区分同部门间的对标运算隔离
parent
e9f9a9d5
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
513 additions
and
146 deletions
+513
-146
BeforeCompareUnitCalActor.java
...tors/akka/actor/indicators/BeforeCompareUnitCalActor.java
+11
-5
CompareUnitCalActor.java
...indicators/akka/actor/indicators/CompareUnitCalActor.java
+7
-2
DriveIndIdCalActor.java
.../indicators/akka/actor/indicators/DriveIndIdCalActor.java
+29
-12
DriveIndIdObjCalActor.java
...dicators/akka/actor/indicators/DriveIndIdObjCalActor.java
+37
-9
StartCompareUnitCalActor.java
...ators/akka/actor/indicators/StartCompareUnitCalActor.java
+15
-6
CalIndAverageAndRankMsg.java
...tors/akka/message/indicators/CalIndAverageAndRankMsg.java
+11
-1
CompareUnitCalMsg.java
...indicators/akka/message/indicators/CompareUnitCalMsg.java
+11
-0
DriveIndIdCalMsg.java
.../indicators/akka/message/indicators/DriveIndIdCalMsg.java
+9
-0
DriveIndIdObjCalMsg.java
...dicators/akka/message/indicators/DriveIndIdObjCalMsg.java
+9
-0
IndScorecardCtrl.java
.../keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
+5
-5
ObjScoreRuleCtrl.java
.../keymobile/indicators/api/hytobacco/ObjScoreRuleCtrl.java
+2
-2
IndicatorReportCtrl.java
.../keymobile/indicators/api/report/IndicatorReportCtrl.java
+11
-9
DriveIndCalResultDef.java
...icators/model/entity/indicators/DriveIndCalResultDef.java
+1
-0
ObjScoreCalResult.java
...dicators/model/entity/objscorerule/ObjScoreCalResult.java
+1
-0
IndicatorsReportOne.java
...e/indicators/model/entity/report/IndicatorsReportOne.java
+1
-0
IndicatorsReportThree.java
...indicators/model/entity/report/IndicatorsReportThree.java
+1
-0
IndicatorsReportTwo.java
...e/indicators/model/entity/report/IndicatorsReportTwo.java
+1
-0
TestDriveIndCalResultDef.java
...cators/model/entity/testrun/TestDriveIndCalResultDef.java
+1
-0
TestObjScoreCalResult.java
...ndicators/model/entity/testrun/TestObjScoreCalResult.java
+1
-0
DriveIndCalResultDefMapper.java
...rs/model/mapper/indmapper/DriveIndCalResultDefMapper.java
+21
-0
ObjScoreCalResultMapper.java
...ators/model/mapper/indmapper/ObjScoreCalResultMapper.java
+5
-0
ReportOneMapper.java
...obile/indicators/model/mapper/report/ReportOneMapper.java
+2
-1
ReportThreeMapper.java
...ile/indicators/model/mapper/report/ReportThreeMapper.java
+2
-1
ReportTwoMapper.java
...obile/indicators/model/mapper/report/ReportTwoMapper.java
+3
-2
TestDriveIndCalResultDefMapper.java
.../model/mapper/testrun/TestDriveIndCalResultDefMapper.java
+14
-0
TestObjScoreCalResultMapper.java
...ors/model/mapper/testrun/TestObjScoreCalResultMapper.java
+4
-0
DriveIndCalResultService.java
...ndicators/service/hytobacco/DriveIndCalResultService.java
+16
-3
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+16
-5
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+27
-18
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+53
-37
TestDriveIndCalResultService.java
...icators/service/testrun/TestDriveIndCalResultService.java
+13
-0
TestScoreRuleService.java
...bile/indicators/service/testrun/TestScoreRuleService.java
+26
-13
DriveIndCalResultDefMapper.xml
.../resources/mybatis/mapping/DriveIndCalResultDefMapper.xml
+60
-2
ObjScoreCalResultMapper.xml
...ain/resources/mybatis/mapping/ObjScoreCalResultMapper.xml
+11
-0
ReportOneMapper.xml
src/main/resources/mybatis/mapping/ReportOneMapper.xml
+8
-2
ReportThreeMapper.xml
src/main/resources/mybatis/mapping/ReportThreeMapper.xml
+7
-3
ReportTwoMapper.xml
src/main/resources/mybatis/mapping/ReportTwoMapper.xml
+7
-4
TestDriveIndCalResultDefMapper.xml
...ources/mybatis/mapping/TestDriveIndCalResultDefMapper.xml
+38
-2
TestObjScoreCalResultMapper.xml
...resources/mybatis/mapping/TestObjScoreCalResultMapper.xml
+16
-2
No files found.
src/main/java/com/keymobile/indicators/akka/actor/indicators/BeforeCompareUnitCalActor.java
View file @
fd87055a
...
@@ -46,6 +46,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -46,6 +46,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
private
Integer
compCalLogId
=
null
;
private
Integer
compCalLogId
=
null
;
private
String
path
=
null
;
//对标单元目录id
@Override
@Override
public
Receive
createReceive
()
{
public
Receive
createReceive
()
{
try
{
try
{
...
@@ -57,6 +59,7 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -57,6 +59,7 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
code
=
beforeCompareUnitCalMsg
.
getCode
();
code
=
beforeCompareUnitCalMsg
.
getCode
();
isTest
=
beforeCompareUnitCalMsg
.
getIsTest
();
isTest
=
beforeCompareUnitCalMsg
.
getIsTest
();
compCalLogId
=
beforeCompareUnitCalMsg
.
getCompCalLogId
();
compCalLogId
=
beforeCompareUnitCalMsg
.
getCompCalLogId
();
path
=
beforeCompareUnitCalMsg
.
getPath
();
if
(
"0"
.
equals
(
isTest
))
{
if
(
"0"
.
equals
(
isTest
))
{
logger
.
info
(
"进行date:"
+
sameDate
+
" 的对标单元试运行计算.....日志id:"
+
compCalLogId
);
logger
.
info
(
"进行date:"
+
sameDate
+
" 的对标单元试运行计算.....日志id:"
+
compCalLogId
);
}
else
{
}
else
{
...
@@ -70,6 +73,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -70,6 +73,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
startCompareUnitCalMsg
.
setUser
(
beforeCompareUnitCalMsg
.
getUser
());
startCompareUnitCalMsg
.
setUser
(
beforeCompareUnitCalMsg
.
getUser
());
startCompareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
startCompareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
//设置对标单元目录
startCompareUnitCalMsg
.
setPath
(
path
);
ActorRef
startCompareUnitCalActor
=
this
.
getContext
().
actorOf
(
Props
.
create
(
ActorRef
startCompareUnitCalActor
=
this
.
getContext
().
actorOf
(
Props
.
create
(
StartCompareUnitCalActor
.
class
,()->
new
StartCompareUnitCalActor
(
getSelf
())));
StartCompareUnitCalActor
.
class
,()->
new
StartCompareUnitCalActor
(
getSelf
())));
...
@@ -96,6 +101,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -96,6 +101,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
StartCompareUnitCalMsg
startCompareUnitCalMsg
=
new
StartCompareUnitCalMsg
(
StartCompareUnitCalMsg
startCompareUnitCalMsg
=
new
StartCompareUnitCalMsg
(
currentCompareUnitDef
,
code
,
isTest
);
currentCompareUnitDef
,
code
,
isTest
);
startCompareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
startCompareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
//设置对标单元目录
startCompareUnitCalMsg
.
setPath
(
path
);
ActorRef
startCompareUnitCalActor
=
this
.
getContext
().
actorOf
(
Props
.
create
(
ActorRef
startCompareUnitCalActor
=
this
.
getContext
().
actorOf
(
Props
.
create
(
StartCompareUnitCalActor
.
class
,()->
new
StartCompareUnitCalActor
(
getSelf
())));
StartCompareUnitCalActor
.
class
,()->
new
StartCompareUnitCalActor
(
getSelf
())));
...
@@ -107,7 +114,6 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -107,7 +114,6 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
Map
<
String
,
String
>
compareObjMap
=
new
HashMap
<>();
Map
<
String
,
String
>
compareObjMap
=
new
HashMap
<>();
logger
.
info
(
"进行date:"
+
currentDate
+
" 指标本期同期报表数据和考核指标报表数据2数据整合"
);
logger
.
info
(
"进行date:"
+
currentDate
+
" 指标本期同期报表数据和考核指标报表数据2数据整合"
);
//整合考核指标报表数据2
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
if
(
StringUtils
.
isNotBlank
(
unitDef
.
getIndIds
())
&&
if
(
StringUtils
.
isNotBlank
(
unitDef
.
getIndIds
())
&&
StringUtils
.
isNotBlank
(
unitDef
.
getCompareObjs
()))
{
StringUtils
.
isNotBlank
(
unitDef
.
getCompareObjs
()))
{
...
@@ -118,13 +124,13 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -118,13 +124,13 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
compareObjMap
.
put
(
compareObj
,
compareObj
);
compareObjMap
.
put
(
compareObj
,
compareObj
);
}
}
//整合指标本期同期报表数据
//整合指标本期同期报表数据
indicatorsReportService
.
dealReportOne
(
indicatorsReportService
.
dealReportOne
(
path
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
(),
code
);
unitDef
.
getDate
(),
code
);
//整合考核指标报表数据2
//整合考核指标报表数据2
indicatorsReportService
.
dealDriveIndReportTwoData
(
indicatorsReportService
.
dealDriveIndReportTwoData
(
path
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
(),
code
);
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
(),
code
);
}
}
...
@@ -140,10 +146,10 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
...
@@ -140,10 +146,10 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
//整合考核指标报表数据3
//整合考核指标报表数据3
logger
.
info
(
"进行date:"
+
currentDate
+
" 指标报表3数据整合"
);
logger
.
info
(
"进行date:"
+
currentDate
+
" 指标报表3数据整合"
);
//删除历史数据
//删除历史数据
indicatorsReportService
.
deleteReportThreeDataByParam
(
currentDate
,
indicatorsReportService
.
deleteReportThreeDataByParam
(
path
,
currentDate
,
new
ArrayList
<
String
>(
compareObjMap
.
keySet
()),
code
);
new
ArrayList
<
String
>(
compareObjMap
.
keySet
()),
code
);
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
for
(
CompareUnitDef
unitDef
:
currentCompareUnitDef
)
{
indicatorsReportService
.
dealDriveIndReportThreeData
(
indicatorsReportService
.
dealDriveIndReportThreeData
(
path
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getDate
(),
code
);
unitDef
.
getDate
(),
code
);
}
}
...
...
src/main/java/com/keymobile/indicators/akka/actor/indicators/CompareUnitCalActor.java
View file @
fd87055a
...
@@ -51,8 +51,11 @@ public class CompareUnitCalActor extends AbstractActor{
...
@@ -51,8 +51,11 @@ public class CompareUnitCalActor extends AbstractActor{
private
String
code
;
//机构编码
private
String
code
;
//机构编码
private
Integer
compCalLogId
;
private
Integer
compCalLogId
;
private
String
isTest
;
private
String
isTest
;
private
String
path
;
//对标单元目录
private
final
ActorRef
startCompareUnitCalActor
;
//定义父actor
private
final
ActorRef
startCompareUnitCalActor
;
//定义父actor
static
public
Props
props
(
ActorRef
startCompareUnitCalActor
)
{
static
public
Props
props
(
ActorRef
startCompareUnitCalActor
)
{
...
@@ -78,6 +81,7 @@ public class CompareUnitCalActor extends AbstractActor{
...
@@ -78,6 +81,7 @@ public class CompareUnitCalActor extends AbstractActor{
code
=
compareUnitCalMsg
.
getCode
();
code
=
compareUnitCalMsg
.
getCode
();
isTest
=
compareUnitCalMsg
.
getIsTest
();
isTest
=
compareUnitCalMsg
.
getIsTest
();
compCalLogId
=
compareUnitCalMsg
.
getCompCalLogId
();
compCalLogId
=
compareUnitCalMsg
.
getCompCalLogId
();
path
=
compareUnitCalMsg
.
getPath
();
// //新增运行日志记录
// //新增运行日志记录
// CompareUnitCalLog compCalLog = new CompareUnitCalLog(compareId,date,
// CompareUnitCalLog compCalLog = new CompareUnitCalLog(compareId,date,
// System.currentTimeMillis()+"","0");
// System.currentTimeMillis()+"","0");
...
@@ -104,6 +108,8 @@ public class CompareUnitCalActor extends AbstractActor{
...
@@ -104,6 +108,8 @@ public class CompareUnitCalActor extends AbstractActor{
compareUnitDef
.
getCompareId
(),
indId
,
compareObjsList
,
compareUnitDef
.
getDate
(),
compareUnitDef
.
getCompareId
(),
indId
,
compareObjsList
,
compareUnitDef
.
getDate
(),
firstExe
,
averageObj
,
compCalLogId
,
compareUnitCalMsg
.
getCode
(),
firstExe
,
averageObj
,
compCalLogId
,
compareUnitCalMsg
.
getCode
(),
compareUnitCalMsg
.
getIsTest
());
compareUnitCalMsg
.
getIsTest
());
//设置对标单元目录
driveIndIdCalMsg
.
setPath
(
path
);
//start akka
//start akka
ActorRef
driveIndIdCalActor
=
this
.
getContext
()
ActorRef
driveIndIdCalActor
=
this
.
getContext
()
.
actorOf
(
Props
.
create
(
DriveIndIdCalActor
.
class
,
.
actorOf
(
Props
.
create
(
DriveIndIdCalActor
.
class
,
...
@@ -164,8 +170,7 @@ public class CompareUnitCalActor extends AbstractActor{
...
@@ -164,8 +170,7 @@ public class CompareUnitCalActor extends AbstractActor{
})
})
.
build
();
.
build
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
error
(
"error:"
,
e
);
CompareUnitCalLog
compCalLog
=
compareUnitCalLogService
.
findById
(
compCalLogId
);
CompareUnitCalLog
compCalLog
=
compareUnitCalLogService
.
findById
(
compCalLogId
);
if
(
compCalLog
!=
null
){
if
(
compCalLog
!=
null
){
compCalLog
.
setEndTime
(
System
.
currentTimeMillis
()+
""
);
compCalLog
.
setEndTime
(
System
.
currentTimeMillis
()+
""
);
...
...
src/main/java/com/keymobile/indicators/akka/actor/indicators/DriveIndIdCalActor.java
View file @
fd87055a
...
@@ -63,6 +63,8 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -63,6 +63,8 @@ public class DriveIndIdCalActor extends AbstractActor{
private
Integer
compCalLogId
;
private
Integer
compCalLogId
;
private
String
path
;
//对标单元目录
private
final
ActorRef
compareUnitCalActor
;
//定义父actor
private
final
ActorRef
compareUnitCalActor
;
//定义父actor
static
public
Props
props
(
ActorRef
compareUnitCalActor
)
{
static
public
Props
props
(
ActorRef
compareUnitCalActor
)
{
...
@@ -89,6 +91,8 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -89,6 +91,8 @@ public class DriveIndIdCalActor extends AbstractActor{
compareObjSize
=
compareObjs
.
size
();
compareObjSize
=
compareObjs
.
size
();
code
=
driveIndIdCalMsg
.
getCode
();
code
=
driveIndIdCalMsg
.
getCode
();
isTest
=
driveIndIdCalMsg
.
getIsTest
();
isTest
=
driveIndIdCalMsg
.
getIsTest
();
//对标单元目录
path
=
driveIndIdCalMsg
.
getPath
();
//日志记录id
//日志记录id
compCalLogId
=
driveIndIdCalMsg
.
getCompCalLogId
();
compCalLogId
=
driveIndIdCalMsg
.
getCompCalLogId
();
...
@@ -103,6 +107,8 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -103,6 +107,8 @@ public class DriveIndIdCalActor extends AbstractActor{
DriveIndIdObjCalMsg
driveIndIdObjCalMsg
=
new
DriveIndIdObjCalMsg
(
compareId
,
DriveIndIdObjCalMsg
driveIndIdObjCalMsg
=
new
DriveIndIdObjCalMsg
(
compareId
,
indId
,
compareObj
,
date
,
dimValueList
,
compCalLogId
,
indId
,
compareObj
,
date
,
dimValueList
,
compCalLogId
,
driveIndIdCalMsg
.
getCode
(),
driveIndIdCalMsg
.
getIsTest
());
driveIndIdCalMsg
.
getCode
(),
driveIndIdCalMsg
.
getIsTest
());
//设置对标单元目录
driveIndIdObjCalMsg
.
setPath
(
path
);
ActorRef
driveIndIdObjCalActor
=
this
.
getContext
()
ActorRef
driveIndIdObjCalActor
=
this
.
getContext
()
.
actorOf
(
Props
.
create
(
DriveIndIdObjCalActor
.
class
,
.
actorOf
(
Props
.
create
(
DriveIndIdObjCalActor
.
class
,
()
->
new
DriveIndIdObjCalActor
(
getSelf
())));
()
->
new
DriveIndIdObjCalActor
(
getSelf
())));
...
@@ -115,6 +121,8 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -115,6 +121,8 @@ public class DriveIndIdCalActor extends AbstractActor{
String
indType
=
calIndAverageAndRankMsg
.
getIndType
();
//指标类型:正向 反向
String
indType
=
calIndAverageAndRankMsg
.
getIndType
();
//指标类型:正向 反向
Integer
scoreCardId
=
calIndAverageAndRankMsg
.
getScoreCardId
();
//评分卡id
Integer
scoreCardId
=
calIndAverageAndRankMsg
.
getScoreCardId
();
//评分卡id
Integer
compCalLogId
=
calIndAverageAndRankMsg
.
getCompCalLogId
();
//记录日志id
Integer
compCalLogId
=
calIndAverageAndRankMsg
.
getCompCalLogId
();
//记录日志id
//对标单元目录
String
compareCatalog
=
calIndAverageAndRankMsg
.
getPath
();
if
(!
"-1"
.
equals
(
id
))
{
if
(!
"-1"
.
equals
(
id
))
{
valueMap
.
put
(
id
,
value
);
valueMap
.
put
(
id
,
value
);
compareObjs
.
add
(
calIndAverageAndRankMsg
.
getCompareObj
());
compareObjs
.
add
(
calIndAverageAndRankMsg
.
getCompareObj
());
...
@@ -130,9 +138,14 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -130,9 +138,14 @@ public class DriveIndIdCalActor extends AbstractActor{
String
actualAverage
=
"0.0"
;
//实际平均分
String
actualAverage
=
"0.0"
;
//实际平均分
if
(
StringUtils
.
isNotBlank
(
averageObj
))
{
if
(
StringUtils
.
isNotBlank
(
averageObj
))
{
if
(
"0"
.
equals
(
isTest
))
{
if
(
"0"
.
equals
(
isTest
))
{
// TestDriveIndCalResultDef provinceDriveIndCalResult =
// testDriveIndCalResultService.findCompareObjInfo(
// calIndAverageAndRankMsg.getDriveIndId(),
// calIndAverageAndRankMsg.getDate(),
// averageObj, code);
TestDriveIndCalResultDef
provinceDriveIndCalResult
=
TestDriveIndCalResultDef
provinceDriveIndCalResult
=
testDriveIndCalResultService
.
findCompareObjInfo
(
testDriveIndCalResultService
.
findCompareObjInfo
(
calIndAverageAndRankMsg
.
getDriveIndId
(),
c
ompareCatalog
,
c
alIndAverageAndRankMsg
.
getDriveIndId
(),
calIndAverageAndRankMsg
.
getDate
(),
calIndAverageAndRankMsg
.
getDate
(),
averageObj
,
code
);
averageObj
,
code
);
if
(
provinceDriveIndCalResult
!=
null
)
{
if
(
provinceDriveIndCalResult
!=
null
)
{
...
@@ -140,9 +153,14 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -140,9 +153,14 @@ public class DriveIndIdCalActor extends AbstractActor{
actualAverage
=
provinceDriveIndCalResult
.
getValue
();
actualAverage
=
provinceDriveIndCalResult
.
getValue
();
}
}
}
else
{
}
else
{
// DriveIndCalResultDef provinceDriveIndCalResult =
// driveIndCalResultService.findCompareObjInfo(
// calIndAverageAndRankMsg.getDriveIndId(),
// calIndAverageAndRankMsg.getDate(),
// averageObj, code);
DriveIndCalResultDef
provinceDriveIndCalResult
=
DriveIndCalResultDef
provinceDriveIndCalResult
=
driveIndCalResultService
.
findCompareObjInfo
(
driveIndCalResultService
.
findCompareObjInfo
(
calIndAverageAndRankMsg
.
getDriveIndId
(),
c
ompareCatalog
,
c
alIndAverageAndRankMsg
.
getDriveIndId
(),
calIndAverageAndRankMsg
.
getDate
(),
calIndAverageAndRankMsg
.
getDate
(),
averageObj
,
code
);
averageObj
,
code
);
if
(
provinceDriveIndCalResult
!=
null
)
{
if
(
provinceDriveIndCalResult
!=
null
)
{
...
@@ -202,10 +220,10 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -202,10 +220,10 @@ public class DriveIndIdCalActor extends AbstractActor{
findById
(
Integer
.
parseInt
(
entry
.
getKey
()));
findById
(
Integer
.
parseInt
(
entry
.
getKey
()));
if
(
driveIndCalResult
!=
null
)
{
if
(
driveIndCalResult
!=
null
)
{
//计算分数
//计算分数
Map
<
String
,
String
>
scoreMap
=
indScorecardService
.
calculateIndiScore
(
Map
<
String
,
String
>
scoreMap
=
indScorecardService
.
calculateIndiScore
(
compareCatalog
,
driveIndCalResult
.
getIndId
(),
driveIndCalResult
.
getDate
(),
driveIndCalResult
.
get
CompareId
(),
driveIndCalResult
.
get
IndId
(),
driveIndCalResult
.
getDate
(),
driveIndCalResult
.
getCompareObj
(),
scoreCardId
,
driveIndCalResult
.
getCompareObj
(),
scoreCardId
,
compareObjs
,
code
);
driveIndCalResult
.
getCompareId
(),
compareObjs
,
code
);
//填充指标分数和改善提升分数
driveIndCalResult
.
setScore
(
scoreMap
.
get
(
"score"
));
driveIndCalResult
.
setScore
(
scoreMap
.
get
(
"score"
));
driveIndCalResult
.
setImproveScore
(
scoreMap
.
get
(
"improveScore"
));
driveIndCalResult
.
setImproveScore
(
scoreMap
.
get
(
"improveScore"
));
testDataList
.
add
(
driveIndCalResult
);
testDataList
.
add
(
driveIndCalResult
);
...
@@ -216,10 +234,10 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -216,10 +234,10 @@ public class DriveIndIdCalActor extends AbstractActor{
findById
(
Integer
.
parseInt
(
entry
.
getKey
()));
findById
(
Integer
.
parseInt
(
entry
.
getKey
()));
if
(
driveIndCalResult
!=
null
)
{
if
(
driveIndCalResult
!=
null
)
{
//计算分数
//计算分数
Map
<
String
,
String
>
scoreMap
=
indScorecardService
.
calculateIndiScore
(
Map
<
String
,
String
>
scoreMap
=
indScorecardService
.
calculateIndiScore
(
compareCatalog
,
driveIndCalResult
.
getIndId
(),
driveIndCalResult
.
getDate
(),
driveIndCalResult
.
get
CompareId
(),
driveIndCalResult
.
get
IndId
(),
driveIndCalResult
.
getDate
(),
driveIndCalResult
.
getCompareObj
(),
scoreCardId
,
driveIndCalResult
.
getCompareObj
(),
scoreCardId
,
compareObjs
,
code
);
driveIndCalResult
.
getCompareId
(),
compareObjs
,
code
);
//填充指标分数和改善提升分数
driveIndCalResult
.
setScore
(
scoreMap
.
get
(
"score"
));
driveIndCalResult
.
setScore
(
scoreMap
.
get
(
"score"
));
driveIndCalResult
.
setImproveScore
(
scoreMap
.
get
(
"improveScore"
));
driveIndCalResult
.
setImproveScore
(
scoreMap
.
get
(
"improveScore"
));
dataList
.
add
(
driveIndCalResult
);
dataList
.
add
(
driveIndCalResult
);
...
@@ -253,8 +271,7 @@ public class DriveIndIdCalActor extends AbstractActor{
...
@@ -253,8 +271,7 @@ public class DriveIndIdCalActor extends AbstractActor{
})
})
.
build
();
.
build
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
error
(
"error:"
,
e
);
CompareUnitCalLog
compCalLog
=
compareUnitCalLogService
.
findById
(
compCalLogId
);
CompareUnitCalLog
compCalLog
=
compareUnitCalLogService
.
findById
(
compCalLogId
);
if
(
compCalLog
!=
null
){
if
(
compCalLog
!=
null
){
compCalLog
.
setEndTime
(
System
.
currentTimeMillis
()+
""
);
compCalLog
.
setEndTime
(
System
.
currentTimeMillis
()+
""
);
...
...
src/main/java/com/keymobile/indicators/akka/actor/indicators/DriveIndIdObjCalActor.java
View file @
fd87055a
...
@@ -79,6 +79,8 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -79,6 +79,8 @@ public class DriveIndIdObjCalActor extends AbstractActor{
private
Integer
compCalLogId
=
null
;
private
Integer
compCalLogId
=
null
;
private
String
path
=
null
;
//对标单元目录
private
final
ActorRef
driveIndIdCalActor
;
//定义父actor
private
final
ActorRef
driveIndIdCalActor
;
//定义父actor
static
public
Props
props
(
ActorRef
driveIndIdCalActor
)
{
static
public
Props
props
(
ActorRef
driveIndIdCalActor
)
{
...
@@ -103,6 +105,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -103,6 +105,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
compCalLogId
=
driveIndIdObjCalMsg
.
getCompCalLogId
();
compCalLogId
=
driveIndIdObjCalMsg
.
getCompCalLogId
();
code
=
driveIndIdObjCalMsg
.
getCode
();
code
=
driveIndIdObjCalMsg
.
getCode
();
isTest
=
driveIndIdObjCalMsg
.
getIsTest
();
isTest
=
driveIndIdObjCalMsg
.
getIsTest
();
path
=
driveIndIdObjCalMsg
.
getPath
();
List
<
String
>
indIdList
=
new
ArrayList
<>();
//定义存储从考核指标公式解析出来的基础指标id
List
<
String
>
indIdList
=
new
ArrayList
<>();
//定义存储从考核指标公式解析出来的基础指标id
...
@@ -113,7 +116,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -113,7 +116,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
new
CalIndAverageAndRankMsg
(-
1
,
new
CalIndAverageAndRankMsg
(-
1
,
compareId
,
driveIndId
,
compareObj
,
date
,
"NaN"
,
compareId
,
driveIndId
,
compareObj
,
date
,
"NaN"
,
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
);
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
,
path
);
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
}
else
{
}
else
{
unit
=
driveIndDef
.
getIndUnit
();
//指标单位
unit
=
driveIndDef
.
getIndUnit
();
//指标单位
...
@@ -138,7 +141,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -138,7 +141,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
driveIndIdObjCalMsg
.
getCode
());
driveIndIdObjCalMsg
.
getCode
());
//传入日志id
//传入日志id
getBaseIndValueMsg
.
setCompCalLogId
(
compCalLogId
);
getBaseIndValueMsg
.
setCompCalLogId
(
compCalLogId
);
//取根据基础指标id和维度去基础指标表取对应的指标值actor
ActorRef
getBaseIndValueActor
=
this
.
getContext
()
ActorRef
getBaseIndValueActor
=
this
.
getContext
()
.
actorOf
(
Props
.
create
(
GetBaseIndValueActor
.
class
,
.
actorOf
(
Props
.
create
(
GetBaseIndValueActor
.
class
,
()
->
new
GetBaseIndValueActor
()));
()
->
new
GetBaseIndValueActor
()));
...
@@ -223,17 +226,23 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -223,17 +226,23 @@ public class DriveIndIdObjCalActor extends AbstractActor{
}
}
if
(
"0"
.
equals
(
isTest
))
{
//试运行
if
(
"0"
.
equals
(
isTest
))
{
//试运行
//判断结果表中是否已存在该结果数据,存在则覆盖
//判断结果表中是否已存在该结果数据,存在则覆盖
//TestDriveIndCalResultDef driveIndCalResult = testDriveIndCalResultService.
//findCalResultDataIsExist(compareId, compareObj, driveIndId, date, code);
try
{
TestDriveIndCalResultDef
driveIndCalResult
=
testDriveIndCalResultService
.
TestDriveIndCalResultDef
driveIndCalResult
=
testDriveIndCalResultService
.
findCalResultDataIsExist
(
compareId
,
compareObj
,
driveIndId
,
date
,
code
);
findCalResultDataIsExistByCatalog
(
path
,
compareObj
,
driveIndId
,
date
,
code
);
if
(
driveIndCalResult
==
null
)
{
if
(
driveIndCalResult
==
null
)
{
driveIndCalResult
=
new
TestDriveIndCalResultDef
(
compareId
,
driveIndCalResult
=
new
TestDriveIndCalResultDef
(
compareId
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
unit
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
unit
,
"1"
,
"1"
,
"admin"
,
code
,
baseIndValueMsg
.
getCompareObjDesc
());
"1"
,
"1"
,
"admin"
,
code
,
baseIndValueMsg
.
getCompareObjDesc
());
//设置对标单元目录
driveIndCalResult
.
setCompareCatalog
(
path
);
}
else
{
}
else
{
driveIndCalResult
.
setCode
(
code
);
driveIndCalResult
.
setCode
(
code
);
driveIndCalResult
.
setUnit
(
unit
);
driveIndCalResult
.
setUnit
(
unit
);
driveIndCalResult
.
setValue
(
driveIndValue
);
driveIndCalResult
.
setValue
(
driveIndValue
);
driveIndCalResult
.
setLastUpdateTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
driveIndCalResult
.
setLastUpdateTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
driveIndCalResult
.
setCompareCatalog
(
path
);
}
}
//保存进考核指标结果表中
//保存进考核指标结果表中
testDriveIndCalResultService
.
saveOrUpdate
(
driveIndCalResult
);
testDriveIndCalResultService
.
saveOrUpdate
(
driveIndCalResult
);
...
@@ -241,21 +250,34 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -241,21 +250,34 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
new
CalIndAverageAndRankMsg
(
driveIndCalResult
.
getId
(),
new
CalIndAverageAndRankMsg
(
driveIndCalResult
.
getId
(),
compareId
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
compareId
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
);
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
,
path
);
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"compareCatalog:"
+
path
+
";compareObj:"
+
compareObj
+
";driveIndId:"
+
driveIndId
+
";date:"
+
date
+
";code:"
+
code
+
" have no only one"
);
throw
new
Exception
(
e
);
}
}
else
{
}
else
{
//判断结果表中是否已存在该结果数据,存在则覆盖
//判断结果表中是否已存在该结果数据,存在则覆盖
//DriveIndCalResultDef driveIndCalResult = driveIndCalResultService.
//findCalResultDataIsExist(compareId, compareObj, driveIndId, date, code);
try
{
//根据对标单元目录进行查找
DriveIndCalResultDef
driveIndCalResult
=
driveIndCalResultService
.
DriveIndCalResultDef
driveIndCalResult
=
driveIndCalResultService
.
findCalResultDataIsExist
(
compareId
,
compareObj
,
driveIndId
,
date
,
code
);
findCalResultDataIsExistByCatalog
(
path
,
compareObj
,
driveIndId
,
date
,
code
);
if
(
driveIndCalResult
==
null
)
{
if
(
driveIndCalResult
==
null
)
{
driveIndCalResult
=
new
DriveIndCalResultDef
(
compareId
,
driveIndCalResult
=
new
DriveIndCalResultDef
(
compareId
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
unit
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
unit
,
"1"
,
"1"
,
"admin"
,
code
,
baseIndValueMsg
.
getCompareObjDesc
());
"1"
,
"1"
,
"admin"
,
code
,
baseIndValueMsg
.
getCompareObjDesc
());
//设置对标单元路径
driveIndCalResult
.
setCompareCatalog
(
path
);
}
else
{
}
else
{
driveIndCalResult
.
setCode
(
code
);
driveIndCalResult
.
setCode
(
code
);
driveIndCalResult
.
setUnit
(
unit
);
driveIndCalResult
.
setUnit
(
unit
);
driveIndCalResult
.
setValue
(
driveIndValue
);
driveIndCalResult
.
setValue
(
driveIndValue
);
driveIndCalResult
.
setLastUpdateTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
driveIndCalResult
.
setLastUpdateTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
driveIndCalResult
.
setCompareCatalog
(
path
);
}
}
//保存进考核指标结果表中
//保存进考核指标结果表中
driveIndCalResultService
.
saveOrUpdate
(
driveIndCalResult
);
driveIndCalResultService
.
saveOrUpdate
(
driveIndCalResult
);
...
@@ -263,8 +285,14 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -263,8 +285,14 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
new
CalIndAverageAndRankMsg
(
driveIndCalResult
.
getId
(),
new
CalIndAverageAndRankMsg
(
driveIndCalResult
.
getId
(),
compareId
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
compareId
,
driveIndId
,
compareObj
,
date
,
driveIndValue
,
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
);
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
,
path
);
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
}
catch
(
Exception
e
)
{
logger
.
error
(
"compareCatalog:"
+
path
+
";compareObj:"
+
compareObj
+
";driveIndId:"
+
driveIndId
+
";date:"
+
date
+
";code:"
+
code
+
" have no only one"
);
throw
new
Exception
(
e
);
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -307,7 +335,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -307,7 +335,7 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
new
CalIndAverageAndRankMsg
(-
1
,
new
CalIndAverageAndRankMsg
(-
1
,
compareId
,
driveIndId
,
compareObj
,
date
,
"NaN"
,
compareId
,
driveIndId
,
compareObj
,
date
,
"NaN"
,
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
);
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
,
path
);
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
}
}
}
else
{
}
else
{
...
@@ -319,14 +347,14 @@ public class DriveIndIdObjCalActor extends AbstractActor{
...
@@ -319,14 +347,14 @@ public class DriveIndIdObjCalActor extends AbstractActor{
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
CalIndAverageAndRankMsg
driveIndAverageAndRankMsg
=
new
CalIndAverageAndRankMsg
(-
1
,
new
CalIndAverageAndRankMsg
(-
1
,
compareId
,
driveIndId
,
compareObj
,
date
,
"NaN"
,
compareId
,
driveIndId
,
compareObj
,
date
,
"NaN"
,
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
);
unit
,
indType
,
scoreCardId
,
averageDriveIndFormula
,
compCalLogId
,
path
);
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
driveIndIdCalActor
.
tell
(
driveIndAverageAndRankMsg
,
ActorRef
.
noSender
());
}
}
}
}
})
})
.
build
();
.
build
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
(
);
logger
.
error
(
"error:"
,
e
);
CompareUnitCalLog
compCalLog
=
compareUnitCalLogService
.
findById
(
compCalLogId
);
CompareUnitCalLog
compCalLog
=
compareUnitCalLogService
.
findById
(
compCalLogId
);
if
(
compCalLog
!=
null
){
if
(
compCalLog
!=
null
){
compCalLog
.
setEndTime
(
System
.
currentTimeMillis
()+
""
);
compCalLog
.
setEndTime
(
System
.
currentTimeMillis
()+
""
);
...
...
src/main/java/com/keymobile/indicators/akka/actor/indicators/StartCompareUnitCalActor.java
View file @
fd87055a
...
@@ -51,6 +51,8 @@ public class StartCompareUnitCalActor extends AbstractActor{
...
@@ -51,6 +51,8 @@ public class StartCompareUnitCalActor extends AbstractActor{
private
String
isTest
=
null
;
//试运行,0:试运行 1:正式运行
private
String
isTest
=
null
;
//试运行,0:试运行 1:正式运行
private
Integer
compCalLogId
=
null
;
private
Integer
compCalLogId
=
null
;
private
String
path
=
null
;
//对标单元目录
private
final
ActorRef
beforeCompareUnitActor
;
//定义父actor
private
final
ActorRef
beforeCompareUnitActor
;
//定义父actor
static
public
Props
props
(
ActorRef
beforeCompareUnitActor
)
{
static
public
Props
props
(
ActorRef
beforeCompareUnitActor
)
{
...
@@ -72,9 +74,8 @@ public class StartCompareUnitCalActor extends AbstractActor{
...
@@ -72,9 +74,8 @@ public class StartCompareUnitCalActor extends AbstractActor{
String
user
=
startCompareUnitCalMsg
.
getUser
();
String
user
=
startCompareUnitCalMsg
.
getUser
();
compCalLogId
=
startCompareUnitCalMsg
.
getCompCalLogId
();
compCalLogId
=
startCompareUnitCalMsg
.
getCompCalLogId
();
List
<
CompareUnitDef
>
compareUnitDefs
=
startCompareUnitCalMsg
.
getCompareInitDefs
();
List
<
CompareUnitDef
>
compareUnitDefs
=
startCompareUnitCalMsg
.
getCompareInitDefs
();
path
=
startCompareUnitCalMsg
.
getPath
();
//将对标单元进行分类,需要先执行的先开始进行对标计算
//将对标单元进行分类,需要先执行的先开始进行对标计算
for
(
CompareUnitDef
unitDef
:
compareUnitDefs
)
{
for
(
CompareUnitDef
unitDef
:
compareUnitDefs
)
{
if
(
"1"
.
equals
(
unitDef
.
getFirstExe
()))
{
if
(
"1"
.
equals
(
unitDef
.
getFirstExe
()))
{
firstExeList
.
add
(
unitDef
);
firstExeList
.
add
(
unitDef
);
...
@@ -101,6 +102,8 @@ public class StartCompareUnitCalActor extends AbstractActor{
...
@@ -101,6 +102,8 @@ public class StartCompareUnitCalActor extends AbstractActor{
//运算者
//运算者
compareUnitCalMsg
.
setUser
(
user
);
compareUnitCalMsg
.
setUser
(
user
);
compareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
compareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
//设置对标单元目录
compareUnitCalMsg
.
setPath
(
path
);
ActorRef
compareUnitCalActor
=
this
.
getContext
()
ActorRef
compareUnitCalActor
=
this
.
getContext
()
.
actorOf
(
Props
.
create
(
CompareUnitCalActor
.
class
,
.
actorOf
(
Props
.
create
(
CompareUnitCalActor
.
class
,
...
@@ -114,6 +117,9 @@ public class StartCompareUnitCalActor extends AbstractActor{
...
@@ -114,6 +117,9 @@ public class StartCompareUnitCalActor extends AbstractActor{
startCompareUnitCalMsg
.
getCode
(),
startCompareUnitCalMsg
.
getCode
(),
startCompareUnitCalMsg
.
getIsTest
());
startCompareUnitCalMsg
.
getIsTest
());
compareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
compareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
//设置对标单元目录
compareUnitCalMsg
.
setPath
(
path
);
ActorRef
compareUnitCalActor
=
this
.
getContext
()
ActorRef
compareUnitCalActor
=
this
.
getContext
()
.
actorOf
(
Props
.
create
(
CompareUnitCalActor
.
class
,
.
actorOf
(
Props
.
create
(
CompareUnitCalActor
.
class
,
()
->
new
CompareUnitCalActor
(
getSelf
())));
()
->
new
CompareUnitCalActor
(
getSelf
())));
...
@@ -139,6 +145,9 @@ public class StartCompareUnitCalActor extends AbstractActor{
...
@@ -139,6 +145,9 @@ public class StartCompareUnitCalActor extends AbstractActor{
CompareUnitCalMsg
compareUnitCalMsg
=
new
CompareUnitCalMsg
(
unitDef
,
CompareUnitCalMsg
compareUnitCalMsg
=
new
CompareUnitCalMsg
(
unitDef
,
code
,
isTest
);
code
,
isTest
);
compareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
compareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
//设置对标单元目录
compareUnitCalMsg
.
setPath
(
path
);
ActorRef
compareUnitCalActor
=
this
.
getContext
()
ActorRef
compareUnitCalActor
=
this
.
getContext
()
.
actorOf
(
Props
.
create
(
CompareUnitCalActor
.
class
,
.
actorOf
(
Props
.
create
(
CompareUnitCalActor
.
class
,
()
->
new
CompareUnitCalActor
(
getSelf
())));
()
->
new
CompareUnitCalActor
(
getSelf
())));
...
@@ -159,12 +168,12 @@ public class StartCompareUnitCalActor extends AbstractActor{
...
@@ -159,12 +168,12 @@ public class StartCompareUnitCalActor extends AbstractActor{
for
(
CompareUnitDef
unitDef
:
calTypeExeList
)
{
for
(
CompareUnitDef
unitDef
:
calTypeExeList
)
{
//试运行
//试运行
if
(
"0"
.
equals
(
isTest
))
{
if
(
"0"
.
equals
(
isTest
))
{
testScoreRuleServer
.
testCalObjScore
(
unitDef
.
getCompareId
(),
testScoreRuleServer
.
testCalObjScore
(
path
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
}
else
{
}
else
{
scoreRuleServer
.
calObjScore
(
unitDef
.
getCompareId
(),
scoreRuleServer
.
calObjScore
(
path
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
...
@@ -193,12 +202,12 @@ public class StartCompareUnitCalActor extends AbstractActor{
...
@@ -193,12 +202,12 @@ public class StartCompareUnitCalActor extends AbstractActor{
for
(
CompareUnitDef
unitDef
:
calTypeExeList
)
{
for
(
CompareUnitDef
unitDef
:
calTypeExeList
)
{
//试运行
//试运行
if
(
"0"
.
equals
(
isTest
))
{
if
(
"0"
.
equals
(
isTest
))
{
testScoreRuleServer
.
testCalObjScore
(
unitDef
.
getCompareId
(),
testScoreRuleServer
.
testCalObjScore
(
path
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
}
else
{
}
else
{
scoreRuleServer
.
calObjScore
(
unitDef
.
getCompareId
(),
scoreRuleServer
.
calObjScore
(
path
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
Arrays
.
asList
(
unitDef
.
getCompareObjs
().
split
(
","
)),
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
unitDef
.
getDate
(),
unitDef
.
getObjScoreRuleId
(),
code
);
...
...
src/main/java/com/keymobile/indicators/akka/message/indicators/CalIndAverageAndRankMsg.java
View file @
fd87055a
...
@@ -19,10 +19,11 @@ public class CalIndAverageAndRankMsg implements Serializable{
...
@@ -19,10 +19,11 @@ public class CalIndAverageAndRankMsg implements Serializable{
private
Integer
scoreCardId
;
private
Integer
scoreCardId
;
private
String
indFormula
;
private
String
indFormula
;
private
Integer
compCalLogId
;
private
Integer
compCalLogId
;
private
String
path
;
//对标单元目录
public
CalIndAverageAndRankMsg
(
Integer
id
,
String
compareId
,
String
driveIndId
,
String
compareObj
,
public
CalIndAverageAndRankMsg
(
Integer
id
,
String
compareId
,
String
driveIndId
,
String
compareObj
,
Integer
date
,
String
driveIndValue
,
String
unit
,
String
indType
,
Integer
scoreCardId
,
Integer
date
,
String
driveIndValue
,
String
unit
,
String
indType
,
Integer
scoreCardId
,
String
indFormula
,
Integer
compCalLogId
)
{
String
indFormula
,
Integer
compCalLogId
,
String
path
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
compareId
=
compareId
;
this
.
compareId
=
compareId
;
this
.
driveIndId
=
driveIndId
;
this
.
driveIndId
=
driveIndId
;
...
@@ -34,6 +35,7 @@ public class CalIndAverageAndRankMsg implements Serializable{
...
@@ -34,6 +35,7 @@ public class CalIndAverageAndRankMsg implements Serializable{
this
.
scoreCardId
=
scoreCardId
;
this
.
scoreCardId
=
scoreCardId
;
this
.
indFormula
=
indFormula
;
this
.
indFormula
=
indFormula
;
this
.
compCalLogId
=
compCalLogId
;
this
.
compCalLogId
=
compCalLogId
;
this
.
path
=
path
;
}
}
public
Integer
getId
()
{
public
Integer
getId
()
{
...
@@ -104,4 +106,12 @@ public class CalIndAverageAndRankMsg implements Serializable{
...
@@ -104,4 +106,12 @@ public class CalIndAverageAndRankMsg implements Serializable{
public
void
setCompCalLogId
(
Integer
compCalLogId
)
{
public
void
setCompCalLogId
(
Integer
compCalLogId
)
{
this
.
compCalLogId
=
compCalLogId
;
this
.
compCalLogId
=
compCalLogId
;
}
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
}
}
src/main/java/com/keymobile/indicators/akka/message/indicators/CompareUnitCalMsg.java
View file @
fd87055a
...
@@ -19,6 +19,9 @@ public class CompareUnitCalMsg implements Serializable{
...
@@ -19,6 +19,9 @@ public class CompareUnitCalMsg implements Serializable{
private
String
user
;
private
String
user
;
private
Integer
compCalLogId
;
private
Integer
compCalLogId
;
private
String
path
;
//对标单元目录
public
CompareUnitCalMsg
(
CompareUnitDef
compareUnitDef
,
String
code
,
String
isTest
)
{
public
CompareUnitCalMsg
(
CompareUnitDef
compareUnitDef
,
String
code
,
String
isTest
)
{
this
.
compareUnitDef
=
compareUnitDef
;
this
.
compareUnitDef
=
compareUnitDef
;
this
.
code
=
code
;
this
.
code
=
code
;
...
@@ -64,4 +67,12 @@ public class CompareUnitCalMsg implements Serializable{
...
@@ -64,4 +67,12 @@ public class CompareUnitCalMsg implements Serializable{
public
void
setIsTest
(
String
isTest
)
{
public
void
setIsTest
(
String
isTest
)
{
this
.
isTest
=
isTest
;
this
.
isTest
=
isTest
;
}
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
}
}
src/main/java/com/keymobile/indicators/akka/message/indicators/DriveIndIdCalMsg.java
View file @
fd87055a
...
@@ -19,6 +19,7 @@ public class DriveIndIdCalMsg implements Serializable{
...
@@ -19,6 +19,7 @@ public class DriveIndIdCalMsg implements Serializable{
private
Integer
compCalLogId
;
//运行日志记录id
private
Integer
compCalLogId
;
//运行日志记录id
private
String
code
;
//机构编码
private
String
code
;
//机构编码
private
String
isTest
;
//试运行 0:试运行 1:正式运行
private
String
isTest
;
//试运行 0:试运行 1:正式运行
private
String
path
;
//对标单元目录
public
DriveIndIdCalMsg
(
String
compareId
,
String
indId
,
List
<
String
>
compareObj
,
Integer
date
,
public
DriveIndIdCalMsg
(
String
compareId
,
String
indId
,
List
<
String
>
compareObj
,
Integer
date
,
String
firstExe
,
String
averageObj
,
Integer
compCalLogId
,
String
code
,
String
isTest
)
{
String
firstExe
,
String
averageObj
,
Integer
compCalLogId
,
String
code
,
String
isTest
)
{
...
@@ -94,4 +95,12 @@ public class DriveIndIdCalMsg implements Serializable{
...
@@ -94,4 +95,12 @@ public class DriveIndIdCalMsg implements Serializable{
public
void
setIsTest
(
String
isTest
)
{
public
void
setIsTest
(
String
isTest
)
{
this
.
isTest
=
isTest
;
this
.
isTest
=
isTest
;
}
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
}
}
src/main/java/com/keymobile/indicators/akka/message/indicators/DriveIndIdObjCalMsg.java
View file @
fd87055a
...
@@ -20,6 +20,7 @@ public class DriveIndIdObjCalMsg implements Serializable{
...
@@ -20,6 +20,7 @@ public class DriveIndIdObjCalMsg implements Serializable{
private
Integer
compCalLogId
;
//运行日志记录id
private
Integer
compCalLogId
;
//运行日志记录id
private
String
code
;
//机构编码
private
String
code
;
//机构编码
private
String
isTest
;
//试运行
private
String
isTest
;
//试运行
private
String
path
;
//对标单元目录
public
DriveIndIdObjCalMsg
(
String
compareId
,
String
indId
,
String
compareObj
,
public
DriveIndIdObjCalMsg
(
String
compareId
,
String
indId
,
String
compareObj
,
Integer
date
,
List
<
DimValue
>
dimValues
,
Integer
compCalLogId
,
Integer
date
,
List
<
DimValue
>
dimValues
,
Integer
compCalLogId
,
...
@@ -88,4 +89,12 @@ public class DriveIndIdObjCalMsg implements Serializable{
...
@@ -88,4 +89,12 @@ public class DriveIndIdObjCalMsg implements Serializable{
public
void
setIsTest
(
String
isTest
)
{
public
void
setIsTest
(
String
isTest
)
{
this
.
isTest
=
isTest
;
this
.
isTest
=
isTest
;
}
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
}
}
src/main/java/com/keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
View file @
fd87055a
...
@@ -143,11 +143,11 @@ public class IndScorecardCtrl {
...
@@ -143,11 +143,11 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"根据评分卡计算指标分数"
,
notes
=
"根据评分卡计算指标分数"
)
@ApiOperation
(
value
=
"根据评分卡计算指标分数"
,
notes
=
"根据评分卡计算指标分数"
)
@PostMapping
(
value
=
"/calculateIndiScore"
)
@PostMapping
(
value
=
"/calculateIndiScore"
)
public
Map
<
String
,
String
>
calculateIndiScore
(
@RequestParam
String
indId
,
@RequestParam
int
date
,
public
Map
<
String
,
String
>
calculateIndiScore
(
@RequestParam
String
compareCatalog
,
@RequestParam
String
compareId
,
@RequestParam
String
indId
,
@RequestParam
int
date
,
@RequestParam
String
compareObj
,
@RequestParam
Integer
indScorecardId
,
@RequestParam
String
compareObj
,
@RequestParam
Integer
indScorecardId
,
@RequestParam
String
compareId
,
@RequestBody
List
<
String
>
compareObjs
,
@RequestBody
List
<
String
>
compareObjs
,
@RequestParam
String
code
)
throws
Exception
{
@RequestParam
String
code
)
throws
Exception
{
return
indScorecardService
.
calculateIndiScore
(
compareCatalog
,
compareId
,
indId
,
date
,
compareObj
,
return
indScorecardService
.
calculateIndiScore
(
indId
,
date
,
compareObj
,
indScorecardId
,
compareObjs
,
code
);
indScorecardId
,
compareId
,
compareObjs
,
code
);
}
}
}
}
src/main/java/com/keymobile/indicators/api/hytobacco/ObjScoreRuleCtrl.java
View file @
fd87055a
...
@@ -143,10 +143,10 @@ public class ObjScoreRuleCtrl {
...
@@ -143,10 +143,10 @@ public class ObjScoreRuleCtrl {
@ApiOperation
(
value
=
"根据单位评分规则计算单位评分"
,
notes
=
"根据单位评分规则计算单位评分"
)
@ApiOperation
(
value
=
"根据单位评分规则计算单位评分"
,
notes
=
"根据单位评分规则计算单位评分"
)
@PostMapping
(
value
=
"/calculateObjectScore"
)
@PostMapping
(
value
=
"/calculateObjectScore"
)
public
void
calculateObjectScore
(
public
void
calculateObjectScore
(
@RequestParam
String
compareCatalog
,
@RequestParam
String
compareId
,
@RequestParam
List
<
String
>
indIds
,
@RequestParam
String
compareId
,
@RequestParam
List
<
String
>
indIds
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
int
date
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
int
date
,
@RequestParam
Integer
scoreRuleId
,
@RequestParam
String
code
){
@RequestParam
Integer
scoreRuleId
,
@RequestParam
String
code
){
scoreRuleService
.
calObjScore
(
compareId
,
indIds
,
compareObjs
,
date
,
scoreRuleId
,
code
);
scoreRuleService
.
calObjScore
(
compare
Catalog
,
compare
Id
,
indIds
,
compareObjs
,
date
,
scoreRuleId
,
code
);
}
}
}
}
src/main/java/com/keymobile/indicators/api/report/IndicatorReportCtrl.java
View file @
fd87055a
...
@@ -28,9 +28,10 @@ public class IndicatorReportCtrl {
...
@@ -28,9 +28,10 @@ public class IndicatorReportCtrl {
@ApiOperation
(
value
=
"整合指标本期同期报表数据"
,
notes
=
"整合指标本期同期报表数据"
)
@ApiOperation
(
value
=
"整合指标本期同期报表数据"
,
notes
=
"整合指标本期同期报表数据"
)
@PostMapping
(
value
=
"/dealReportOne"
)
@PostMapping
(
value
=
"/dealReportOne"
)
public
String
dealReportOne
(
@RequestParam
String
compareUnitId
,
@RequestParam
List
<
String
>
indIds
,
public
String
dealReportOne
(
@RequestParam
String
compareCatalog
,
@RequestParam
String
compareUnitId
,
@RequestParam
List
<
String
>
indIds
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
Integer
date
,
@RequestParam
String
code
)
{
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
Integer
date
,
@RequestParam
String
code
)
{
indicatorsReportService
.
dealReportOne
(
compareUnitId
,
indIds
,
compareObjs
,
date
,
code
);
indicatorsReportService
.
dealReportOne
(
compare
Catalog
,
compare
UnitId
,
indIds
,
compareObjs
,
date
,
code
);
return
"考核指标本期同期报表数据开始整合..."
;
return
"考核指标本期同期报表数据开始整合..."
;
}
}
...
@@ -44,17 +45,18 @@ public class IndicatorReportCtrl {
...
@@ -44,17 +45,18 @@ public class IndicatorReportCtrl {
@ApiOperation
(
value
=
"整合考核指标报表数据2"
,
notes
=
"整合考核指标报表数据2"
)
@ApiOperation
(
value
=
"整合考核指标报表数据2"
,
notes
=
"整合考核指标报表数据2"
)
@PostMapping
(
value
=
"/dealDriveReportTwo"
)
@PostMapping
(
value
=
"/dealDriveReportTwo"
)
public
String
dealDriveReportTwo
(
@RequestParam
String
compareUnitId
,
@RequestParam
List
<
String
>
indIds
,
public
String
dealDriveReportTwo
(
@RequestParam
String
compareCatalog
,
@RequestParam
String
compareUnitId
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
Integer
date
,
@RequestParam
List
<
String
>
indIds
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
String
code
)
{
@RequestParam
Integer
date
,
@RequestParam
String
code
)
{
indicatorsReportService
.
dealDriveIndReportTwoData
(
compareUnitId
,
indIds
,
compareObjs
,
date
,
code
);
indicatorsReportService
.
dealDriveIndReportTwoData
(
compareCatalog
,
compareUnitId
,
indIds
,
compareObjs
,
date
,
code
);
return
"整合考核指标报表数据2开始整合..."
;
return
"整合考核指标报表数据2开始整合..."
;
}
}
@ApiOperation
(
value
=
"整合考核指标报表数据3"
,
notes
=
"整合考核指标报表数据3"
)
@ApiOperation
(
value
=
"整合考核指标报表数据3"
,
notes
=
"整合考核指标报表数据3"
)
@PostMapping
(
value
=
"/dealDriveReportThree"
)
@PostMapping
(
value
=
"/dealDriveReportThree"
)
public
String
dealDriveReportThree
(
@RequestBody
List
<
CompareUnitDef
>
compareUnitList
,
public
String
dealDriveReportThree
(
@RequestBody
List
<
CompareUnitDef
>
compareUnitList
,
@RequestParam
String
code
)
throws
Exception
{
@RequestParam
String
code
,
@RequestParam
String
compareCatalog
)
throws
Exception
{
Map
<
String
,
String
>
compareObjMap
=
new
HashMap
<>();
Map
<
String
,
String
>
compareObjMap
=
new
HashMap
<>();
Integer
date
=
null
;
Integer
date
=
null
;
for
(
CompareUnitDef
unitDef
:
compareUnitList
)
{
for
(
CompareUnitDef
unitDef
:
compareUnitList
)
{
...
@@ -67,10 +69,10 @@ public class IndicatorReportCtrl {
...
@@ -67,10 +69,10 @@ public class IndicatorReportCtrl {
date
=
unitDef
.
getDate
();
date
=
unitDef
.
getDate
();
}
}
//删除历史数据
//删除历史数据
indicatorsReportService
.
deleteReportThreeDataByParam
(
date
,
indicatorsReportService
.
deleteReportThreeDataByParam
(
compareCatalog
,
date
,
new
ArrayList
<
String
>(
compareObjMap
.
keySet
()),
code
);
new
ArrayList
<
String
>(
compareObjMap
.
keySet
()),
code
);
for
(
CompareUnitDef
unitDef
:
compareUnitList
)
{
for
(
CompareUnitDef
unitDef
:
compareUnitList
)
{
indicatorsReportService
.
dealDriveIndReportThreeData
(
indicatorsReportService
.
dealDriveIndReportThreeData
(
compareCatalog
,
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getCompareId
(),
Arrays
.
asList
(
unitDef
.
getIndIds
().
split
(
","
)),
unitDef
.
getDate
(),
code
);
unitDef
.
getDate
(),
code
);
}
}
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndCalResultDef.java
View file @
fd87055a
...
@@ -40,6 +40,7 @@ public class DriveIndCalResultDef {
...
@@ -40,6 +40,7 @@ public class DriveIndCalResultDef {
private
String
improveScore
;
//改善提升得分
private
String
improveScore
;
//改善提升得分
private
String
actualAverage
;
//实际平均数:用于省对市的操作,如果有全省的基础项数据,直接拿全省的基础项数据算考核指标做为其实际平均值
private
String
actualAverage
;
//实际平均数:用于省对市的操作,如果有全省的基础项数据,直接拿全省的基础项数据算考核指标做为其实际平均值
private
String
code
;
//编码标识
private
String
code
;
//编码标识
private
String
compareCatalog
;
//对标单元目录
public
DriveIndCalResultDef
()
{
public
DriveIndCalResultDef
()
{
super
();
super
();
...
...
src/main/java/com/keymobile/indicators/model/entity/objscorerule/ObjScoreCalResult.java
View file @
fd87055a
...
@@ -28,4 +28,5 @@ public class ObjScoreCalResult {
...
@@ -28,4 +28,5 @@ public class ObjScoreCalResult {
private
String
scoreSumValue
;
//指标总积分
private
String
scoreSumValue
;
//指标总积分
private
Integer
indCount
;
//指标个数
private
Integer
indCount
;
//指标个数
private
String
code
;
//机构编码
private
String
code
;
//机构编码
private
String
compareCatalog
;
//对标单元目录
}
}
src/main/java/com/keymobile/indicators/model/entity/report/IndicatorsReportOne.java
View file @
fd87055a
...
@@ -40,4 +40,5 @@ public class IndicatorsReportOne {
...
@@ -40,4 +40,5 @@ public class IndicatorsReportOne {
private
BigDecimal
lastSameScore
;
//同期综合评分
private
BigDecimal
lastSameScore
;
//同期综合评分
private
BigDecimal
lastSameImprove
;
//同期改善提升评分
private
BigDecimal
lastSameImprove
;
//同期改善提升评分
private
String
code
;
//编码标识
private
String
code
;
//编码标识
private
String
compareCatalog
;
//对标单元目录
}
}
src/main/java/com/keymobile/indicators/model/entity/report/IndicatorsReportThree.java
View file @
fd87055a
...
@@ -41,4 +41,5 @@ public class IndicatorsReportThree {
...
@@ -41,4 +41,5 @@ public class IndicatorsReportThree {
private
Integer
rankLastThreeCount
;
//排名末三指标个数
private
Integer
rankLastThreeCount
;
//排名末三指标个数
private
String
code
;
//机构编码
private
String
code
;
//机构编码
private
String
compareCatalog
;
//对标单元目录
}
}
src/main/java/com/keymobile/indicators/model/entity/report/IndicatorsReportTwo.java
View file @
fd87055a
...
@@ -60,4 +60,5 @@ public class IndicatorsReportTwo {
...
@@ -60,4 +60,5 @@ public class IndicatorsReportTwo {
private
String
rankLastThreeDesc
;
//排名末三描述
private
String
rankLastThreeDesc
;
//排名末三描述
private
String
code
;
//系统编码
private
String
code
;
//系统编码
private
String
compareCatalog
;
//对标单元目录
}
}
src/main/java/com/keymobile/indicators/model/entity/testrun/TestDriveIndCalResultDef.java
View file @
fd87055a
...
@@ -39,6 +39,7 @@ public class TestDriveIndCalResultDef {
...
@@ -39,6 +39,7 @@ public class TestDriveIndCalResultDef {
private
String
improveScore
;
//改善提升得分
private
String
improveScore
;
//改善提升得分
private
String
actualAverage
;
//实际平均数:用于省对市的操作,如果有全省的基础项数据,直接拿全省的基础项数据算考核指标做为其实际平均值
private
String
actualAverage
;
//实际平均数:用于省对市的操作,如果有全省的基础项数据,直接拿全省的基础项数据算考核指标做为其实际平均值
private
String
code
;
//编码标识
private
String
code
;
//编码标识
private
String
compareCatalog
;
//对标单元目录
public
TestDriveIndCalResultDef
()
{
public
TestDriveIndCalResultDef
()
{
super
();
super
();
...
...
src/main/java/com/keymobile/indicators/model/entity/testrun/TestObjScoreCalResult.java
View file @
fd87055a
...
@@ -27,4 +27,5 @@ public class TestObjScoreCalResult {
...
@@ -27,4 +27,5 @@ public class TestObjScoreCalResult {
private
String
scoreSumValue
;
//指标总积分
private
String
scoreSumValue
;
//指标总积分
private
Integer
indCount
;
//指标个数
private
Integer
indCount
;
//指标个数
private
String
code
;
//机构编码
private
String
code
;
//机构编码
private
String
compareCatalog
;
//对标单元目录
}
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndCalResultDefMapper.java
View file @
fd87055a
...
@@ -21,6 +21,15 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
...
@@ -21,6 +21,15 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
public
DriveIndCalResultDef
findByIndIdAndDateAndCompareObj
(
@Param
(
"indId"
)
String
indId
,
public
DriveIndCalResultDef
findByIndIdAndDateAndCompareObj
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"code"
)
String
code
);
@Param
(
"date"
)
int
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"code"
)
String
code
);
//根据对标单元目录
public
DriveIndCalResultDef
findByIndIdAndDateAndCompareObjAndCompareCatalog
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"code"
)
String
code
,
@Param
(
"compareCatalog"
)
String
compareCatalog
);
public
DriveIndCalResultDef
findByCompareCatalogAndIndIdAndDateAndCompareObj
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"code"
)
String
code
);
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDate
(
@Param
(
"indId"
)
String
indId
,
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDate
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
);
@Param
(
"date"
)
int
date
);
...
@@ -36,18 +45,30 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
...
@@ -36,18 +45,30 @@ public interface DriveIndCalResultDefMapper extends BaseMapper<DriveIndCalResult
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDateAndCompareIdAndSort
(
@Param
(
"indId"
)
String
indId
,
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDateAndCompareIdAndSort
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"code"
)
String
code
);
@Param
(
"date"
)
int
date
,
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"code"
)
String
code
);
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDateAndCompareCatalogAndSort
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"code"
)
String
code
);
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDateAndCompareId
(
@Param
(
"indId"
)
String
indId
,
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDateAndCompareId
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareId"
)
String
compareId
);
@Param
(
"date"
)
int
date
,
@Param
(
"compareId"
)
String
compareId
);
public
List
<
DriveIndCalResultDef
>
findByCompareObjAndDate
(
@Param
(
"compareObj"
)
String
compareObj
,
public
List
<
DriveIndCalResultDef
>
findByCompareObjAndDate
(
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
int
date
,
@Param
(
"code"
)
String
code
);
@Param
(
"date"
)
int
date
,
@Param
(
"code"
)
String
code
);
//使用对标单元目录进行过滤
public
List
<
DriveIndCalResultDef
>
findByCompareCatalogAndCompareObjAndDate
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
int
date
,
@Param
(
"code"
)
String
code
);
public
List
<
DriveIndCalResultDef
>
findByCompareObjAndDateAndIndIdIn
(
Map
<
String
,
Object
>
param
);
public
List
<
DriveIndCalResultDef
>
findByCompareObjAndDateAndIndIdIn
(
Map
<
String
,
Object
>
param
);
public
DriveIndCalResultDef
findByCompareIdAndCompareObjAndIndIdAndDate
(
public
DriveIndCalResultDef
findByCompareIdAndCompareObjAndIndIdAndDate
(
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
//根据目录单元目录查找对标结果
public
DriveIndCalResultDef
findByCompareCatalogAndCompareObjAndIndIdAndDate
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDateAndCompareObjIn
(
Map
<
String
,
Object
>
param
);
public
List
<
DriveIndCalResultDef
>
findByIndIdAndDateAndCompareObjIn
(
Map
<
String
,
Object
>
param
);
public
List
<
DriveIndCalResultDef
>
findByCompareIdAndDate
(
@Param
(
"compareId"
)
String
compareId
,
public
List
<
DriveIndCalResultDef
>
findByCompareIdAndDate
(
@Param
(
"compareId"
)
String
compareId
,
...
...
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ObjScoreCalResultMapper.java
View file @
fd87055a
...
@@ -15,6 +15,11 @@ public interface ObjScoreCalResultMapper extends BaseMapper<ObjScoreCalResult>{
...
@@ -15,6 +15,11 @@ public interface ObjScoreCalResultMapper extends BaseMapper<ObjScoreCalResult>{
public
ObjScoreCalResult
getObjScoreCalResultByParam
(
@Param
(
"compareId"
)
String
compareId
,
public
ObjScoreCalResult
getObjScoreCalResultByParam
(
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
//使用对标单元目录进行过滤
public
ObjScoreCalResult
getObjScoreCalResultByCompareCatalog
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
ObjScoreCalResult
>
datas
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
ObjScoreCalResult
>
datas
);
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
ObjScoreCalResult
>
datas
);
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
ObjScoreCalResult
>
datas
);
...
...
src/main/java/com/keymobile/indicators/model/mapper/report/ReportOneMapper.java
View file @
fd87055a
...
@@ -14,7 +14,8 @@ import tk.mybatis.mapper.common.BaseMapper;
...
@@ -14,7 +14,8 @@ import tk.mybatis.mapper.common.BaseMapper;
public
interface
ReportOneMapper
extends
BaseMapper
<
IndicatorsReportOne
>{
public
interface
ReportOneMapper
extends
BaseMapper
<
IndicatorsReportOne
>{
public
IndicatorsReportOne
getByParam
(
@Param
(
"indId"
)
String
indId
,
public
IndicatorsReportOne
getByParam
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
,
@Param
(
"code"
)
String
code
);
@Param
(
"type"
)
String
type
,
@Param
(
"code"
)
String
code
,
@Param
(
"compareCatalog"
)
String
compareCatalog
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
IndicatorsReportOne
>
datas
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
IndicatorsReportOne
>
datas
);
...
...
src/main/java/com/keymobile/indicators/model/mapper/report/ReportThreeMapper.java
View file @
fd87055a
...
@@ -13,7 +13,8 @@ import tk.mybatis.mapper.common.BaseMapper;
...
@@ -13,7 +13,8 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper
@Mapper
public
interface
ReportThreeMapper
extends
BaseMapper
<
IndicatorsReportThree
>{
public
interface
ReportThreeMapper
extends
BaseMapper
<
IndicatorsReportThree
>{
public
IndicatorsReportThree
getByParam
(
@Param
(
"compareObj"
)
String
compareObj
,
public
IndicatorsReportThree
getByParam
(
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
,
@Param
(
"code"
)
String
code
);
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
,
@Param
(
"code"
)
String
code
,
@Param
(
"compareCatalog"
)
String
compareCatalog
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
IndicatorsReportThree
>
datas
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
IndicatorsReportThree
>
datas
);
...
...
src/main/java/com/keymobile/indicators/model/mapper/report/ReportTwoMapper.java
View file @
fd87055a
...
@@ -12,8 +12,9 @@ import tk.mybatis.mapper.common.BaseMapper;
...
@@ -12,8 +12,9 @@ import tk.mybatis.mapper.common.BaseMapper;
@Mapper
@Mapper
public
interface
ReportTwoMapper
extends
BaseMapper
<
IndicatorsReportTwo
>{
public
interface
ReportTwoMapper
extends
BaseMapper
<
IndicatorsReportTwo
>{
public
IndicatorsReportTwo
getDataByParam
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"compareUnitId"
)
String
compareUnitId
,
public
IndicatorsReportTwo
getDataByParam
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
,
@Param
(
"code"
)
String
code
);
@Param
(
"date"
)
Integer
date
,
@Param
(
"type"
)
String
type
,
@Param
(
"code"
)
String
code
,
@Param
(
"compareCatalog"
)
String
compareCatalog
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
IndicatorsReportTwo
>
datas
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
IndicatorsReportTwo
>
datas
);
...
...
src/main/java/com/keymobile/indicators/model/mapper/testrun/TestDriveIndCalResultDefMapper.java
View file @
fd87055a
...
@@ -15,13 +15,27 @@ public interface TestDriveIndCalResultDefMapper extends BaseMapper<TestDriveIndC
...
@@ -15,13 +15,27 @@ public interface TestDriveIndCalResultDefMapper extends BaseMapper<TestDriveIndC
public
List
<
TestDriveIndCalResultDef
>
findByCompareObjAndDate
(
@Param
(
"compareObj"
)
String
compareObj
,
public
List
<
TestDriveIndCalResultDef
>
findByCompareObjAndDate
(
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
int
date
,
@Param
(
"code"
)
String
code
);
@Param
(
"date"
)
int
date
,
@Param
(
"code"
)
String
code
);
//使用对标单元目录过滤
public
List
<
TestDriveIndCalResultDef
>
findByCompareCatalogAndCompareObjAndDate
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
int
date
,
@Param
(
"code"
)
String
code
);
public
TestDriveIndCalResultDef
findByIndIdAndDateAndCompareObj
(
@Param
(
"indId"
)
String
indId
,
public
TestDriveIndCalResultDef
findByIndIdAndDateAndCompareObj
(
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"code"
)
String
code
);
@Param
(
"date"
)
int
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"code"
)
String
code
);
//使用对标单元目录过滤
public
TestDriveIndCalResultDef
findByCompareCatalogAndIndIdAndDateAndCompareObj
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
int
date
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"code"
)
String
code
);
public
TestDriveIndCalResultDef
findByCompareIdAndCompareObjAndIndIdAndDate
(
public
TestDriveIndCalResultDef
findByCompareIdAndCompareObjAndIndIdAndDate
(
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
//根据对标单元目录查找对标结果表是否存在
public
TestDriveIndCalResultDef
findByCompareCatalogAndCompareObjAndIndIdAndDate
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"indId"
)
String
indId
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
//批量保存
//批量保存
public
void
batchSave
(
@Param
(
"datas"
)
List
<
TestDriveIndCalResultDef
>
datas
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
TestDriveIndCalResultDef
>
datas
);
//批量修改
//批量修改
...
...
src/main/java/com/keymobile/indicators/model/mapper/testrun/TestObjScoreCalResultMapper.java
View file @
fd87055a
...
@@ -15,6 +15,10 @@ public interface TestObjScoreCalResultMapper extends BaseMapper<TestObjScoreCalR
...
@@ -15,6 +15,10 @@ public interface TestObjScoreCalResultMapper extends BaseMapper<TestObjScoreCalR
public
TestObjScoreCalResult
getTestObjScoreCalResultByParam
(
@Param
(
"compareId"
)
String
compareId
,
public
TestObjScoreCalResult
getTestObjScoreCalResultByParam
(
@Param
(
"compareId"
)
String
compareId
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
//根据对标单元目录获取
public
TestObjScoreCalResult
getTestObjScoreCalResultByCompareCatalog
(
@Param
(
"compareCatalog"
)
String
compareCatalog
,
@Param
(
"compareObj"
)
String
compareObj
,
@Param
(
"date"
)
Integer
date
,
@Param
(
"code"
)
String
code
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
TestObjScoreCalResult
>
datas
);
public
void
batchSave
(
@Param
(
"datas"
)
List
<
TestObjScoreCalResult
>
datas
);
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
TestObjScoreCalResult
>
datas
);
public
void
batchUpdate
(
@Param
(
"datas"
)
List
<
TestObjScoreCalResult
>
datas
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCalResultService.java
View file @
fd87055a
...
@@ -87,12 +87,26 @@ public class DriveIndCalResultService {
...
@@ -87,12 +87,26 @@ public class DriveIndCalResultService {
compareObj
,
code
);
compareObj
,
code
);
}
}
//根据对标单元目录
public
DriveIndCalResultDef
findCompareObjInfo
(
String
compareCatalog
,
String
driveIndId
,
int
date
,
String
compareObj
,
String
code
)
{
return
driveIndCalResultDefMapper
.
findByCompareCatalogAndIndIdAndDateAndCompareObj
(
compareCatalog
,
driveIndId
,
date
,
compareObj
,
code
);
}
public
DriveIndCalResultDef
findCalResultDataIsExist
(
String
compareId
,
String
compareObj
,
public
DriveIndCalResultDef
findCalResultDataIsExist
(
String
compareId
,
String
compareObj
,
String
indId
,
int
date
,
String
code
)
{
String
indId
,
int
date
,
String
code
)
{
return
driveIndCalResultDefMapper
.
findByCompareIdAndCompareObjAndIndIdAndDate
(
compareId
,
return
driveIndCalResultDefMapper
.
findByCompareIdAndCompareObjAndIndIdAndDate
(
compareId
,
compareObj
,
indId
,
date
,
code
);
compareObj
,
indId
,
date
,
code
);
}
}
//根据对标单元目录查找对标结果是否存在
public
DriveIndCalResultDef
findCalResultDataIsExistByCatalog
(
String
compareCatalog
,
String
compareObj
,
String
indId
,
int
date
,
String
code
)
{
return
driveIndCalResultDefMapper
.
findByCompareCatalogAndCompareObjAndIndIdAndDate
(
compareCatalog
,
compareObj
,
indId
,
date
,
code
);
}
public
List
<
DriveIndCalResultDef
>
findByCompareIdAndDate
(
String
compareId
,
Integer
date
){
public
List
<
DriveIndCalResultDef
>
findByCompareIdAndDate
(
String
compareId
,
Integer
date
){
return
driveIndCalResultDefMapper
.
findByCompareIdAndDate
(
compareId
,
date
);
return
driveIndCalResultDefMapper
.
findByCompareIdAndDate
(
compareId
,
date
);
}
}
...
@@ -134,6 +148,8 @@ public class DriveIndCalResultService {
...
@@ -134,6 +148,8 @@ public class DriveIndCalResultService {
sameCompareUnitList
,
code
,
isTest
);
sameCompareUnitList
,
code
,
isTest
);
startCompareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
startCompareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
//author:zhangkb time:2020-12-12 desc:将path参数传入对标计算中
startCompareUnitCalMsg
.
setPath
(
path
);
ActorRef
beforeCompareUnitCalActor
=
system
.
actorOf
(
Props
.
create
(
ActorRef
beforeCompareUnitCalActor
=
system
.
actorOf
(
Props
.
create
(
BeforeCompareUnitCalActor
.
class
,()->
new
BeforeCompareUnitCalActor
()));
BeforeCompareUnitCalActor
.
class
,()->
new
BeforeCompareUnitCalActor
()));
...
@@ -162,7 +178,6 @@ public class DriveIndCalResultService {
...
@@ -162,7 +178,6 @@ public class DriveIndCalResultService {
param2
.
put
(
"compareIds"
,
compareIds
);
param2
.
put
(
"compareIds"
,
compareIds
);
param2
.
put
(
"dates"
,
param2Dates
);
param2
.
put
(
"dates"
,
param2Dates
);
if
(
"1"
.
equals
(
isTest
)){
if
(
"1"
.
equals
(
isTest
)){
//删除数据
//删除数据
reportOneMapper
.
deleteByCompareIdInAndDateIn
(
param1
);
reportOneMapper
.
deleteByCompareIdInAndDateIn
(
param1
);
...
@@ -173,8 +188,6 @@ public class DriveIndCalResultService {
...
@@ -173,8 +188,6 @@ public class DriveIndCalResultService {
testDriveIndCalResultDefMapper
.
deleteByCompareIdInAndDateIn
(
param2
);
testDriveIndCalResultDefMapper
.
deleteByCompareIdInAndDateIn
(
param2
);
testObjScoreCalResultMapper
.
deleteByCompareIdInAndDateIn
(
param2
);
testObjScoreCalResultMapper
.
deleteByCompareIdInAndDateIn
(
param2
);
}
}
}
}
}
}
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
fd87055a
...
@@ -139,8 +139,8 @@ public class IndScorecardService {
...
@@ -139,8 +139,8 @@ public class IndScorecardService {
return
result
;
return
result
;
}
}
public
Map
<
String
,
String
>
calculateIndiScore
(
String
indId
,
int
date
,
String
compareObj
,
public
Map
<
String
,
String
>
calculateIndiScore
(
String
compareCatalog
,
String
compareId
,
String
indId
,
int
date
,
String
compareObj
,
Integer
indScorecardId
,
String
compareId
,
List
<
String
>
compareObjs
,
String
code
)
throws
Exception
{
Integer
indScorecardId
,
List
<
String
>
compareObjs
,
String
code
)
throws
Exception
{
Map
<
String
,
String
>
result
=
new
HashMap
<>();
Map
<
String
,
String
>
result
=
new
HashMap
<>();
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
String
indScoreValue
=
"0.0"
;
String
indScoreValue
=
"0.0"
;
...
@@ -161,6 +161,9 @@ public class IndScorecardService {
...
@@ -161,6 +161,9 @@ public class IndScorecardService {
List
<
DriveIndCalResultDef
>
currentDriveResult
=
driveIndCalResultDefMapper
List
<
DriveIndCalResultDef
>
currentDriveResult
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareIdAndSort
(
indId
,
date
,
compareId
,
code
);
.
findByIndIdAndDateAndCompareIdAndSort
(
indId
,
date
,
compareId
,
code
);
//List<DriveIndCalResultDef> currentDriveResult = driveIndCalResultDefMapper
//.findByIndIdAndDateAndCompareCatalogAndSort(indId,date,compareCatalog,code);
if
(!
currentDriveResult
.
isEmpty
())
{
if
(!
currentDriveResult
.
isEmpty
())
{
//过滤考核指标结果集无效值
//过滤考核指标结果集无效值
Iterator
<
DriveIndCalResultDef
>
it
=
currentDriveResult
.
iterator
();
Iterator
<
DriveIndCalResultDef
>
it
=
currentDriveResult
.
iterator
();
...
@@ -173,8 +176,12 @@ public class IndScorecardService {
...
@@ -173,8 +176,12 @@ public class IndScorecardService {
}
}
int
currentDriveResultSize
=
currentDriveResult
.
size
();
int
currentDriveResultSize
=
currentDriveResult
.
size
();
//根据indId,date,compareObj获取考核结果
//根据indId,date,compareObj获取考核结果
// DriveIndCalResultDef currentCompareObjResult = driveIndCalResultDefMapper
// .findByIndIdAndDateAndCompareObj(indId, date, compareObj, code);
//改用添加对标单元目录做为条件过滤
DriveIndCalResultDef
currentCompareObjResult
=
driveIndCalResultDefMapper
DriveIndCalResultDef
currentCompareObjResult
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
(
indId
,
date
,
compareObj
,
code
);
.
findByIndIdAndDateAndCompareObjAndCompareCatalog
(
indId
,
date
,
compareObj
,
code
,
compareCatalog
);
if
(
currentCompareObjResult
!=
null
)
{
if
(
currentCompareObjResult
!=
null
)
{
String
average
=
currentCompareObjResult
.
getAverage
();
String
average
=
currentCompareObjResult
.
getAverage
();
...
@@ -255,9 +262,13 @@ public class IndScorecardService {
...
@@ -255,9 +262,13 @@ public class IndScorecardService {
//改善提升
//改善提升
if
(
"1"
.
equals
(
scoreCard
.
getIsIncluScore
()))
{
//纳入单位得分计算
if
(
"1"
.
equals
(
scoreCard
.
getIsIncluScore
()))
{
//纳入单位得分计算
//同期
//同期
// DriveIndCalResultDef sameCompareObjResult = driveIndCalResultDefMapper
// .findByIndIdAndDateAndCompareObj(indId, (date-100),
// compareObj,code);
//改用添加对标单元目录做为过滤条件
DriveIndCalResultDef
sameCompareObjResult
=
driveIndCalResultDefMapper
DriveIndCalResultDef
sameCompareObjResult
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
(
indId
,
(
date
-
100
),
.
findByIndIdAndDateAndCompareObj
AndCompareCatalog
(
indId
,
(
date
-
100
),
compareObj
,
code
);
compareObj
,
code
,
compareCatalog
);
if
(
sameCompareObjResult
!=
null
)
{
if
(
sameCompareObjResult
!=
null
)
{
List
<
ImproveScoreDef
>
importScoreDefList
=
new
ArrayList
<>();
List
<
ImproveScoreDef
>
importScoreDefList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
scoreCard
.
getImproveScoreItemJson
()))
{
if
(
StringUtils
.
isNotBlank
(
scoreCard
.
getImproveScoreItemJson
()))
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
View file @
fd87055a
...
@@ -122,8 +122,8 @@ public class ScoreRuleService {
...
@@ -122,8 +122,8 @@ public class ScoreRuleService {
}
}
//计算组内考核指标平均值或者总和 type:0 计算地区所有纳入考核指标平均数 3指标总得分
//计算组内考核指标平均值或者总和 type:0 计算地区所有纳入考核指标平均数 3指标总得分
private
ObjScoreCalResult
calGroupIndAverageOrSum
(
ObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
private
ObjScoreCalResult
calGroupIndAverageOrSum
(
String
compareCatalog
,
ObjScoreCalResult
objResult
,
String
compareObj
,
int
date
,
String
type
,
String
code
){
S
coreRule
scoreRule
,
S
tring
compareObj
,
int
date
,
String
type
,
String
code
){
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setScoreValue
(
"0.0"
);
objResult
.
setScoreValue
(
"0.0"
);
objResult
.
setImproveValue
(
"0.0"
);
objResult
.
setImproveValue
(
"0.0"
);
...
@@ -136,8 +136,11 @@ public class ScoreRuleService {
...
@@ -136,8 +136,11 @@ public class ScoreRuleService {
//paremMap.put("indIds", indIds);
//paremMap.put("indIds", indIds);
//List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
//List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
//findByCompareObjAndDateAndIndIdIn(paremMap);
//findByCompareObjAndDateAndIndIdIn(paremMap);
// List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
// findByCompareObjAndDate(compareObj, date, code);
//改用添加对标单元目录过滤
List
<
DriveIndCalResultDef
>
calResults
=
driveIndCalResultDefMapper
.
List
<
DriveIndCalResultDef
>
calResults
=
driveIndCalResultDefMapper
.
findByCompare
ObjAndDate
(
compareObj
,
date
,
code
);
findByCompare
CatalogAndCompareObjAndDate
(
compareCatalog
,
compareObj
,
date
,
code
);
int
indCount
=
0
;
//定义用户记录纳入考核指标个数
int
indCount
=
0
;
//定义用户记录纳入考核指标个数
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
improveValues
=
new
ArrayList
<>();
List
<
String
>
improveValues
=
new
ArrayList
<>();
...
@@ -206,7 +209,7 @@ public class ScoreRuleService {
...
@@ -206,7 +209,7 @@ public class ScoreRuleService {
return
objResult
;
return
objResult
;
}
}
private
ObjScoreCalResult
calSingleIndWeight
(
ObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
private
ObjScoreCalResult
calSingleIndWeight
(
String
compareCatalog
,
ObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
String
compareObj
,
int
date
,
String
code
){
String
compareObj
,
int
date
,
String
code
){
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setScoreValue
(
"0.0"
);
objResult
.
setScoreValue
(
"0.0"
);
...
@@ -227,7 +230,7 @@ public class ScoreRuleService {
...
@@ -227,7 +230,7 @@ public class ScoreRuleService {
for
(
String
indId
:
indIdList
)
{
for
(
String
indId
:
indIdList
)
{
//根据日期,对标对象和考核的指标获取考核指标结果详情
//根据日期,对标对象和考核的指标获取考核指标结果详情
DriveIndCalResultDef
calresultOp
=
driveIndCalResultDefMapper
.
DriveIndCalResultDef
calresultOp
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
(
indId
,
date
,
compareObj
,
code
);
findByIndIdAndDateAndCompareObj
AndCompareCatalog
(
indId
,
date
,
compareObj
,
code
,
compareCatalog
);
if
(
calresultOp
!=
null
)
{
if
(
calresultOp
!=
null
)
{
//auth:zhangkb time:2020-7-15 desc:填充对标对象描述
//auth:zhangkb time:2020-7-15 desc:填充对标对象描述
objResult
.
setCompareObjDesc
(
calresultOp
.
getCompareObjDesc
());
objResult
.
setCompareObjDesc
(
calresultOp
.
getCompareObjDesc
());
...
@@ -304,7 +307,7 @@ public class ScoreRuleService {
...
@@ -304,7 +307,7 @@ public class ScoreRuleService {
}
}
//按照指标类别进行分类分别计算平均分后再跟类别权重相乘后相加得到最终分数
//按照指标类别进行分类分别计算平均分后再跟类别权重相乘后相加得到最终分数
private
ObjScoreCalResult
calIndCatalogTypeAverage
(
ObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
private
ObjScoreCalResult
calIndCatalogTypeAverage
(
String
compareCatalog
,
ObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
String
compareObj
,
int
date
,
String
code
){
String
compareObj
,
int
date
,
String
code
){
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setCompareObj
(
compareObj
);
...
@@ -313,8 +316,11 @@ public class ScoreRuleService {
...
@@ -313,8 +316,11 @@ public class ScoreRuleService {
objResult
.
setDate
(
date
);
objResult
.
setDate
(
date
);
//根据对标对象,日期查找该对标对象对标的所有指标结果
//根据对标对象,日期查找该对标对象对标的所有指标结果
// List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
// findByCompareObjAndDate(compareObj, date, code);
//改用添加对标单元目录进行过滤
List
<
DriveIndCalResultDef
>
calResults
=
driveIndCalResultDefMapper
.
List
<
DriveIndCalResultDef
>
calResults
=
driveIndCalResultDefMapper
.
findByCompare
ObjAndDate
(
compareObj
,
date
,
code
);
findByCompare
CatalogAndCompareObjAndDate
(
compareCatalog
,
compareObj
,
date
,
code
);
double
scoreValue
=
0.0
;
double
scoreValue
=
0.0
;
double
improveValue
=
0.0
;
double
improveValue
=
0.0
;
double
scoreSumValue
=
0.0
;
double
scoreSumValue
=
0.0
;
...
@@ -396,7 +402,7 @@ public class ScoreRuleService {
...
@@ -396,7 +402,7 @@ public class ScoreRuleService {
}
}
//根据单位评分规则计算单位分数
//根据单位评分规则计算单位分数
public
void
calObjScore
(
String
compareId
,
List
<
String
>
indIds
,
public
void
calObjScore
(
String
compare
Catalog
,
String
compare
Id
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
int
date
,
Integer
scoreRuleId
,
String
code
)
{
List
<
String
>
compareObjs
,
int
date
,
Integer
scoreRuleId
,
String
code
)
{
//根据单位得分评分卡id获取评分卡详情
//根据单位得分评分卡id获取评分卡详情
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
...
@@ -405,28 +411,31 @@ public class ScoreRuleService {
...
@@ -405,28 +411,31 @@ public class ScoreRuleService {
if
(!
indIds
.
isEmpty
()
&&
!
compareObjs
.
isEmpty
())
{
if
(!
indIds
.
isEmpty
()
&&
!
compareObjs
.
isEmpty
())
{
for
(
String
compareObj
:
compareObjs
)
{
for
(
String
compareObj
:
compareObjs
)
{
//判断库表是否已存在改结果数据
//判断库表是否已存在改结果数据
// ObjScoreCalResult objScoreCalResult = objScoreCalResultMapper.
// getObjScoreCalResultByParam(compareId, compareObj, date, code);
//改用添加对标单元目录过滤
ObjScoreCalResult
objScoreCalResult
=
objScoreCalResultMapper
.
ObjScoreCalResult
objScoreCalResult
=
objScoreCalResultMapper
.
getObjScoreCalResultBy
Param
(
compareId
,
compareObj
,
date
,
code
);
getObjScoreCalResultBy
CompareCatalog
(
compareCatalog
,
compareId
,
compareObj
,
date
,
code
);
if
(
objScoreCalResult
==
null
)
{
if
(
objScoreCalResult
==
null
)
{
objScoreCalResult
=
new
ObjScoreCalResult
();
objScoreCalResult
=
new
ObjScoreCalResult
();
}
}
objScoreCalResult
.
setCode
(
code
);
//计算类型:0 地区所有纳入评价的考核指标平均数
//计算类型:0 地区所有纳入评价的考核指标平均数
if
(
"0"
.
equals
(
scoreRule
.
getCalType
()))
{
if
(
"0"
.
equals
(
scoreRule
.
getCalType
()))
{
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
compareCatalog
,
objScoreCalResult
,
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
scoreRule
,
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
}
else
if
(
"1"
.
equals
(
scoreRule
.
getCalType
()))
{
//1 根据目录类别分类算平均分后根据权重计算考核指标
}
else
if
(
"1"
.
equals
(
scoreRule
.
getCalType
()))
{
//1 根据目录类别分类算平均分后根据权重计算考核指标
objScoreCalResult
=
this
.
calIndCatalogTypeAverage
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calIndCatalogTypeAverage
(
compareCatalog
,
objScoreCalResult
,
compareObj
,
date
,
code
);
scoreRule
,
compareObj
,
date
,
code
);
}
else
if
(
"2"
.
equals
(
scoreRule
.
getCalType
())){
//2单个指标权重计算
}
else
if
(
"2"
.
equals
(
scoreRule
.
getCalType
())){
//2单个指标权重计算
objScoreCalResult
=
this
.
calSingleIndWeight
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calSingleIndWeight
(
compareCatalog
,
objScoreCalResult
,
scoreRule
,
compareObj
,
date
,
code
);
compareObj
,
date
,
code
);
}
else
{
//3:指标总得分
}
else
{
//3:指标总得分
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
compareCatalog
,
objScoreCalResult
,
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
scoreRule
,
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
}
}
objScoreCalResult
.
setCompareCatalog
(
compareCatalog
);
objScoreCalResult
.
setCompareId
(
compareId
);
objScoreCalResult
.
setCompareId
(
compareId
);
objScoreCalResult
.
setCode
(
code
);
datas
.
add
(
objScoreCalResult
);
datas
.
add
(
objScoreCalResult
);
}
}
//进行综合评价和改善提升总分排名
//进行综合评价和改善提升总分排名
...
...
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
fd87055a
...
@@ -124,14 +124,15 @@ public class IndicatorsReportService {
...
@@ -124,14 +124,15 @@ public class IndicatorsReportService {
}
}
}
}
public
void
deleteReportThreeDataByParam
(
Integer
date
,
List
<
String
>
compareObjs
,
String
code
)
{
public
void
deleteReportThreeDataByParam
(
String
compareCatalog
,
Integer
date
,
List
<
String
>
compareObjs
,
String
code
)
{
if
(
compareObjs
!=
null
&&
compareObjs
.
size
()>
0
){
if
(
compareObjs
!=
null
&&
compareObjs
.
size
()>
0
){
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
String
type
=
this
.
getCompareType
(
date
);
String
type
=
this
.
getCompareType
(
date
);
paramMap
.
put
(
"date"
,
date
);
paramMap
.
put
(
"date"
,
date
);
paramMap
.
put
(
"type"
,
type
);
paramMap
.
put
(
"type"
,
type
);
paramMap
.
put
(
"code"
,
code
);
paramMap
.
put
(
"code"
,
code
);
paramMap
.
put
(
"compareCatalog"
,
compareCatalog
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
log
.
info
(
"开始清除报表三数据:date={},type={},code={},compareObjs={}"
,
date
,
type
,
code
,
compareObjs
);
log
.
info
(
"开始清除报表三数据:date={},type={},code={},compareObjs={}"
,
date
,
type
,
code
,
compareObjs
);
reportThreeMapper
.
deleteByParam
(
paramMap
);
reportThreeMapper
.
deleteByParam
(
paramMap
);
...
@@ -141,7 +142,7 @@ public class IndicatorsReportService {
...
@@ -141,7 +142,7 @@ public class IndicatorsReportService {
return
;
return
;
}
}
public
void
dealDriveIndReportThreeData
(
String
compareId
,
List
<
String
>
indIds
,
public
void
dealDriveIndReportThreeData
(
String
compare
Catalog
,
String
compare
Id
,
List
<
String
>
indIds
,
Integer
date
,
String
code
)
throws
Exception
{
Integer
date
,
String
code
)
throws
Exception
{
String
type
=
this
.
getCompareType
(
date
);
String
type
=
this
.
getCompareType
(
date
);
for
(
String
indId
:
indIds
)
{
for
(
String
indId
:
indIds
)
{
...
@@ -164,7 +165,7 @@ public class IndicatorsReportService {
...
@@ -164,7 +165,7 @@ public class IndicatorsReportService {
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
for
(
DriveIndCalResultDef
calResult
:
calResults
)
{
//判断是否存在
//判断是否存在
IndicatorsReportThree
indReportData
=
reportThreeMapper
.
getByParam
(
IndicatorsReportThree
indReportData
=
reportThreeMapper
.
getByParam
(
calResult
.
getCompareObj
(),
date
,
type
,
code
);
calResult
.
getCompareObj
(),
date
,
type
,
code
,
compareCatalog
);
if
(
indReportData
==
null
)
{
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportThree
();
indReportData
=
new
IndicatorsReportThree
();
}
}
...
@@ -172,14 +173,14 @@ public class IndicatorsReportService {
...
@@ -172,14 +173,14 @@ public class IndicatorsReportService {
indReportData
.
setCompareObjDesc
(
calResult
.
getCompareObjDesc
());
indReportData
.
setCompareObjDesc
(
calResult
.
getCompareObjDesc
());
indReportData
.
setCompareDate
(
date
);
indReportData
.
setCompareDate
(
date
);
indReportData
.
setCompareType
(
type
);
indReportData
.
setCompareType
(
type
);
//设置对标单元目录
indReportData
.
setCompareCatalog
(
compareCatalog
);
indReportData
.
setCode
(
code
);
indReportData
.
setCode
(
code
);
if
(
StringUtils
.
isNotBlank
(
indRule
)
&&
if
(
StringUtils
.
isNotBlank
(
indRule
)
&&
StringUtils
.
isNotBlank
(
growCalType
))
{
StringUtils
.
isNotBlank
(
growCalType
))
{
//填充优劣平均数指标个数
//填充优劣平均数指标个数
indReportData
=
this
.
fillAverageCount
(
indReportData
,
calResult
,
indRule
);
indReportData
=
this
.
fillAverageCount
(
indReportData
,
calResult
,
indRule
);
//填充排名前三末三指标个数
//填充排名前三末三指标个数
indReportData
=
this
.
fillRankHeadAndAfterCount
(
indReportData
,
indReportData
=
this
.
fillRankHeadAndAfterCount
(
indReportData
,
calResults
,
indRule
);
calResults
,
indRule
);
//判断是否存在同期数据
//判断是否存在同期数据
DriveIndCalResultDef
sameCalResult
=
driveIndCalResultDefMapper
.
DriveIndCalResultDef
sameCalResult
=
driveIndCalResultDefMapper
.
...
@@ -260,7 +261,7 @@ public class IndicatorsReportService {
...
@@ -260,7 +261,7 @@ public class IndicatorsReportService {
Map
<
String
,
Integer
>
resultRank
=
new
HashMap
<>();
Map
<
String
,
Integer
>
resultRank
=
new
HashMap
<>();
resultRank
=
CalculateUtils
.
rankValue
(
improveValue
,
indRule
);
resultRank
=
CalculateUtils
.
rankValue
(
improveValue
,
indRule
);
//提升前三
//提升前三
dataList
=
this
.
fillImproveHeadAndAfterCount
(
resultRank
,
dataList
,
0
,
code
);
dataList
=
this
.
fillImproveHeadAndAfterCount
(
compareCatalog
,
resultRank
,
dataList
,
0
,
code
);
//清空map
//清空map
resultRank
.
clear
();
resultRank
.
clear
();
...
@@ -271,21 +272,21 @@ public class IndicatorsReportService {
...
@@ -271,21 +272,21 @@ public class IndicatorsReportService {
}
}
resultRank
=
CalculateUtils
.
rankValue
(
improveValue
,
indRule
);
resultRank
=
CalculateUtils
.
rankValue
(
improveValue
,
indRule
);
//提升末三
//提升末三
dataList
=
this
.
fillImproveHeadAndAfterCount
(
resultRank
,
dataList
,
1
,
code
);
dataList
=
this
.
fillImproveHeadAndAfterCount
(
compareCatalog
,
resultRank
,
dataList
,
1
,
code
);
this
.
batchSaveOrUpdateReportThree
(
dataList
);
this
.
batchSaveOrUpdateReportThree
(
dataList
);
}
}
}
}
}
}
//type:0 前三 1末三
//type:0 前三 1末三
private
List
<
IndicatorsReportThree
>
fillImproveHeadAndAfterCount
(
Map
<
String
,
Integer
>
resultRank
private
List
<
IndicatorsReportThree
>
fillImproveHeadAndAfterCount
(
String
compareCatalog
,
,
List
<
IndicatorsReportThree
>
dataList
,
Integer
type
,
String
code
){
Map
<
String
,
Integer
>
resultRank
,
List
<
IndicatorsReportThree
>
dataList
,
Integer
type
,
String
code
){
resultRank
=
CalculateUtils
.
sortMapByValue
(
resultRank
,
0
);
resultRank
=
CalculateUtils
.
sortMapByValue
(
resultRank
,
0
);
for
(
IndicatorsReportThree
indReportData
:
dataList
)
{
for
(
IndicatorsReportThree
indReportData
:
dataList
)
{
//判断是否存在
//判断是否存在
IndicatorsReportThree
DBIndReportData
=
reportThreeMapper
.
getByParam
(
IndicatorsReportThree
DBIndReportData
=
reportThreeMapper
.
getByParam
(
indReportData
.
getCompareObj
(),
indReportData
.
getCompareDate
(),
indReportData
.
getCompareObj
(),
indReportData
.
getCompareDate
(),
indReportData
.
getCompareType
(),
code
);
indReportData
.
getCompareType
(),
code
,
compareCatalog
);
if
(
DBIndReportData
!=
null
)
{
if
(
DBIndReportData
!=
null
)
{
indReportData
.
setId
(
DBIndReportData
.
getId
());
indReportData
.
setId
(
DBIndReportData
.
getId
());
}
}
...
@@ -475,7 +476,7 @@ public class IndicatorsReportService {
...
@@ -475,7 +476,7 @@ public class IndicatorsReportService {
}
}
@Async
@Async
public
void
dealDriveIndReportTwoData
(
String
compareUnitId
,
List
<
String
>
indIds
,
public
void
dealDriveIndReportTwoData
(
String
compare
Catalog
,
String
compare
UnitId
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
Integer
date
,
String
code
)
{
List
<
String
>
compareObjs
,
Integer
date
,
String
code
)
{
List
<
IndicatorsReportTwo
>
dataList
=
new
ArrayList
<>();
List
<
IndicatorsReportTwo
>
dataList
=
new
ArrayList
<>();
String
type
=
this
.
getCompareType
(
date
);
String
type
=
this
.
getCompareType
(
date
);
...
@@ -484,21 +485,26 @@ public class IndicatorsReportService {
...
@@ -484,21 +485,26 @@ public class IndicatorsReportService {
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"date"
,
date
);
paramMap
.
put
(
"date"
,
date
);
paramMap
.
put
(
"code"
,
code
);
paramMap
.
put
(
"code"
,
code
);
//添加对标单元目录条件
paramMap
.
put
(
"compareCatalog"
,
compareCatalog
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObjIn
(
paramMap
);
.
findByIndIdAndDateAndCompareObjIn
(
paramMap
);
if
(!
calDatas
.
isEmpty
())
{
if
(!
calDatas
.
isEmpty
())
{
//判断是否存在
//判断是否存在
IndicatorsReportTwo
indReportData
=
reportTwoMapper
.
getDataByParam
(
indId
,
IndicatorsReportTwo
indReportData
=
reportTwoMapper
.
getDataByParam
(
indId
,
compareUnitId
,
date
,
type
,
code
);
date
,
type
,
code
,
compareCatalog
);
if
(
indReportData
==
null
)
{
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportTwo
();
indReportData
=
new
IndicatorsReportTwo
();
}
}
indReportData
.
setCompareType
(
type
);
indReportData
.
setCompareType
(
type
);
indReportData
.
setCompareUnitId
(
compareUnitId
);
indReportData
.
setCompareDate
(
date
);
indReportData
.
setCompareDate
(
date
);
indReportData
.
setCode
(
code
);
indReportData
.
setCode
(
code
);
indReportData
=
fillDriveIndiReportTwoData
(
indId
,
calDatas
,
indReportData
,
//设置对标单元目录
indReportData
.
setCompareCatalog
(
compareCatalog
);
//设置对标单元id
indReportData
.
setCompareUnitId
(
compareUnitId
);
indReportData
=
fillDriveIndiReportTwoData
(
compareCatalog
,
indId
,
calDatas
,
indReportData
,
date
,
compareObjs
,
code
);
date
,
compareObjs
,
code
);
dataList
.
add
(
indReportData
);
dataList
.
add
(
indReportData
);
}
}
...
@@ -516,7 +522,7 @@ public class IndicatorsReportService {
...
@@ -516,7 +522,7 @@ public class IndicatorsReportService {
for
(
IndicatorsData
indiData
:
indiDatas
)
{
for
(
IndicatorsData
indiData
:
indiDatas
)
{
//判断是否存在
//判断是否存在
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
indiData
.
getIndId
(),
indiData
.
getDim1
(),
indiData
.
getDim2
(),
type
,
code
);
indiData
.
getIndId
(),
indiData
.
getDim1
(),
indiData
.
getDim2
(),
type
,
code
,
null
);
if
(
indReportData
==
null
)
{
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportOne
();
indReportData
=
new
IndicatorsReportOne
();
}
}
...
@@ -532,20 +538,21 @@ public class IndicatorsReportService {
...
@@ -532,20 +538,21 @@ public class IndicatorsReportService {
logger
.
info
(
"完成:"
+
date
+
" 基础项本期同期整合"
);
logger
.
info
(
"完成:"
+
date
+
" 基础项本期同期整合"
);
}
}
public
void
dealReportOneDatas
(
List
<
DriveIndCalResultDef
>
calDatas
,
String
code
)
{
public
void
dealReportOneDatas
(
String
compareCatalog
,
List
<
DriveIndCalResultDef
>
calDatas
,
String
code
)
{
List
<
IndicatorsReportOne
>
datas
=
new
ArrayList
<>();
List
<
IndicatorsReportOne
>
datas
=
new
ArrayList
<>();
for
(
DriveIndCalResultDef
calData
:
calDatas
)
{
for
(
DriveIndCalResultDef
calData
:
calDatas
)
{
String
type
=
this
.
getCompareType
(
calData
.
getDate
());
String
type
=
this
.
getCompareType
(
calData
.
getDate
());
//判断是否存在
//判断是否存在
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
calData
.
getIndId
(),
calData
.
getCompareObj
(),
calData
.
getDate
(),
type
,
code
);
calData
.
getIndId
(),
calData
.
getCompareObj
(),
calData
.
getDate
(),
type
,
code
,
compareCatalog
);
if
(
indReportData
==
null
)
{
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportOne
();
indReportData
=
new
IndicatorsReportOne
();
}
}
indReportData
.
setCode
(
calData
.
getCode
());
indReportData
.
setCode
(
calData
.
getCode
());
indReportData
.
setCompareType
(
type
);
indReportData
.
setCompareType
(
type
);
indReportData
.
setUnit
(
calData
.
getUnit
());
indReportData
.
setUnit
(
calData
.
getUnit
());
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
,
code
);
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
,
code
,
compareCatalog
);
datas
.
add
(
indReportData
);
datas
.
add
(
indReportData
);
}
}
//批量新增或修改
//批量新增或修改
...
@@ -554,7 +561,7 @@ public class IndicatorsReportService {
...
@@ -554,7 +561,7 @@ public class IndicatorsReportService {
//整合指标本期同期指标报表数据
//整合指标本期同期指标报表数据
@Async
@Async
public
String
dealReportOne
(
String
compareId
,
List
<
String
>
indIds
,
public
String
dealReportOne
(
String
compare
Catalog
,
String
compare
Id
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
Integer
date
,
String
code
)
{
List
<
String
>
compareObjs
,
Integer
date
,
String
code
)
{
int
count
=
0
;
int
count
=
0
;
for
(
String
indId
:
indIds
)
{
for
(
String
indId
:
indIds
)
{
...
@@ -562,6 +569,8 @@ public class IndicatorsReportService {
...
@@ -562,6 +569,8 @@ public class IndicatorsReportService {
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"date"
,
date
);
paramMap
.
put
(
"date"
,
date
);
paramMap
.
put
(
"code"
,
code
);
paramMap
.
put
(
"code"
,
code
);
//加入对标单元目录做为过滤条件
paramMap
.
put
(
"compareCatalog"
,
compareCatalog
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
//获取所有考核指标结果
//获取所有考核指标结果
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
List
<
DriveIndCalResultDef
>
calDatas
=
driveIndCalResultDefMapper
...
@@ -571,16 +580,19 @@ public class IndicatorsReportService {
...
@@ -571,16 +580,19 @@ public class IndicatorsReportService {
//判断是否存在
//判断是否存在
String
type
=
this
.
getCompareType
(
calData
.
getDate
());
String
type
=
this
.
getCompareType
(
calData
.
getDate
());
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
IndicatorsReportOne
indReportData
=
reportOneMapper
.
getByParam
(
calData
.
getIndId
(),
calData
.
getCompareObj
(),
calData
.
getDate
(),
type
,
code
);
calData
.
getIndId
(),
calData
.
getCompareObj
(),
calData
.
getDate
(),
type
,
code
,
compareCatalog
);
if
(
indReportData
==
null
)
{
if
(
indReportData
==
null
)
{
indReportData
=
new
IndicatorsReportOne
();
indReportData
=
new
IndicatorsReportOne
();
}
}
indReportData
.
setCode
(
code
);
indReportData
.
setCode
(
code
);
indReportData
.
setCompareType
(
type
);
indReportData
.
setCompareType
(
type
);
indReportData
.
setUnit
(
calData
.
getUnit
());
indReportData
.
setUnit
(
calData
.
getUnit
());
//设置对标单元目录
indReportData
.
setCompareCatalog
(
compareCatalog
);
//设置对标单元id
//设置对标单元id
indReportData
.
setCompareUnitId
(
compareId
);
indReportData
.
setCompareUnitId
(
compareId
);
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
,
code
);
indReportData
=
this
.
fillReportOneData
(
calData
,
indReportData
,
code
,
compareCatalog
);
datas
.
add
(
indReportData
);
datas
.
add
(
indReportData
);
}
}
//计算增幅排名
//计算增幅排名
...
@@ -615,12 +627,13 @@ public class IndicatorsReportService {
...
@@ -615,12 +627,13 @@ public class IndicatorsReportService {
count
+=
datas
.
size
();
count
+=
datas
.
size
();
this
.
batchSaveOrUpdate
(
datas
);
//批量新增或修改
this
.
batchSaveOrUpdate
(
datas
);
//批量新增或修改
}
}
log
.
info
(
"compareId={}:date={}报表一完成,生成{}条数据"
,
compareId
,
date
,
count
);
log
.
info
(
"compareCatalog={},compareId={}:date={}报表一完成,生成{}条数据"
,
compareCatalog
,
compareId
,
date
,
count
);
return
"deal indicators report one success"
;
return
"deal indicators report one success"
;
}
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
IndicatorsReportTwo
fillDriveIndiReportTwoData
(
String
indId
,
List
<
DriveIndCalResultDef
>
calDatas
,
public
IndicatorsReportTwo
fillDriveIndiReportTwoData
(
String
compareCatalog
,
String
indId
,
List
<
DriveIndCalResultDef
>
calDatas
,
IndicatorsReportTwo
indReportData
,
Integer
date
,
List
<
String
>
compareObjs
,
String
code
)
{
IndicatorsReportTwo
indReportData
,
Integer
date
,
List
<
String
>
compareObjs
,
String
code
)
{
//针对省对市对标获取前三末三地区顺序
//针对省对市对标获取前三末三地区顺序
Map
<
String
,
Integer
>
objSort
=
new
HashMap
<>();
Map
<
String
,
Integer
>
objSort
=
new
HashMap
<>();
...
@@ -643,14 +656,14 @@ public class IndicatorsReportService {
...
@@ -643,14 +656,14 @@ public class IndicatorsReportService {
//取出一项获取平均值
//取出一项获取平均值
if
(!
calDatas
.
isEmpty
())
{
if
(!
calDatas
.
isEmpty
())
{
//获取全省维度的指标值做为平均数
//获取全省维度的指标值做为平均数
DriveIndCalResultDef
currentActualAverage
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
(
DriveIndCalResultDef
currentActualAverage
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
AndCompareCatalog
(
indId
,
date
,
"43"
,
code
);
indId
,
date
,
"43"
,
code
,
compareCatalog
);
if
(
currentActualAverage
!=
null
)
{
if
(
currentActualAverage
!=
null
)
{
indReportData
.
setCurrentActualAverage
(
currentActualAverage
.
getValue
());
indReportData
.
setCurrentActualAverage
(
currentActualAverage
.
getValue
());
}
}
//查找同期对标结果
//查找同期对标结果
DriveIndCalResultDef
sameActualAverage
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
(
DriveIndCalResultDef
sameActualAverage
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
AndCompareCatalog
(
indId
,
(
date
-
100
),
"43"
,
code
);
indId
,
(
date
-
100
),
"43"
,
code
,
compareCatalog
);
if
(
sameActualAverage
!=
null
)
{
if
(
sameActualAverage
!=
null
)
{
indReportData
.
setSameActualAverage
(
sameActualAverage
.
getValue
());
indReportData
.
setSameActualAverage
(
sameActualAverage
.
getValue
());
//获取指标正反向类型
//获取指标正反向类型
...
@@ -686,6 +699,8 @@ public class IndicatorsReportService {
...
@@ -686,6 +699,8 @@ public class IndicatorsReportService {
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"date"
,
(
date
-
100
));
paramMap
.
put
(
"date"
,
(
date
-
100
));
paramMap
.
put
(
"code"
,
code
);
paramMap
.
put
(
"code"
,
code
);
//添加对标单元目录
paramMap
.
put
(
"compareCatalog"
,
compareCatalog
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
List
<
DriveIndCalResultDef
>
sameCalDatas
=
driveIndCalResultDefMapper
List
<
DriveIndCalResultDef
>
sameCalDatas
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObjIn
(
paramMap
);
.
findByIndIdAndDateAndCompareObjIn
(
paramMap
);
...
@@ -731,8 +746,8 @@ public class IndicatorsReportService {
...
@@ -731,8 +746,8 @@ public class IndicatorsReportService {
driveIndDef
.
getIndRule
(),
average
,
calDatas
));
driveIndDef
.
getIndRule
(),
average
,
calDatas
));
}
}
//同比提升单位
//同比提升单位
Map
<
String
,
Object
>
sameImproveResult
=
this
.
sameImproveUnits
(
indId
,
date
,
compareObjs
,
Map
<
String
,
Object
>
sameImproveResult
=
this
.
sameImproveUnits
(
compareCatalog
,
indId
,
date
,
calDatas
,
code
);
c
ompareObjs
,
c
alDatas
,
code
);
if
(
Integer
.
parseInt
(
sameImproveResult
.
get
(
"improveNum"
).
toString
())!=
0
)
{
if
(
Integer
.
parseInt
(
sameImproveResult
.
get
(
"improveNum"
).
toString
())!=
0
)
{
indReportData
.
setSameImproveUnits
(
Integer
.
parseInt
(
sameImproveResult
.
get
(
"improveNum"
).
toString
()));
indReportData
.
setSameImproveUnits
(
Integer
.
parseInt
(
sameImproveResult
.
get
(
"improveNum"
).
toString
()));
}
else
{
}
else
{
...
@@ -896,8 +911,8 @@ public class IndicatorsReportService {
...
@@ -896,8 +911,8 @@ public class IndicatorsReportService {
}
}
//同比提升单位数
//同比提升单位数
private
Map
<
String
,
Object
>
sameImproveUnits
(
String
indId
,
Integer
date
,
List
<
String
>
compareObjs
,
private
Map
<
String
,
Object
>
sameImproveUnits
(
String
compareCatalog
,
String
indId
,
Integer
date
,
List
<
DriveIndCalResultDef
>
currentCalDatas
,
String
code
)
{
List
<
String
>
compareObjs
,
List
<
DriveIndCalResultDef
>
currentCalDatas
,
String
code
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Integer
improveNum
=
0
;
//单位提升数
Integer
improveNum
=
0
;
//单位提升数
Map
<
String
,
Integer
>
resultRank
=
new
HashMap
<>();
Map
<
String
,
Integer
>
resultRank
=
new
HashMap
<>();
...
@@ -911,6 +926,7 @@ public class IndicatorsReportService {
...
@@ -911,6 +926,7 @@ public class IndicatorsReportService {
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"indId"
,
indId
);
paramMap
.
put
(
"date"
,
(
date
-
100
));
paramMap
.
put
(
"date"
,
(
date
-
100
));
paramMap
.
put
(
"code"
,
code
);
paramMap
.
put
(
"code"
,
code
);
paramMap
.
put
(
"compareCatalog"
,
compareCatalog
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
List
<
DriveIndCalResultDef
>
sameCalDatas
=
driveIndCalResultDefMapper
List
<
DriveIndCalResultDef
>
sameCalDatas
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObjIn
(
paramMap
);
.
findByIndIdAndDateAndCompareObjIn
(
paramMap
);
...
@@ -1007,7 +1023,7 @@ public class IndicatorsReportService {
...
@@ -1007,7 +1023,7 @@ public class IndicatorsReportService {
}
}
public
IndicatorsReportOne
fillReportOneData
(
DriveIndCalResultDef
calData
,
public
IndicatorsReportOne
fillReportOneData
(
DriveIndCalResultDef
calData
,
IndicatorsReportOne
indReportData
,
String
code
)
{
IndicatorsReportOne
indReportData
,
String
code
,
String
compareCatalog
)
{
indReportData
.
setIndId
(
calData
.
getIndId
());
indReportData
.
setIndId
(
calData
.
getIndId
());
//根据指标id获取指标信息
//根据指标id获取指标信息
DriveIndDef
driveIndDef
=
driveIndDefMapper
.
selectByPrimaryKey
(
calData
.
getIndId
());
DriveIndDef
driveIndDef
=
driveIndDefMapper
.
selectByPrimaryKey
(
calData
.
getIndId
());
...
@@ -1031,8 +1047,8 @@ public class IndicatorsReportService {
...
@@ -1031,8 +1047,8 @@ public class IndicatorsReportService {
indReportData
.
setCurrentImprove
(
new
BigDecimal
(
calData
.
getImproveScore
()));
indReportData
.
setCurrentImprove
(
new
BigDecimal
(
calData
.
getImproveScore
()));
}
}
//查找同期结果
//查找同期结果
DriveIndCalResultDef
sameCalData
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
(
DriveIndCalResultDef
sameCalData
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
AndCompareCatalog
(
calData
.
getIndId
(),
(
calData
.
getDate
()-
100
),
calData
.
getCompareObj
(),
code
);
calData
.
getIndId
(),
(
calData
.
getDate
()-
100
),
calData
.
getCompareObj
(),
code
,
compareCatalog
);
if
(
sameCalData
!=
null
)
{
if
(
sameCalData
!=
null
)
{
if
(
StringUtils
.
isNotBlank
(
sameCalData
.
getValue
()))
{
if
(
StringUtils
.
isNotBlank
(
sameCalData
.
getValue
()))
{
indReportData
.
setLastSameValue
(
new
BigDecimal
(
sameCalData
.
getValue
()));
indReportData
.
setLastSameValue
(
new
BigDecimal
(
sameCalData
.
getValue
()));
...
...
src/main/java/com/keymobile/indicators/service/testrun/TestDriveIndCalResultService.java
View file @
fd87055a
...
@@ -28,12 +28,25 @@ public class TestDriveIndCalResultService {
...
@@ -28,12 +28,25 @@ public class TestDriveIndCalResultService {
driveIndId
,
date
,
compareObj
,
code
);
driveIndId
,
date
,
compareObj
,
code
);
}
}
//根据对标单元目录
public
TestDriveIndCalResultDef
findCompareObjInfo
(
String
compareCatalog
,
String
driveIndId
,
int
date
,
String
compareObj
,
String
code
)
{
return
testDriveIndCalResultDefMapper
.
findByCompareCatalogAndIndIdAndDateAndCompareObj
(
compareCatalog
,
driveIndId
,
date
,
compareObj
,
code
);
}
public
TestDriveIndCalResultDef
findCalResultDataIsExist
(
String
compareId
,
String
compareObj
,
public
TestDriveIndCalResultDef
findCalResultDataIsExist
(
String
compareId
,
String
compareObj
,
String
indId
,
int
date
,
String
code
)
{
String
indId
,
int
date
,
String
code
)
{
return
testDriveIndCalResultDefMapper
.
return
testDriveIndCalResultDefMapper
.
findByCompareIdAndCompareObjAndIndIdAndDate
(
compareId
,
compareObj
,
indId
,
date
,
code
);
findByCompareIdAndCompareObjAndIndIdAndDate
(
compareId
,
compareObj
,
indId
,
date
,
code
);
}
}
public
TestDriveIndCalResultDef
findCalResultDataIsExistByCatalog
(
String
compareCatalog
,
String
compareObj
,
String
indId
,
int
date
,
String
code
)
{
return
testDriveIndCalResultDefMapper
.
findByCompareCatalogAndCompareObjAndIndIdAndDate
(
compareCatalog
,
compareObj
,
indId
,
date
,
code
);
}
public
int
saveOrUpdate
(
TestDriveIndCalResultDef
driveIndCalResult
)
{
public
int
saveOrUpdate
(
TestDriveIndCalResultDef
driveIndCalResult
)
{
if
(
driveIndCalResult
.
getId
()==
null
)
{
if
(
driveIndCalResult
.
getId
()==
null
)
{
testDriveIndCalResultDefMapper
.
insert
(
driveIndCalResult
);
testDriveIndCalResultDefMapper
.
insert
(
driveIndCalResult
);
...
...
src/main/java/com/keymobile/indicators/service/testrun/TestScoreRuleService.java
View file @
fd87055a
...
@@ -44,7 +44,7 @@ public class TestScoreRuleService {
...
@@ -44,7 +44,7 @@ public class TestScoreRuleService {
private
static
final
Pattern
P
=
Pattern
.
compile
(
"(\\[[^\\]]*\\])"
);
private
static
final
Pattern
P
=
Pattern
.
compile
(
"(\\[[^\\]]*\\])"
);
//根据单位评分规则计算单位分数
//根据单位评分规则计算单位分数
public
void
testCalObjScore
(
String
compareId
,
List
<
String
>
indIds
,
public
void
testCalObjScore
(
String
compare
Catalog
,
String
compare
Id
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
int
date
,
Integer
scoreRuleId
,
String
code
)
{
List
<
String
>
compareObjs
,
int
date
,
Integer
scoreRuleId
,
String
code
)
{
//根据单位得分评分卡id获取评分卡详情
//根据单位得分评分卡id获取评分卡详情
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
...
@@ -53,27 +53,31 @@ public class TestScoreRuleService {
...
@@ -53,27 +53,31 @@ public class TestScoreRuleService {
if
(!
indIds
.
isEmpty
()
&&
!
compareObjs
.
isEmpty
())
{
if
(!
indIds
.
isEmpty
()
&&
!
compareObjs
.
isEmpty
())
{
for
(
String
compareObj
:
compareObjs
)
{
for
(
String
compareObj
:
compareObjs
)
{
//判断库表是否已存在改结果数据
//判断库表是否已存在改结果数据
// TestObjScoreCalResult objScoreCalResult = testObjScoreCalResultMapper.
// getTestObjScoreCalResultByParam(compareId, compareObj, date, code);
//改用对标单元目录过滤
TestObjScoreCalResult
objScoreCalResult
=
testObjScoreCalResultMapper
.
TestObjScoreCalResult
objScoreCalResult
=
testObjScoreCalResultMapper
.
getTestObjScoreCalResultBy
Param
(
compareId
,
compareObj
,
date
,
code
);
getTestObjScoreCalResultBy
CompareCatalog
(
compareCatalog
,
compareObj
,
date
,
code
);
if
(
objScoreCalResult
==
null
)
{
if
(
objScoreCalResult
==
null
)
{
objScoreCalResult
=
new
TestObjScoreCalResult
();
objScoreCalResult
=
new
TestObjScoreCalResult
();
}
}
//计算类型:0 地区所有纳入评价的考核指标平均数
//计算类型:0 地区所有纳入评价的考核指标平均数
if
(
"0"
.
equals
(
scoreRule
.
getCalType
()))
{
if
(
"0"
.
equals
(
scoreRule
.
getCalType
()))
{
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
compareCatalog
,
objScoreCalResult
,
scoreRule
,
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
}
else
if
(
"1"
.
equals
(
scoreRule
.
getCalType
()))
{
//1 根据目录类别分类算平均分后根据权重计算考核指标
}
else
if
(
"1"
.
equals
(
scoreRule
.
getCalType
()))
{
//1 根据目录类别分类算平均分后根据权重计算考核指标
objScoreCalResult
=
this
.
calIndCatalogTypeAverage
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calIndCatalogTypeAverage
(
compareCatalog
,
objScoreCalResult
,
scoreRule
,
compareObj
,
date
,
code
);
compareObj
,
date
,
code
);
}
else
if
(
"2"
.
equals
(
scoreRule
.
getCalType
())){
//2单个指标权重计算
}
else
if
(
"2"
.
equals
(
scoreRule
.
getCalType
())){
//2单个指标权重计算
objScoreCalResult
=
this
.
calSingleIndWeight
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calSingleIndWeight
(
compareCatalog
,
objScoreCalResult
,
scoreRule
,
compareObj
,
date
,
code
);
compareObj
,
date
,
code
);
}
else
{
//3:指标总得分
}
else
{
//3:指标总得分
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
objScoreCalResult
,
scoreRule
,
objScoreCalResult
=
this
.
calGroupIndAverageOrSum
(
compareCatalog
,
objScoreCalResult
,
scoreRule
,
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
compareObj
,
date
,
scoreRule
.
getCalType
(),
code
);
}
}
objScoreCalResult
.
setCode
(
code
);
objScoreCalResult
.
setCompareCatalog
(
compareCatalog
);
objScoreCalResult
.
setCompareId
(
compareId
);
objScoreCalResult
.
setCompareId
(
compareId
);
datas
.
add
(
objScoreCalResult
);
datas
.
add
(
objScoreCalResult
);
}
}
//批量新增或修改
//批量新增或修改
...
@@ -85,7 +89,7 @@ public class TestScoreRuleService {
...
@@ -85,7 +89,7 @@ public class TestScoreRuleService {
}
}
//计算组内考核指标平均值或者总和 type:0 计算地区所有纳入考核指标平均数 3指标总得分
//计算组内考核指标平均值或者总和 type:0 计算地区所有纳入考核指标平均数 3指标总得分
private
TestObjScoreCalResult
calGroupIndAverageOrSum
(
TestObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
private
TestObjScoreCalResult
calGroupIndAverageOrSum
(
String
compareCatalog
,
TestObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
String
compareObj
,
int
date
,
String
type
,
String
code
){
String
compareObj
,
int
date
,
String
type
,
String
code
){
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setScoreValue
(
"0.0"
);
objResult
.
setScoreValue
(
"0.0"
);
...
@@ -99,8 +103,11 @@ public class TestScoreRuleService {
...
@@ -99,8 +103,11 @@ public class TestScoreRuleService {
//paremMap.put("indIds", indIds);
//paremMap.put("indIds", indIds);
//List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
//List<DriveIndCalResultDef> calResults = driveIndCalResultDefMapper.
//findByCompareObjAndDateAndIndIdIn(paremMap);
//findByCompareObjAndDateAndIndIdIn(paremMap);
// List<TestDriveIndCalResultDef> calResults = testDriveIndCalResultDefMapper.
// findByCompareObjAndDate(compareObj, date, code);
//改用对标单元目录进行过滤
List
<
TestDriveIndCalResultDef
>
calResults
=
testDriveIndCalResultDefMapper
.
List
<
TestDriveIndCalResultDef
>
calResults
=
testDriveIndCalResultDefMapper
.
findByCompare
ObjAndDate
(
compareObj
,
date
,
code
);
findByCompare
CatalogAndCompareObjAndDate
(
compareCatalog
,
compareObj
,
date
,
code
);
int
indCount
=
0
;
//定义用户记录纳入考核指标个数
int
indCount
=
0
;
//定义用户记录纳入考核指标个数
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
improveValues
=
new
ArrayList
<>();
List
<
String
>
improveValues
=
new
ArrayList
<>();
...
@@ -169,7 +176,7 @@ public class TestScoreRuleService {
...
@@ -169,7 +176,7 @@ public class TestScoreRuleService {
return
objResult
;
return
objResult
;
}
}
private
TestObjScoreCalResult
calSingleIndWeight
(
TestObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
private
TestObjScoreCalResult
calSingleIndWeight
(
String
compareCatalog
,
TestObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
String
compareObj
,
int
date
,
String
code
){
String
compareObj
,
int
date
,
String
code
){
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setScoreValue
(
"0.0"
);
objResult
.
setScoreValue
(
"0.0"
);
...
@@ -187,8 +194,11 @@ public class TestScoreRuleService {
...
@@ -187,8 +194,11 @@ public class TestScoreRuleService {
}
}
for
(
String
indId
:
indIdList
)
{
for
(
String
indId
:
indIdList
)
{
//根据日期,对标对象和考核的指标获取考核指标结果详情
//根据日期,对标对象和考核的指标获取考核指标结果详情
// TestDriveIndCalResultDef calresultOp = testDriveIndCalResultDefMapper.
// findByIndIdAndDateAndCompareObj(indId, date, compareObj, code);
//改用对标单元目录进行过滤
TestDriveIndCalResultDef
calresultOp
=
testDriveIndCalResultDefMapper
.
TestDriveIndCalResultDef
calresultOp
=
testDriveIndCalResultDefMapper
.
findBy
IndIdAndDateAndCompareObj
(
indId
,
date
,
compareObj
,
code
);
findBy
CompareCatalogAndIndIdAndDateAndCompareObj
(
compareCatalog
,
indId
,
date
,
compareObj
,
code
);
if
(
calresultOp
!=
null
)
{
if
(
calresultOp
!=
null
)
{
//auth:zhangkb time:2020-7-15 desc:填充对标对象描述
//auth:zhangkb time:2020-7-15 desc:填充对标对象描述
objResult
.
setCompareObjDesc
(
calresultOp
.
getCompareObjDesc
());
objResult
.
setCompareObjDesc
(
calresultOp
.
getCompareObjDesc
());
...
@@ -254,7 +264,7 @@ public class TestScoreRuleService {
...
@@ -254,7 +264,7 @@ public class TestScoreRuleService {
}
}
//按照指标类别进行分类分别计算平均分后再跟类别权重相乘后相加得到最终分数
//按照指标类别进行分类分别计算平均分后再跟类别权重相乘后相加得到最终分数
private
TestObjScoreCalResult
calIndCatalogTypeAverage
(
TestObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
private
TestObjScoreCalResult
calIndCatalogTypeAverage
(
String
compareCatalog
,
TestObjScoreCalResult
objResult
,
ScoreRule
scoreRule
,
String
compareObj
,
int
date
,
String
code
){
String
compareObj
,
int
date
,
String
code
){
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
objResult
.
setCompareObj
(
compareObj
);
objResult
.
setCompareObj
(
compareObj
);
...
@@ -263,8 +273,11 @@ public class TestScoreRuleService {
...
@@ -263,8 +273,11 @@ public class TestScoreRuleService {
objResult
.
setDate
(
date
);
objResult
.
setDate
(
date
);
//根据对标对象,日期查找该对标对象对标的所有指标结果
//根据对标对象,日期查找该对标对象对标的所有指标结果
// List<TestDriveIndCalResultDef> calResults = testDriveIndCalResultDefMapper.
// findByCompareObjAndDate(compareObj, date, code);
//改用对标单元目录进行过滤
List
<
TestDriveIndCalResultDef
>
calResults
=
testDriveIndCalResultDefMapper
.
List
<
TestDriveIndCalResultDef
>
calResults
=
testDriveIndCalResultDefMapper
.
findByCompare
ObjAndDate
(
compareObj
,
date
,
code
);
findByCompare
CatalogAndCompareObjAndDate
(
compareCatalog
,
compareObj
,
date
,
code
);
double
scoreValue
=
0.0
;
double
scoreValue
=
0.0
;
double
improveValue
=
0.0
;
double
improveValue
=
0.0
;
if
(!
calResults
.
isEmpty
())
{
if
(!
calResults
.
isEmpty
())
{
...
...
src/main/resources/mybatis/mapping/DriveIndCalResultDefMapper.xml
View file @
fd87055a
...
@@ -36,6 +36,28 @@
...
@@ -36,6 +36,28 @@
code = #{code}
code = #{code}
</select>
</select>
<select
id=
"findByIndIdAndDateAndCompareObjAndCompareCatalog"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
from drive_ind_cal_result_def
where
ind_id = #{indId} and
compare_obj = #{compareObj} and
date = #{date} and
code = #{code} and
comare_catalog = #{compareCatalog}
</select>
<select
id=
"findByCompareCatalogAndIndIdAndDateAndCompareObj"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
from drive_ind_cal_result_def
where
compare_catalog = #{compareCatalog} and
ind_id = #{indId} and
compare_obj = #{compareObj} and
date = #{date} and
code = #{code}
</select>
<select
id=
"findByIndIdAndDate"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
<select
id=
"findByIndIdAndDate"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
select *
from drive_ind_cal_result_def
from drive_ind_cal_result_def
...
@@ -80,6 +102,16 @@
...
@@ -80,6 +102,16 @@
code = #{code} order by `rank` asc
code = #{code} order by `rank` asc
</select>
</select>
<select
id=
"findByIndIdAndDateAndCompareCatalogAndSort"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
from drive_ind_cal_result_def
where
ind_id = #{indId} and
date = #{date} and
compare_catalog = #{compareCatalog} and
code = #{code} order by `rank` asc
</select>
<select
id=
"findByIndIdAndDateAndCompareId"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
<select
id=
"findByIndIdAndDateAndCompareId"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
select *
from drive_ind_cal_result_def
from drive_ind_cal_result_def
...
@@ -98,6 +130,16 @@
...
@@ -98,6 +130,16 @@
code = #{code}
code = #{code}
</select>
</select>
<select
id=
"findByCompareCatalogAndCompareObjAndDate"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
from drive_ind_cal_result_def
where
compare_obj = #{compareObj} and
date = #{date} and
code = #{code} and
compare_catalog = #{compareCatalog}
</select>
<select
id=
"findByCompareObjAndDateAndIndIdIn"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
<select
id=
"findByCompareObjAndDateAndIndIdIn"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
select *
from drive_ind_cal_result_def
from drive_ind_cal_result_def
...
@@ -121,6 +163,17 @@
...
@@ -121,6 +163,17 @@
code = #{code}
code = #{code}
</select>
</select>
<select
id=
"findByCompareCatalogAndCompareObjAndIndIdAndDate"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
from drive_ind_cal_result_def
where
compare_catalog = #{compareCatalog} and
compare_obj = #{compareObj} and
ind_id = #{indId} and
date = #{date} and
code = #{code}
</select>
<select
id=
"findByIndIdAndDateAndCompareObjIn"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
<select
id=
"findByIndIdAndDateAndCompareObjIn"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
select *
from drive_ind_cal_result_def
from drive_ind_cal_result_def
...
@@ -128,6 +181,7 @@
...
@@ -128,6 +181,7 @@
ind_id = #{indId} and
ind_id = #{indId} and
date = #{date} and
date = #{date} and
code = #{code} and
code = #{code} and
compare_catalog = #{compareCatalog} and
compare_obj in
compare_obj in
<foreach
item=
"id"
collection=
"compareObjs"
open=
"("
close=
")"
separator=
","
>
<foreach
item=
"id"
collection=
"compareObjs"
open=
"("
close=
")"
separator=
","
>
#{id}
#{id}
...
@@ -156,13 +210,14 @@
...
@@ -156,13 +210,14 @@
insert into drive_ind_cal_result_def(
insert into drive_ind_cal_result_def(
compare_id, ind_id, compare_obj, compare_obj_desc, date, value, unit, type,
compare_id, ind_id, compare_obj, compare_obj_desc, date, value, unit, type,
is_right, last_update_time, last_updater, average, `rank`, score, improve_score,
is_right, last_update_time, last_updater, average, `rank`, score, improve_score,
actual_average, code)
actual_average, code
, compare_catalog
)
values
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
(
#{val.compareId}, #{val.indId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.date},
#{val.compareId}, #{val.indId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.date},
#{val.value},#{val.unit},#{val.type},#{val.isRight},#{val.lastUpdateTime},#{val.lastUpdater},
#{val.value},#{val.unit},#{val.type},#{val.isRight},#{val.lastUpdateTime},#{val.lastUpdater},
#{val.average},#{val.rank},#{val.score},#{val.improveScore},#{val.actualAverage},#{val.code}
#{val.average},#{val.rank},#{val.score},#{val.improveScore},#{val.actualAverage},#{val.code},
#{val.compareCatalog}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
@@ -222,6 +277,9 @@
...
@@ -222,6 +277,9 @@
<if
test=
"val.code != null"
>
<if
test=
"val.code != null"
>
code = #{val.code},
code = #{val.code},
</if>
</if>
<if
test=
"val.compareCatalog != null"
>
compare_catalog = #{val.compareCatalog},
</if>
</set>
</set>
where id = ${val.id}
where id = ${val.id}
</foreach>
</foreach>
...
...
src/main/resources/mybatis/mapping/ObjScoreCalResultMapper.xml
View file @
fd87055a
...
@@ -11,6 +11,17 @@
...
@@ -11,6 +11,17 @@
code=#{code}
code=#{code}
</select>
</select>
<select
id=
"getObjScoreCalResultByCompareCatalog"
resultType=
"com.keymobile.indicators.model.entity.objscorerule.ObjScoreCalResult"
>
select *
from obj_score_cal_result
where
compare_id=#{compareId} and
compare_obj=#{compareObj} and
date=#{date} and
code=#{code} and
compare_catalog=#{compareCatalog}
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
insert into obj_score_cal_result(
insert into obj_score_cal_result(
compare_id, compare_obj, compare_obj_desc, ind_ids, date, score_value, improve_value,
compare_id, compare_obj, compare_obj_desc, ind_ids, date, score_value, improve_value,
...
...
src/main/resources/mybatis/mapping/ReportOneMapper.xml
View file @
fd87055a
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
compare_date = #{date} and
compare_date = #{date} and
compare_type = #{type} and
compare_type = #{type} and
code = #{code}
code = #{code}
<if
test=
"compareCatalog!=null"
>
and compare_catalog = #{compareCatalog}
</if>
</select>
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
...
@@ -17,7 +20,7 @@
...
@@ -17,7 +20,7 @@
ind_id, ind_name, compare_obj, compare_obj_desc, compare_date, compare_type, unit, depart,
ind_id, ind_name, compare_obj, compare_obj_desc, compare_date, compare_type, unit, depart,
catalog_type, current_value, last_same_value, value_rate, current_rank, last_same_rank,
catalog_type, current_value, last_same_value, value_rate, current_rank, last_same_rank,
current_score, current_improve, last_same_score, last_same_improve, code, value_rate_rank,
current_score, current_improve, last_same_score, last_same_improve, code, value_rate_rank,
compare_unit_id)
compare_unit_id
, compare_catalog
)
values
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
(
...
@@ -25,7 +28,7 @@
...
@@ -25,7 +28,7 @@
#{val.compareType},#{val.unit},#{val.depart},#{val.catalogType},#{val.currentValue},
#{val.compareType},#{val.unit},#{val.depart},#{val.catalogType},#{val.currentValue},
#{val.lastSameValue},#{val.valueRate},#{val.currentRank},#{val.lastSameRank},
#{val.lastSameValue},#{val.valueRate},#{val.currentRank},#{val.lastSameRank},
#{val.currentScore},#{val.currentImprove},#{val.lastSameScore},#{val.lastSameImprove},
#{val.currentScore},#{val.currentImprove},#{val.lastSameScore},#{val.lastSameImprove},
#{val.code},#{val.valueRateRank},#{val.compareUnitId}
#{val.code},#{val.valueRateRank},#{val.compareUnitId}
,#{val.compareCatalog}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
@@ -97,6 +100,9 @@
...
@@ -97,6 +100,9 @@
<if
test=
"val.compareUnitId != null"
>
<if
test=
"val.compareUnitId != null"
>
compare_unit_id = #{val.compareUnitId},
compare_unit_id = #{val.compareUnitId},
</if>
</if>
<if
test=
"val.compareCatalog != null"
>
compare_catalog = #{val.compareCatalog},
</if>
</set>
</set>
where id = ${val.id}
where id = ${val.id}
</foreach>
</foreach>
...
...
src/main/resources/mybatis/mapping/ReportThreeMapper.xml
View file @
fd87055a
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
compare_obj = #{compareObj} and
compare_obj = #{compareObj} and
compare_date = #{date} and
compare_date = #{date} and
compare_type = #{type} and
compare_type = #{type} and
code = #{code}
code = #{code} and
compare_catalog = #{compreCatalog}
</select>
</select>
<delete
id=
"deleteByParam"
parameterType=
"map"
>
<delete
id=
"deleteByParam"
parameterType=
"map"
>
...
@@ -18,6 +19,7 @@
...
@@ -18,6 +19,7 @@
compare_date = #{date} and
compare_date = #{date} and
compare_type = #{type} and
compare_type = #{type} and
code = #{code} and
code = #{code} and
compare_catalog = #{compreCatalog} and
compare_obj in
compare_obj in
<foreach
item=
"compareObj"
collection=
"compareObjs"
open=
"("
close=
")"
separator=
","
>
<foreach
item=
"compareObj"
collection=
"compareObjs"
open=
"("
close=
")"
separator=
","
>
#{compareObj}
#{compareObj}
...
@@ -30,7 +32,8 @@
...
@@ -30,7 +32,8 @@
bad_average_ind_count, rank_head_three_ind_count, rank_after_three_ind_count,
bad_average_ind_count, rank_head_three_ind_count, rank_after_three_ind_count,
ind_improve_count, ind_improve_head_three_count, ind_improve_after_three_count,
ind_improve_count, ind_improve_head_three_count, ind_improve_after_three_count,
ind_improve_rate,effective_ind_count,ind_reduce_count,rank_one_count,rank_two_count,
ind_improve_rate,effective_ind_count,ind_reduce_count,rank_one_count,rank_two_count,
rank_three_count,rank_last_one_count,rank_last_two_count,rank_last_three_count,code)
rank_three_count,rank_last_one_count,rank_last_two_count,rank_last_three_count,code,
compare_catalog)
values
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
(
...
@@ -39,7 +42,8 @@
...
@@ -39,7 +42,8 @@
#{val.rankAfterThreeIndCount}, #{val.indImproveCount}, #{val.indImproveHeadThreeCount},
#{val.rankAfterThreeIndCount}, #{val.indImproveCount}, #{val.indImproveHeadThreeCount},
#{val.indImproveAfterThreeCount}, #{val.indImproveRate}, #{val.effectiveIndCount},
#{val.indImproveAfterThreeCount}, #{val.indImproveRate}, #{val.effectiveIndCount},
#{val.indReduceCount},#{val.rankOneCount},#{val.rankTwoCount},#{val.rankThreeCount},
#{val.indReduceCount},#{val.rankOneCount},#{val.rankTwoCount},#{val.rankThreeCount},
#{val.rankLastOneCount},#{val.rankLastTwoCount},#{val.rankLastThreeCount},#{val.code}
#{val.rankLastOneCount},#{val.rankLastTwoCount},#{val.rankLastThreeCount},#{val.code},
#{val.compareCatalog}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
...
src/main/resources/mybatis/mapping/ReportTwoMapper.xml
View file @
fd87055a
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
from indicators_report_two
from indicators_report_two
where
where
ind_id = #{indId} and
ind_id = #{indId} and
compare_unit_id = #{compareUnitId} and
compare_date = #{date} and
compare_date = #{date} and
compare_type = #{type} and
compare_type = #{type} and
code = #{code}
code = #{code} and
compare_catalog = #{compareCatalog}
</select>
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
rank_after_three_desc,same_improve_head_three,same_improve_head_three_desc,same_improve_after_three,
rank_after_three_desc,same_improve_head_three,same_improve_head_three_desc,same_improve_after_three,
same_improve_after_three_desc,same_average,rank_one,rank_one_desc,rank_two,rank_two_desc,
same_improve_after_three_desc,same_average,rank_one,rank_one_desc,rank_two,rank_two_desc,
rank_three,rank_three_desc,rank_last_one,rank_last_one_desc,rank_last_two,rank_last_two_desc,
rank_three,rank_three_desc,rank_last_one,rank_last_one_desc,rank_last_two,rank_last_two_desc,
rank_last_three,rank_last_three_desc,code)
rank_last_three,rank_last_three_desc,code
,compare_catalog
)
values
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
(
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#{val.sameImproveAfterThree},#{val.sameImproveAfterThreeDesc},#{val.sameAverage},
#{val.sameImproveAfterThree},#{val.sameImproveAfterThreeDesc},#{val.sameAverage},
#{val.rankOne},#{val.rankOneDesc},#{val.rankTwo},#{val.rankTwoDesc},#{val.rankThree},
#{val.rankOne},#{val.rankOneDesc},#{val.rankTwo},#{val.rankTwoDesc},#{val.rankThree},
#{val.rankThreeDesc},#{val.rankLastOne},#{val.rankLastOneDesc},#{val.rankLastTwo},
#{val.rankThreeDesc},#{val.rankLastOne},#{val.rankLastOneDesc},#{val.rankLastTwo},
#{val.rankLastTwoDesc},#{val.rankLastThree},#{val.rankLastThreeDesc},#{val.code}
#{val.rankLastTwoDesc},#{val.rankLastThree},#{val.rankLastThreeDesc},#{val.code}
,#{val.compareCatalog}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
@@ -161,6 +161,9 @@
...
@@ -161,6 +161,9 @@
<if
test=
"val.code != null"
>
<if
test=
"val.code != null"
>
code = #{val.code},
code = #{val.code},
</if>
</if>
<if
test=
"val.compareCatalog != null"
>
compare_catalog = #{val.compareCatalog},
</if>
</set>
</set>
where id = ${val.id}
where id = ${val.id}
</foreach>
</foreach>
...
...
src/main/resources/mybatis/mapping/TestDriveIndCalResultDefMapper.xml
View file @
fd87055a
...
@@ -10,6 +10,16 @@
...
@@ -10,6 +10,16 @@
code = #{code}
code = #{code}
</select>
</select>
<select
id=
"findByCompareCatalogAndCompareObjAndDate"
resultType=
"com.keymobile.indicators.model.entity.testrun.TestDriveIndCalResultDef"
>
select *
from test_drive_ind_cal_result_def
where
compare_obj = #{compareObj} and
date = #{date} and
code = #{code} and
compare_catalog = #{compareCatalog}
</select>
<select
id=
"findByIndIdAndDateAndCompareObj"
resultType=
"com.keymobile.indicators.model.entity.testrun.TestDriveIndCalResultDef"
>
<select
id=
"findByIndIdAndDateAndCompareObj"
resultType=
"com.keymobile.indicators.model.entity.testrun.TestDriveIndCalResultDef"
>
select *
select *
from test_drive_ind_cal_result_def
from test_drive_ind_cal_result_def
...
@@ -20,6 +30,17 @@
...
@@ -20,6 +30,17 @@
code = #{code}
code = #{code}
</select>
</select>
<select
id=
"findByCompareCatalogAndIndIdAndDateAndCompareObj"
resultType=
"com.keymobile.indicators.model.entity.testrun.TestDriveIndCalResultDef"
>
select *
from test_drive_ind_cal_result_def
where
compare_catalog = #{compareCatalog} and
ind_id = #{indId} and
compare_obj = #{compareObj} and
date = #{date} and
code = #{code}
</select>
<select
id=
"findByCompareIdAndCompareObjAndIndIdAndDate"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
<select
id=
"findByCompareIdAndCompareObjAndIndIdAndDate"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
select *
from test_drive_ind_cal_result_def
from test_drive_ind_cal_result_def
...
@@ -31,17 +52,29 @@
...
@@ -31,17 +52,29 @@
code = #{code}
code = #{code}
</select>
</select>
<select
id=
"findByCompareCatalogAndCompareObjAndIndIdAndDate"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef"
>
select *
from test_drive_ind_cal_result_def
where
compare_catalog = #{compareCatalog} and
compare_obj = #{compareObj} and
ind_id = #{indId} and
date = #{date} and
code = #{code}
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
insert into test_drive_ind_cal_result_def(
insert into test_drive_ind_cal_result_def(
compare_id, ind_id, compare_obj, compare_obj_desc, date, value, unit, type,
compare_id, ind_id, compare_obj, compare_obj_desc, date, value, unit, type,
is_right, last_update_time, last_updater, average, `rank`, score, improve_score,
is_right, last_update_time, last_updater, average, `rank`, score, improve_score,
actual_average, code)
actual_average, code
, compare_catalog
)
values
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
(
#{val.compareId}, #{val.indId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.date},
#{val.compareId}, #{val.indId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.date},
#{val.value},#{val.unit},#{val.type},#{val.isRight},#{val.lastUpdateTime},#{val.lastUpdater},
#{val.value},#{val.unit},#{val.type},#{val.isRight},#{val.lastUpdateTime},#{val.lastUpdater},
#{val.average},#{val.rank},#{val.score},#{val.improveScore},#{val.actualAverage},#{val.code}
#{val.average},#{val.rank},#{val.score},#{val.improveScore},#{val.actualAverage},#{val.code},
#{val.compareCatalog}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
@@ -101,6 +134,9 @@
...
@@ -101,6 +134,9 @@
<if
test=
"val.code != null"
>
<if
test=
"val.code != null"
>
code = #{val.code},
code = #{val.code},
</if>
</if>
<if
test=
"val.compareCatalog != null"
>
compare_catalog = #{val.compareCatalog},
</if>
</set>
</set>
where id = ${val.id}
where id = ${val.id}
</foreach>
</foreach>
...
...
src/main/resources/mybatis/mapping/TestObjScoreCalResultMapper.xml
View file @
fd87055a
...
@@ -11,15 +11,26 @@
...
@@ -11,15 +11,26 @@
code=#{code}
code=#{code}
</select>
</select>
<select
id=
"getTestObjScoreCalResultByCompareCatalog"
resultType=
"com.keymobile.indicators.model.entity.testrun.TestObjScoreCalResult"
>
select *
from test_obj_score_cal_result
where
compare_catalog=#{compareCatalog} and
compare_obj=#{compareObj} and
date=#{date} and
code=#{code}
</select>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
<insert
id=
"batchSave"
parameterType=
"java.util.List"
>
insert into test_obj_score_cal_result(
insert into test_obj_score_cal_result(
compare_id, compare_obj, compare_obj_desc, ind_ids, date, score_value, improve_value,
compare_id, compare_obj, compare_obj_desc, ind_ids, date, score_value, improve_value,
score_sum_value, ind_count, code)
score_sum_value, ind_count, code
, compare_catalog
)
values
values
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
<foreach
collection=
"datas"
item=
"val"
separator=
","
>
(
(
#{val.compareId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.indIds}, #{val.date},
#{val.compareId}, #{val.compareObj}, #{val.compareObjDesc}, #{val.indIds}, #{val.date},
#{val.scoreValue},#{val.improveValue},#{val.scoreSumValue},#{val.indCount},#{val.code})
#{val.scoreValue},#{val.improveValue},#{val.scoreSumValue},#{val.indCount},#{val.code},
#{val.compareCatalog})
</foreach>
</foreach>
</insert>
</insert>
...
@@ -57,6 +68,9 @@
...
@@ -57,6 +68,9 @@
<if
test=
"val.code != null"
>
<if
test=
"val.code != null"
>
code = #{val.code},
code = #{val.code},
</if>
</if>
<if
test=
"val.compareCatalog != null"
>
compare_catalog = #{val.compareCatalog},
</if>
</set>
</set>
where id = ${val.id}
where id = ${val.id}
</foreach>
</foreach>
...
...
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