| | |
| | | import com.stylefeng.guns.modular.system.dao.SysIntegralMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.CouponsListVo; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | |
| | | paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 2, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | if (userInfo.getBalance() == null || userInfo.getBalance() < orderMoney) { |
| | | return ResultUtil.error("余额不足,无法完成支付"); |
| | | } |
| | | if(orderMoney > 0){ |
| | | resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),orderMoney); |
| | | if(resultUtil.getCode()==500){ |
| | | return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // if(orderMoney > 0){ |
| | | // resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),orderMoney); |
| | | // if(resultUtil.getCode()==500){ |
| | | // return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "跨城出行订单", orderMoney, 2, 1, 1, 3, orderId); |
| | | userInfoService.updateById(userInfo); |
| | |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()){ |
| | | if(payType == 3) {//余额支付 |
| | | if (userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()) { |
| | | return ResultUtil.error("余额不足,无法完成支付"); |
| | | } |
| | | resultUtil= appOrderController.moneyPay(id,userInfo.getId(),query.getMoney()); |
| | | if(resultUtil.getCode()==500){ |
| | | return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | } |
| | | |
| | | // resultUtil= appOrderController.moneyPay(id,userInfo.getId(),query.getMoney()); |
| | | // if(resultUtil.getCode()==500){ |
| | | // return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | // } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(query.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "跨城出行取消订单", query.getMoney(), 2, 1, 1, 3, id); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | |
| | | //解除小号绑定 |
| | | if(orderCrossCity.getBindId() != null){ |
| | | if (orderCrossCity.getBindId() != null) { |
| | | chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId(), orderCrossCity.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | } |
| | | |
| | |
| | | resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee"); |
| | | paymentRecordService.saveData(1, uid, 1, orderId, 3, 2, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < money){ |
| | | if(payType == 3) {//余额支付 |
| | | if (userInfo.getBalance() == null || userInfo.getBalance() < money) { |
| | | return ResultUtil.error("余额不足,无法完成支付"); |
| | | } |
| | | |
| | | resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money); |
| | | if(resultUtil.getCode()==500){ |
| | | return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | } |
| | | // resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money); |
| | | // if(resultUtil.getCode()==500){ |
| | | // return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | // } |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "跨城出行-感谢费", money, 2, 1, 1, 3, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | |
| | | orderCrossCity.setThankYouFee(money); |
| | | this.updateById(orderCrossCity); |
| | | |
| | |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType==2?"支付宝":"云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1); |
| | | } |
| | | |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayCrossCityOrders(Integer uid) throws Exception { |
| | | EntityWrapper<OrderCrossCity> query = new EntityWrapper<>(); |
| | | query.eq("userId", uid).eq("state", 7); |
| | | // 查询未支付订单 |
| | | List<OrderCrossCity> orderCrossCities = this.selectList(query); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for(OrderCrossCity orderCrossCity : orderCrossCities){ |
| | | |
| | | UnPayOrderVO unPayOrderVO = new UnPayOrderVO(); |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(orderCrossCity, unPayOrderVO); |
| | | unPayOrderVOList.add(unPayOrderVO); |
| | | } |
| | | return unPayOrderVOList; |
| | | } |
| | | } |