修复位置信息
This commit is contained in:
@@ -48,6 +48,8 @@ public class DisasterRiskData {
|
|||||||
private int index;
|
private int index;
|
||||||
/** 位置 */
|
/** 位置 */
|
||||||
private String position;
|
private String position;
|
||||||
|
/** 乡镇/街道 */
|
||||||
|
private String village;
|
||||||
/** 发生概率(小数 0-1) */
|
/** 发生概率(小数 0-1) */
|
||||||
private Double probability;
|
private Double probability;
|
||||||
/** 灾害等级:高(>=70%) / 中(50%-70%) */
|
/** 灾害等级:高(>=70%) / 中(50%-70%) */
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ public class IReportOutputServiceImpl implements ReportOutputService {
|
|||||||
String level = prob >= 70 ? "高" : "中";
|
String level = prob >= 70 ? "高" : "中";
|
||||||
return new DisasterRiskData.SpotRisk()
|
return new DisasterRiskData.SpotRisk()
|
||||||
.setPosition(spot.getPosition())
|
.setPosition(spot.getPosition())
|
||||||
|
.setVillage(spot.getVillage())
|
||||||
.setProbability(prob)
|
.setProbability(prob)
|
||||||
.setRiskLevel(level);
|
.setRiskLevel(level);
|
||||||
})
|
})
|
||||||
@@ -227,9 +228,11 @@ public class IReportOutputServiceImpl implements ReportOutputService {
|
|||||||
|
|
||||||
data.setSpots(spots);
|
data.setSpots(spots);
|
||||||
|
|
||||||
// 中高风险街道
|
// 中高风险街道(village 去重)
|
||||||
data.setHighRiskStreets(spots.stream()
|
data.setHighRiskStreets(spots.stream()
|
||||||
.map(DisasterRiskData.SpotRisk::getPosition)
|
.map(DisasterRiskData.SpotRisk::getVillage)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
.collect(Collectors.joining("、")));
|
.collect(Collectors.joining("、")));
|
||||||
|
|
||||||
// 图片
|
// 图片
|
||||||
@@ -403,7 +406,8 @@ public class IReportOutputServiceImpl implements ReportOutputService {
|
|||||||
private String buildAllHighRiskPosition(List<DisasterRiskData> list) {
|
private String buildAllHighRiskPosition(List<DisasterRiskData> list) {
|
||||||
return list.stream().filter(DisasterRiskData::hasData)
|
return list.stream().filter(DisasterRiskData::hasData)
|
||||||
.flatMap(d -> d.getSpots().stream())
|
.flatMap(d -> d.getSpots().stream())
|
||||||
.map(DisasterRiskData.SpotRisk::getPosition)
|
.map(DisasterRiskData.SpotRisk::getVillage)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.joining("、"));
|
.collect(Collectors.joining("、"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ algorithm:
|
|||||||
# 文件配置
|
# 文件配置
|
||||||
files:
|
files:
|
||||||
server:
|
server:
|
||||||
url: "http://localhost:8082"
|
url: "http://localhost:8083"
|
||||||
local:
|
local:
|
||||||
path: "G:/files"
|
path: "G:/files"
|
||||||
Reference in New Issue
Block a user