提交 f5af8da4 authored 作者: huyufan's avatar huyufan

接单判断

上级 8a13f3e9
......@@ -34,7 +34,7 @@ public class AppDriverOrderChildController {
@ApiOperation(value = "接单判断", notes = "<br>By:胡宇帆")
@PostMapping("/getOrderChildCheck")
public Result<String> getOrderChildCheck(@RequestBody @Validated OrderChildCheckParam param) {
public Result<Integer> getOrderChildCheck(@RequestBody @Validated OrderChildCheckParam param) {
return Result.ok(orderChildService.getOrderChildCheck(param));
}
......
......@@ -95,5 +95,5 @@ public interface OrderChildService {
OrderChildVO getOwnerOrderChildInfo(String childNo);
String getOrderChildCheck(OrderChildCheckParam param);
Integer getOrderChildCheck(OrderChildCheckParam param);
}
......@@ -1471,7 +1471,16 @@ public class OrderChildServiceImpl implements OrderChildService {
}
@Override
public String getOrderChildCheck(OrderChildCheckParam param) {
public Integer getOrderChildCheck(OrderChildCheckParam param) {
try {
return check(param);
} catch (Exception e) {
log.info("接单判断弹窗错误,错误信息:{}", e.getMessage());
return 0;
}
}
private int check(OrderChildCheckParam param) {
OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(param.getOrderGoodsNo()).get();
BigDecimal sendLatitude = orderGoods.getSendLatitude();
BigDecimal sendLongitude = orderGoods.getSendLongitude();
......@@ -1486,7 +1495,7 @@ public class OrderChildServiceImpl implements OrderChildService {
BigDecimal[] location = truckLocationDTO.getLocation();
longitude = location[0];
latitude = location[1];
log.info("当前中交兴路获取司机车牌:{},相关位置信息:{}",param.getTruckNo(), JSONUtil.parse(truckLocationDTO));
log.info("当前中交兴路获取司机车牌:{},相关位置信息:{}", param.getTruckNo(), JSONUtil.parse(truckLocationDTO));
}
List<GdRouteDTO> route = gdService.getRoute(longitude, latitude, sendLongitude, sendLatitude);
......@@ -1507,13 +1516,13 @@ public class OrderChildServiceImpl implements OrderChildService {
if (localDateTime.isAfter(beginLocalDateTime) && localDateTime.isBefore(endLocalDateTime)) {
log.info("不用弹");
return "不用弹";
return 0;
} else {
log.info("需要弹");
return "需要弹";
return 1;
}
}
return "不用弹,高德数据为空";
return 0;
}
//计算亏吨吨数
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论