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
2bc0b35b
Commit
2bc0b35b
authored
Mar 09, 2023
by
dengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多层权重计算逻辑问题修复
parent
4e5ddd72
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
14 deletions
+25
-14
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+0
-1
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+6
-6
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+1
-2
WeightIndValueServiceImpl.java
...rvice/weightDataEnter/impl/WeightIndValueServiceImpl.java
+18
-5
No files found.
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
2bc0b35b
...
@@ -142,7 +142,6 @@ public class IndScorecardService {
...
@@ -142,7 +142,6 @@ public class IndScorecardService {
public
Map
<
String
,
String
>
calculateIndiScore
(
String
compareCatalog
,
String
compareId
,
String
indId
,
int
date
,
String
compareObj
,
public
Map
<
String
,
String
>
calculateIndiScore
(
String
compareCatalog
,
String
compareId
,
String
indId
,
int
date
,
String
compareObj
,
Integer
indScorecardId
,
List
<
String
>
compareObjs
,
String
code
,
int
dateMark
)
throws
Exception
{
Integer
indScorecardId
,
List
<
String
>
compareObjs
,
String
code
,
int
dateMark
)
throws
Exception
{
logger
.
info
(
"计算方法参数为:"
+
compareCatalog
+
"|"
+
compareId
+
"|"
+
indId
+
"|"
+
date
+
"|"
+
compareObj
+
"|"
+
indScorecardId
+
"|"
+
compareObjs
+
"|"
+
code
+
"|"
+
dateMark
);
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"
;
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
View file @
2bc0b35b
...
@@ -631,7 +631,7 @@ public class ScoreRuleService {
...
@@ -631,7 +631,7 @@ public class ScoreRuleService {
// 获取组内指标
// 获取组内指标
List
<
TaskRuleIndicator
>
indicators
=
driveIndDef
.
getIndicators
();
List
<
TaskRuleIndicator
>
indicators
=
driveIndDef
.
getIndicators
();
BigDecimal
dimensionWeight
=
BigDecimal
.
ZERO
;
BigDecimal
dimensionWeight
=
BigDecimal
.
ZERO
;
if
(
weightIndValue
.
getDimensionWeight
()
!=
null
)
{
if
(
weightIndValue
.
getDimensionWeight
()
!=
null
&&
weightIndValue
.
getDimensionWeight
().
doubleValue
()
!=
0
)
{
dimensionWeight
=
weightIndValue
.
getDimensionWeight
().
divide
(
new
BigDecimal
(
100
));
dimensionWeight
=
weightIndValue
.
getDimensionWeight
().
divide
(
new
BigDecimal
(
100
));
}
}
// 获取多合一指标中的最大指标值
// 获取多合一指标中的最大指标值
...
@@ -639,7 +639,7 @@ public class ScoreRuleService {
...
@@ -639,7 +639,7 @@ public class ScoreRuleService {
if
(!
StringUtils
.
equals
(
"0.0"
,
map
.
get
(
"maxScore"
)))
{
if
(!
StringUtils
.
equals
(
"0.0"
,
map
.
get
(
"maxScore"
)))
{
BigDecimal
score
=
new
BigDecimal
(
map
.
get
(
"maxScore"
));
BigDecimal
score
=
new
BigDecimal
(
map
.
get
(
"maxScore"
));
BigDecimal
synthesizeWeight
=
BigDecimal
.
ZERO
;
BigDecimal
synthesizeWeight
=
BigDecimal
.
ZERO
;
if
(
weightIndValue
.
getSynthesizeWeight
()
!=
null
)
{
if
(
weightIndValue
.
getSynthesizeWeight
()
!=
null
&&
weightIndValue
.
getSynthesizeWeight
().
doubleValue
()
!=
0
)
{
synthesizeWeight
=
weightIndValue
.
getSynthesizeWeight
().
divide
(
new
BigDecimal
(
100
));
synthesizeWeight
=
weightIndValue
.
getSynthesizeWeight
().
divide
(
new
BigDecimal
(
100
));
}
}
BigDecimal
finalScore
=
score
.
multiply
(
synthesizeWeight
).
multiply
(
dimensionWeight
);
BigDecimal
finalScore
=
score
.
multiply
(
synthesizeWeight
).
multiply
(
dimensionWeight
);
...
@@ -648,7 +648,7 @@ public class ScoreRuleService {
...
@@ -648,7 +648,7 @@ public class ScoreRuleService {
if
(!
StringUtils
.
equals
(
"0.0"
,
map
.
get
(
"maxImproveScore"
)))
{
if
(!
StringUtils
.
equals
(
"0.0"
,
map
.
get
(
"maxImproveScore"
)))
{
BigDecimal
improveScore
=
new
BigDecimal
(
map
.
get
(
"maxImproveScore"
));
BigDecimal
improveScore
=
new
BigDecimal
(
map
.
get
(
"maxImproveScore"
));
BigDecimal
improveWeight
=
BigDecimal
.
ZERO
;
BigDecimal
improveWeight
=
BigDecimal
.
ZERO
;
if
(
weightIndValue
.
getImproveWeight
()
!=
null
)
{
if
(
weightIndValue
.
getImproveWeight
()
!=
null
&&
weightIndValue
.
getImproveWeight
().
doubleValue
()
!=
0
)
{
improveWeight
=
weightIndValue
.
getImproveWeight
().
divide
(
new
BigDecimal
(
100
));
improveWeight
=
weightIndValue
.
getImproveWeight
().
divide
(
new
BigDecimal
(
100
));
}
}
BigDecimal
finalImproveScore
=
improveScore
.
multiply
(
improveWeight
).
multiply
(
dimensionWeight
);
BigDecimal
finalImproveScore
=
improveScore
.
multiply
(
improveWeight
).
multiply
(
dimensionWeight
);
...
@@ -661,13 +661,13 @@ public class ScoreRuleService {
...
@@ -661,13 +661,13 @@ public class ScoreRuleService {
}
else
{
}
else
{
indCount
+=
1
;
indCount
+=
1
;
BigDecimal
dimensionWeight
=
BigDecimal
.
ZERO
;
BigDecimal
dimensionWeight
=
BigDecimal
.
ZERO
;
if
(
weightIndValue
.
getDimensionWeight
()
!=
null
)
{
if
(
weightIndValue
.
getDimensionWeight
()
!=
null
&&
weightIndValue
.
getDimensionWeight
().
doubleValue
()
!=
0
)
{
dimensionWeight
=
weightIndValue
.
getDimensionWeight
().
divide
(
new
BigDecimal
(
100
));
dimensionWeight
=
weightIndValue
.
getDimensionWeight
().
divide
(
new
BigDecimal
(
100
));
}
}
if
(!
"No"
.
equals
(
calResult
.
getImproveScore
())
&&
StringUtils
.
isNotBlank
(
calResult
.
getImproveScore
()))
{
if
(!
"No"
.
equals
(
calResult
.
getImproveScore
())
&&
StringUtils
.
isNotBlank
(
calResult
.
getImproveScore
()))
{
BigDecimal
improveScore
=
new
BigDecimal
(
calResult
.
getImproveScore
());
BigDecimal
improveScore
=
new
BigDecimal
(
calResult
.
getImproveScore
());
BigDecimal
improveWeight
=
BigDecimal
.
ZERO
;
BigDecimal
improveWeight
=
BigDecimal
.
ZERO
;
if
(
weightIndValue
.
getImproveWeight
()
!=
null
)
{
if
(
weightIndValue
.
getImproveWeight
()
!=
null
&&
weightIndValue
.
getImproveWeight
().
doubleValue
()
!=
0
)
{
improveWeight
=
weightIndValue
.
getImproveWeight
().
divide
(
new
BigDecimal
(
100
));
improveWeight
=
weightIndValue
.
getImproveWeight
().
divide
(
new
BigDecimal
(
100
));
}
}
BigDecimal
finalImproveScore
=
improveScore
.
multiply
(
improveWeight
).
multiply
(
dimensionWeight
);
BigDecimal
finalImproveScore
=
improveScore
.
multiply
(
improveWeight
).
multiply
(
dimensionWeight
);
...
@@ -676,7 +676,7 @@ public class ScoreRuleService {
...
@@ -676,7 +676,7 @@ public class ScoreRuleService {
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
if
(!
"NaN"
.
equals
(
calResult
.
getValue
())
&&
!
"Infinite"
.
equals
(
calResult
.
getValue
())
&&
!
"0"
.
equals
(
calResult
.
getValue
()))
{
BigDecimal
score
=
new
BigDecimal
(
calResult
.
getScore
());
BigDecimal
score
=
new
BigDecimal
(
calResult
.
getScore
());
BigDecimal
synthesizeWeight
=
BigDecimal
.
ZERO
;
BigDecimal
synthesizeWeight
=
BigDecimal
.
ZERO
;
if
(
weightIndValue
.
getSynthesizeWeight
()
!=
null
)
{
if
(
weightIndValue
.
getSynthesizeWeight
()
!=
null
&&
weightIndValue
.
getSynthesizeWeight
().
doubleValue
()
!=
0
)
{
synthesizeWeight
=
weightIndValue
.
getSynthesizeWeight
().
divide
(
new
BigDecimal
(
100
));
synthesizeWeight
=
weightIndValue
.
getSynthesizeWeight
().
divide
(
new
BigDecimal
(
100
));
}
}
BigDecimal
finalScore
=
score
.
multiply
(
synthesizeWeight
).
multiply
(
dimensionWeight
);
BigDecimal
finalScore
=
score
.
multiply
(
synthesizeWeight
).
multiply
(
dimensionWeight
);
...
...
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
2bc0b35b
...
@@ -930,8 +930,7 @@ public class IndicatorsReportService {
...
@@ -930,8 +930,7 @@ public class IndicatorsReportService {
int
start
=
0
;
int
start
=
0
;
int
end
=
3
;
int
end
=
3
;
Map
<
String
,
Integer
>
resultRank
=
(
Map
<
String
,
Integer
>)
sameImproveResult
.
get
(
"resultRank"
);
Map
<
String
,
Integer
>
resultRank
=
(
Map
<
String
,
Integer
>)
sameImproveResult
.
get
(
"resultRank"
);
logger
.
info
(
"空指针日志resultRank:"
+
resultRank
);
// 判空有未考虑到情况,需要添加其他判空情况
// TODO: 2023-02-16-0016 判空有未考虑到情况,需要添加其他判空情况
if
(
resultRank
!=
null
&&
!
resultRank
.
isEmpty
())
{
if
(
resultRank
!=
null
&&
!
resultRank
.
isEmpty
())
{
//根据省对市地区顺序排列排名并列的情况
//根据省对市地区顺序排列排名并列的情况
Map
<
String
,
Object
>
objSortRank
=
CalculateUtils
.
rankByObjSort
(
resultRank
,
objSort
);
Map
<
String
,
Object
>
objSortRank
=
CalculateUtils
.
rankByObjSort
(
resultRank
,
objSort
);
...
...
src/main/java/com/keymobile/indicators/service/weightDataEnter/impl/WeightIndValueServiceImpl.java
View file @
2bc0b35b
...
@@ -53,6 +53,7 @@ public class WeightIndValueServiceImpl implements WeightIndValueService {
...
@@ -53,6 +53,7 @@ public class WeightIndValueServiceImpl implements WeightIndValueService {
*/
*/
private
void
saveDetail
(
List
<
WeightIndValue
>
values
,
Integer
weightId
)
{
private
void
saveDetail
(
List
<
WeightIndValue
>
values
,
Integer
weightId
)
{
ObjScoreIndWeightCfg
weightCfg
=
weightCfgMapper
.
getById
(
weightId
);
ObjScoreIndWeightCfg
weightCfg
=
weightCfgMapper
.
getById
(
weightId
);
BigDecimal
big
=
new
BigDecimal
(
100
);
// 先清除表里面的数据
// 先清除表里面的数据
weightDetailMapper
.
deleteByCfgId
(
weightId
);
weightDetailMapper
.
deleteByCfgId
(
weightId
);
List
<
ObjScoreIndWeightDetail
>
details
=
new
ArrayList
<>();
List
<
ObjScoreIndWeightDetail
>
details
=
new
ArrayList
<>();
...
@@ -68,12 +69,20 @@ public class WeightIndValueServiceImpl implements WeightIndValueService {
...
@@ -68,12 +69,20 @@ public class WeightIndValueServiceImpl implements WeightIndValueService {
weightDetail
.
setIndId
(
indValue
.
getIndId
());
weightDetail
.
setIndId
(
indValue
.
getIndId
());
weightDetail
.
setIndName
(
indValue
.
getIndName
());
weightDetail
.
setIndName
(
indValue
.
getIndName
());
if
(
StringUtils
.
isNotBlank
(
indDef
.
getComprehensiveEvaluation
()))
{
if
(
StringUtils
.
isNotBlank
(
indDef
.
getComprehensiveEvaluation
()))
{
weightDetail
.
setWeight
(
new
BigDecimal
(
indDef
.
getComprehensiveEvaluation
()));
weightDetail
.
setWeight
(
new
BigDecimal
(
indDef
.
getComprehensiveEvaluation
())
.
divide
(
big
)
);
}
else
{
}
else
{
weightDetail
.
setWeight
(
new
BigDecimal
(
0
));
weightDetail
.
setWeight
(
BigDecimal
.
ZERO
);
}
if
(
indValue
.
getSynthesizeWeight
()
!=
null
)
{
weightDetail
.
setIndWeight
(
indValue
.
getSynthesizeWeight
().
divide
(
big
));
}
else
{
weightDetail
.
setIndWeight
(
BigDecimal
.
ZERO
);
}
if
(
indValue
.
getImproveWeight
()
!=
null
){
weightDetail
.
setIndImproveWeight
(
indValue
.
getImproveWeight
().
divide
(
big
));
}
else
{
weightDetail
.
setIndImproveWeight
(
BigDecimal
.
ZERO
);
}
}
weightDetail
.
setIndWeight
(
indValue
.
getSynthesizeWeight
());
weightDetail
.
setIndImproveWeight
(
indValue
.
getImproveWeight
());
weightDetail
.
setWeightTwo
(
weightCfg
.
getWeightTwo
());
weightDetail
.
setWeightTwo
(
weightCfg
.
getWeightTwo
());
weightDetail
.
setWeightOne
(
weightCfg
.
getWeightOne
());
weightDetail
.
setWeightOne
(
weightCfg
.
getWeightOne
());
if
(
weightCfg
.
getWeightTwo
().
equals
(
indValue
.
getDimensionWeight
()))
{
if
(
weightCfg
.
getWeightTwo
().
equals
(
indValue
.
getDimensionWeight
()))
{
...
@@ -81,7 +90,11 @@ public class WeightIndValueServiceImpl implements WeightIndValueService {
...
@@ -81,7 +90,11 @@ public class WeightIndValueServiceImpl implements WeightIndValueService {
}
else
{
}
else
{
weightDetail
.
setOrgType
(
"纯销区"
);
weightDetail
.
setOrgType
(
"纯销区"
);
}
}
weightDetail
.
setBigWeight
(
indValue
.
getDimensionWeight
());
if
(
indValue
.
getDimensionWeight
()
!=
null
)
{
weightDetail
.
setBigWeight
(
indValue
.
getDimensionWeight
().
divide
(
big
));
}
else
{
weightDetail
.
setBigWeight
(
BigDecimal
.
ZERO
);
}
details
.
add
(
weightDetail
);
details
.
add
(
weightDetail
);
}
}
weightDetailMapper
.
batchInsert
(
details
);
weightDetailMapper
.
batchInsert
(
details
);
...
...
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