コード例 #1
0
        public int SyncReport(string channel)
        {
            var endTime = DateTime.Now.ToString("yyyy-MM-dd");
            //endTime = "2018-09-09";
            //var startTime = DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd");
            var req = new GetReportReq()
            {
                _Channels = channel,
                startTime = endTime,
                endTime   = endTime,
                timeType  = "0"
            };
            var report = apiClient.GetReport(req);

            List <P_ORDER_XMS_REPORT> list = report.listReport.Select(a => new P_ORDER_XMS_REPORT()
            {
                XmsOrderId       = a.ipathOrderId,
                totalFee         = a.totalFee,
                customerPickup   = string.IsNullOrEmpty(a.customerPickup) ? string.Empty : a.customerPickup,
                cancelFeedback   = string.IsNullOrEmpty(a.cancelFeedback) ? string.Empty : a.cancelFeedback,
                cancelFailReason = string.IsNullOrEmpty(a.cancelFailReason) ? string.Empty : a.cancelFailReason,
                feeModifyReason  = string.IsNullOrEmpty(a.feeModifyReason) ? string.Empty : a.feeModifyReason,
                bookState        = string.IsNullOrEmpty(a.bookState) ? string.Empty : a.bookState,
                cancelState      = string.IsNullOrEmpty(a.cancelState) ? string.Empty : a.cancelState,
                TYYYDRDC         = string.IsNullOrEmpty(a.TYYYDRDC) ? string.Empty : a.TYYYDRDC,
                TYDBDRDC         = string.IsNullOrEmpty(a.TYDBDRDC) ? string.Empty : a.TYDBDRDC,
                TYDBTYYYDRDC     = string.IsNullOrEmpty(a.TYDBTYYYDRDC) ? string.Empty : a.TYDBTYYYDRDC,
                CHRSDYLS         = string.IsNullOrEmpty(a.CHRSDYLS) ? string.Empty : a.CHRSDYLS,
                CHRSXYLSDDFSDYLS = string.IsNullOrEmpty(a.CHRSXYLSDDFSDYLS) ? string.Empty : a.CHRSXYLSDDFSDYLS,
                TYCTDRDC         = string.IsNullOrEmpty(a.TYCTDRDC) ? string.Empty : a.TYCTDRDC,
                TYDBTYCTDRDC     = string.IsNullOrEmpty(a.TYDBTYCTDRDC) ? string.Empty : a.TYDBTYCTDRDC,
                TYDBTYYYTYCTDRDC = string.IsNullOrEmpty(a.TYDBTYYYTYCTDRDC) ? string.Empty : a.TYDBTYYYTYCTDRDC,
            }).ToList();

            if (list.Count > 0)
            {
                return(orderService.SyncReport(list));
            }

            return(1);
        }
コード例 #2
0
        // GET: Test
        public ContentResult Index()
        {
            #region
            //var wc = XFramework.XUtil.ThreadWebClientFactory.GetWebClient();
            //wc.Encoding = Encoding.UTF8;
            //wc.TimeOut = 600000;
            //wc.Headers.Add("Content-Type", "application/json");

            //var param = "{\"requestData\":{\"supplier\":\"xms\",\"sign\":\"292e3aec6d6c32250a1f3ec5ea047a4d0b858259\",\"timestamp\":\"1510800715908\"}}";
            //var rel = wc.UploadData("https://wxm-dev.igskapp.com/NMealH5/P/CallBack/SyncHospital", "POST", Encoding.UTF8.GetBytes(param));

            //var json = Encoding.UTF8.GetString(rel);

            //var req = new GetReportReq()
            //{
            //    _Channels="bds",
            //    startTime="2017-11-13",
            //    endTime="2017-11-19",
            //    timeType="1"
            //};
            ////var guid = new Guid();

            //var res = apiClient.GetReport(req);
            #endregion

            var 请求 = new GetReportReq()
            {
                _Channels = "bds",
                startTime = "2017-11-27",
                endTime   = "2017-12-03",
                timeType  = "1"
            };
            var res = apiClient.GetReport(请求);


            return(Content("ok"));
        }