| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import cn.hutool.system.UserInfo; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.google.gson.Gson; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.PushUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.TextToSpeechUtil; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TSystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | |
| | | @Controller |
| | | @RequestMapping("/tOrderPrivateCar") |
| | | public class TOrderPrivateCarController extends BaseController { |
| | | |
| | | Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | private String PREFIX = "/system/tOrderPrivateCar/"; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private ITUserService userService; |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private ITCarService carService; |
| | | private ResultUtil resultUtil; |
| | | @Autowired |
| | | private ITCompanyService companyService; |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | @Autowired |
| | | private ITSystemNoticeService systemNoticeService; |
| | | @Resource |
| | | private TSystemPriceMapper systemPriceMapper; |
| | | |
| | | /** |
| | | * 跳转到专车订单首页 |
| | |
| | | model.addAttribute("item",item); |
| | | return PREFIX + "tOrderPrivateCar_orderDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改专车订单 |
| | | */ |
| | |
| | | model.addAttribute("item",item); |
| | | return PREFIX + "toChangeMoney.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到出租车订单轨迹页面 |
| | | */ |
| | |
| | | page.setRecords(tOrderPrivateCarService.getPrivateCarOrderList(page,beginTime,endTime,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),orderNum,orderSource,userName,userPhone,passengers,passengersPhone,serverCarModelId,driver,state,smsNumber)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | private ResultUtil resultUtil; |
| | | |
| | | /** |
| | | * 获取订单轨迹 |
| | |
| | | return resultUtil; |
| | | } |
| | | |
| | | @Autowired |
| | | private ITCompanyService companyService; |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付专车订单 |
| | | */ |
| | |
| | | orderPrivateCar.setAbnormalMoney(orderPrivateCar.getOrderMoney()); |
| | | orderPrivateCar.setOrderMoney(money); |
| | | orderPrivateCar.setPayMoney(money); |
| | | orderPrivateCar.setPayType(5); |
| | | orderPrivateCar.setState(7); |
| | | orderPrivateCar.setIsDispute(1); |
| | | orderPrivateCar.updateById(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/frozenOrder") |
| | | @ResponseBody |
| | | public Object frozenOrder(@RequestParam Integer tOrderPrivateCarId) throws Exception { |
| | | TOrderPrivateCar orderPrivateCar = tOrderPrivateCarService.selectById(tOrderPrivateCarId); |
| | | |
| | | //添加已收入明细 |
| | | TDriver tDriver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用 |
| | | |
| | | //添加已收入明细 |
| | | TCompany company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney().doubleValue(); |
| | | Integer language =tDriver.getLanguage(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(taxi); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney().doubleValue() + orderPrivateCar.getMileageMoney().doubleValue() + orderPrivateCar.getWaitMoney().doubleValue()+ orderPrivateCar.getDurationMoney().doubleValue() + orderPrivateCar.getLongDistanceMoney().doubleValue(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | if(orderPrivateCar.getIsFrozen()==1){ |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance((null != driver.getBalance() ? driver.getBalance() : BigDecimal.ZERO).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | driver.setFrozenMoney(driver.getFrozenMoney().add(c)); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance((null != driver.getBalance() ? driver.getBalance() : BigDecimal.ZERO).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | driver.setFrozenMoney(driver.getFrozenMoney().subtract(c)); |
| | | driverService.updateById(driver); |
| | | } |
| | | if (orderPrivateCar.getIsFrozen() == 1){ |
| | | TOrderPrivateCar orderPrivateCar1 = tOrderPrivateCarService.selectById(tOrderPrivateCarId); |
| | | if(orderPrivateCar1.getArriveTime()==null){ |
| | | orderPrivateCar1.setArriveTime(orderPrivateCar1.getStartServiceTime()); |
| | | if(orderPrivateCar.getIsFrozen() == 1 && orderPrivateCar.getState() < 7){ |
| | | if(orderPrivateCar.getArriveTime()==null){ |
| | | orderPrivateCar.setArriveTime(orderPrivateCar.getStartServiceTime()); |
| | | } |
| | | orderPrivateCar1 = this.setMoney(orderPrivateCar1, 0D, 0D);//计算费用 |
| | | |
| | | orderPrivateCar1.setOrderMoney(orderPrivateCar1.getOrderMoney().add(orderPrivateCar1.getParkMoney()).add(orderPrivateCar1.getRoadTollMoney())); |
| | | orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用 |
| | | orderPrivateCar.setPayManner(1); |
| | | orderPrivateCar.setParkMoney(new BigDecimal(0)); |
| | | orderPrivateCar.setRoadTollMoney(new BigDecimal(0)); |
| | | //判断是否首单免费-免费直接完成 |
| | | Integer orderNumber = tOrderPrivateCarService.selectCount(new EntityWrapper<TOrderPrivateCar>().eq("userId",orderPrivateCar1.getUserId()).last("and (state=8 or state=9)")); |
| | | |
| | | Integer orderNumber = tOrderPrivateCarService.selectCount(new EntityWrapper<TOrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()).last("and (state=8 or state=9)")); |
| | | |
| | | if(orderNumber<=0){//判断是否是首单 |
| | | //判断是否免单 |
| | | TUser userInfo = userService.selectById(orderPrivateCar1.getUserId()); |
| | | TUser userInfo = userService.selectById(orderPrivateCar.getUserId()); |
| | | if(userInfo.getFreeMoney().doubleValue()>0d){ |
| | | if(orderPrivateCar1.getOrderMoney().compareTo(userInfo.getFreeMoney())<=-1){ |
| | | orderPrivateCar1.setState(8); |
| | | orderPrivateCar1.setIsFree(2); |
| | | if(orderPrivateCar.getOrderMoney().compareTo(userInfo.getFreeMoney())<=0){ |
| | | orderPrivateCar.setState(8); |
| | | orderPrivateCar.setIsFree(2); |
| | | //添加已收入明细 |
| | | TCompany tCompany = companyService.selectById(orderPrivateCar1.getCompanyId()); |
| | | BigDecimal speMoney = tCompany.getSpeMoney(); |
| | | |
| | | if(tCompany.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = speMoney; |
| | | c = orderPrivateCar1.getOrderMoney().subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | TCompany company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double speMoney = company.getSpeMoney().doubleValue(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(tCompany.getIsSpeFixedOrProportional() == 1){//比例 |
| | | BigDecimal price = orderPrivateCar1.getStartMoney().add(orderPrivateCar1.getMileageMoney()).add(new BigDecimal(orderPrivateCar1.getWaitMoney())).add(orderPrivateCar1.getDurationMoney()).add(orderPrivateCar1.getLongDistanceMoney()); |
| | | d = price.multiply(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | c = orderPrivateCar1.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney().add(orderPrivateCar.getMileageMoney()).add(new BigDecimal(orderPrivateCar.getWaitMoney())).add(orderPrivateCar.getDurationMoney()).add(orderPrivateCar.getLongDistanceMoney()).doubleValue(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar1.getCompanyId(), 2, orderPrivateCar1.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar1.getDriverId(), 2, orderPrivateCar1.getId(), 1, c.doubleValue()); |
| | | TDriver driver = driverService.selectById(orderPrivateCar1.getDriverId()); |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | if (null != driver.getBalance()){ |
| | | driver.setBalance(driver.getBalance().add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | }else{ |
| | | driver.setBalance(BigDecimal.ZERO.add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | } |
| | | driver.setBalance((null != driver.getBalance() ? driver.getBalance() : new BigDecimal("0")).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | orderPrivateCar1.setState(7); |
| | | orderPrivateCar1.setOrderMoney(orderPrivateCar1.getOrderMoney().subtract(userInfo.getFreeMoney())); |
| | | orderPrivateCar1.setFreeMoney(userInfo.getFreeMoney()); |
| | | |
| | | orderPrivateCar.setState(7); |
| | | orderPrivateCar.setOrderMoney(orderPrivateCar.getOrderMoney().subtract(userInfo.getFreeMoney())); |
| | | orderPrivateCar.setFreeMoney(userInfo.getFreeMoney()); |
| | | |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | orderPrivateCar1.setState(7); |
| | | orderPrivateCar.setState(7); |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | orderPrivateCar1.setState(7); |
| | | orderPrivateCar.setState(7); |
| | | } |
| | | |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderPrivateCar1.getBindId(),orderPrivateCar1.getTelX()); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar1.setTelX(""); |
| | | orderPrivateCar1.setBindId(""); |
| | | |
| | | tOrderPrivateCarService.updateById(orderPrivateCar); |
| | | |
| | | //修改行程数据 |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", null, null, orderPrivateCar.getTripId(), null, null, null, null, orderPrivateCar.getId(), 1); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("COMPLETE", null, null, orderPrivateCar.getTripId(), null, null, null, null, orderPrivateCar.getId(), 1); |
| | | if(updateTrip){ |
| | | orderPrivateCar.setIsover(1); |
| | | tOrderPrivateCarService.updateById(orderPrivateCar); |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | orderPrivateCar.setIsover(1); |
| | | tOrderPrivateCarService.updateById(orderPrivateCar); |
| | | } |
| | | tOrderPrivateCarService.updateById(orderPrivateCar1); |
| | | |
| | | |
| | | pushUtil.removeTask(orderPrivateCar1.getId(), 1);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "司机已结束本次行程,谢谢使用" : language == 2 ? |
| | | "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderPrivateCar1.getUserId()); |
| | | |
| | | //上报行程 |
| | | boolean reportBillableEvent = fleetEngineUtil.reportBillableEvent(orderPrivateCar.getTripId()); |
| | | if(!reportBillableEvent){ |
| | | for (int i = 0; i < 5; i++) { |
| | | reportBillableEvent = fleetEngineUtil.reportBillableEvent(orderPrivateCar.getTripId()); |
| | | if(reportBillableEvent){ |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | TUser userInfo = userService.selectById(orderPrivateCar.getUserId()); |
| | | Integer language1 = userInfo.getLanguage(); |
| | | systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已结束本次行程,谢谢使用" : language1 == 2 ? |
| | | "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderPrivateCar.getUserId()); |
| | | |
| | | //回滚司机状态为空闲 |
| | | TDriver driver = driverService.selectById(orderPrivateCar1.getDriverId()); |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | TOrderPrivateCar finalOrderTaxi = orderPrivateCar1; |
| | | |
| | | TOrderPrivateCar finalOrderTaxi = orderPrivateCar; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | | TOrderPrivateCar finalOrderPrivateCar = orderPrivateCar1; |
| | | new Thread(()->{ |
| | | try { |
| | | //上报google |
| | | fleetEngineUtil.reportBillableEvent(finalOrderPrivateCar.getTripId()); |
| | | System.err.println("上报时间:{},tripid:{},created_at:{},completed_at:{}"+ System.currentTimeMillis()+ finalOrderPrivateCar.getTripId()+ |
| | | finalOrderPrivateCar.getInsertTime().getTime()+finalOrderPrivateCar.getEndServiceTime().getTime()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | }).start(); |
| | | // 冻结订单需要给司机推送一个消息; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(2, finalOrderPrivateCar.getDriverId(), finalOrderPrivateCar.getId(), 1, 7, 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | | pushUtil.frozenOrder(orderPrivateCar.getDriverId(), 2); |
| | | } |
| | | |
| | | orderPrivateCar.setIsFrozen(orderPrivateCar.getIsFrozen()==1?2:1); |
| | | orderPrivateCar.setState(7); |
| | | tOrderPrivateCarService.updateAllColumnById(orderPrivateCar); |
| | | |
| | | orderPrivateCar.setIsDispute(1); |
| | | tOrderPrivateCarService.updateById(orderPrivateCar); |
| | | return SUCCESS_TIP; |
| | | } |
| | | @Autowired |
| | | private ChinaMobileUtil chinaMobileUtil; |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | @Autowired |
| | | private ITSystemNoticeService systemNoticeService; |
| | | @Resource |
| | | private TSystemPriceMapper systemPriceMapper; |
| | | |
| | | public TOrderPrivateCar setMoney(TOrderPrivateCar orderPrivateCar, Double parkingFee, Double crossingFee) throws Exception { |
| | | System.err.println("计算金额:"+orderPrivateCar); |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | |
| | | orderPrivateCar.setIsplatPay(2); |
| | | orderPrivateCar.setPayManner(1); |
| | | orderPrivateCar.setState(8); |
| | | orderPrivateCar.setPayType(5); |
| | | orderPrivateCar.setPayMoney(orderPrivateCar.getOrderMoney()); |
| | | tOrderPrivateCarService.updateAllColumnById(orderPrivateCar); |
| | | return SUCCESS_TIP; |
| | |
| | | @ResponseBody |
| | | public Object cancel(@RequestParam Integer tOrderPrivateCarId) { |
| | | TOrderPrivateCar tOrderPrivateCar = tOrderPrivateCarService.selectById(tOrderPrivateCarId); |
| | | |
| | | if(Arrays.asList(6, 7, 8, 9, 10).contains(tOrderPrivateCar.getState())){ |
| | | return ERROR; |
| | | } |
| | | //修改之前司机状态 -- 空闲 |
| | | if(null != tOrderPrivateCar.getDriverId()){ |
| | | TDriver driver = tDriverService.selectById(tOrderPrivateCar.getDriverId()); |
| | |
| | | orderCancelMapper.insert(orderCancel); |
| | | |
| | | //修改行程信息 |
| | | try { |
| | | fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderPrivateCar.getTripId(), null, null, null, null); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | TCar car = carService.selectById(tOrderPrivateCar.getCarId()); |
| | | //修改行程信息 |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tOrderPrivateCar.getTripId(), null, null, null, null, tOrderPrivateCar.getId(), 1); |
| | | if(!updateTrip){ |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tOrderPrivateCar.getTripId(), null, null, null, null, tOrderPrivateCar.getId(), 1); |
| | | if(updateTrip){ |
| | | tOrderPrivateCar.setIsover(1); |
| | | tOrderPrivateCarService.updateById(tOrderPrivateCar); |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(3000L); |
| | | } catch (InterruptedException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | tOrderPrivateCar.setIsover(1); |
| | | tOrderPrivateCarService.updateById(tOrderPrivateCar); |
| | | } |
| | | |
| | | |
| | |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("id", tOrderPrivateCar.getId().toString()); |
| | | map.put("orderType", "1"); |
| | | map.put("from", "admin"); |
| | | String result = HttpRequestUtil.postRequest(PushURL.cancel_order_url, map); |
| | | System.out.println("专车取消:【orderId="+tOrderPrivateCar.getId().toString()+"】,调用接口:"+result); |
| | | return SUCCESS_TIP; |