void initLazyLoaders(bool newOrder) { _OemInfoLoader = new LazyLoader <OEMInfo>(() => OEMService.QueryOEMById(OEMID.Value)); if (newOrder) { _applyformLoader = new EnumerableLazyLoader <BaseApplyform>(); _operationLoader = new EnumerableLazyLoader <Log.Domain.OrderLog>(); _coordinationLoader = new EnumerableLazyLoader <Coordination>(); } else { _applyformLoader = new EnumerableLazyLoader <BaseApplyform>(() => { return(ApplyformQueryService.QueryApplyforms(this.Id)); }); _operationLoader = new EnumerableLazyLoader <Log.Domain.OrderLog>(() => { return(LogService.QueryOrderLog(this.Id)); }); _coordinationLoader = new EnumerableLazyLoader <Coordination>(() => { return(CoordinationService.QueryOrderCoordinations(this.Id)); }); } _associateOrderLoader = new LazyLoader <Order>(); _distributionBillLoader = new LazyLoader <Service.Distribution.Domain.OrderBill>(() => { return(DistributionQueryService.QueryOrderBill(this.Id)); }); }
internal static void ProcessPostponeRefundment(RefundFailedRecord refundInfo) { var refundBill = DistributionQueryService.QueryPostponeRefundBill(refundInfo.ApplyformId); if (refundBill != null) { var refundResult = Refund(refundInfo.OrderId, refundBill); if (refundResult.Success) { DistributionProcessService.PostponeRefundSuccess(refundBill, refundResult.RefundTime.Value); using (var command = Order.Repository.Factory.CreateCommand()) { command.BeginTransaction(); try { var distributionRepository = Order.Repository.Factory.CreateDistributionRepository(command); distributionRepository.UpdateRefundBillForRefundSuccess(refundBill); command.CommitTransaction(); } catch (Exception ex) { command.RollbackTransaction(); LogService.SaveExceptionLog(ex, "申请单退款"); throw; } } } } }
internal static void ProcessOrderRefundment(RefundFailedRecord refundInfo) { var refundBill = DistributionQueryService.QueryNormalRefundBill(refundInfo.ApplyformId); if (refundBill != null) { var refundResults = Refund(refundBill, refundInfo.BusinessType); if (refundResults.Any(item => item.Success)) { var purchaserSucceed = refundBill.Purchaser.Success; DistributionProcessService.NormalRefundSuccess(refundBill, refundResults); using (var command = Order.Repository.Factory.CreateCommand()) { command.BeginTransaction(); try { var distributionRepository = Order.Repository.Factory.CreateDistributionRepository(command); distributionRepository.UpdateRefundBillForRefundSuccess(refundBill); command.CommitTransaction(); } catch (Exception ex) { command.RollbackTransaction(); LogService.SaveExceptionLog(ex, "交易分润退款"); throw; } } if (!purchaserSucceed && refundBill.Purchaser.Success) { var applyform = ApplyformQueryService.QueryRefundOrScrapApplyform(refundInfo.ApplyformId); var notifier = new Order.Notify.RefundApplyformNotifier(applyform); notifier.RefundSuccess(); } } } }
internal static void ProcessTradeRefundemnt(RefundFailedRecord refundInfo) { //if(refundInfo.BusinessType == RefundBusinessType.PayTimeout) { // var order = OrderQueryService.QueryOrder(refundInfo.OrderId); // if(order != null) { // TradeRefund(order, refundInfo.PayTradeNo); // } // return; //} var refundBill = DistributionQueryService.QueryNormalRefundBill(refundInfo.ApplyformId); if (refundBill != null) { var refundResult = TradeRefund(refundBill, refundInfo.BusinessType); if (refundResult != null && refundResult.Success) { DistributionProcessService.NormalRefundSuccess(refundBill, new[] { refundResult }); using (var command = Order.Repository.Factory.CreateCommand()) { command.BeginTransaction(); try { var distributionRepository = Order.Repository.Factory.CreateDistributionRepository(command); distributionRepository.UpdateRefundBillForRefundSuccess(refundBill); command.CommitTransaction(); } catch (Exception ex) { command.RollbackTransaction(); LogService.SaveExceptionLog(ex, "交易退款"); throw; } var order = OrderQueryService.QueryOrder(refundInfo.OrderId); //发取消出票退款成功通知 var notifier = new Order.Notify.OrderNotifier(order); notifier.SendRefundSuccessNotify(); } } } }
private void initLazyLoaders() { _applyformLoader = new LazyLoader <RefundOrScrapApplyform>(() => ApplyformQueryService.QueryRefundOrScrapApplyform(AssociateApplyformId)); _refundBillLoader = new LazyLoader <NormalRefundBill>(() => DistributionQueryService.QueryNormalRefundBill(AssociateApplyformId)); }
internal PostponeRefundBill(decimal applyformId) : base(applyformId) { _payBillLoader = new LazyLoader <PostponePayBill>(() => DistributionQueryService.QueryPostponePayBill(ApplyformId)); }
internal Refundment(Guid id) : base(id) { _paymentLoader = new LazyLoader <Payment>(() => DistributionQueryService.QueryPayment(TradeNo)); }
protected override System.Collections.Generic.IEnumerable <PostponePayDetailBill> GetDetailBills() { return(DistributionQueryService.QueryPostponePayDetailBills(this.BillId)); }
internal NormalRefundBill(decimal orderId, decimal applyformId) : base(applyformId) { OrderId = orderId; _payBillLoader = new LazyLoader <NormalPayBill>(() => DistributionQueryService.QueryNormalPayBill(OrderId)); }
internal NormalRefundRoleBill(Guid id, TradeRole owner) : base(id, owner) { _payRoleBillLoader = new LazyLoader <NormalPayRoleBill>(() => DistributionQueryService.QueryNormalPayRoleBill(this.Id)); }
internal OrderBill(decimal orderId) { this.OrderId = orderId; _mainPayBillLoader = new LazyLoader <NormalPayBill>(() => DistributionQueryService.QueryNormalPayBill(this.OrderId)); _postponePayBillsLoader = new EnumerableLazyLoader <PostponePayBill>(() => DistributionQueryService.QueryPostponePayBills(this.OrderId)); }
internal NormalPayBill(decimal orderId) : base(orderId) { _refundBillsLoader = new EnumerableLazyLoader <NormalRefundBill>(() => DistributionQueryService.QueryNormalRefundBills(OrderId)); }
void initLazyLoader() { _payBillLoader = new LazyLoader <PostponePayBill>(() => DistributionQueryService.QueryPostponePayBill(this.Id)); }
void initLazyLoader() { _refundBillLoader = new LazyLoader <NormalRefundBill>(() => DistributionQueryService.QueryNormalRefundBill(this.Id)); }
protected override System.Collections.Generic.IEnumerable <NormalRefundDetailBill> GetDetailBills() { return(DistributionQueryService.QueryNormalRefundDetailBills(this.BillId)); }