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
29382506
Commit
29382506
authored
Apr 23, 2021
by
hzc
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hy-tobacco' into hy-tobacco
# Conflicts: # src/main/resources/application-test.yml
parents
2ff9fa57
0c07ddc3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
8 deletions
+41
-8
BeforeCompareUnitCalActor.java
...tors/akka/actor/indicators/BeforeCompareUnitCalActor.java
+13
-0
StartCompareUnitCalMsg.java
...ators/akka/message/indicators/StartCompareUnitCalMsg.java
+9
-0
SystemAuthService.java
...a/com/keymobile/indicators/service/SystemAuthService.java
+7
-0
DriveIndCalResultService.java
...ndicators/service/hytobacco/DriveIndCalResultService.java
+6
-2
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+3
-3
TestScoreRuleService.java
...bile/indicators/service/testrun/TestScoreRuleService.java
+3
-3
No files found.
src/main/java/com/keymobile/indicators/akka/actor/indicators/BeforeCompareUnitCalActor.java
View file @
29382506
...
...
@@ -4,6 +4,7 @@ import java.util.*;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.indicators.CompareUnitCalLog
;
import
com.keymobile.indicators.service.SystemAuthService
;
import
com.keymobile.indicators.service.hytobacco.CompareUnitCalLogService
;
import
com.keymobile.indicators.utils.LogManager
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -25,6 +26,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
private
IndicatorsReportService
indicatorsReportService
=
SpringUtil
.
getBean
(
IndicatorsReportService
.
class
);
private
SystemAuthService
systemAuthService
=
SpringUtil
.
getBean
(
SystemAuthService
.
class
);
private
CompareUnitCalLogService
compareUnitCalLogService
=
SpringUtil
.
getBean
(
CompareUnitCalLogService
.
class
);
private
int
numberOfConfirm
=
0
;
//定义返回确认消息的子actor
...
...
@@ -47,6 +50,8 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
private
String
path
=
null
;
//对标单元目录id
private
Boolean
isClearAllPools
;
@Override
public
Receive
createReceive
()
{
try
{
...
...
@@ -60,6 +65,9 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
compCalLogId
=
beforeCompareUnitCalMsg
.
getCompCalLogId
();
path
=
beforeCompareUnitCalMsg
.
getPath
();
currentDate
=
beforeCompareUnitCalMsg
.
getDateMark
();
//dateMark记录本期对标时间
isClearAllPools
=
beforeCompareUnitCalMsg
.
getClearAllPools
();
//是否清理smartBi缓存
if
(
"0"
.
equals
(
isTest
))
{
logger
.
info
(
"进行date:"
+
sameDate
+
" 的对标单元试运行计算.....日志id:"
+
compCalLogId
);
}
else
{
...
...
@@ -183,6 +191,11 @@ public class BeforeCompareUnitCalActor extends AbstractActor{
compareUnitCalLogService
.
saveOrUndate
(
compCalLog
);
}
LogManager
.
logInfo
(
Constants
.
LOG_INDICATOR_UNIT_CAL_API
,
"完成对标单元id:{},日期:{} 的正式运行计算"
,
compCalLogId
,
currentDate
);
//清缓存
if
(
isClearAllPools
){
logger
.
info
(
"开始清除smartBi缓存"
);
systemAuthService
.
clearAllPools
();
}
logger
.
info
(
"本期同期对标单元计算完成"
);
}
}
...
...
src/main/java/com/keymobile/indicators/akka/message/indicators/StartCompareUnitCalMsg.java
View file @
29382506
...
...
@@ -26,6 +26,7 @@ public class StartCompareUnitCalMsg implements Serializable{
private
Integer
dateMark
;
//本期对标时间
private
Boolean
clearAllPools
;
public
StartCompareUnitCalMsg
(
List
<
CompareUnitDef
>
compareInitDefs
,
String
code
,
String
isTest
,
Integer
dateMark
)
{
...
...
@@ -35,6 +36,14 @@ public class StartCompareUnitCalMsg implements Serializable{
this
.
dateMark
=
dateMark
;
}
public
Boolean
getClearAllPools
()
{
return
clearAllPools
;
}
public
void
setClearAllPools
(
Boolean
clearAllPools
)
{
this
.
clearAllPools
=
clearAllPools
;
}
public
Integer
getCompCalLogId
()
{
return
compCalLogId
;
}
...
...
src/main/java/com/keymobile/indicators/service/SystemAuthService.java
View file @
29382506
...
...
@@ -67,4 +67,11 @@ public interface SystemAuthService {
*/
@GetMapping
(
"/standardObj/listByIds"
)
List
<
JSONObject
>
getStandardObjByIds
(
@RequestParam
(
"ids"
)
List
<
String
>
ids
);
/**
* 清理smartBi缓存
* * @return
*/
@GetMapping
(
"/smartBi/clearAllPools"
)
void
clearAllPools
();
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCalResultService.java
View file @
29382506
...
...
@@ -13,6 +13,7 @@ import org.apache.commons.lang.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.akka.actor.indicators.BeforeCompareUnitCalActor
;
...
...
@@ -48,7 +49,10 @@ public class DriveIndCalResultService {
@Autowired
private
TestObjScoreCalResultMapper
testObjScoreCalResultMapper
;
@Value
(
"${isClearAllPools}"
)
private
Boolean
isClearAllPools
;
public
int
saveOrUpdate
(
DriveIndCalResultDef
driveIndCalResult
)
{
if
(
driveIndCalResult
.
getId
()==
null
)
{
driveIndCalResultDefMapper
.
insert
(
driveIndCalResult
);
...
...
@@ -150,7 +154,7 @@ public class DriveIndCalResultService {
startCompareUnitCalMsg
.
setCompCalLogId
(
compCalLogId
);
//author:zhangkb time:2020-12-12 desc:将path参数传入对标计算中
startCompareUnitCalMsg
.
setPath
(
path
);
startCompareUnitCalMsg
.
setClearAllPools
(
isClearAllPools
);
ActorRef
beforeCompareUnitCalActor
=
system
.
actorOf
(
Props
.
create
(
BeforeCompareUnitCalActor
.
class
,()->
new
BeforeCompareUnitCalActor
()));
beforeCompareUnitCalActor
.
tell
(
startCompareUnitCalMsg
,
ActorRef
.
noSender
());
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
View file @
29382506
...
...
@@ -155,7 +155,7 @@ public class ScoreRuleService {
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
// && !"0.0000".equals(calResult.getValue())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
scoreValues
.
add
(
calResult
.
get
Valu
e
());
scoreValues
.
add
(
calResult
.
get
Scor
e
());
}
indCount
+=
1
;
...
...
@@ -285,7 +285,7 @@ public class ScoreRuleService {
if
(!
"NaN"
.
equals
(
calresultOp
.
getValue
())
&&
!
"Infinite"
.
equals
(
calresultOp
.
getValue
())
// && !"0.0000".equals(calResult.getValue())
&&
!
"0"
.
equals
(
calresultOp
.
getValue
()))
{
scoreTmpSumValue
+=
Double
.
parseDouble
(
calresultOp
.
get
Valu
e
());
scoreTmpSumValue
+=
Double
.
parseDouble
(
calresultOp
.
get
Scor
e
());
}
//得分类型:0 指标值直接参与计算
...
...
@@ -441,7 +441,7 @@ public class ScoreRuleService {
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
// && !"0.0000".equals(calResult.getValue())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
scoreValues
.
add
(
calResult
.
get
Valu
e
());
scoreValues
.
add
(
calResult
.
get
Scor
e
());
}
if
(
"0"
.
equals
(
scoreRule
.
getScoreType
()))
{
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
...
...
src/main/java/com/keymobile/indicators/service/testrun/TestScoreRuleService.java
View file @
29382506
...
...
@@ -119,7 +119,7 @@ public class TestScoreRuleService {
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
// && !"0.0000".equals(calResult.getValue())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
scoreValues
.
add
(
calResult
.
get
Valu
e
());
scoreValues
.
add
(
calResult
.
get
Scor
e
());
}
indCount
+=
1
;
//得分类型:0 指标值直接参与计算
...
...
@@ -239,7 +239,7 @@ public class TestScoreRuleService {
if
(!
"NaN"
.
equals
(
calresultOp
.
getValue
())
&&
!
"Infinite"
.
equals
(
calresultOp
.
getValue
())
// && !"0.0000".equals(calResult.getValue())
&&
!
"0"
.
equals
(
calresultOp
.
getValue
()))
{
scoreTmpSumValue
+=
Double
.
parseDouble
(
calresultOp
.
get
Valu
e
());
scoreTmpSumValue
+=
Double
.
parseDouble
(
calresultOp
.
get
Scor
e
());
}
//得分类型:0 指标值直接参与计算
if
(
"0"
.
equals
(
scoreRule
.
getScoreType
()))
{
...
...
@@ -374,7 +374,7 @@ public class TestScoreRuleService {
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
// && !"0.0000".equals(calResult.getValue())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
scoreValues
.
add
(
calResult
.
get
Valu
e
());
scoreValues
.
add
(
calResult
.
get
Scor
e
());
}
if
(
"0"
.
equals
(
scoreRule
.
getScoreType
()))
{
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
...
...
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