diff --git a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/AppGroupAssociationRepository.java b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/AppGroupAssociationRepository.java index 98bf67a2..f89e15bf 100644 --- a/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/AppGroupAssociationRepository.java +++ b/eiam-common/src/main/java/cn/topiam/employee/common/repository/app/AppGroupAssociationRepository.java @@ -55,7 +55,7 @@ public interface AppGroupAssociationRepository extends void deleteByGroupIdAndAppId(@Param("groupId") Long groupId, @Param("appId") Long appId); /** - * 删除关联 + * 根据应用ID删除关联 * * @param appId {@link Long} * @return {@link Boolean} @@ -66,6 +66,19 @@ public interface AppGroupAssociationRepository extends + " WHERE app_id = :appId", nativeQuery = true) void deleteAllByAppId(@Param(value = "appId") Long appId); + + /** + * 根据应用组ID删除关联 + * + * @param groupId {@link Long} + * @return {@link Boolean} + */ + @Modifying + @Transactional(rollbackFor = Exception.class) + @Query(value = "UPDATE app_group_association SET " + SOFT_DELETE_SET + + " WHERE group_id = :groupId", nativeQuery = true) + void deleteAllByGroupId(@Param(value = "groupId") Long groupId); + /** * 根据应用ID删除关联信息 * diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/converter/app/AppConverter.java b/eiam-console/src/main/java/cn/topiam/employee/console/converter/app/AppConverter.java index bb4e00f9..07a90bb2 100644 --- a/eiam-console/src/main/java/cn/topiam/employee/console/converter/app/AppConverter.java +++ b/eiam-console/src/main/java/cn/topiam/employee/console/converter/app/AppConverter.java @@ -26,7 +26,6 @@ import org.mapstruct.Mapping; import com.google.common.collect.Lists; - import cn.topiam.employee.application.ApplicationService; import cn.topiam.employee.application.ApplicationServiceLoader; import cn.topiam.employee.common.entity.app.AppEntity; diff --git a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppGroupServiceImpl.java b/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppGroupServiceImpl.java index 0cfacb38..1d7395ad 100644 --- a/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppGroupServiceImpl.java +++ b/eiam-console/src/main/java/cn/topiam/employee/console/service/app/impl/AppGroupServiceImpl.java @@ -125,6 +125,7 @@ public class AppGroupServiceImpl implements AppGroupService { public boolean deleteAppGroup(Long id) { appGroupRequireNonNull(id); appGroupRepository.deleteById(id); + appGroupAssociationRepository.deleteAllByGroupId(id); AuditContext .setTarget(Target.builder().id(id.toString()).type(TargetType.APP_GROUP).build()); return true;