[umbrella]: Fix delete stakeholder in order to remove from umbrella dashboards when it is deleted.
This commit is contained in:
parent
ab33c2ec45
commit
1bc576ea69
|
@ -200,6 +200,13 @@ public class StakeholderService {
|
|||
public String delete(String id) {
|
||||
Stakeholder stakeholder = this.findByPath(id);
|
||||
if (this.commonService.hasDeleteAuthority(stakeholder.getType())) {
|
||||
this.dao.umbrellaStakeholders().forEach(umbrellaStakeholder -> {
|
||||
StakeholderType type = StakeholderType.valueOf(stakeholder.getType());
|
||||
List<String> ids = umbrellaStakeholder.getUmbrella().getChildren().get(type);
|
||||
if(ids != null && ids.contains(stakeholder.getId())) {
|
||||
this.removeChild(umbrellaStakeholder.getId(), StakeholderType.valueOf(stakeholder.getType()), stakeholder.getId());
|
||||
}
|
||||
});
|
||||
this.dao.findByDefaultIdAndCopyIsTrue(stakeholder.getId()).forEach(child -> {
|
||||
this.delete(child.getId());
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue