Ejemplo n.º 1
0
        public HttpResponseMessage PrintTicketCallBack()
        {
            factory = new PrintTicketFactory();
            domain  = factory.CreateDomainObj();

            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        orderDomain        = orderDomainFactory.CreateUpdateOrderDomainObj();

            IAccountDomainFactory accountDomainFactory = new AccountDomainFactory();
            IAccountDomain        accountDomain        = accountDomainFactory.CreateDomainObj();

            domain.OrderTicketEvent      += orderDomain.DoOrderTicketEvent;
            orderDomain.PaySupplierEvent += accountDomain.DoPaySupplierEvent;
            var str = domain.DoPrintTicket();

            domain.OrderTicketEvent      -= orderDomain.DoOrderTicketEvent;
            orderDomain.PaySupplierEvent -= accountDomain.DoPaySupplierEvent;

            LogHelper.WriteLog("确认出票回调:" + str, "CallBack");

            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent("SUCCESS", Encoding.UTF8);
            return(response);
        }
Ejemplo n.º 2
0
        public HttpResponseMessage RefundCallBack()
        {
            try
            {
                factory = new RefundTicketFactory();
                domain  = factory.CreateDomainObj();
                IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
                IOrderDomain        traOrderDomain     = orderDomainFactory.CreateUpdateOrderDomainObj();

                IAccountDomainFactory accountDomainFactory = new AccountDomainFactory();
                IAccountDomain        accountDomain        = accountDomainFactory.CreateDomainObj();

                domain.RefundCallBackEvent          += traOrderDomain.RefundTicketCallBackEvent;
                traOrderDomain.CollectSupplierEvent += accountDomain.DoCollectSupplierEvent;
                domain.DoRefundTicket();
                domain.RefundCallBackEvent          -= traOrderDomain.RefundTicketCallBackEvent;
                traOrderDomain.CollectSupplierEvent -= accountDomain.DoCollectSupplierEvent;
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("Api异常信息:" + ex.Message + "||||||报错路径:" + ex.StackTrace, "MojoryException");
            }
            //不用管异常处理,强制返回一个success,这样就能收到退款
            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent("SUCCESS", Encoding.UTF8);
            return(response);
        }
Ejemplo n.º 3
0
        public ResponseBaseViewModel <TraOrderConfirmResponseViewModel> GetOrderConfirm([FromBody] TraOrderConfirmViewModel request)
        {
            #region 生产环境,测试帐号不许出票,直接返回
            string testCid = AppSettingsHelper.GetAppSettings(AppSettingsEnum.TestCid);//生产环境,测试帐号不许出票
            if (testCid == this.GetCid().ToString())
            {
                return(new ResponseBaseViewModel <TraOrderConfirmResponseViewModel>()
                {
                    Flag = new ResponseCodeViewModel()
                    {
                        Code = 0
                    },
                    Data = new TraOrderConfirmResponseViewModel()
                    {
                        OrderID = request.OrderID,
                        OrderNumber = request.TransactionID
                    }
                });
            }
            #endregion

            factory = new OrderConfirmFactory();
            domain  = factory.CreateDomainObj();
            TraOrderConfirmModel orderConfirmModel = new TraOrderConfirmModel()
            {
                orderid       = request.OrderID,
                transactionid = request.TransactionID
            };

            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        orderDomain        = orderDomainFactory.CreateUpdateOrderDomainObj();

            domain.OrderConfirmEvent += orderDomain.DoOrderConfirmEvent;
            var obj = domain.DoOrderConfirm(orderConfirmModel);
            domain.OrderConfirmEvent -= orderDomain.DoOrderConfirmEvent;

            var uiModel = new ResponseBaseViewModel <TraOrderConfirmResponseViewModel>();
            var flag    = new ResponseCodeViewModel();
            uiModel.Flag = flag;
            TraOrderConfirmResponseViewModel model = new TraOrderConfirmResponseViewModel()
            {
                OrderID     = obj.orderid,
                OrderNumber = obj.ordernumber
            };
            uiModel.Flag.Message = obj.msg;
            uiModel.Data         = model;
            if (obj.code == 100)
            {
                uiModel.Flag.Code = 0;
            }

            return(uiModel);
        }
Ejemplo n.º 4
0
        public HttpResponseMessage ModPrintTicketCallBack()
        {
            factory = new ModPrintTicketFactory();
            domain  = factory.CreateDomainObj();
            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        traOrderDomain     = orderDomainFactory.CreateUpdateOrderDomainObj();

            domain.ModPrintTicketEvent += traOrderDomain.DoModPrintTicketEvent;
            domain.DoModPrintTicket();
            domain.ModPrintTicketEvent -= traOrderDomain.DoModPrintTicketEvent;
            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent("SUCCESS", Encoding.UTF8);
            return(response);
        }
Ejemplo n.º 5
0
        public HttpResponseMessage HoldSeatCallBack()
        {
            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        traOrderDomain     = orderDomainFactory.CreateUpdateOrderDomainObj();

            factory = new HoldSeatFactory();
            domain  = factory.CreateDomainObj();

            domain.TraHoldSeatCallBackEvent += traOrderDomain.DoTraHoldSeatCallBackEvent;
            bool flag = domain.DoHoldSeat();

            domain.TraHoldSeatCallBackEvent -= traOrderDomain.DoTraHoldSeatCallBackEvent;
            var response = Request.CreateResponse(HttpStatusCode.OK);

            if (flag)
            {
                response.Content = new StringContent("SUCCESS", Encoding.UTF8);
                return(response);
            }

            response.Content = new StringContent("ERROR", Encoding.UTF8);
            return(response);
        }