| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | |
| | | BatchNo = x.FirstOrDefault()?.BatchNo ?? "", |
| | | MaterielCode = x.Key, |
| | | OrderQuantity = x.Sum(x => x.OrderQuantity), |
| | | MaterielName= x.FirstOrDefault()?.MaterielName ?? "", |
| | | Remark = x.FirstOrDefault(v => !string.IsNullOrEmpty(v.Remark))?.Remark ?? "" |
| | | }).ToList(); |
| | | return AddOutboundOrder(outboundOrder); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent GetOutboundOrder(OutboundOrderGetDTO outboundOrderGetDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Expression<Func<Dt_OutboundOrder, bool>> expressionOrder = x => true; |
| | | if (!string.IsNullOrEmpty(outboundOrderGetDTO.OrderNo)) |
| | | { |
| | | expressionOrder = x => x.OrderNo.Contains(outboundOrderGetDTO.OrderNo); |
| | | } |
| | | int count = BaseDal.QueryData(x => x.OrderStatus == OutboundStatusEnum.æªå¼å§.ObjToInt()).ToList().Count(); |
| | | int maxPage = Convert.ToInt32(Math.Ceiling(count / 10.0)); |
| | | if (outboundOrderGetDTO.pageNo <= maxPage) |
| | | { |
| | | var outboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(expressionOrder).OrderByDescending(x => x.CreateDate).Skip((outboundOrderGetDTO.pageNo - 1) * 10).Take(10).Select(x => new Dt_OutboundOrder { OrderNo = x.OrderNo, Id = x.Id, CreateDate = x.CreateDate, Creater = x.Creater }).ToList(); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: outboundOrder); |
| | | } |
| | | else |
| | | { |
| | | content = WebResponseContent.Instance.OK(data: null, message: "已尿åä¸é¡µ"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"æ¥è¯¢åºåºåæ®é误,é误信æ¯:{ex.Message}"); |
| | | } |
| | | |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent GetOutboundOrderDetail(string OrderNo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_OutboundOrder outboundOrder = BaseDal.QueryFirst(x => x.OrderNo == OrderNo); |
| | | |
| | | var outboundOrderDetail = BaseDal.Db.Queryable<Dt_OutboundOrderDetail>().Where(x => x.OrderId == outboundOrder.Id).Take(10).Select(x => new Dt_OutboundOrderDetail {Id=x.Id, MaterielCode = x.MaterielCode, MaterielName = x.MaterielName, OrderQuantity = x.OrderQuantity, OverOutQuantity = x.OverOutQuantity, LockQuantity = x.LockQuantity }).ToList(); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: outboundOrderDetail); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"æ¥è¯¢åºåºåæ®æç»é误,é误信æ¯:{ex.Message}"); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |