Commit 96f70f44 authored by wujipeng's avatar wujipeng
Browse files

优化

parent 1c76f2f3
...@@ -65,6 +65,14 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl ...@@ -65,6 +65,14 @@ public class BasicServiceImpl extends ServiceImpl<BasicMapper, BasicEntity> impl
List<BasicEntity> basicList = list(new LambdaQueryWrapper<>(BasicEntity.class).eq(BasicEntity::getRegion, region)); List<BasicEntity> basicList = list(new LambdaQueryWrapper<>(BasicEntity.class).eq(BasicEntity::getRegion, region));
Map<String, String> basicMap = new HashMap<>(); Map<String, String> basicMap = new HashMap<>();
for (BasicEntity basicEntity : basicList) { for (BasicEntity basicEntity : basicList) {
/*
* roadName 在后续会被作为返回结果 Map 的 key,即 JSON 对象的字段名。
* Jackson 无法将 null key 序列化为 JSON,因此对道路名称为 null 的异常基础数据
* 不进行汇总输出,避免生成 result.put(null, ...)并导致整个接口返回失败。
*/
if (basicEntity.getRoadName() == null) {
continue;
}
basicMap.put(basicEntity.getRelId(), basicEntity.getRoadName()); basicMap.put(basicEntity.getRelId(), basicEntity.getRoadName());
} }
if ("检测".equals(type)) { if ("检测".equals(type)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment