mirror of https://gitee.com/topiam/eiam
				
				
				
			优化应用分组
							parent
							
								
									d82ac71727
								
							
						
					
					
						commit
						c46abef65d
					
				| 
						 | 
				
			
			@ -64,7 +64,7 @@ public interface AppGroupAssociationRepository extends
 | 
			
		|||
    @Transactional(rollbackFor = Exception.class)
 | 
			
		||||
    @Query(value = "UPDATE app_group_association SET " + SOFT_DELETE_SET
 | 
			
		||||
                   + " WHERE app_id = :appId", nativeQuery = true)
 | 
			
		||||
    void deleteAllByAppId(@Param(value = "appId") Long appId);
 | 
			
		||||
    void deleteByAppId(@Param(value = "appId") Long appId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据应用组ID删除关联
 | 
			
		||||
| 
						 | 
				
			
			@ -83,7 +83,9 @@ public interface AppGroupAssociationRepository extends
 | 
			
		|||
     *
 | 
			
		||||
     * @param appId {@link Long}
 | 
			
		||||
     */
 | 
			
		||||
    void deleteByAppId(Long appId);
 | 
			
		||||
    @Modifying
 | 
			
		||||
    @Query(value = "DELETE FROM app_group_association WHERE app_id = :appId AND is_deleted = '0'", nativeQuery = true)
 | 
			
		||||
    void deleteAllByAppId(Long appId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据应用ID 查询关联信息
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -114,7 +114,7 @@ public class AppServiceImpl implements AppService {
 | 
			
		|||
        AppEntity entity = appConverter.appUpdateParamConverterToEntity(param);
 | 
			
		||||
        BeanUtils.merge(entity, app, LAST_MODIFIED_TIME, LAST_MODIFIED_BY);
 | 
			
		||||
        appRepository.save(app);
 | 
			
		||||
        appGroupAssociationRepository.deleteByAppId(app.getId());
 | 
			
		||||
        appGroupAssociationRepository.deleteAllByAppId(app.getId());
 | 
			
		||||
        List<AppGroupAssociationEntity> list = new ArrayList<>();
 | 
			
		||||
        for (String id : param.getGroupIds()) {
 | 
			
		||||
            AppGroupAssociationEntity appGroupAssociationEntity = new AppGroupAssociationEntity();
 | 
			
		||||
| 
						 | 
				
			
			@ -139,7 +139,7 @@ public class AppServiceImpl implements AppService {
 | 
			
		|||
    public boolean deleteApp(Long id) {
 | 
			
		||||
        AppEntity app = appRequireNonNull(id);
 | 
			
		||||
        applicationServiceLoader.getApplicationService(app.getTemplate()).delete(id.toString());
 | 
			
		||||
        appGroupAssociationRepository.deleteAllByAppId(id);
 | 
			
		||||
        appGroupAssociationRepository.deleteByAppId(id);
 | 
			
		||||
        AuditContext
 | 
			
		||||
            .setTarget(Target.builder().id(id.toString()).type(TargetType.APPLICATION).build());
 | 
			
		||||
        return true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue