| | |
| | | |
| | | 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; |
| | |
| | | reassignMapper.deleteById(query.getId()); |
| | | } |
| | | query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 2); |
| | | int types=1; |
| | | if (null != query) { |
| | | return ResultUtil.error("您提交的申请正在处理中"); |
| | | 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); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid, 1); |
| | | if(types==1){ |
| | | this.insert(reassign); |
| | | } |
| | | // systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid, 1); |
| | | |
| | | //开始支付 |
| | | if (null != reassign.getPayType()) { |
| | | if (reassign.getPayType() == 1) {//微信支付 |
| | | reassign.setState(1); |
| | | |
| | | resultUtil = payMoneyUtil.weixinpay("改派订单", "", reassign.getId() + "_" + reassign.getOrderType() + "_" + UUIDUtil.getRandomCode(5), aDouble.toString(), "/base/wxReassign", "APP", ""); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 1, aDouble, "", 1);//添加预支付数据 |
| | | resultUtil = payMoneyUtil.weixinpay("改派订单", "", reassign.getId() + "_" + reassign.getOrderType() + "_" + UUIDUtil.getRandomCode(5), "0", "/base/wxReassign", "APP", ""); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 1, 0.0, "", 1);//添加预支付数据 |
| | | } |
| | | if (reassign.getPayType() == 2) {//支付宝 |
| | | reassign.setState(1); |
| | | resultUtil = payMoneyUtil.alipay("改派订单", "改派订单", "", reassign.getId() + "_" + reassign.getOrderType() + "_" + UUIDUtil.getRandomCode(5), aDouble.toString(), "/base/aliReassign"); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 2, aDouble, "", 1);//添加预支付数据 |
| | | resultUtil = payMoneyUtil.alipay("改派订单", "改派订单", "", reassign.getId() + "_" + reassign.getOrderType() + "_" + UUIDUtil.getRandomCode(5), "0", "/base/aliReassign"); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 2, 0.0, "", 1);//添加预支付数据 |
| | | } |
| | | if (reassign.getPayType() == 3) {//余额 |
| | | reassign.setState(2); |
| | |
| | | //添加已收入明细 |
| | | // incomeService.saveData(1, orderPrivateCar.getCompanyId(), 4, orderPrivateCar.getId(), 1, reassign.getMoney()); |
| | | // qyt 改派直接推送 |
| | | pushOrderPrivate(orderPrivateCar, uid); |
| | | pushOrderPrivate(orderPrivateCar, uid,types); |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(reassign.getOrderId()); |
| | |
| | | // incomeService.saveData(1, orderTaxi.getCompanyId(), 4, orderTaxi.getId(), 2, reassign.getMoney()); |
| | | |
| | | // qyt 改派直接推送 |
| | | pushOrderTaxi(orderTaxi, uid); |
| | | pushOrderTaxi(orderTaxi, uid,types); |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId()); |
| | |
| | | // jgPushUtil.push(2,"有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | // } |
| | | |
| | | |
| | | } |
| | | if (reassign.getPayType() == 4) { |
| | | // TODO 司机云闪付 改派调起云闪付 |
| | | Double payMoney = reassign.getMoney(); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 4, aDouble, "", 1);//添加预支付数据 |
| | | resultUtil = placeAnOrder(new BigDecimal(payMoney), 4, 1, reassign.getId()); |
| | | } |
| | | // if (reassign.getPayType() == 4) { |
| | | // // TODO 司机云闪付 改派调起云闪付 |
| | | // Double payMoney = reassign.getMoney(); |
| | | // paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 4, aDouble, "", 1);//添加预支付数据 |
| | | // resultUtil = placeAnOrder(new BigDecimal(payMoney), 4, 1, reassign.getId()); |
| | | // } |
| | | } |
| | | return resultUtil; |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | * @param orderTaxi |
| | | * @throws Exception |
| | | */ |
| | | public void pushOrderTaxi(OrderTaxi orderTaxi, Integer uid) throws Exception { |
| | | public void pushOrderTaxi(OrderTaxi orderTaxi, Integer uid,int type) throws Exception { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | for (int i = 1; i <= 6; i++) { |
| | | int size=1; |
| | | if(type==2){ |
| | | size = 6; |
| | | } |
| | | |
| | | 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); |
| | | System.out.println("pushOrder:" + pushOrder); |
| | |
| | | * @param orderPrivateCar |
| | | * @throws Exception |
| | | */ |
| | | public void pushOrderPrivate(OrderPrivateCar orderPrivateCar, Integer uid) throws Exception { |
| | | public void pushOrderPrivate(OrderPrivateCar orderPrivateCar, Integer uid,int type) throws Exception { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//获取需要推送的次数 |
| | | for (int i = 1; i <= 6; i++) { |
| | | int size=1; |
| | | if(type==2){ |
| | | size=6; |
| | | } |
| | | for (int i = 1; i <= size; i++) { |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(id); |
| | | if (null == orderPrivateCar || (orderPrivateCar.getState() > 1 && orderPrivateCar.getState() != 11)) { |
| | | break; |