|
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.google.common.collect.Sets;
|
|
|
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.PrivilegeRepo;
|
|
@@ -50,11 +51,18 @@ public class RolePrivilegeServiceImpl implements RolePrivilegeService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ Set<String> temp = Sets.newHashSet();
|
|
|
+
|
|
|
List<RolePrivilegeRelation> list = Lists.newArrayList();
|
|
|
for (Long cur : privilegeIdSet) {
|
|
|
if (0 > cur) {
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
+ if (temp.contains(String.valueOf(cur))) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ temp.add(String.valueOf(cur));
|
|
|
RolePrivilegeRelation bean = new RolePrivilegeRelation();
|
|
|
bean.setRoleId(roleId);
|
|
|
bean.setRootOrgId(rootOrgId);
|