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
b96343a4
Commit
b96343a4
authored
Jun 16, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加根据指标id获取指标详情接口
parent
a44beb64
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
IndicatorsDefCtrl.java
...keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
+18
-0
DriveIndDefService.java
...bile/indicators/service/hytobacco/DriveIndDefService.java
+26
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
View file @
b96343a4
...
...
@@ -43,6 +43,12 @@ public class IndicatorsDefCtrl {
baseIndDefService
.
delete
(
indId
);
}
@ApiOperation
(
value
=
"根据id查询基础指标详情"
,
notes
=
"根据id查询基础指标详情"
)
@PostMapping
(
value
=
"/getBaseIndById"
)
public
BaseIndDef
getBaseIndById
(
@RequestParam
String
indId
)
throws
Exception
{
return
baseIndDefService
.
getById
(
indId
);
}
@ApiOperation
(
value
=
"根据关键字查询基础指标"
,
notes
=
"根据关键字查询基础指标"
)
@PostMapping
(
value
=
"/getByPageAndKeyword"
)
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
@RequestParam
Integer
catalogId
,
...
...
@@ -65,6 +71,18 @@ public class IndicatorsDefCtrl {
driveIndDefService
.
delete
(
indId
);
}
@ApiOperation
(
value
=
"根据考核指标id获取指标详情"
,
notes
=
"根据考核指标id获取指标详情"
)
@PostMapping
(
value
=
"/getDrivedefById"
)
public
DriveIndDef
getDrivedefById
(
@RequestParam
String
indId
)
throws
Exception
{
return
driveIndDefService
.
getById
(
indId
);
}
@ApiOperation
(
value
=
"根据考核指标id获取指标详情(包含短板筛选规则信息)"
,
notes
=
"根据考核指标id获取指标详情(包含短板筛选规则信息)"
)
@PostMapping
(
value
=
"/getDrivedefDetailById"
)
public
Map
<
String
,
Object
>
getDrivedefDetailById
(
@RequestParam
String
indId
)
throws
Exception
{
return
driveIndDefService
.
getDetailById
(
indId
);
}
@ApiOperation
(
value
=
"根据关键字查询考核指标"
,
notes
=
"根据关键字查询考核指标"
)
@PostMapping
(
value
=
"/getDriveByPageAndKeyword"
)
public
Map
<
String
,
Object
>
getDriveByPageAndKeyword
(
@RequestParam
Integer
catalogId
,
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefService.java
View file @
b96343a4
...
...
@@ -17,8 +17,10 @@ import com.google.common.collect.Maps;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardDriveIndRel
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardRule
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.ShortboardDriveIndRelMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.ShortboardRuleMapper
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
...
...
@@ -31,6 +33,8 @@ public class DriveIndDefService {
private
BaseIndDataService
baseIndDataService
;
@Autowired
private
ShortboardDriveIndRelMapper
shortboardDriveIndRelMapper
;
@Autowired
private
ShortboardRuleMapper
shortboardRuleMapper
;
public
String
saveOrUpdate
(
DriveIndDef
driveIndDef
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
,
String
shortboardIds
)
throws
Exception
{
...
...
@@ -90,6 +94,28 @@ public class DriveIndDefService {
return
driveIndDefMapper
.
selectOne
(
driveIndDef
);
}
public
Map
<
String
,
Object
>
getDetailById
(
String
indId
)
throws
Exception
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
DriveIndDef
driveIndDef
=
new
DriveIndDef
();
driveIndDef
.
setIndId
(
indId
);
driveIndDef
=
driveIndDefMapper
.
selectOne
(
driveIndDef
);
if
(
driveIndDef
!=
null
)
{
result
.
put
(
"driveIndDef"
,
driveIndDef
);
//查找考核指标之前关联的短板筛选规则
List
<
ShortboardDriveIndRel
>
relations
=
shortboardDriveIndRelMapper
.
findByDriveIndDefId
(
driveIndDef
.
getIndId
());
List
<
ShortboardRule
>
rules
=
new
ArrayList
<>();
for
(
ShortboardDriveIndRel
relation
:
relations
)
{
ShortboardRule
rule
=
shortboardRuleMapper
.
selectByPrimaryKey
(
relation
.
getShortboardRuleId
());
if
(
rule
!=
null
)
{
rules
.
add
(
rule
);
}
}
result
.
put
(
"shortboardRules"
,
rules
);
}
return
result
;
}
public
void
delete
(
String
indId
)
throws
Exception
{
driveIndDefMapper
.
deleteByPrimaryKey
(
indId
);
}
...
...
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