|
@@ -142,14 +142,25 @@ public class AreaController extends BaseController {
|
|
|
// }
|
|
|
return "redirect:" + adminPath + "/sys/area/";
|
|
|
}
|
|
|
-
|
|
|
+ //排重
|
|
|
+ public static LinkedList<Map<String,Object>> paichong(LinkedList<Map<String,Object>> list){
|
|
|
+ LinkedList<Map<String,Object>> linkedList=new LinkedList<>();
|
|
|
+ Iterator<Map<String,Object>> it=list.iterator();
|
|
|
+ while (it.hasNext()){
|
|
|
+ Map<String,Object> str=it.next();
|
|
|
+ if (!linkedList.contains(str)){
|
|
|
+ linkedList.add(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return linkedList;
|
|
|
+ }
|
|
|
@RequiresPermissions("user")
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "treeData")
|
|
|
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String selectName, HttpServletResponse response) {
|
|
|
// List<Map<String, Object>> mapList = Lists.newArrayList();
|
|
|
List<Area> list = areaService.findByArae(selectName);
|
|
|
- HashSet<Map<String,Object>> prantsSet = new HashSet();
|
|
|
+ LinkedList<Map<String,Object>> prantsSet = new LinkedList<>();
|
|
|
for (int i=0; i<list.size(); i++){
|
|
|
Area e = list.get(i);
|
|
|
if (StringUtils.isBlank(extId) || (extId!=null && !extId.equals(e.getId()) && e.getParentIds().indexOf(","+extId+",")==-1)){
|
|
@@ -178,7 +189,8 @@ public class AreaController extends BaseController {
|
|
|
prantsSet.add(map);
|
|
|
}
|
|
|
}
|
|
|
- List<Map<String,Object>> mapList = Lists.newArrayList(prantsSet);
|
|
|
+ List<Map<String,Object>> s=paichong(prantsSet);
|
|
|
+ List<Map<String,Object>> mapList = Lists.newArrayList(s);
|
|
|
return mapList;
|
|
|
}
|
|
|
|