|
|
|
@ -813,15 +813,18 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<JSONObject> findListByClientName(String clientName, String linkMan, String linkPhone) { |
|
|
|
|
|
|
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
|
List<ClientInfoVO> ls = baseMapper.findListByClientName(clientName, linkMan, linkPhone); |
|
|
|
|
//把ls中所有元素的clientId放入一个list中
|
|
|
|
|
List<Long> clientIds = ls.stream().map(ClientInfoVO::getClientId).collect(Collectors.toList()); |
|
|
|
|
if(clientIds.isEmpty()){ |
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
List<BasicdataStoreBrandEntity> storeBrandEntities = basicdataStoreBrandService.findListByClientIds(clientIds); |
|
|
|
|
//把storeBrandEntities中所有元素通过clientId分组
|
|
|
|
|
Map<Long, List<BasicdataStoreBrandEntity>> collect = storeBrandEntities.stream().collect(Collectors.groupingBy(BasicdataStoreBrandEntity::getClientId)); |
|
|
|
|
|
|
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
|
// List<JSONObject> list = new ArrayList<>();
|
|
|
|
|
for (ClientInfoVO clientInfoVO : ls) { |
|
|
|
|
Long clientId = clientInfoVO.getClientId(); |
|
|
|
|
List<BasicdataStoreBrandEntity> storeBrandEntityList = collect.get(clientId); |
|
|
|
|