private OrderQueryCondition GetCondition() { var condition = new OrderQueryCondition { OrderId = StringUtility.ToNullableDecimal(txtOrderId.Text), PNR = txtPNR.Text.Trim(), Passenger = txtPassenger.Text.Trim(), ProducedDateRange = new Range <DateTime>(DateTime.Parse(txtStartDate.Text), DateTime.Parse(txtEndDate.Text)), Provider = CurrentCompany.CompanyId }; if (!string.IsNullOrWhiteSpace(ddlProduct.SelectedValue)) { condition.ProviderProductType = (ProductType)int.Parse(ddlProduct.SelectedValue); } condition.Status = OrderStatus.PaidForETDZ; condition.Passenger = txtPassenger.Text.Trim(); if (!string.IsNullOrEmpty(ddlOfficeNumber.SelectedValue.Trim())) { condition.OfficeNo = ddlOfficeNumber.SelectedItem.Text.Trim(); } if (!string.IsNullOrEmpty(ddlFlightCompany.SelectedValue.Trim())) { condition.Carrier = ddlFlightCompany.SelectedValue.Trim(); } var setting = CompanyService.GetWorkingSetting(CurrentCompany.CompanyId); if (setting != null && setting.IsImpower) { condition.CustomNo = CompanyService.GetCustomNumberByEmployee(CurrentUser.Id).Join(",", c => c.Number); } return(condition); }
private OrderQueryCondition getCondition() { var condition = new OrderQueryCondition() { OrderId = ChinaPay.Utility.StringUtility.ToNullableDecimal(this.txtOrderId.Text), Passenger = this.txtPassenger.Text.Trim(), ProductType = ProductType.Special, ProducedDateRange = new Core.Range <DateTime>(DateTime.Parse(this.txtStartDate.Text), DateTime.Parse(this.txtEndDate.Text)) }; if (CurrentCompany.CompanyType == Common.Enums.CompanyType.Supplier) { condition.Supplier = CurrentCompany.CompanyId; } else if (CurrentCompany.CompanyType == Common.Enums.CompanyType.Provider) { condition.Provider = CurrentCompany.CompanyId; } if (string.IsNullOrWhiteSpace(this.ddlStatus.SelectedValue)) { condition.Status = OrderStatus.Applied | OrderStatus.PaidForSupply; } else { condition.Status = (OrderStatus)int.Parse(this.ddlStatus.SelectedValue); } return(condition); }
private void process() { showMessage("开始下一批处理"); var condition = new OrderQueryCondition { Status = OrderStatus.Ordered, ProducedDateRange = new Core.Range <DateTime>(DateTime.Today.AddYears(-1), DateTime.Now.AddMinutes(-5)) }; var pagination = new Pagination { GetRowCount = false, PageIndex = 1, PageSize = int.MaxValue }; var orders = Service.OrderQueryService.QueryOrders(condition, pagination); foreach (var order in orders) { if (!_run) { break; } showMessage("开始处理[" + order.ProductType.GetDescription() + "]订单[" + order.OrderId + "]..."); try { Service.OrderProcessService.ProcessWaitForPayOrder(order.OrderId); showMessage("处理成功"); } catch (Exception ex) { showMessage("处理失败" + Environment.NewLine + "原因:" + ex.Message); } System.Threading.Thread.Sleep(50); } showMessage("当前批次处理结束"); }
/// <summary> /// 获取订单列表信息 /// </summary> /// <param name="condition">查询条件</param> /// <param name="pagination">分页信息</param> /// <param name="extendDateTime">是否进行日期扩展(结束日期扩展时间到23:59) </param> public static IEnumerable <OrderListView> QueryOrders(OrderQueryCondition condition, Pagination pagination, bool extendDateTime = true) { if (condition == null) { throw new ArgumentNullException("condition"); } if (pagination == null) { throw new ArgumentNullException("pagination"); } using (var command = Factory.CreateCommand()) { var repository = Factory.CreateOrderRepository(command); return(repository.QueryOrders(condition, pagination, extendDateTime)); } }
private OrderQueryCondition getCondition() { var parameter = new OrderQueryCondition() { PNR = txtPNR.Text.Trim(), Passenger = txtPassenger.Text.Trim(), ProducedDateRange = new Range <DateTime>(DateTime.Parse(txtDateStart.Text.Trim()), DateTime.Parse(txtDateEnd.Text.Trim()).AddDays(1).AddTicks(-1)), }; if (!String.IsNullOrEmpty(txtOrderformId.Text.Trim()) && Regex.IsMatch(txtOrderformId.Text.Trim(), "\\d+")) { parameter.OrderId = decimal.Parse(txtOrderformId.Text.Trim()); } parameter.Purchaser = CurrentCompany.CompanyId; parameter.Status = OrderStatus.Finished; return(parameter); }
/// <summary> /// 平台获取订单列表信息(目的为了处理OEM是否能够联系采购) /// </summary> /// <param name="condition">查询条件</param> /// <param name="pagination">分页信息</param> /// <param name="extendDateTime">是否进行日期扩展(结束日期扩展时间到23:59)</param> /// <returns></returns> public static IEnumerable <OrderListView> QueryOperateOrders(OrderQueryCondition condition, Pagination pagination, bool extendDateTime = true) { var orders = QueryOrders(condition, pagination, extendDateTime); IEnumerable <Guid> oemIds = orders.Where(o => o.OEMID.HasValue).Select(o => o.OEMID.Value).Distinct(); if (oemIds.Any()) { IEnumerable <KeyValuePair <Guid, bool> > oems = OEMService.QueryOEMContractSettings(oemIds); foreach (var item in orders) { item.AllowPlatformContractPurchaser = true; if (!item.OEMID.HasValue) { continue; } var oem = oems.FirstOrDefault(o => o.Key == item.OEMID.Value); item.AllowPlatformContractPurchaser = oem.Key != Guid.Empty && oem.Value; } } return(orders); }
private OrderQueryCondition getCondition() { var condition = new OrderQueryCondition() { OrderId = ChinaPay.Utility.StringUtility.ToNullableDecimal(this.txtOrderId.Text), PNR = this.txtPNR.Text.Trim(), Passenger = this.txtPassenger.Text.Trim(), ProducedDateRange = new Core.Range <DateTime>(DateTime.Parse(this.txtStartDate.Text), DateTime.Parse(this.txtEndDate.Text)), Status = OrderStatus.Ordered, Purchaser = CurrentCompany.CompanyId }; if (!string.IsNullOrWhiteSpace(this.ddlProduct.SelectedValue)) { condition.ProductType = (ProductType)int.Parse(this.ddlProduct.SelectedValue); } if (!string.IsNullOrWhiteSpace(this.ddlOperator.SelectedValue)) { condition.ProducedAccount = this.ddlOperator.SelectedValue; } return(condition); }