/// <summary> /// 用户完成充值申请 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task ChargeApplyCustomer(ChargeInput input) { var current = await AbpSession.Current(); var apply = await _applyRepository.FirstOrDefaultAsync(input.Id); if (apply == null) { throw new UserFriendlyException("充值申请不存在"); } var customer = await _customerRepository.FirstOrDefaultAsync(c => c.Id == apply.CustomerId); if (customer == null) { throw new UserFriendlyException("当前客户信息不存在"); } customer.Balance += input.Money; await _chargeRecordRepository.InsertAsync(new ChargeRecord() { ActionName = current.Name, ChargeMoney = input.Money, CustomerId = customer.Id, CustomerName = customer.CompanyName }); apply.State = true; apply.ActrueMoney = input.Money; apply.ActionName = current.Name; }