| | |
| | | orderPrivateCar.setOldState(orderPrivateCar.getState()); |
| | | orderPrivateCar.setState(11); |
| | | orderPrivateCar.setReassignNotice(2); |
| | | orderPrivateCar.setIsReassign(2); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | |
| | | if(ToolUtil.isNotEmpty(orderPrivateCar.getTravelId())){ |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | } |
| | | |
| | | |
| | | //添加已收入明细 |
| | |
| | | orderTaxi.setOldState(orderTaxi.getState()); |
| | | orderTaxi.setState(11); |
| | | orderTaxi.setReassignNotice(2); |
| | | orderTaxi.setIsReassign(2); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | |
| | | if(ToolUtil.isNotEmpty(orderTaxi.getTravelId())){ |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | |
| | | //添加已收入明细 |
| | | // incomeService.saveData(1, orderTaxi.getCompanyId(), 4, orderTaxi.getId(), 2, reassign.getMoney()); |
| | |
| | | orderLogistics.setOldState(orderLogistics.getState()); |
| | | orderLogistics.setState(11); |
| | | orderLogistics.setReassignNotice(2); |
| | | orderLogistics.setIsReassign(2); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | |
| | | //添加已收入明细 |
| | |
| | | orderLogistics1.setOldState(orderLogistics1.getState()); |
| | | orderLogistics1.setState(11); |
| | | orderLogistics1.setReassignNotice(2); |
| | | orderLogistics1.setIsReassign(2); |
| | | orderLogisticsService.updateById(orderLogistics1); |
| | | |
| | | //添加已收入明细 |
| | |
| | | orderPrivateCar.setReassignNotice(0); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | |
| | | if(ToolUtil.isNotEmpty(orderPrivateCar.getTravelId())){ |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | |
| | | } |
| | | request.setSupplierShopId(company.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request); |
| | | } |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(reassign.getOrderId()); |
| | |
| | | orderTaxi.setState(orderTaxi.getOldState()); |
| | | orderTaxi.setReassignNotice(0); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | if(ToolUtil.isNotEmpty(orderTaxi.getTravelId())){ |
| | | Company company1 = companyService.selectById(driver.getCompanyId()); |
| | | //中台修改订单状态 |
| | | ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); |
| | |
| | | } |
| | | request1.setSupplierShopId(company1.getEnterCode()); |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | } |
| | | break; |
| | | } |
| | | reassignMapper.delete(new EntityWrapper<Reassign>().eq("orderId",reassign.getOrderId()).eq("orderType",reassign.getOrderType())); |
| | |
| | | orderCrossCity.setOldState(orderCrossCity.getState()); |
| | | orderCrossCity.setState(11); |
| | | orderCrossCity.setReassignNotice(2); |
| | | orderCrossCity.setIsReassign(2); |
| | | orderCrossCityService.updateById(orderCrossCity); |
| | | |
| | | //添加已收入明细 |
| | |
| | | } |
| | | systemNoticeService.addSystemNotice(2, "您已使用余额成功支付改派申请费用!", uid, 1); |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | | map.put("orderType", reassign.getOrderType().toString()); |
| | | List<Dispatch> dispatches = dispatchMapper.queryDispatchs(driver.getFranchiseeId() == null ? driver.getCompanyId() : driver.getFranchiseeId(), 1); |
| | | for (Dispatch dispatch : dispatches) { |
| | | jgPushUtil.push(2, "有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | } |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // map.put("orderId", reassign.getOrderId().toString()); |
| | | // map.put("orderType", reassign.getOrderType().toString()); |
| | | // List<Dispatch> dispatches = dispatchMapper.queryDispatchs(driver.getFranchiseeId() == null ? driver.getCompanyId() : driver.getFranchiseeId(), 1); |
| | | // for (Dispatch dispatch : dispatches) { |
| | | // jgPushUtil.push(2, "有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | // } |
| | | } |
| | | if (reassign.getPayType() == 4) { |
| | | |
| | |
| | | reassign.setPayOrder(order_id); |
| | | reassign.setPayTime(new Date()); |
| | | this.updateById(reassign); |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | | map.put("orderType", reassign.getOrderType().toString()); |
| | | List<Dispatch> dispatches = dispatchMapper.queryDispatchs(driver.getFranchiseeId() == null ? driver.getCompanyId() : driver.getFranchiseeId(), 1); |
| | | for (Dispatch dispatch : dispatches) { |
| | | jgPushUtil.push(2, "有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | } |
| | | // //开始推送调度单 |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // map.put("orderId", reassign.getOrderId().toString()); |
| | | // map.put("orderType", reassign.getOrderType().toString()); |
| | | // List<Dispatch> dispatches = dispatchMapper.queryDispatchs(driver.getFranchiseeId() == null ? driver.getCompanyId() : driver.getFranchiseeId(), 1); |
| | | // for (Dispatch dispatch : dispatches) { |
| | | // jgPushUtil.push(2, "有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | // } |
| | | } |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | |
| | | orderCrossCity1.setOldState(orderCrossCity1.getState()); |
| | | orderCrossCity1.setState(11); |
| | | orderCrossCity1.setReassignNotice(2); |
| | | orderCrossCity1.setIsReassign(2); |
| | | orderCrossCityService.updateById(orderCrossCity1); |
| | | System.out.println("==============跨城修改改派通知状态完毕===================" + orderCrossCity1); |
| | | |
| | |
| | | orderPrivateCar.setOldState(orderPrivateCar.getState()); |
| | | orderPrivateCar.setState(11); |
| | | orderPrivateCar.setReassignNotice(2); |
| | | orderPrivateCar.setIsReassign(2); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | |
| | | //添加已收入明细 |
| | |
| | | orderTaxi.setOldState(orderTaxi.getState()); |
| | | orderTaxi.setState(11); |
| | | orderTaxi.setReassignNotice(2); |
| | | orderTaxi.setIsReassign(2); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | |
| | | //添加已收入明细 |
| | |
| | | orderLogistics.setOldState(orderLogistics.getState()); |
| | | orderLogistics.setState(11); |
| | | orderLogistics.setReassignNotice(2); |
| | | orderLogistics.setIsReassign(2); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | |
| | | //添加已收入明细 |
| | |
| | | orderLogistics1.setOldState(orderLogistics1.getState()); |
| | | orderLogistics1.setState(11); |
| | | orderLogistics1.setReassignNotice(2); |
| | | orderLogistics1.setIsReassign(2); |
| | | orderLogisticsService.updateById(orderLogistics1); |
| | | |
| | | //添加已收入明细 |
| | |
| | | break; |
| | | } |
| | | systemNoticeService.addSystemNotice(2, "您已使用" + (type == 1 ? "微信" : (type == 2 ? "支付宝" : "云闪付")) + "成功支付改派申请费用!", reassign.getOriginalDriverId(), 1); |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | | map.put("orderType", reassign.getOrderType().toString()); |
| | | List<Dispatch> dispatches = dispatchMapper.queryDispatchs(driver.getFranchiseeId() == null ? driver.getCompanyId() : driver.getFranchiseeId(), 1); |
| | | for (Dispatch dispatch : dispatches) { |
| | | jgPushUtil.push(2, "有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | } |
| | | // //开始推送调度单 |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // map.put("orderId", reassign.getOrderId().toString()); |
| | | // map.put("orderType", reassign.getOrderType().toString()); |
| | | // List<Dispatch> dispatches = dispatchMapper.queryDispatchs(driver.getFranchiseeId() == null ? driver.getCompanyId() : driver.getFranchiseeId(), 1); |
| | | // for (Dispatch dispatch : dispatches) { |
| | | // jgPushUtil.push(2, "有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | // } |
| | | System.out.println("==============其他订单完毕==================="); |
| | | } else { |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | int size=18; |
| | | for (int i = 1; i <= size; i++) { |
| | | int num = 0; |
| | | for (int j = 0; j < 6; j++) { |
| | | Boolean push = false; |
| | | for (int i = 1; i <= querys.size(); i++) { |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | System.out.println("pushOrder:" + pushOrder); |
| | |
| | | Integer state = orderTaxi1.getState(); |
| | | if (state != 1 || state!= 11) { |
| | | orderIds.remove(orderTaxi.getId()); |
| | | push = true; |
| | | break; |
| | | } |
| | | if (i == 18 && (state == 1 || state==11)) { |
| | | if (num == 18 && (state == 1 || state==11)) { |
| | | System.err.println("结束改派退单-------------修改订单为取消状态"); |
| | | pushUtil.pushEndPush(1, orderTaxi.getUserId(), orderTaxi.getId(), 2); |
| | | pushUtil.pushEndPush(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, 11); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, 10); |
| | | orderTaxi1.setState(10); |
| | | orderTaxiService.updateById(orderTaxi1); |
| | | orderIds.remove(orderTaxi.getId()); |
| | | } |
| | | } |
| | | if(push){ |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//获取需要推送的次数 |
| | | int size=18; |
| | | for (int i = 1; i <= size; i++) { |
| | | int num = 0; |
| | | for (int j = 0; j < 6; j++) { |
| | | Boolean push = false; |
| | | for (int i = 1; i <= querys.size(); i++) { |
| | | num++; |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(id); |
| | | if (null == orderPrivateCar || (orderPrivateCar.getState() > 1 && orderPrivateCar.getState() != 11)) { |
| | | push = true; |
| | | break; |
| | | } |
| | | int finalI = i; |
| | |
| | | System.out.println("pushOrder:" + pushOrder); |
| | | |
| | | if (orderPrivateCar.getState() > 1 && orderPrivateCar.getState() != 11) { |
| | | push = true; |
| | | break; |
| | | } |
| | | //获取空闲司机 |
| | |
| | | Integer state = orderPrivateCar.getState(); |
| | | if (state > 1 && state != 11) { |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | | push = true; |
| | | return; |
| | | } |
| | | if (i == 18 && (state == 1 || state==11)) { |
| | | if (num == 18 && (state == 1 || state==11)) { |
| | | System.err.println("结束改派退单-------------修改订单为取消状态"); |
| | | pushUtil.pushEndPush(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1); |
| | | pushUtil.pushEndPush(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, 11); |
| | | pushUtil.pushReassignEndCancel(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, 10); |
| | | orderPrivateCar.setState(10); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | | } |
| | | |
| | | } |
| | | if(push){ |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |