| | |
| | | */ |
| | | |
| | | public void addCruiseMission(XpVehicle vehicle, XpOrder order) { |
| | | |
| | | if (vehicle.getState() != 0 || vehicle.getOperatingStatus() != 1) { |
| | | return; |
| | | } |
| | | |
| | | if (vehicle.getState() != 0 || vehicle.getOperatingStatus() != 1) { |
| | | return; |
| | | } |
| | | |
| | | // 判断是否有计划 |
| | | R<XpCruisePlanVehicle> xpCruisePlanR = xpCruisePlanClient.getCruisePlan(vehicle.getId()); |
| | | if (xpCruisePlanR == null || xpCruisePlanR.getData() == null) { |
| | | return; |
| | | } |
| | | |
| | | // 获取配置 根据配置判断是否该收车 如果是则找到收车点位进行收车操作 |
| | | R<XpTaskRule> xpTaskRuleR = xpTaskRuleClient.queryDetail(); |
| | | XpTaskRule xpTaskRule = xpTaskRuleR.getData(); |
| | |
| | | if (vehicle.getState() != 0 || vehicle.getOperatingStatus() != 1) { |
| | | return; |
| | | } |
| | | if (vehicle.getState() != 0 || vehicle.getOperatingStatus() != 1) { |
| | | return; |
| | | } |
| | | // 判断是否有计划 |
| | | R<XpCruisePlanVehicle> xpCruisePlanR = xpCruisePlanClient.getCruisePlan(vehicle.getId()); |
| | | if (xpCruisePlanR == null || xpCruisePlanR.getData() == null) { |
| | |
| | | xpCruiseOrder.setStartLat(vehiclePosition.getPoint().getY()); |
| | | |
| | | // 完成的直接走终点 终止的走起点 |
| | | if (temp == 0) { |
| | | xpCruiseOrder.setEndPointId(xpCruiseOrders.getStartPointId()); |
| | | xpCruiseOrder.setEndPointName(xpCruiseOrders.getStartPointName()); |
| | | xpCruiseOrder.setEndLon(xpCruiseOrders.getStartLon()); |
| | | xpCruiseOrder.setEndLat(xpCruiseOrders.getStartLat()); |
| | | } else { |
| | | xpCruiseOrder.setEndPointId(xpCruiseOrders.getEndPointId()); |
| | | xpCruiseOrder.setEndPointName(xpCruiseOrders.getEndPointName()); |
| | | xpCruiseOrder.setEndLon(xpCruiseOrders.getEndLon()); |
| | | xpCruiseOrder.setEndLat(xpCruiseOrders.getEndLat()); |
| | | if(null != xpCruiseOrders){ |
| | | if (temp == 0) { |
| | | xpCruiseOrder.setEndPointId(xpCruiseOrders.getStartPointId()); |
| | | xpCruiseOrder.setEndPointName(xpCruiseOrders.getStartPointName()); |
| | | xpCruiseOrder.setEndLon(xpCruiseOrders.getStartLon()); |
| | | xpCruiseOrder.setEndLat(xpCruiseOrders.getStartLat()); |
| | | } else { |
| | | xpCruiseOrder.setEndPointId(xpCruiseOrders.getEndPointId()); |
| | | xpCruiseOrder.setEndPointName(xpCruiseOrders.getEndPointName()); |
| | | xpCruiseOrder.setEndLon(xpCruiseOrders.getEndLon()); |
| | | xpCruiseOrder.setEndLat(xpCruiseOrders.getEndLat()); |
| | | } |
| | | }else{ |
| | | // 先找计划 |
| | | List<XpCruisePlanPoint> planPointList = xpCruisePlanClient.getCruisePlanPointList(vehicle.getId()).getData(); |
| | | XpCruisePlanPoint xpCruisePlanPoint = planPointList.get(0); |
| | | Long endPointId = xpCruisePlanPoint.getPointId(); |
| | | XpPoint endPoint = xpPointClient.queryById(endPointId).getData(); |
| | | xpCruiseOrder.setEndPointId(endPointId); |
| | | xpCruiseOrder.setEndPointName(endPoint.getPointName()); |
| | | xpCruiseOrder.setEndLon(endPoint.getPointLon()); |
| | | xpCruiseOrder.setEndLat(endPoint.getPointLat()); |
| | | } |
| | | |
| | | |