Commit 30d2eeef by huangjinxin

fix:指派订单插单优化

1 parent b2ab54aa
...@@ -586,6 +586,15 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -586,6 +586,15 @@ public class OrderInfoServiceImpl implements OrderInfoService {
} }
LocalDateTime planStartTime = (LocalDateTime) handleLeaveTimeResult.getResult(); LocalDateTime planStartTime = (LocalDateTime) handleLeaveTimeResult.getResult();
if (orderSegment.getEnd().plusMinutes(roadTime).compareTo(planStartTime) <= 0) { if (orderSegment.getEnd().plusMinutes(roadTime).compareTo(planStartTime) <= 0) {
//下一单为待插入订单且为最后一单直接返回
if (i == orderSegments.size() - 2) {
insertOrder.setTakeTime(skillInfo.getTakeTime());
insertOrder.setPlanStartTime(planStartTime);
insertOrder.setPlanEndTime(planStartTime.plusMinutes(skillInfo.getTakeTime()));
insertOrder.setArriveElapsed(roadTime);
insertOrder.setArriveDistance(BigDecimal.valueOf(distanceDTO.getDis() * 1000).intValue());
return Result.success(insertOrder);
}
OrderInfoEntity nestOrder = orderInfoDao.getByOrderId(nestOrderSegment.getOrderId()); OrderInfoEntity nestOrder = orderInfoDao.getByOrderId(nestOrderSegment.getOrderId());
nestOrder.setArriveElapsed(roadTime); nestOrder.setArriveElapsed(roadTime);
nestOrder.setArriveDistance(BigDecimal.valueOf(distanceDTO.getDis() * 1000).intValue()); nestOrder.setArriveDistance(BigDecimal.valueOf(distanceDTO.getDis() * 1000).intValue());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!