Commit 7492b21a by 刘鑫

fix(ID1004248): 博西PEA_V1.1-推荐工程师页-地图常规位置:取值“派单首选地点,数据源在工程师的「位置配置」”,部分工程师没有位置信息时,地图上可不标注

1 parent 1ba38560
......@@ -363,16 +363,18 @@ public class OrderAssignImpl implements OrderAssign {
.collect(Collectors.toSet());
//均计算距离
List<TempEngineer> result = engineerCodes1.stream()
.map(engineerCode -> {
List<TempEngineer> result = new ArrayList<>();
for (String engineerCode : engineerCodes1) {
List<TLocation> tLocations = engineerDateLocation(engineerCode);
TLocation location = tLocations.stream().filter(t -> Objects.equals(t.getLocationType(), LocationType.QUASI_REALTIME))
.findFirst().get();
.findFirst().orElse(null);
if (Objects.nonNull(location)) {
BigDecimal orderAndEngineerDistance = BigDecimal.valueOf(Stapial4jUtil.getDistance(location.getLongitude(), location.getLatitude(),
orderLongitude, orderLatitude));
return new TempEngineer(engineerCode, orderAndEngineerDistance, tLocations);
}).collect(Collectors.toList());
result.add(new TempEngineer(engineerCode, orderAndEngineerDistance, tLocations));
}
}
// 距离过滤
if (Objects.nonNull(distance)) {
final BigDecimal finalDistance = BigDecimal.valueOf(distance);
......@@ -439,7 +441,7 @@ public class OrderAssignImpl implements OrderAssign {
quasiRealTimeLocation.setLongitude(Double.parseDouble(finishedOrderInfo.getX()));
quasiRealTimeLocation.setLatitude(Double.parseDouble(finishedOrderInfo.getY()));
currentOrder = finishedOrderInfo;
} else if (Objects.nonNull(generalLocation)){
} else if (Objects.nonNull(generalLocation)) {
//常规位置, 出发地
resultLocationList.add(generalLocation);
//准实时位置
......@@ -448,7 +450,9 @@ public class OrderAssignImpl implements OrderAssign {
quasiRealTimeLocation.setLatitude(generalLocation.getLatitude());
}
//准实时位置
if (Objects.nonNull(quasiRealTimeLocation.getLongitude()) && Objects.nonNull(quasiRealTimeLocation.getLatitude())) {
resultLocationList.add(quasiRealTimeLocation);
}
//
if (Objects.nonNull(currentOrder)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!