| | |
| | | public synchronized ResultUtil<BaseWarpper> taxiOrder(OrderTaxi orderTaxi, Integer uid) throws Exception { |
| | | //定义用户所属公司 |
| | | UserInfo userInfo1 = userInfoService.selectById(uid); |
| | | if (null == userInfo1 || userInfo1.getFlag() == 3) { |
| | | return ResultUtil.error("无效的账户"); |
| | | } |
| | | if (2 == userInfo1.getState()) { |
| | | return ResultUtil.error("账号已被冻结,请联系管理员"); |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat())); |
| | | if(null == query){ |
| | | return ResultUtil.error("出发点暂未开通"); |
| | |
| | | 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()); |
| | | //添加交易明细 |
| | |
| | | userRedPacketRecord.setUserId(orderTaxi.getUserId()); |
| | | userRedPacketRecordService.insert(userRedPacketRecord); |
| | | } |
| | | appOrderController.moneyPay(orderTaxi.getId(),orderTaxi.getUserId(),money); |
| | | // appOrderController.moneyPay(orderTaxi.getId(),orderTaxi.getUserId(),money); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | |
| | | 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(orderTaxi.getCompanyId()); |