我有一个用户被分配到团队的场景。
不同的 ClientServices 分配给不同的团队,
我们需要以 RoundRobin 方式将这些团队中的用户分配给 clientservice
我试图按如下方式解决它以获取将映射团队名称和 ClientServiceInstance 列表的地图,以便我可以进行进一步处理在上面
def teamMap = [:]
clientServicesList.each {clientServiceInstance->
if(teamMap[clientServiceInstance.ownerTeam] == null){
teamMap.putAt(clientServiceInstance.ownerTeam, new ArrayList().push(clientServiceInstance))
}else{
def tmpList = teamMap[clientServiceInstance.ownerTeam]
tmpList.push(clientServiceInstance)
teamMap[clientServiceInstance.ownerTeam] = tmpList
}
}
but instead of pushing clientServiceInstance it pushes true.
Any idea?