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
5a11dd4a
Commit
5a11dd4a
authored
Jul 09, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改删除基础项判断是否有关联,有无法删除提示;
parent
9dcc48d3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
5 deletions
+48
-5
IndicatorsDefCtrl.java
...keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
+2
-2
BaseIndDefMapper.java
.../indicators/model/mapper/indicators/BaseIndDefMapper.java
+2
-0
DriveIndDefMapper.java
...indicators/model/mapper/indicators/DriveIndDefMapper.java
+2
-0
BaseIndDefService.java
...obile/indicators/service/hytobacco/BaseIndDefService.java
+23
-3
DriveIndDefService.java
...bile/indicators/service/hytobacco/DriveIndDefService.java
+5
-0
BaseIndDefMapper.xml
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
+7
-0
DriveIndDefMapper.xml
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
+7
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
View file @
5a11dd4a
...
...
@@ -62,8 +62,8 @@ public class IndicatorsDefCtrl {
@ApiOperation
(
value
=
"删除基础指标"
,
notes
=
"删除基础指标"
)
@PostMapping
(
value
=
"/deleteBaseInd"
)
public
void
deleteBaseInd
(
@RequestParam
List
<
String
>
indIds
)
throws
Exception
{
baseIndDefService
.
delete
(
indIds
);
public
String
deleteBaseInd
(
@RequestParam
List
<
String
>
indIds
)
throws
Exception
{
return
baseIndDefService
.
delete
(
indIds
);
}
@ApiOperation
(
value
=
"根据id查询基础指标详情"
,
notes
=
"根据id查询基础指标详情"
)
...
...
src/main/java/com/keymobile/indicators/model/mapper/indicators/BaseIndDefMapper.java
View file @
5a11dd4a
...
...
@@ -18,4 +18,6 @@ public interface BaseIndDefMapper extends BaseMapper<BaseIndDef>{
public
void
deleteByCatalogIdIn
(
@Param
(
"catalogIds"
)
List
<
Integer
>
catalogIds
);
public
String
getMaxIndId
(
@Param
(
"code"
)
String
code
,
@Param
(
"length"
)
int
length
);
public
List
<
BaseIndDef
>
getByIndFormatLike
(
@Param
(
"indId"
)
String
indId
);
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/DriveIndDefMapper.java
View file @
5a11dd4a
...
...
@@ -22,4 +22,6 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
public
List
<
DriveIndDef
>
getByIdList
(
@Param
(
"ids"
)
List
<
String
>
ids
);
public
List
<
DriveIndDef
>
getByScorecardId
(
@Param
(
"scorecardId"
)
Integer
scorecardId
);
public
List
<
DriveIndDef
>
getByIndFormatLike
(
@Param
(
"indId"
)
String
indId
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefService.java
View file @
5a11dd4a
...
...
@@ -20,6 +20,8 @@ public class BaseIndDefService {
private
BaseIndDefVersionService
baseIndDefVersionService
;
@Autowired
private
IndicatorsRelService
indRelService
;
@Autowired
private
DriveIndDefService
driveIndDefService
;
public
String
saveOrUpdate
(
BaseIndDef
baseIndDef
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
,
String
isUpdate
,
String
code
)
...
...
@@ -73,11 +75,25 @@ public class BaseIndDefService {
return
baseIndDefMapper
.
selectOne
(
baseIndDef
);
}
public
void
delete
(
List
<
String
>
indIds
)
throws
Exception
{
public
String
delete
(
List
<
String
>
indIds
)
throws
Exception
{
StringBuilder
message
=
new
StringBuilder
(
""
);
for
(
String
indId
:
indIds
)
{
baseIndDefMapper
.
deleteByPrimaryKey
(
indId
);
baseIndDefVersionService
.
updateIsDeleteStatus
(
indId
,
"1"
);
//标识已删除
if
(
driveIndDefService
.
getByIndFormatLike
(
indId
).
isEmpty
()&&
this
.
getByIndFormatLike
(
indId
).
isEmpty
())
{
//基础项都没有关联指标才能删除
baseIndDefMapper
.
deleteByPrimaryKey
(
indId
);
baseIndDefVersionService
.
updateIsDeleteStatus
(
indId
,
"1"
);
//标识已删除
}
else
{
BaseIndDef
baseIndDef
=
this
.
getById
(
indId
);
if
(
baseIndDef
!=
null
)
{
message
.
append
(
"'"
).
append
(
baseIndDef
.
getIndName
())
.
append
(
"'"
).
append
(
"有关联的基础项或者指标,无法删除;"
);
}
}
}
if
(
StringUtils
.
isBlank
(
message
.
toString
()))
{
message
.
append
(
"删除成功"
);
}
return
message
.
toString
();
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
Integer
catalogId
,
String
keyword
,
...
...
@@ -118,4 +134,8 @@ public class BaseIndDefService {
}
return
maxId
;
}
public
List
<
BaseIndDef
>
getByIndFormatLike
(
String
indId
){
return
baseIndDefMapper
.
getByIndFormatLike
(
"%"
+
indId
+
";%"
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefService.java
View file @
5a11dd4a
...
...
@@ -223,4 +223,9 @@ public class DriveIndDefService {
public
List
<
DriveIndDef
>
getByScorecardId
(
Integer
scorecardId
){
return
driveIndDefMapper
.
getByScorecardId
(
scorecardId
);
}
//根据基础项id获取关联的考核指标公式
public
List
<
DriveIndDef
>
getByIndFormatLike
(
String
indId
){
return
driveIndDefMapper
.
getByIndFormatLike
(
"%"
+
indId
+
";%"
);
}
}
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
View file @
5a11dd4a
...
...
@@ -40,4 +40,10 @@
from base_ind_def
where ind_id like #{code} and LENGTH(ind_id)=#{length}
</select>
<select
id=
"getByIndFormatLike"
resultType=
"com.keymobile.indicators.model.entity.indicators.BaseIndDef"
>
select *
from base_ind_def
where ind_format like #{indId}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
View file @
5a11dd4a
...
...
@@ -55,4 +55,10 @@
from drive_ind_def
where ind_cal_score_rule=#{scorecardId}
</select>
<select
id=
"getByIndFormatLike"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndDef"
>
select *
from drive_ind_def
where ind_format like #{indId}
</select>
</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