| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Dynamic; |
| | | using System.Globalization; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Reflection; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | |
| | | _invokeERPService = invokeERPService; |
| | | _warehouseService = warehouseService; |
| | | _palletTypeInfoRepository = palletTypeInfoRepository; |
| | | } |
| | | public override object GetDetailPage(PageDataOptions pageData) |
| | | { |
| | | Type t = typeof(Dt_InboundOrder); |
| | | |
| | | if (pageData.Value == null) return new PageGridData<object>(total: 0, null); |
| | | string keyName = t.GetKeyName(); |
| | | ////çææ¥è¯¢æ¡ä»¶ |
| | | //Expression<Func<TEntity, bool>> whereExpression = keyName.CreateExpression<TEntity>(pageData.Value, LinqExpressionType.Equal); |
| | | int totalCount = 0; |
| | | PropertyInfo propertyInfo = t.GetProperties().FirstOrDefault(x => x.GetCustomAttribute<Navigate>() != null); |
| | | if (propertyInfo != null) |
| | | { |
| | | Type detailType = propertyInfo.PropertyType.GetGenericArguments()[0]; |
| | | Navigate navigate = propertyInfo.GetCustomAttribute<Navigate>(); |
| | | List<Dt_InboundOrderDetail> list = BaseDal.Db.Queryable<Dt_InboundOrderDetail>().Where(navigate.GetName(), "=", pageData.Value).ToPageList(pageData.Page, pageData.Rows, ref totalCount); |
| | | decimal sum = 0; |
| | | list.ForEach(x => |
| | | { |
| | | sum += Convert.ToDecimal(x.OrderQuantity); |
| | | }); |
| | | PageGridData<Dt_InboundOrderDetail> pageGridData = new PageGridData<Dt_InboundOrderDetail>() |
| | | { |
| | | Total= totalCount, |
| | | Rows=list, |
| | | Summary=new |
| | | { |
| | | OrderQuantity = Math.Round(sum, 3), |
| | | } |
| | | }; |
| | | return pageGridData; |
| | | } |
| | | return new PageGridData<object>(total: 0, null); |
| | | } |
| | | /// <summary> |
| | | /// å
¶ä»å
¥åºåæ¥æ¶(è°æå
¥ä»,客ä¾åæ¶,ç©æéå®éè´§) |
| | |
| | | List<Dt_InboundOrder> dt_ReceiveOrders = new List<Dt_InboundOrder>(); |
| | | if (string.IsNullOrEmpty(orderNo)) |
| | | { |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 5); |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).Includes(x=>x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 10); |
| | | } |
| | | else |
| | | { |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => (x.InboundOrderNo.Contains(orderNo)) && x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 5); |
| | | dt_ReceiveOrders = Db.Queryable<Dt_InboundOrder>().Where(x => (x.InboundOrderNo.Contains(orderNo)) && x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt() && x.WarehouseId == warehouseId).Includes(x => x.Details).OrderByDescending(x => x.CreateDate).ToPageList(pageNo, 10); |
| | | } |
| | | |
| | | content.OK(data: dt_ReceiveOrders); |