/// <summary> /// Anies the specified request. /// </summary> /// <param name="request">The request.</param> /// <returns>System.Object.</returns> /// <remarks>聚石塔WebService</remarks> public object Any(GetJXTrade request) { logger.Debug(JsonConvert.SerializeObject(request)); JXTradeValidator validator = new JXTradeValidator(); ValidationResult results = validator.Validate(request); if (!results.IsValid) { logger.Error(JsonConvert.SerializeObject(results)); return(results); } using (RDSContext db = new RDSContext()) { IQueryable <jdp_jx_trade> q = db.jdp_jx_trade; //0:淘宝推送时间;1:订单修改时间;默认0 if (request.DateType == 0) { q = q.Where(u => u.jdp_modified >= request.StartDateTime && u.jdp_modified <= request.EndDateTime).OrderBy(m => m.jdp_modified); } else { q = q.Where(u => u.modified_time >= request.StartDateTime && u.modified_time <= request.EndDateTime).OrderBy(m => m.modified_time); } //订单状态 if (request.OrderStatus != 0) { q = q.Where(u => u.order_status == ((JXTradeStatus )request.OrderStatus).ToString()); } if (request.DealerOrderId != 0) { q = q.Where(u => u.dealer_order_id == request.DealerOrderId); } if (!string.IsNullOrEmpty(request.SupplierNick)) { q = q.Where(u => u.supplier_nick == request.SupplierNick); } if (!string.IsNullOrEmpty(request.ApplierNick)) { q = q.Where(u => u.applier_nick == request.ApplierNick); } DefaultResponse response = new DefaultResponse(); response.PageSize = request.PageSize; response.RecordCount = q.Count(); response.PageCount = (int)Math.Ceiling(response.RecordCount * 1.00 / response.PageSize); response.Result = q.Skip(request.PageNo * request.PageSize).Take(request.PageSize).Select(u => u.jdp_response).ToList(); logger.Debug(JsonConvert.SerializeObject(results)); return(response); } }
/// <summary> /// Anies the specified request. /// </summary> /// <param name="request">The request.</param> /// <returns>System.Object.</returns> /// <remarks>聚石塔WebService</remarks> public object Any(GetJXTrade request) { logger.Debug(JsonConvert.SerializeObject(request)); JXTradeValidator validator = new JXTradeValidator(); ValidationResult results = validator.Validate(request); if (!results.IsValid) { logger.Error(JsonConvert.SerializeObject(results)); return results; } using (RDSContext db = new RDSContext()) { IQueryable<jdp_jx_trade> q = db.jdp_jx_trade; //0:淘宝推送时间;1:订单修改时间;默认0 if (request.DateType == 0) { q = q.Where(u => u.jdp_modified >= request.StartDateTime && u.jdp_modified <= request.EndDateTime).OrderBy(m => m.jdp_modified); } else { q = q.Where(u => u.modified_time >= request.StartDateTime && u.modified_time <= request.EndDateTime).OrderBy(m => m.modified_time); } //订单状态 if (request.OrderStatus != 0) { q = q.Where(u => u.order_status == ((JXTradeStatus )request.OrderStatus).ToString()); } if (request.DealerOrderId != 0) { q = q.Where(u => u.dealer_order_id == request.DealerOrderId ); } if (!string.IsNullOrEmpty(request.SupplierNick )) { q = q.Where(u => u.supplier_nick == request.SupplierNick); } if (!string.IsNullOrEmpty(request.ApplierNick )) { q = q.Where(u => u.applier_nick == request.ApplierNick); } DefaultResponse response = new DefaultResponse(); response.PageSize = request.PageSize; response.RecordCount = q.Count(); response.PageCount = (int)Math.Ceiling(response.RecordCount * 1.00 / response.PageSize); response.Result = q.Skip(request.PageNo * request.PageSize).Take(request.PageSize).Select(u => u.jdp_response).ToList(); logger.Debug(JsonConvert.SerializeObject(results)); return response; } }