| | |
| | | public ResultUtil payLogisticsOrder(Integer payType, Integer bankCardId, Integer orderId, Integer type, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState() != 7){ |
| | | return ResultUtil.error("订单已完成支付,不允许重复支付", ""); |
| | | return ResultUtil.error(language == 1 ? "订单已完成支付,不允许重复支付" : language == 2 ? "The order has been paid, no double payment is allowed" : "La commande a été payée, aucun paiement en double n’est autorisé", ""); |
| | | } |
| | | Integer uid = orderLogistics.getUserId(); |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 1, orderMoney, null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error("支付失败", ""); |
| | | resultUtil = ResultUtil.error(language == 1 ? "支付失败" : language == 2 ? "Payment failure" : "Paiement échoué", ""); |
| | | } |
| | | return resultUtil; |
| | | } |
| | |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 2, orderMoney, null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error("支付失败", ""); |
| | | resultUtil = ResultUtil.error(language == 1 ? "支付失败" : language == 2 ? "Payment failure" : "Paiement échoué", ""); |
| | | } |
| | | return resultUtil; |
| | | } |
| | |
| | | public ResultUtil payPrivateCarOrder(Integer payType, Integer bankCardId, Integer orderId, Integer couponId, Integer type, Integer language) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){ |
| | | return ResultUtil.error("订单已完成支付,不允许重复支付", ""); |
| | | return ResultUtil.error(language == 1 ? "订单已完成支付,不允许重复支付" : language == 2 ? "The order has been paid, no double payment is allowed" : "La commande a été payée, aucun paiement en double n’est autorisé", ""); |
| | | } |
| | | if(orderPrivateCar.getState() != 7){ |
| | | return ResultUtil.error("订单不在待支付状态,不允许支付", ""); |
| | | return ResultUtil.error(language == 1 ? "订单不在待支付状态,不允许支付" : language == 2 ? "The order is not pending payment and cannot be paid" : "La commande n’est pas en attente de paiement et ne permet pas le paiement", ""); |
| | | } |
| | | Integer uid = orderPrivateCar.getUserId(); |
| | | Double orderMoney = orderPrivateCar.getOrderMoney(); |
| | |
| | | if(null != couponId){ |
| | | userCouponRecord = userCouponRecordService.selectById(couponId); |
| | | if(userCouponRecord.getCompanyId() != orderPrivateCar.getCompanyId()){ |
| | | return ResultUtil.error("优惠券不能用于此订单", ""); |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupons cannot be used for this order" : "Le coupon ne peut pas être utilisé pour cette commande", ""); |
| | | } |
| | | if(userCouponRecord.getState() == 2){ |
| | | return ResultUtil.error("优惠券已使用", ""); |
| | | return ResultUtil.error(language == 1 ? "优惠券已使用" : language == 2 ? "Coupon used" : "Coupon a été utilisé", ""); |
| | | } |
| | | if(userCouponRecord.getState() == 3){ |
| | | return ResultUtil.error("优惠券已过期", ""); |
| | | return ResultUtil.error(language == 1 ? "优惠券已过期" : language == 2 ? "Coupon has expired" : "Le coupon a expiré", ""); |
| | | } |
| | | if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 1){ |
| | | return ResultUtil.error("优惠券不能用于此类型订单", ""); |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupons cannot be used for this order" : "Le coupon ne peut pas être utilisé pour cette commande", ""); |
| | | } |
| | | if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){ |
| | | return ResultUtil.error("优惠券不能用于此订单", ""); |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupons cannot be used for this order" : "Le coupon ne peut pas être utilisé pour cette commande", ""); |
| | | } |
| | | orderMoney = orderMoney - userCouponRecord.getMoney(); |
| | | orderPrivateCar.setCouponMoney(userCouponRecord.getMoney()); |
| | |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 1, 1, orderMoney, null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error("支付失败", ""); |
| | | resultUtil = ResultUtil.error(language == 1 ? "支付失败" : language == 2 ? "Payment failure" : "Paiement échoué", ""); |
| | | } |
| | | |
| | | } |
| | |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 1, 2, orderMoney, null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error("支付失败", ""); |
| | | resultUtil = ResultUtil.error(language == 1 ? "支付失败" : language == 2 ? "Payment failure" : "Paiement échoué", ""); |
| | | } |
| | | } |
| | | if(payType == 3){//余额支付 |