| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | |
| | | // if(null != query){ |
| | | // return ResultUtil.error("有未完成支付的改派申请"); |
| | | // } |
| | | int types=1; |
| | | Reassign query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 1); |
| | | if (null != query) { |
| | | types=2; |
| | | // return ResultUtil.error("不能重复提交申请"); |
| | | reassignMapper.deleteById(query.getId()); |
| | | } |
| | | query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 2); |
| | | int types=1; |
| | | |
| | | if (null != query) { |
| | | types=2; |
| | | // return ResultUtil.error("您提交的申请正在处理中"); |
| | | } |
| | | |
| | | //获取支付金额 |
| | | // Double aDouble = orderService.queryReassignMoney(reassign.getOrderId(), reassign.getOrderType()); |
| | | // reassign.setMoney(aDouble); |
| | | // reassign.setOriginalDriverId(uid); |
| | | // reassign.setOriginalCarId(driver.getCarId()); |
| | | // reassign.setInsertTime(new Date()); |
| | | // this.insert(reassign); |
| | | Double aDouble = orderService.queryReassignMoney(reassign.getOrderId(), reassign.getOrderType()); |
| | | reassign.setMoney(aDouble); |
| | | reassign.setOriginalDriverId(uid); |
| | | reassign.setOriginalCarId(driver.getCarId()); |
| | | reassign.setInsertTime(new Date()); |
| | | if(types==1){ |
| | | this.insert(reassign); |
| | | } |
| | | // systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid, 1); |
| | | |
| | | //开始支付 |
| | |
| | | Driver driver = driverService.selectById(uid); |
| | | //修改改派通知状态 |
| | | switch (reassign.getOrderType()) { |
| | | |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(reassign.getOrderId()); |
| | | orderPrivateCar.setState(orderPrivateCar.getOldState()); |
| | |
| | | OrderUtil.modifyTravelItinerary(request1); |
| | | break; |
| | | } |
| | | reassignMapper.delete(new EntityWrapper<Reassign>().eq("orderId",reassign.getOrderId()).eq("orderType",reassign.getOrderType())); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | int size=1; |
| | | if(type==2){ |
| | | size = 6; |
| | | } |
| | | |
| | | int size=18; |
| | | for (int i = 1; i <= size; i++) { |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | |
| | | if (state != 1 || state!= 11) { |
| | | break; |
| | | } |
| | | if (i == 6 && (state == 1 || state==11)) { |
| | | if (i == 18 && (state == 1 || state==11)) { |
| | | pushUtil.pushEndPush(1, orderTaxi.getUserId(), orderTaxi.getId(), 2); |
| | | orderTaxi1.setState(10); |
| | | orderTaxiService.updateById(orderTaxi1); |
| | |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//获取需要推送的次数 |
| | | int size=1; |
| | | if(type==2){ |
| | | size=6; |
| | | } |
| | | int size=18; |
| | | for (int i = 1; i <= size; i++) { |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(id); |
| | | if (null == orderPrivateCar || (orderPrivateCar.getState() > 1 && orderPrivateCar.getState() != 11)) { |
| | |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | | return; |
| | | } |
| | | if (i == 6 && (state == 1 || state==11)) { |
| | | if (i == 18 && (state == 1 || state==11)) { |
| | | pushUtil.pushEndPush(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1); |
| | | orderPrivateCar.setState(10); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |