/// <summary> /// 单号查询 /// </summary> /// <param name="OrderNum"></param> /// <returns></returns> public IHttpActionResult Get(string OrderNum) { var inStorage = new InStorageService(); var list = inStorage.GetAll().Where(item => item.OrderNum.IndexOf(OrderNum) != -1); return(Json(list)); }
public IHttpActionResult GetMaxOrderNum() { var inStorage = new InStorageService(); var maxCode = inStorage.GetAll().Select(item => item.OrderNum).LastOrDefault(); return(Json(maxCode)); }
public IHttpActionResult InStoCount([FromUri] InStoCountDto inStoCountDto) { if (inStoCountDto.sky == 0) { inStoCountDto.StartTime = DateTime.Now.AddYears(-5); inStoCountDto.EndTime = DateTime.Now.AddYears(1); } else if (inStoCountDto.sky == 1) { inStoCountDto.StartTime = DateTime.Now.AddDays(-60); inStoCountDto.EndTime = DateTime.Now; } else if (inStoCountDto.sky == 2) { inStoCountDto.StartTime = DateTime.Now.AddDays(-30); inStoCountDto.EndTime = DateTime.Now; } else if (inStoCountDto.sky == 3) { inStoCountDto.StartTime = DateTime.Now.AddDays(-10); inStoCountDto.EndTime = DateTime.Now; } var InStoCountService = new InStorageCountService(); var listSto = InStoCountService.GetByTime(inStoCountDto.StartTime, inStoCountDto.EndTime); var inStorage = new InStorageService(); var InStolist = inStorage.GetAll().Where(item => item.IsDelete != 1 && item.CreateTime >= inStoCountDto.StartTime && item.CreateTime <= inStoCountDto.EndTime).Select(item => new { OrderNum = item.OrderNum, SupName = item.SupName, ContactName = item.ContactName, Phone = item.Phone, CreateTime = item.CreateTime.ToString("yyyy-MM-dd"), Num = item.Num, Amount = item.Amount }); var result = new { list = listSto, InList = InStolist }; return(Json(result)); }
public IHttpActionResult GetByOrder(string OrderNum) { var inStorageService = new InStorageService(); var inStorageList = inStorageService.GetAll().Where(item => item.OrderNum == OrderNum); var inStorageDetailService = new InStorageDetailService(); var inStorageDetailList = inStorageDetailService.GetAll().Where(item => item.OrderNum == OrderNum); var listObj = new List <Object>(); inStorageDetailList.ToList().ForEach(item => { var location = new LocationService(); var locationName = location.FindByLocalNum(item.LocalNum); var obj = new { ID = item.ID, OrderNum = item.OrderNum, ProductName = item.ProductName, ProductNum = item.ProductNum, BarCode = item.BarCode, BatchNum = item.BatchNum, Num = item.Num, InPrice = item.InPrice, Amount = item.Amount, LocalName = locationName.LocalName, LocalNum = locationName.LocalNum, }; listObj.Add(obj); }); var result = new { InStorageList = inStorageList, InStorageDetailList = listObj }; return(Json(result)); }