|
@@ -1,5 +1,6 @@
|
|
package com.fdkankan.indoor.core.service.impl;
|
|
package com.fdkankan.indoor.core.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.fdkankan.indoor.base.constant.MsgCode;
|
|
import com.fdkankan.indoor.base.constant.MsgCode;
|
|
import com.fdkankan.indoor.base.convert.DistanceUtil;
|
|
import com.fdkankan.indoor.base.convert.DistanceUtil;
|
|
@@ -71,11 +72,18 @@ public class FilterServiceImpl implements FilterService {
|
|
public Result findById(String sceneCode, Integer id) {
|
|
public Result findById(String sceneCode, Integer id) {
|
|
FilterEntity entity = findBySceneCode(sceneCode);
|
|
FilterEntity entity = findBySceneCode(sceneCode);
|
|
List<FilterHotDto> data = entity.getData();
|
|
List<FilterHotDto> data = entity.getData();
|
|
|
|
+ if(CollectionUtil.isEmpty(data)) {
|
|
|
|
+ log.warn("漫游点表数据为空");
|
|
|
|
+ return Result.success();
|
|
|
|
+ }
|
|
|
|
|
|
data = data.stream().filter(p -> id.equals(p.getId()))
|
|
data = data.stream().filter(p -> id.equals(p.getId()))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
if (data.size() == 0) {
|
|
if (data.size() == 0) {
|
|
- throw new RuntimeException("此场景没有数据");
|
|
|
|
|
|
+ String msg = "没有此漫游点数据 id:" + id;
|
|
|
|
+ log.error(msg);
|
|
|
|
+ return Result.success();
|
|
|
|
+// throw new BaseRuntimeException(msg);
|
|
}
|
|
}
|
|
|
|
|
|
return Result.success(data);
|
|
return Result.success(data);
|