|
@@ -214,14 +214,6 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
-// public Result filter(String sceneCode, PoiQueryDto param) {
|
|
|
-// List<PoiHotDto> data = findDataBySceneCode(sceneCode);
|
|
|
-// if (isLogin()) {
|
|
|
-// return Result.success(data);
|
|
|
-// }
|
|
|
-// return Result.success(changeSecurityUnLoginList(data));
|
|
|
-// }
|
|
|
|
|
|
// 查询是有优先级的
|
|
|
@Override
|
|
@@ -245,16 +237,23 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+ // site_model_entity 必要条件
|
|
|
List<Integer> siteModelIds = param.getSite_model_entity();
|
|
|
+ if (siteModelIds == null) {
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+ data = data.stream().filter(p -> siteModelIds.contains(p.getSite_model_entity_id())).collect(Collectors.toList());
|
|
|
|
|
|
+ // Poi_type 非必要条件
|
|
|
List<Integer> poiTypeIds = param.getPoi_type();
|
|
|
- if (siteModelIds.size() == 0 || poiTypeIds.size() == 0) {
|
|
|
- return Result.success();
|
|
|
+ if (poiTypeIds != null) {
|
|
|
+ data = data.stream().filter(p -> poiTypeIds.contains(p.getPoi_type_id())).collect(Collectors.toList());
|
|
|
}
|
|
|
+// data = data.stream().filter(p -> poiTypeIds.contains(p.getPoi_type_id())).collect(Collectors.toList());
|
|
|
+// if (siteModelIds.size() == 0 || poiTypeIds.size() == 0) {
|
|
|
+// return Result.success();
|
|
|
+// }
|
|
|
|
|
|
- data = data.stream().filter(p -> siteModelIds.contains(p.getSite_model_entity_id())).collect(Collectors.toList());
|
|
|
- data = data.stream().filter(p -> poiTypeIds.contains(p.getPoi_type_id())).collect(Collectors.toList());
|
|
|
|
|
|
if (data.size() == 0) {
|
|
|
log.warn("查询结果没有符合条件的数据");
|
|
@@ -341,9 +340,6 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
|
|
|
coordinates1[0] = queryJsonData.getLon();
|
|
|
coordinates1[1] = queryJsonData.getLat();
|
|
|
|
|
|
-// Double z = queryJsonData.getZ();
|
|
|
-// z = z == null ? 0 : z;
|
|
|
-// coordinates1[2] = z;
|
|
|
|
|
|
int i = 1;
|
|
|
Double min = null;
|
|
@@ -356,7 +352,6 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
|
|
|
coordinates2[2] = jsonData.getLocation()[2];
|
|
|
|
|
|
Double distance = DistanceUtil.distance(coordinates1, coordinates2, "miles");
|
|
|
-// log.info("计算出的距离:{}", distance);
|
|
|
// 默认取第一值
|
|
|
if (i==1) {
|
|
|
min = distance;
|
|
@@ -385,10 +380,6 @@ public class PoiServiceImpl extends IBaseServiceImpl implements PoiService {
|
|
|
coordinates1[0] = queryJsonData.getLon();
|
|
|
coordinates1[1] = queryJsonData.getLat();
|
|
|
|
|
|
-// Double z = queryJsonData.getZ();
|
|
|
-// z = z == null ? 0 : z;
|
|
|
-// coordinates1[2] = z;
|
|
|
-
|
|
|
// 计算距离后的结果集
|
|
|
Map<Double, PoiHotDto> calResultMap = new HashMap<>();
|
|
|
for (PoiHotDto jsonData : jsonDataList) {
|