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
092bfafa
Commit
092bfafa
authored
Feb 01, 2023
by
dengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.多合一指标 2.指标管理增加指标权重维护功能 3.单位积分规则增加多层权重
parent
9c40d807
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
4 deletions
+105
-4
IndicatorsDefCtrl.java
...keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
+7
-0
TaskRuleIndicator.java
.../indicators/model/entity/dataenter/TaskRuleIndicator.java
+5
-1
DriveIndDef.java
...obile/indicators/model/entity/indicators/DriveIndDef.java
+15
-0
TaskRuleIndicatorMapper.java
...tors/model/mapper/indicators/TaskRuleIndicatorMapper.java
+12
-0
DriveIndDefService.java
...bile/indicators/service/hytobacco/DriveIndDefService.java
+43
-2
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+12
-1
TaskRuleIndicatorMapper.xml
...ain/resources/mybatis/mapping/TaskRuleIndicatorMapper.xml
+11
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
View file @
092bfafa
...
@@ -214,4 +214,11 @@ public class IndicatorsDefCtrl {
...
@@ -214,4 +214,11 @@ public class IndicatorsDefCtrl {
return
value
;
return
value
;
}
}
@ApiOperation
(
"根据id获取考核指标"
)
@GetMapping
(
"getIndById"
)
public
DriveIndDef
getIndById
(
@ApiParam
(
"indId"
)
@RequestParam
(
"indId"
)
String
indId
)
{
LogManager
.
logInfo
(
Constants
.
LOG_INDICATOR_DRIVE_INDI_API
,
"根据id获取考核指标,id:{}"
,
indId
);
return
driveIndDefService
.
getIndById
(
indId
,
true
);
}
}
}
src/main/java/com/keymobile/indicators/model/entity/dataenter/TaskRuleIndicator.java
View file @
092bfafa
...
@@ -45,6 +45,10 @@ public class TaskRuleIndicator extends BaseModel {
...
@@ -45,6 +45,10 @@ public class TaskRuleIndicator extends BaseModel {
@ApiModelProperty
(
"指标单位"
)
@ApiModelProperty
(
"指标单位"
)
private
String
indUnit
;
private
String
indUnit
;
/**
* 父指标id
*/
@ApiModelProperty
(
"父指标id"
)
private
String
parentIndId
;
}
}
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndDef.java
View file @
092bfafa
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
com.keymobile.indicators.model.entity.dataenter.TaskRuleIndicator
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
...
@@ -44,4 +47,16 @@ public class DriveIndDef {
...
@@ -44,4 +47,16 @@ public class DriveIndDef {
private
Integer
indNum
;
//指标序号 - 2021/8/17 hzc
private
Integer
indNum
;
//指标序号 - 2021/8/17 hzc
private
String
checkType
;
//考核类型- 2021/8/17 hzc
private
String
checkType
;
//考核类型- 2021/8/17 hzc
private
String
formulaInfo
;
private
String
formulaInfo
;
private
String
isMoreThanOneIndicators
;
//是否多合一指标 是:1 否:0 - 2023年1月31日11:07:59 邓威
@Transient
private
List
<
TaskRuleIndicator
>
indicators
;
// 组内指标 - 2023年1月31日11:07:59 邓威
// 2023年2月1日15:18:33 邓威 -- 新增字段
private
String
twoSmokeArea
;
// 类别权重:两烟区
private
String
netSalesArea
;
// 类别权重:纯销区
private
String
comprehensiveEvaluation
;
// 指标权重:综合评价
private
String
improve
;
// 指标权重:改善提升
}
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/TaskRuleIndicatorMapper.java
View file @
092bfafa
...
@@ -20,6 +20,18 @@ public interface TaskRuleIndicatorMapper extends BaseMapper<TaskRuleIndicator> {
...
@@ -20,6 +20,18 @@ public interface TaskRuleIndicatorMapper extends BaseMapper<TaskRuleIndicator> {
void
deleteByRuleId
(
Integer
ruleId
);
void
deleteByRuleId
(
Integer
ruleId
);
/**
* 根据父指标id获取关联数据项
* @param parentIndId 父指标id
* @return 关联数据项
*/
List
<
TaskRuleIndicator
>
getByParentIndId
(
String
parentIndId
);
/**
* 根据父指标id删除关联数据项
* @param parentIndId 父指标id
*/
void
deleteByParentIndId
(
String
parentIndId
);
/**
/**
* 关联指标表查询出对应的指标信息
* 关联指标表查询出对应的指标信息
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefService.java
View file @
092bfafa
...
@@ -10,8 +10,12 @@ import java.util.regex.Matcher;
...
@@ -10,8 +10,12 @@ import java.util.regex.Matcher;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.dataenter.TaskRule
;
import
com.keymobile.indicators.model.entity.dataenter.TaskRuleIndicator
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
com.keymobile.indicators.model.mapper.indicators.TaskRuleIndicatorMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCatalogMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCatalogMapper
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -42,6 +46,8 @@ public class DriveIndDefService {
...
@@ -42,6 +46,8 @@ public class DriveIndDefService {
private
IndicatorsRelService
indRelService
;
private
IndicatorsRelService
indRelService
;
@Autowired
@Autowired
private
DriveIndCatalogMapper
driveIndCatalogMapper
;
private
DriveIndCatalogMapper
driveIndCatalogMapper
;
@Autowired
private
TaskRuleIndicatorMapper
taskRuleIndicatorMapper
;
public
String
saveOrUpdate
(
DriveIndDef
driveIndDef
,
String
code
,
Integer
catalogId
,
String
catalogIdPath
,
public
String
saveOrUpdate
(
DriveIndDef
driveIndDef
,
String
code
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
,
String
isUpdate
,
String
shortboardIds
)
throws
Exception
{
String
user
,
String
isUpdate
,
String
shortboardIds
)
throws
Exception
{
...
@@ -62,8 +68,8 @@ public class DriveIndDefService {
...
@@ -62,8 +68,8 @@ public class DriveIndDefService {
}
}
DriveIndCatalog
driveIndCatalog
=
driveIndCatalogMapper
.
selectByPrimaryKey
(
catalogPid
);
DriveIndCatalog
driveIndCatalog
=
driveIndCatalogMapper
.
selectByPrimaryKey
(
catalogPid
);
driveIndDef
.
setIndLevel
(
driveIndCatalog
.
getCatalogName
());
driveIndDef
.
setIndLevel
(
driveIndCatalog
.
getCatalogName
());
if
(
"0"
.
equals
(
isUpdate
))
{
//新建
DriveIndDef
dbDriveIndDef
=
this
.
getById
(
driveIndDef
.
getIndId
());
DriveIndDef
dbDriveIndDef
=
this
.
getById
(
driveIndDef
.
getIndId
());
if
(
"0"
.
equals
(
isUpdate
))
{
//新建
if
(
dbDriveIndDef
!=
null
)
{
if
(
dbDriveIndDef
!=
null
)
{
throw
new
Exception
(
"指标编号存在,新增指标失败"
);
throw
new
Exception
(
"指标编号存在,新增指标失败"
);
}
else
{
}
else
{
...
@@ -76,9 +82,9 @@ public class DriveIndDefService {
...
@@ -76,9 +82,9 @@ public class DriveIndDefService {
driveIndDef
.
setCatalogId
(
catalogId
);
driveIndDef
.
setCatalogId
(
catalogId
);
driveIndDef
.
setCatalogIdPath
(
catalogIdPath
);
driveIndDef
.
setCatalogIdPath
(
catalogIdPath
);
driveIndDefMapper
.
insert
(
driveIndDef
);
driveIndDefMapper
.
insert
(
driveIndDef
);
this
.
saveRuleIndicators
(
driveIndDef
);
}
}
}
else
{
}
else
{
DriveIndDef
dbDriveIndDef
=
this
.
getById
(
driveIndDef
.
getIndId
());
if
(
dbDriveIndDef
!=
null
)
{
if
(
dbDriveIndDef
!=
null
)
{
//生成版本
//生成版本
if
(
driveIndDefVersionService
.
save
(
dbDriveIndDef
))
{
if
(
driveIndDefVersionService
.
save
(
dbDriveIndDef
))
{
...
@@ -91,6 +97,8 @@ public class DriveIndDefService {
...
@@ -91,6 +97,8 @@ public class DriveIndDefService {
driveIndDef
.
setCatalogId
(
catalogId
);
driveIndDef
.
setCatalogId
(
catalogId
);
driveIndDef
.
setCatalogIdPath
(
catalogIdPath
);
driveIndDef
.
setCatalogIdPath
(
catalogIdPath
);
driveIndDefMapper
.
updateByPrimaryKey
(
driveIndDef
);
driveIndDefMapper
.
updateByPrimaryKey
(
driveIndDef
);
taskRuleIndicatorMapper
.
deleteByParentIndId
(
driveIndDef
.
getIndId
());
this
.
saveRuleIndicators
(
driveIndDef
);
}
}
}
else
{
}
else
{
throw
new
Exception
(
"指标不存在,修改失败"
);
throw
new
Exception
(
"指标不存在,修改失败"
);
...
@@ -122,6 +130,27 @@ public class DriveIndDefService {
...
@@ -122,6 +130,27 @@ public class DriveIndDefService {
return
"success;driveIndId:"
+
driveIndDef
.
getIndId
();
return
"success;driveIndId:"
+
driveIndDef
.
getIndId
();
}
}
/**
* 保存指标关联的数据项多合一指标
* @param driveIndDef 考核指标
*/
private
void
saveRuleIndicators
(
DriveIndDef
driveIndDef
)
{
List
<
TaskRuleIndicator
>
indicators
=
driveIndDef
.
getIndicators
();
if
(
CollectionUtils
.
isNotEmpty
(
indicators
))
{
for
(
TaskRuleIndicator
indicator
:
indicators
)
{
indicator
.
setId
(
null
);
indicator
.
setRuleId
(
0
);
indicator
.
setState
(
Constants
.
DATA_STATE_A
);
indicator
.
setCreateTime
(
driveIndDef
.
getUpdateTime
());
indicator
.
setCreator
(
driveIndDef
.
getUpdater
());
indicator
.
setUpdater
(
driveIndDef
.
getUpdater
());
indicator
.
setUpdateTime
(
driveIndDef
.
getUpdateTime
());
indicator
.
setParentIndId
(
driveIndDef
.
getIndId
());
taskRuleIndicatorMapper
.
insert
(
indicator
);
}
}
}
public
DriveIndDef
getById
(
String
indId
)
throws
Exception
{
public
DriveIndDef
getById
(
String
indId
)
throws
Exception
{
DriveIndDef
driveIndDef
=
new
DriveIndDef
();
DriveIndDef
driveIndDef
=
new
DriveIndDef
();
driveIndDef
.
setIndId
(
indId
);
driveIndDef
.
setIndId
(
indId
);
...
@@ -253,4 +282,16 @@ public class DriveIndDefService {
...
@@ -253,4 +282,16 @@ public class DriveIndDefService {
public
List
<
DriveIndDef
>
getByIndFormatLike
(
String
indId
){
public
List
<
DriveIndDef
>
getByIndFormatLike
(
String
indId
){
return
driveIndDefMapper
.
getByIndFormatLike
(
"%"
+
indId
+
";%"
);
return
driveIndDefMapper
.
getByIndFormatLike
(
"%"
+
indId
+
";%"
);
}
}
// 根据指标id获取考核指标信息和组内指标关联项
public
DriveIndDef
getIndById
(
String
indId
,
boolean
needInd
)
{
DriveIndDef
selectParam
=
new
DriveIndDef
();
selectParam
.
setIndId
(
indId
);
DriveIndDef
driveIndDef
=
driveIndDefMapper
.
selectOne
(
selectParam
);
if
(
needInd
)
{
List
<
TaskRuleIndicator
>
indicators
=
taskRuleIndicatorMapper
.
getByParentIndId
(
indId
);
driveIndDef
.
setIndicators
(
indicators
);
}
return
driveIndDef
;
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
092bfafa
...
@@ -458,7 +458,7 @@ public class IndScorecardService {
...
@@ -458,7 +458,7 @@ public class IndScorecardService {
}
}
avg
=
(
sum
*
1.0
)
/
(
current
.
size
()
*
1.0
);
avg
=
(
sum
*
1.0
)
/
(
current
.
size
()
*
1.0
);
// 排名
// 排名
Map
<
String
,
Integer
>
rankValue
=
CalculateUtils
.
rankValue
(
valueMap
,
"0"
);
Map
<
String
,
Integer
>
rankValue
=
CalculateUtils
.
rankValue
(
valueMap
,
acsType
);
// 排序
// 排序
Map
<
String
,
Integer
>
sortValue
=
CalculateUtils
.
sortByValueAsc
(
rankValue
);
Map
<
String
,
Integer
>
sortValue
=
CalculateUtils
.
sortByValueAsc
(
rankValue
);
String
compareObj
=
currentCompareObjResult
.
getCompareObj
();
String
compareObj
=
currentCompareObjResult
.
getCompareObj
();
...
@@ -523,6 +523,17 @@ public class IndScorecardService {
...
@@ -523,6 +523,17 @@ public class IndScorecardService {
List
<
RankScoreDef
>
minusScoreItem
=
gson
.
List
<
RankScoreDef
>
minusScoreItem
=
gson
.
fromJson
(
scoreCard
.
getMinusScoreItemJson
(),
new
TypeToken
<
List
<
RankScoreDef
>>(){}.
getType
());
fromJson
(
scoreCard
.
getMinusScoreItemJson
(),
new
TypeToken
<
List
<
RankScoreDef
>>(){}.
getType
());
rank
=
currentDriveResult
.
size
()-
rank
+
1
;
rank
=
currentDriveResult
.
size
()-
rank
+
1
;
int
maxRank
=
0
;
for
(
DriveIndCalResultDef
tempDriveIndCalResultDef
:
currentDriveResult
)
{
if
(
tempDriveIndCalResultDef
.
getRank
()>
maxRank
){
maxRank
=
tempDriveIndCalResultDef
.
getRank
()
;
}
}
if
(
rank
==
maxRank
){
rank
=
1
;
}
else
{
rank
=
currentDriveResult
.
size
()
-
rank
+
1
;
}
for
(
RankScoreDef
scoreDef
:
minusScoreItem
)
{
for
(
RankScoreDef
scoreDef
:
minusScoreItem
)
{
if
(
scoreDef
.
getRank
()==
rank
)
{
if
(
scoreDef
.
getRank
()==
rank
)
{
value
-=
scoreDef
.
getScore
();
value
-=
scoreDef
.
getScore
();
...
...
src/main/resources/mybatis/mapping/TaskRuleIndicatorMapper.xml
View file @
092bfafa
...
@@ -8,6 +8,11 @@
...
@@ -8,6 +8,11 @@
where rule_id = #{ruleId} and state = 1
where rule_id = #{ruleId} and state = 1
</select>
</select>
<select
id=
"getByParentIndId"
parameterType=
"java.lang.String"
resultType=
"com.keymobile.indicators.model.entity.dataenter.TaskRuleIndicator"
>
select *
from data_enter_rule_ind
where parent_ind_id = #{parentIndId} and state = 1
</select>
<update
id=
"deleteByRuleId"
parameterType=
"java.lang.Integer"
>
<update
id=
"deleteByRuleId"
parameterType=
"java.lang.Integer"
>
update data_enter_rule_ind
update data_enter_rule_ind
...
@@ -15,6 +20,12 @@
...
@@ -15,6 +20,12 @@
where rule_id = #{ruleId}
where rule_id = #{ruleId}
</update>
</update>
<update
id=
"deleteByParentIndId"
parameterType=
"java.lang.String"
>
update data_enter_rule_ind
set state = 3
where parent_ind_id = #{parentIndId}
</update>
<select
id=
"findIndRefByRuleIdIdAndDept"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndDef"
>
<select
id=
"findIndRefByRuleIdIdAndDept"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndDef"
>
SELECT def.*
SELECT def.*
from data_enter_rule_ind ind LEFT JOIN drive_ind_def def on ind.ind_id=def.ind_id
from data_enter_rule_ind ind LEFT JOIN drive_ind_def def on ind.ind_id=def.ind_id
...
...
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