예제 #1
0
        public void VerifyTicket()
        {
            var list = _noticeOrderConsumedService.GetList();

            foreach (var row in list)
            {
                if (row.IdentityKey.ToLower() == CtripConfig.MyAccountId.ToLower())
                {
                    var isSuccess = _ctripGateway.NoticeOrderConsumed(new NoticeOrderConsumedBodyRequest
                    {
                        OtaOrderId      = row.OtaOrderId,
                        SupplierOrderId = row.OrderNo,
                        SequenceId      = row.SequenceId,
                        items           = new List <NoticeOrderConsumedItemRequest> {
                            new NoticeOrderConsumedItemRequest {
                                itemId      = row.OtaOrderDetailId,
                                quantity    = row.Count,
                                useQuantity = row.Count
                            }
                        }
                    });
                    row.RunCount++;
                    if (isSuccess)
                    {
                        row.RunCount = 3;
                    }
                    _noticeOrderConsumedService.Update(row.OrderNo, row.RunCount);
                    Console.Write("订单消费通知,携程订单号:" + row.OrderNo + "  是否成功: " + isSuccess);
                }
                else if (row.IdentityKey.ToLower() == TongChengConfig.MyAccountId.ToLower())
                {
                    //var isSuccess = _tongChengGateway.NoticeOrderConsumed(new ConsumeNoticeRequest
                    //{
                    //    orderSerialId = row.OtaOrderId,
                    //    partnerOrderId = row.OrderNo,
                    //    tickets = row.Count,
                    //    consumeDate = row.UseDate.Value.ToString("yyyy-MM-dd HH:mm:ss"),
                    //});
                    //row.RunCount++;
                    //if (isSuccess)
                    //{
                    //    row.RunCount = 3;
                    //}
                    //_noticeOrderConsumedService.Update(row.OrderNo, row.RunCount);
                    //Console.Write("同城订单号:" + row.OrderNo + "  是否成功: " + isSuccess);
                }
            }
        }
        public void VerifyTicket()
        {
            var list = _noticeOrderConsumedService.GetList();

            foreach (var row in list)
            {
                if (row.IdentityKey.ToLower() == CtripConfig.MyAccountId.ToLower())
                {
                    var isSuccess = _ctripGateway.NoticeOrderConsumed(new NoticeOrderConsumedBody
                    {
                        otaOrderId    = row.OtaOrderId,
                        vendorOrderId = row.OrderNo,
                        cancelCount   = 0,
                        count         = row.Count,
                        useCount      = row.Count,
                        useDate       = row.UseDate.Value.ToString("yyyy-MM-dd")
                    });
                    row.RunCount++;
                    if (isSuccess)
                    {
                        row.RunCount = 3;
                    }
                    _noticeOrderConsumedService.Update(row.OrderNo, row.RunCount);
                    Console.Write("携程订单号:" + row.OrderNo + "  是否成功: " + isSuccess);
                }
                else if (row.IdentityKey.ToLower() == TongChengConfig.MyAccountId.ToLower())
                {
                    //var isSuccess = _tongChengGateway.NoticeOrderConsumed(new ConsumeNoticeRequest
                    //{
                    //    orderSerialId = row.OtaOrderId,
                    //    partnerOrderId = row.OrderNo,
                    //    tickets = row.Count,
                    //    consumeDate = row.UseDate.Value.ToString("yyyy-MM-dd HH:mm:ss"),
                    //});
                    //row.RunCount++;
                    //if (isSuccess)
                    //{
                    //    row.RunCount = 3;
                    //}
                    //_noticeOrderConsumedService.Update(row.OrderNo, row.RunCount);
                    //Console.Write("同城订单号:" + row.OrderNo + "  是否成功: " + isSuccess);
                }
            }
        }