| | |
| | | private readonly IBalancePayServices _balancePayServices; |
| | | private readonly IAliPayServices _aliPayServices; |
| | | private readonly IWeChatPayServices _weChatPayServices; |
| | | private readonly ICoreCmsPlanOrderServices _planOrderServices; |
| | | //private readonly ICoreCmsOrderServices _orderServices; |
| | | |
| | | |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | public CoreCmsBillRefundServices(IUnitOfWork unitOfWork, ICoreCmsBillRefundRepository dal, ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsMessageCenterServices messageCenterServices, ICoreCmsPaymentsServices paymentsServices, IBalancePayServices balancePayServices, IAliPayServices aliPayServices, IWeChatPayServices weChatPayServices) |
| | | public CoreCmsBillRefundServices(IUnitOfWork unitOfWork, ICoreCmsBillRefundRepository dal, ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsMessageCenterServices messageCenterServices, ICoreCmsPaymentsServices paymentsServices, IBalancePayServices balancePayServices, IAliPayServices aliPayServices, IWeChatPayServices weChatPayServices |
| | | , ICoreCmsPlanOrderServices planOrderServices |
| | | //, ICoreCmsOrderServices orderServices |
| | | ) |
| | | { |
| | | this._dal = dal; |
| | | base.BaseDal = dal; |
| | |
| | | _balancePayServices = balancePayServices; |
| | | _aliPayServices = aliPayServices; |
| | | _weChatPayServices = weChatPayServices; |
| | | _planOrderServices = planOrderServices; |
| | | //_orderServices = orderServices; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | jm = await _balancePayServices.Refund(info, panyMentsInfo); |
| | | } |
| | | ////计划订单退款 |
| | | else if (panyMentsInfo.paymentCode == GlobalEnumVars.PaymentsTypes.planorderpay.ToString()) |
| | | { |
| | | // //查询订单 |
| | | |
| | | // var order = await _orderServices.QueryByIdAsync(info.sourceId); |
| | | var order = await _unitOfWork.GetDbClient().Queryable<CoreCmsOrder>().Where(p => p.orderId == info.sourceId).FirstAsync(); |
| | | if (order == null) |
| | | { |
| | | _unitOfWork.RollbackTran(); |
| | | jm.msg = "订单获取失败"; |
| | | return jm; |
| | | } |
| | | //查询计划订单 |
| | | var planOrder = await _planOrderServices.QueryByIdAsync(order.planorderId); |
| | | //上面保存好订单表,下面保存订单的其他信息 |
| | | if (planOrder == null || planOrder.isdelete == true) |
| | | { |
| | | _unitOfWork.RollbackTran(); |
| | | jm.msg = "计划订单获取失败"; |
| | | return jm; |
| | | } |
| | | planOrder.huaFeiAmount = planOrder.huaFeiAmount - panyMentsInfo.money; |
| | | //修改计划订单的已花费金额 |
| | | await _planOrderServices.UpdateAsync(planOrder); |
| | | |
| | | } |
| | | |
| | | if (jm.status) |
| | | { |