Commit 5c48a862 authored by wujipeng's avatar wujipeng
Browse files

各路段检测修复汇总-优化

parent cfb7cf6e
......@@ -132,8 +132,9 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
Map<String, Integer> result = new HashMap<>();
//获取基础信息
List<BasicEntity> basicList = basicService.list();
Map<String, String> basicMap = new HashMap<>();
for (BasicEntity basicEntity : basicList) {
result.put(basicEntity.getRoadName(), 0);
basicMap.put(basicEntity.getRelId(), basicEntity.getRoadName());
}
if ("检测".equals(type)) {
List<DefectEntity> defectList = defectService.list();
......@@ -145,10 +146,12 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
defectMap.put(defectEntity.getRelId(), defectEntity.getNum());
}
}
result.forEach((key, value) -> {
basicMap.forEach((key, value) -> {
if(defectMap.containsKey(key)){
Integer i = defectMap.get(key);
result.put(key, i);
result.put(value, i);
} else {
result.put(value, 0);
}
});
} else 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