Ejemplo n.º 1
0
        /// <summary>
        /// 生成支付账单
        /// </summary>
        /// <param name="postponeApplyform">改期申请</param>
        public static Distribution.Domain.Bill.Pay.PostponePayBill ProducePayBill(Order.Domain.Applyform.PostponeApplyform postponeApplyform)
        {
            if (postponeApplyform == null)
            {
                throw new ArgumentNullException("postponeApplyform");
            }
            if (!postponeApplyform.Passengers.Any())
            {
                throw new CustomException("缺少乘机人信息");
            }
            if (!postponeApplyform.Flights.Any())
            {
                throw new CustomException("缺少航段信息");
            }
            if (DistributionQueryService.QueryPostponePayBill(postponeApplyform.Id) != null)
            {
                throw new RepeatedItemException("改期支付账单已存在");
            }

            var payBill = new Distribution.Domain.Bill.Pay.PostponePayBill(postponeApplyform.OrderId, postponeApplyform.Id)
            {
                Remark = "改期收费"
            };
            // 申请方
            var applier = new Distribution.Domain.Role.Purchaser(postponeApplyform.PurchaserId);

            payBill.Applier = applier.MakePayBill(postponeApplyform.Flights, postponeApplyform.Passengers);
            // 受理方
            var accepter = new Distribution.Domain.Role.Platform();

            payBill.Accepter = accepter.MakePayBill(postponeApplyform.Flights, postponeApplyform.Passengers, new[] { payBill.Applier });
            return(payBill);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 采购支付改期费成功
        /// </summary>
        /// <param name="postponeApplyformId">改期申请单号</param>
        /// <param name="payAccount">支付账号</param>
        /// <param name="payTradeNo">支付交易流水号</param>
        /// <param name="payInterface">支付接口</param>
        /// <param name="payAccountType">支付账号类型</param>
        /// <param name="payTime">支付时间</param>
        public static Distribution.Domain.Bill.Pay.PostponePayBill PurchaserPaySuccessForPostpone(decimal postponeApplyformId, string payAccount, string payTradeNo, PayInterface payInterface, PayAccountType payAccountType, DateTime payTime, string channelTradeNo)
        {
            var payBill = DistributionQueryService.QueryPostponePayBill(postponeApplyformId);

            if (payBill == null)
            {
                throw new NotFoundException("无 " + postponeApplyformId + " 的记录");
            }
            payBill.PaySuccess(payAccount, payTradeNo, payInterface, payAccountType, payTime, channelTradeNo);
            return(payBill);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 生成退款账单
        /// </summary>
        /// <param name="postponeApplyformId">改期申请单号</param>
        public static Distribution.Domain.Bill.Refund.PostponeRefundBill ProducePostponeRefundBill(decimal postponeApplyformId)
        {
            var payBill = DistributionQueryService.QueryPostponePayBill(postponeApplyformId);

            if (payBill == null)
            {
                throw new NotFoundException("无 " + postponeApplyformId + " 的支付账单记录");
            }
            if (DistributionQueryService.QueryPostponeRefundBill(postponeApplyformId) != null)
            {
                throw new RepeatedItemException("退款账单已存在");
            }

            return(payBill.MakeRefundBill("拒绝改期"));
        }