我需要遍历组列表中的用户列表,如果用户列表有组(来自组列表),我需要从用户列表中删除它。我尝试了以下但它不工作
def groupsList = entity.companyContainer.groups
groupsList.each { g ->
g.users.each { u ->
if( u.groups.find( g ) ) {
u.groups.remove( g )
entityService.update( u )
}
}
entityService.delete(g)
}
例外:
ERROR | com.core.common.controller.impl.BaseMultiActionController | groovy.lang.MissingMethodException:
No signature of method:
com.core.configuration.persistence.ListWithPersistentSetPropertyAccessor$ListWithPersistentSet.find()
is applicable for argument types: (com.core.security.model.impl.Group) values: [LFO Super Users_Lawfirm]
Possible solutions: find(groovy.lang.Closure),
find(groovy.lang.Closure),
min(),
min(groovy.lang.Closure),
min(java.util.Comparator),
size()