|
@@ -77,8 +77,8 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int projectNum = 0;
|
|
|
- int num = 0;
|
|
|
+ long projectNum = 0;
|
|
|
+ long num = 0;
|
|
|
//遍历项目列表,获取区域下的项目个数和区域下的总电梯数
|
|
|
Long id = Long.valueOf(region.get("id").toString());
|
|
|
for (Map<String, Object> project : projects) {
|
|
@@ -86,15 +86,12 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
|
|
|
if (project.get("regionId").equals(id)) {
|
|
|
projectNum += 1;
|
|
|
//如果项目电梯数量为null,就设置0
|
|
|
- num += null != project.get("num") ? (Integer) project.get("num") : 0;
|
|
|
+ num += null != project.get("num") ? (long) project.get("num") : 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
region.put("projectNum", projectNum);
|
|
|
region.put("num", num);
|
|
|
-
|
|
|
- projectNum = 0;
|
|
|
- num = 0;
|
|
|
}
|
|
|
return RestResponse.success(regions, "成功");
|
|
|
}
|