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
291245f3
Commit
291245f3
authored
Jul 08, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改删除指标评分逻辑,关联了指标的评分无法删除
parent
d8829128
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
3 deletions
+30
-3
IndScorecardCtrl.java
.../keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
+2
-2
DriveIndDefMapper.java
...indicators/model/mapper/indicators/DriveIndDefMapper.java
+2
-0
DriveIndDefService.java
...bile/indicators/service/hytobacco/DriveIndDefService.java
+5
-0
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+14
-1
DriveIndDefMapper.xml
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
+7
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
View file @
291245f3
...
@@ -74,8 +74,8 @@ public class IndScorecardCtrl {
...
@@ -74,8 +74,8 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestBody
List
<
Integer
>
ids
)
{
public
String
delete
(
@RequestBody
List
<
Integer
>
ids
)
{
indScorecardService
.
delete
(
ids
);
return
indScorecardService
.
delete
(
ids
);
}
}
@ApiOperation
(
value
=
"获取所有评分卡"
,
notes
=
"获取所有评分卡"
)
@ApiOperation
(
value
=
"获取所有评分卡"
,
notes
=
"获取所有评分卡"
)
...
...
src/main/java/com/keymobile/indicators/model/mapper/indicators/DriveIndDefMapper.java
View file @
291245f3
...
@@ -20,4 +20,6 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
...
@@ -20,4 +20,6 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
public
String
getMaxIndId
(
@Param
(
"code"
)
String
code
,
@Param
(
"length"
)
int
length
);
public
String
getMaxIndId
(
@Param
(
"code"
)
String
code
,
@Param
(
"length"
)
int
length
);
public
List
<
DriveIndDef
>
getByIdList
(
@Param
(
"ids"
)
List
<
String
>
ids
);
public
List
<
DriveIndDef
>
getByIdList
(
@Param
(
"ids"
)
List
<
String
>
ids
);
public
List
<
DriveIndDef
>
getByScorecardId
(
@Param
(
"scorecardId"
)
Integer
scorecardId
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefService.java
View file @
291245f3
...
@@ -218,4 +218,9 @@ public class DriveIndDefService {
...
@@ -218,4 +218,9 @@ public class DriveIndDefService {
}
}
return
maxId
;
return
maxId
;
}
}
//根据指标评分规则id获取考核指标
public
List
<
DriveIndDef
>
getByScorecardId
(
Integer
scorecardId
){
return
driveIndDefMapper
.
getByScorecardId
(
scorecardId
);
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
291245f3
...
@@ -71,11 +71,24 @@ public class IndScorecardService {
...
@@ -71,11 +71,24 @@ public class IndScorecardService {
return
indScorecard
.
getId
();
return
indScorecard
.
getId
();
}
}
public
void
delete
(
List
<
Integer
>
ids
)
{
public
String
delete
(
List
<
Integer
>
ids
)
{
StringBuilder
message
=
new
StringBuilder
(
""
);
for
(
Integer
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
if
(!
driveIndDefService
.
getByScorecardId
(
id
).
isEmpty
())
{
IndScorecard
scorecard
=
this
.
findById
(
id
);
if
(
scorecard
!=
null
)
{
message
.
append
(
"'"
).
append
(
scorecard
.
getCardName
())
.
append
(
"'"
).
append
(
"关联了考核指标,无法删除;"
);
}
}
else
{
indScorecardMapper
.
deleteByPrimaryKey
(
id
);
indScorecardMapper
.
deleteByPrimaryKey
(
id
);
}
}
}
}
if
(
StringUtils
.
isBlank
(
message
.
toString
()))
{
message
.
append
(
"删除成功"
);
}
return
message
.
toString
();
}
public
List
<
IndScorecard
>
getAll
(){
public
List
<
IndScorecard
>
getAll
(){
return
indScorecardMapper
.
selectAll
();
return
indScorecardMapper
.
selectAll
();
...
...
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
View file @
291245f3
...
@@ -49,4 +49,10 @@
...
@@ -49,4 +49,10 @@
#{id}
#{id}
</foreach>
</foreach>
</select>
</select>
<select
id=
"getByScorecardId"
parameterType=
"java.lang.Integer"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndDef"
>
select *
from drive_ind_def
where ind_cal_score_rule=#{scorecardId}
</select>
</mapper>
</mapper>
\ No newline at end of file
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