| | |
| | | { |
| | | var repeat = await _lifePayExpensesReceiptsRepository.Where(x => x.ExpensesReceiptsType == input.ExpensesReceiptsType |
| | | && x.OrderNo == input.OrderNo).AnyAsync(); |
| | | if (repeat) |
| | | if (!repeat) |
| | | { |
| | | var data = new LifePayExpensesReceipts() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 统计所有消费流水 |
| | |
| | | var orderList = await _lifePayOrderRepository.Where(x => x.PayStatus == LifePayStatusEnum.已支付).ToListAsync(); |
| | | foreach (var item in orderList) |
| | | { |
| | | |
| | | |
| | | if (item.ACOOLYStatus != null) |
| | | { |
| | | switch (item.ACOOLYStatus) |
| | |
| | | } |
| | | |
| | | var repeat = await _lifePayChannlesRakeRepository.Where(x => x.OrderNo == item.OrderNo).AnyAsync(); |
| | | if (repeat) |
| | | if (!repeat) |
| | | { |
| | | await _lifePayChannlesRakeRepository.InsertAsync(lifePayChannlesRake); |
| | | } |
| | |
| | | |
| | | #region 方法 |
| | | public async Task CreatLifePayConsumption(ACOOLYStatusEnum status, string orderNo, string aCOOLYOrderNo, |
| | | decimal platformDeductionAmount, string channelId, DateTime orderCreationTime, DateTime? orderFinishTime) |
| | | decimal platformDeductionAmount, string channelId, DateTime orderCreationTime, DateTime? orderFinishTime, decimal? channelRate = 0, decimal? parValue = 0, decimal? actualParValue = 0) |
| | | { |
| | | LifePayConsumption lifePayConsumption = new LifePayConsumption() |
| | | { |
| | |
| | | lifePayConsumption.DeductionAmount = 0; |
| | | lifePayConsumption.FrozenAmount = 0; |
| | | break; |
| | | //case ACOOLYStatusEnum.部分充值成功: |
| | | // lifePayConsumption.FinishTime = orderCreationTime; |
| | | // lifePayConsumption.ACOOLYStatus = ACOOLYStatusEnum.部分充值成功; |
| | | // lifePayConsumption.FrozenStatus = ConsumptionFrozenStatusEnum.Thaw; |
| | | // lifePayConsumption.Flow = ConsumptionFlowEnum.Unchanged; |
| | | // lifePayConsumption.DeductionAmount = 0; |
| | | // lifePayConsumption.FrozenAmount = lifePayConsumption.Amount; |
| | | case ACOOLYStatusEnum.部分充值成功: |
| | | lifePayConsumption.FinishTime = orderCreationTime; |
| | | lifePayConsumption.ACOOLYStatus = ACOOLYStatusEnum.部分充值成功; |
| | | lifePayConsumption.FrozenStatus = ConsumptionFrozenStatusEnum.Thaw; |
| | | lifePayConsumption.Flow = ConsumptionFlowEnum.Out; |
| | | lifePayConsumption.DeductionAmount = lifePayConsumption.Amount; |
| | | lifePayConsumption.FrozenAmount = 0; |
| | | if ((parValue ?? 0) != 0 && (parValue ?? 0) != actualParValue) |
| | | { |
| | | LifePayConsumption lifePayConsumptionOther = new LifePayConsumption() |
| | | { |
| | | OrderNo = orderNo, |
| | | AcoolyOrderNo = aCOOLYOrderNo, |
| | | Amount = ((parValue ?? 0) - (actualParValue ?? 0)) * (channelRate ?? 0), |
| | | ChannelId = channelId, |
| | | FinishTime = orderCreationTime, |
| | | ACOOLYStatus = ACOOLYStatusEnum.部分充值成功, |
| | | FrozenStatus = ConsumptionFrozenStatusEnum.Thaw, |
| | | Flow = ConsumptionFlowEnum.Unchanged, |
| | | DeductionAmount = 0, |
| | | FrozenAmount = 0 |
| | | }; |
| | | await _lifePayConsumption.InsertAsync(lifePayConsumptionOther); |
| | | } |
| | | |
| | | // repeat = await _lifePayConsumption.Where(x => x.OrderNo == lifePayConsumption.OrderNo |
| | | // && x.ACOOLYStatus == lifePayConsumption.ACOOLYStatus && x.Flow == lifePayConsumption.Flow).FirstOrDefaultAsync(); |
| | | // if (repeat == null) |
| | | // { |
| | | // await _lifePayConsumption.InsertAsync(lifePayConsumption); |
| | | // } |
| | | |
| | | // break; |
| | | break; |
| | | default: break; |
| | | } |
| | | |
| | | var repeat = await _lifePayConsumption.Where(x => x.OrderNo == lifePayConsumption.OrderNo |
| | | && x.ACOOLYStatus == lifePayConsumption.ACOOLYStatus && x.Flow == lifePayConsumption.Flow).AnyAsync(); |
| | | if (repeat) |
| | | if (!repeat) |
| | | { |
| | | await _lifePayConsumption.InsertAsync(lifePayConsumption); |
| | | } |
| | |
| | | FinishTime = x.FinishTime, |
| | | CreationTime = x.CreationTime, |
| | | }); |
| | | |
| | | |
| | | return list; |
| | | } |
| | | |