| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | } |
| | | return (true, "æå", inboundOrderAddDTO); |
| | | } |
| | | |
| | | public WebResponseContent GetInboundOrder(InboundOrderGetDTO inboundOrderGetDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Expression<Func<Dt_InboundOrder, bool>> expressionOrder = x => true; |
| | | if (!string.IsNullOrEmpty(inboundOrderGetDTO.OrderNo)) |
| | | { |
| | | expressionOrder = x => x.OrderNo.Contains(inboundOrderGetDTO.OrderNo); |
| | | } |
| | | int count = BaseDal.QueryData(x => x.OrderStatus == InboundStatusEnum.æªå¼å§.ObjToInt()).ToList().Count(); |
| | | int maxPage = Convert.ToInt32(Math.Ceiling(count / 10.0)); |
| | | if (inboundOrderGetDTO.pageNo <= maxPage) |
| | | { |
| | | var inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(expressionOrder).OrderByDescending(x => x.CreateDate).Skip((inboundOrderGetDTO.pageNo - 1) * 10).Take(10).Select(x => new Dt_InboundOrder { OrderNo = x.OrderNo, Id = x.Id, CreateDate = x.CreateDate,Creater=x.Creater }).ToList(); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: inboundOrder); |
| | | } |
| | | else |
| | | { |
| | | content = WebResponseContent.Instance.OK(data: null, message: "已尿åä¸é¡µ"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"æ¥è¯¢å
¥åºåæ®é误,é误信æ¯:{ex.Message}"); |
| | | } |
| | | |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent GetInboundOrderDetail(string OrderNo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_InboundOrder inboundOrder = BaseDal.QueryFirst(x => x.OrderNo==OrderNo); |
| | | |
| | | var inboundOrderDetail = BaseDal.Db.Queryable<Dt_InboundOrderDetail>().Where(x=>x.OrderId==inboundOrder.Id).Take(10).Select(x => new Dt_InboundOrderDetail { MaterielCode = x.MaterielCode, MaterielName = x.MaterielName, OrderQuantity = x.OrderQuantity, ReceiptQuantity = x.ReceiptQuantity, OverInQuantity=x.OverInQuantity }).ToList(); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: inboundOrderDetail); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"æ¥è¯¢å
¥åºåæ®æç»é误,é误信æ¯:{ex.Message}"); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |