Browse Source

feat(all): 车次成本计算

1 修改车次成本公里数成本计算错误问题
dev
zhaoqiaobo 2 months ago
parent
commit
2bb46dc69e
  1. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

@ -1100,7 +1100,13 @@ public class DeliverFinishReportListener implements ReportService {
}
// A-B B-C C-D 每一个点为起点到下一个点的距离
Long distance = GaoDeApiUtil.measureDistance(beforePositioning, arrivePositioning);
allRouteMap.put(value1.getSignReservationCode(), Convert.toStr(ObjectUtil.isNotEmpty(distance) ? NumberUtil.div(new BigDecimal(distance), 1000) : 0L / 1000));
// 获取上一个点位的总距离
BigDecimal reduce = BigDecimal.ZERO;
if(CollUtil.isNotEmpty(allRouteMap)){
reduce = allRouteMap.values().stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);
}
String str = Convert.toStr(ObjectUtil.isNotEmpty(distance) ? NumberUtil.div(new BigDecimal(distance), 1000) : 0L / 1000);
allRouteMap.put(value1.getSignReservationCode(), Convert.toStr(NumberUtil.add(reduce, new BigDecimal(str))));
beforePositioning = arrivePositioning;
}
}

Loading…
Cancel
Save