提交 d5a1fff6 authored 作者: jiangwujie's avatar jiangwujie

Merge branch 'v21.1_jianzhuang_20240807' into test

Former-commit-id: c77b7747
...@@ -2981,15 +2981,15 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -2981,15 +2981,15 @@ public class OrderChildServiceImpl implements OrderChildService {
* @Param [truckNo, beginLongitude, beginLatitude, endLongitude, endLatitude] * @Param [truckNo, beginLongitude, beginLatitude, endLongitude, endLatitude]
* @return * @return
**/ **/
public GdRouteDTO getGdRoute(String truckNo, BigDecimal beginLongitude, BigDecimal beginLatitude, public Integer getGdRoute(String truckNo, BigDecimal beginLongitude, BigDecimal beginLatitude,
BigDecimal endLongitude, BigDecimal endLatitude) { BigDecimal endLongitude, BigDecimal endLatitude) {
List<GdRouteDTO> gdRouteDTOS = null; Integer distance = null;
try { try {
gdRouteDTOS = gdService.getRoute(beginLongitude, beginLatitude, endLongitude, endLatitude); distance = gdService.getShortestRouteDistance(beginLongitude, beginLatitude, endLongitude, endLatitude);
} catch (ServiceSystemException e) { } catch (ServiceSystemException e) {
log.info("orderChildExpect==高德地图调用失败,车辆{},异常原因{}", truckNo, e.getMessage()); log.info("orderChildExpect==高德地图调用失败,车辆{},异常原因{}", truckNo, e.getMessage());
} }
return CollectionUtils.isNotEmpty(gdRouteDTOS) ? gdRouteDTOS.get(0) : null; return distance;
} }
@Override @Override
...@@ -3198,10 +3198,8 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -3198,10 +3198,8 @@ public class OrderChildServiceImpl implements OrderChildService {
if (longitude == null || latitude == null) { if (longitude == null || latitude == null) {
return new OrderChildLoadRangeCheckResultVO(OrderChildEnum.NeedAlertEnum.FAIL.getCode(), TRUCK_LOCATION_ERROR.getCode(), TRUCK_LOCATION_ERROR.getMsg()); return new OrderChildLoadRangeCheckResultVO(OrderChildEnum.NeedAlertEnum.FAIL.getCode(), TRUCK_LOCATION_ERROR.getCode(), TRUCK_LOCATION_ERROR.getMsg());
} }
List<GdRouteDTO> route = gdService.getRoute(longitude, latitude, sendLongitude, sendLatitude); Integer distance = gdService.getShortestRouteDistance(longitude, latitude, sendLongitude, sendLatitude);
if (CollectionUtils.isNotEmpty(route)) { if (distance != null) {
GdRouteDTO gdRouteDTO = route.get(0);
Integer distance = gdRouteDTO.getDistance();
log.info("truckNo:{} 高德计算距离:{} curr:{},{}, 货源地:{},{}", orderChild.getTruckNo(), distance, longitude, latitude, sendLongitude, sendLatitude); log.info("truckNo:{} 高德计算距离:{} curr:{},{}, 货源地:{},{}", orderChild.getTruckNo(), distance, longitude, latitude, sendLongitude, sendLatitude);
if (distance > config.allowUploadDistanceMeter()) { if (distance > config.allowUploadDistanceMeter()) {
// 装车位置 超限 // 装车位置 超限
...@@ -3263,14 +3261,12 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -3263,14 +3261,12 @@ public class OrderChildServiceImpl implements OrderChildService {
BigDecimal siteLatitudeY = orderGoods.getSendLatitude(); BigDecimal siteLatitudeY = orderGoods.getSendLatitude();
//调高德获取距离 //调高德获取距离
if (Objects.nonNull(truckLongitudeX) && Objects.nonNull(truckLatitudeY)) { if (Objects.nonNull(truckLongitudeX) && Objects.nonNull(truckLatitudeY)) {
GdRouteDTO route = getGdRoute(truckNo, orderGoods.getSendLongitude(), orderGoods.getSendLatitude(), siteLongitudeX, Integer distance = getGdRoute(truckNo, orderGoods.getSendLongitude(), orderGoods.getSendLatitude(), siteLongitudeX,
siteLatitudeY); siteLatitudeY);
if (route == null) { if (distance == null) {
log.error("高德获取卡车与货源地位置距离失败,orderGoodsNo:{},orderChildNo:{},truckNo:{}", orderGoodsNo, childNo, truckNo); log.error("高德获取卡车与货源地位置距离失败,orderGoodsNo:{},orderChildNo:{},truckNo:{}", orderGoodsNo, childNo, truckNo);
return; return;
} }
//距离
Integer distance = route.getDistance();
// 超出货源地+通知触发距离 // 超出货源地+通知触发距离
if (distance > driverNoticeConfigVO.getNoticeTriggerDistanceMeter()) { if (distance > driverNoticeConfigVO.getNoticeTriggerDistanceMeter()) {
if (Objects.equals(child.getExitNoticeStatus(), OrderChildEnum.ExitNoticeStatus.NOT_NOTIFIED.getCode()) if (Objects.equals(child.getExitNoticeStatus(), OrderChildEnum.ExitNoticeStatus.NOT_NOTIFIED.getCode())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论