更新社区人员和B端用户列表

This commit is contained in:
panshuling321 2022-03-24 16:25:07 +08:00
parent 22ec3d921e
commit 73c8f1816e
2 changed files with 17 additions and 13 deletions

View File

@ -22,10 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* @author yuyang * @author yuyang
@ -62,9 +59,13 @@ public class XhpcCommunityServiceImpl extends BaseService implements IXhpcCommun
} }
} }
for (Map<String, Object> commMap: list){ Iterator<Map<String, Object>> iterator = list.iterator();
while (iterator.hasNext()){
Map<String, Object> commMap = iterator.next();
List<Map<String, Object>> userMapList = xhpcCommunityMapper.communityPersonnelTree(commMap.get("id").toString().replaceAll("COMM_", "")); List<Map<String, Object>> userMapList = xhpcCommunityMapper.communityPersonnelTree(commMap.get("id").toString().replaceAll("COMM_", ""));
if(userMapList.size() > 0){ if (userMapList.size() < 1){
iterator.remove();
} else {
commMap.put("children", userMapList); commMap.put("children", userMapList);
} }
} }

View File

@ -47,13 +47,16 @@ public class XhpcCustomersServiceImpl extends BaseService implements IXhpcCustom
list = xhpcCustomersMapper.tree(name,loginUser.getSysUser().getOperatorId(),loginUser.getTenantId()); list = xhpcCustomersMapper.tree(name,loginUser.getSysUser().getOperatorId(),loginUser.getTenantId());
} }
for(Map<String, Object> cusMap: list){ Iterator<Map<String, Object>> iterator = list.iterator();
while (iterator.hasNext()){
Map<String, Object> cusMap = iterator.next();
List<Map<String, Object>> userList = xhpcCustomersMapper.customersPersonnelTree(cusMap.get("id").toString().replaceAll("CUS_", "")); List<Map<String, Object>> userList = xhpcCustomersMapper.customersPersonnelTree(cusMap.get("id").toString().replaceAll("CUS_", ""));
if (userList.size() > 0){ if (userList.size() < 1){
iterator.remove();
} else {
cusMap.put("children", userList); cusMap.put("children", userList);
} }
} }
return list; return list;
} }