|
|
|
@ -18,6 +18,8 @@ import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import static java.util.stream.Collectors.toList;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 店铺
|
|
|
|
|
*/
|
|
|
|
@ -83,4 +85,25 @@ public class PoiStoreService {
|
|
|
|
|
List<PoiStore> baseShopDOS = poiStoreDOMapper.selectList(null);
|
|
|
|
|
return baseShopDOS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据区域id找到店铺集合,若没有,则查用户所有店铺
|
|
|
|
|
* @param companyId 零售公司ID
|
|
|
|
|
*/
|
|
|
|
|
public List<PoiStore> getStoreByCompanyId(long userId,Long companyId){
|
|
|
|
|
List<PoiStore> poiStores = new ArrayList<>();
|
|
|
|
|
//找到店铺集合
|
|
|
|
|
List<Long> shopsIds = privilageDomainService.listUserDatePermission(userId);
|
|
|
|
|
if(!companyId.equals(0L)){
|
|
|
|
|
Set<Long> shops = customerViewService.getCompanyShop(companyId,userId);
|
|
|
|
|
if(shops.size() > 0){
|
|
|
|
|
List<PoiStore> regionPoiStores = poiStoreDOMapper.selectBatchIds(shops);
|
|
|
|
|
List<PoiStore> intersection = regionPoiStores.stream().filter(item -> shops.contains(item.getId())).collect(toList());
|
|
|
|
|
return intersection;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
poiStores = poiStoreDOMapper.selectBatchIds(shopsIds);
|
|
|
|
|
}
|
|
|
|
|
return poiStores;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|