Esempio n. 1
0
        /// <summary>
        /// 查询单据详细数据分页
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public override List <BadReportDetailEntity> GetDetailList(BadReportDetailEntity entity, ref Framework.DataTypes.PageInfo pageInfo)
        {
            BadReportDetailEntity detail = new BadReportDetailEntity();

            detail.Where(a => a.OrderNum == entity.OrderNum);
            detail.IncludeAll();
            detail.OrderBy(a => a.ID, EOrderBy.DESC);
            int rowCount = 0;
            List <BadReportDetailEntity> listResult = this.BadReportDetail.GetList(detail, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;
            if (!listResult.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider().GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (BadReportDetailEntity item in listResult)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.FromLocalNum);
                    item.FromLocalName = location == null ? "" : location.LocalName;

                    location         = listLocation.FirstOrDefault(a => a.LocalNum == item.ToLocalNum);
                    item.ToLocalName = location == null ? "" : location.LocalName;
                    if (item.Amount == 0)
                    {
                        item.Amount = item.InPrice * item.Num;
                    }
                }
            }
            return(listResult);
        }
Esempio n. 2
0
        /// <summary>
        /// 获得单据详细信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override List <BadReportDetailEntity> GetOrderDetail(BadReportDetailEntity entity)
        {
            BadReportDetailEntity detail = new BadReportDetailEntity();

            detail.IncludeAll();
            detail.Where(a => a.OrderNum == entity.OrderNum);
            List <BadReportDetailEntity> list = this.BadReportDetail.GetList(detail);

            if (!list.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider().GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (BadReportDetailEntity item in list)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.FromLocalNum);
                    item.FromLocalName = location == null ? "" : location.LocalName;

                    location         = listLocation.FirstOrDefault(a => a.LocalNum == item.ToLocalNum);
                    item.ToLocalName = location == null ? "" : location.LocalName;
                    if (item.Amount == 0)
                    {
                        item.Amount = item.InPrice * item.Num;
                    }
                }
            }
            return(list);
        }
Esempio n. 3
0
        /// <summary>
        /// 获得单据详细信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override List <MoveOrderDetailEntity> GetOrderDetail(MoveOrderDetailEntity entity)
        {
            MoveOrderDetailEntity detail = new MoveOrderDetailEntity();

            detail.IncludeAll();
            detail.Where(a => a.OrderSnNum == entity.OrderSnNum)
            .And(a => a.CompanyID == this.CompanyID);

            ProductEntity product = new ProductEntity();

            product.Include(a => new { Size = a.Size });
            detail.Left <ProductEntity>(product, new Params <string, string>()
            {
                Item1 = "ProductNum", Item2 = "SnNum"
            });
            List <MoveOrderDetailEntity> list = this.MoveOrderDetail.GetList(detail);

            if (!list.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider(this.CompanyID).GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (MoveOrderDetailEntity item in list)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.FromLocalNum);
                    item.FromLocalName = location == null ? "" : location.LocalName;
                    item.StorageName   = location == null ? "" : location.StorageName;

                    location         = listLocation.FirstOrDefault(a => a.LocalNum == item.ToLocalNum);
                    item.ToLocalName = location == null ? "" : location.LocalName;
                }
            }
            return(list);
        }
Esempio n. 4
0
        /// <summary>
        /// 获得单据详细信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override List <OutStoDetailEntity> GetOrderDetail(OutStoDetailEntity entity)
        {
            ProductProvider    provider = new ProductProvider();
            OutStoDetailEntity detail   = new OutStoDetailEntity();

            detail.IncludeAll();
            detail.Where(a => a.OrderNum == entity.OrderNum);
            List <OutStoDetailEntity> list = this.OutStoDetail.GetList(detail);

            if (!list.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider().GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (OutStoDetailEntity item in list)
                {
                    ProductEntity pro = new ProductEntity();
                    pro = provider.GetProductBySn2(item.ProductNum);
                    //item.Size = pro.Size;
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.LocalNum);
                    item.LocalName = location == null ? "" : location.LocalName;

                    if (item.Amount == 0)
                    {
                        item.Amount = item.OutPrice * item.Num;
                    }
                }
            }
            return(list);
        }
Esempio n. 5
0
        /// <summary>
        /// 获得单据详细信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override List <InStorDetailEntity> GetOrderDetail(InStorDetailEntity entity)
        {
            InStorDetailEntity detail = new InStorDetailEntity();

            detail.IncludeAll();
            detail.Where(a => a.OrderSnNum == entity.OrderSnNum)
            .And(a => a.CompanyID == this.CompanyID)
            ;
            List <InStorDetailEntity> list = this.InStorDetail.GetList(detail);

            if (!list.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider(this.CompanyID).GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                List <ProductEntity> listProduct = new ProductProvider(this.CompanyID).GetList();
                listProduct = listProduct == null ? new List <ProductEntity>() : listProduct;
                foreach (InStorDetailEntity item in list)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.LocalNum);
                    item.LocalName   = location == null ? "" : location.LocalName;
                    item.StorageName = location == null ? "" : location.StorageName;

                    ProductEntity product = listProduct.FirstOrDefault(a => a.SnNum == item.ProductNum);
                    item.Size = product.IsNull() ? string.Empty : product.Size;
                }
            }
            return(list);
        }
Esempio n. 6
0
        /// <summary>
        /// 获得单据详细信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override List <CheckStockInfoEntity> GetOrderDetail(CheckStockInfoEntity entity)
        {
            CheckStockInfoEntity detail = new CheckStockInfoEntity();

            detail.IncludeAll();
            detail.Where(a => a.OrderNum == entity.OrderNum);
            List <CheckStockInfoEntity> list = this.CheckStockInfo.GetList(detail);

            if (!list.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider().GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (CheckStockInfoEntity item in list)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.TargetNum);
                    item.LocalName = location == null ? "" : location.LocalName;
                }
            }
            return(list);
        }
Esempio n. 7
0
        /// <summary>
        /// 获得订单详细查询
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public List <OutStoDetailEntity> GetOrderDetail(OutStoDetailEntity entity)
        {
            entity.IncludeAll();
            List <OutStoDetailEntity> list = this.OutStoDetail.GetList(entity);

            if (!list.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider().GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (OutStoDetailEntity item in list)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.LocalNum);
                    item.LocalName = location == null ? "" : location.LocalName;
                    if (item.Amount == 0)
                    {
                        item.Amount = item.OutPrice * item.Num;
                    }
                }
            }
            return(list);
        }
Esempio n. 8
0
        /// <summary>
        /// 查询单据详细数据分页
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public override List <CheckStockInfoEntity> GetDetailList(CheckStockInfoEntity entity, ref Framework.DataTypes.PageInfo pageInfo)
        {
            CheckStockInfoEntity detail = new CheckStockInfoEntity();

            detail.Where(a => a.OrderNum == entity.OrderNum);
            detail.IncludeAll();
            detail.OrderBy(a => a.ID, EOrderBy.DESC);
            int rowCount = 0;
            List <CheckStockInfoEntity> listResult = this.CheckStockInfo.GetList(detail, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;
            if (!listResult.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider().GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (CheckStockInfoEntity item in listResult)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.TargetNum);
                    item.LocalName = location == null ? "" : location.LocalName;
                }
            }
            return(listResult);
        }
Esempio n. 9
0
        /// <summary>
        /// 查询单据详细数据分页
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public override List <InStorDetailEntity> GetDetailList(InStorDetailEntity entity, ref PageInfo pageInfo)
        {
            InStorDetailEntity detail = new InStorDetailEntity();

            detail.IncludeAll();
            detail.OrderBy(a => a.ID, EOrderBy.DESC);
            detail.Where(a => a.CompanyID == this.CompanyID);

            if (!entity.BarCode.IsEmpty())
            {
                detail.And("BarCode", ECondition.Like, "%" + entity.BarCode + "%");
            }
            if (!entity.ProductName.IsEmpty())
            {
                detail.And("ProductName", ECondition.Like, "%" + entity.ProductName + "%");
            }
            if (!entity.StorageNum.IsEmpty())
            {
                detail.And(a => a.StorageNum == entity.StorageNum);
            }

            ProductEntity product = new ProductEntity();

            product.Include(item => new { Size = item.Size });
            detail.Left <ProductEntity>(product, new Params <string, string>()
            {
                Item1 = "ProductNum", Item2 = "SnNum"
            });

            InStorageEntity InOrder = new InStorageEntity();

            InOrder.Include(a => new { OrderNum = a.OrderNum, SupNum = a.SupNum, SupName = a.SupName, OrderTime = a.OrderTime, Status = a.Status, InType = a.InType, AuditeTime = a.AuditeTime });
            detail.Left <InStorageEntity>(InOrder, new Params <string, string>()
            {
                Item1 = "OrderSnNum", Item2 = "SnNum"
            });
            InOrder.And(a => a.IsDelete == (int)EIsDelete.NotDelete);
            if (!entity.SupNum.IsEmpty())
            {
                InOrder.AndBegin <InStorageEntity>()
                .And <InStorageEntity>("SupNum", ECondition.Like, "%" + entity.SupNum + "%")
                .Or <InStorageEntity>("SupName", ECondition.Like, "%" + entity.SupNum + "%")
                .End <InStorageEntity>()
                ;
            }
            if (!entity.SupName.IsEmpty())
            {
                InOrder.AndBegin <InStorageEntity>()
                .And <InStorageEntity>("SupNum", ECondition.Like, "%" + entity.SupName + "%")
                .Or <InStorageEntity>("SupName", ECondition.Like, "%" + entity.SupName + "%")
                .End <InStorageEntity>()
                ;
            }
            if (!entity.BeginTime.IsEmpty())
            {
                DateTime time = ConvertHelper.ToType <DateTime>(entity.BeginTime, DateTime.Now.Date.AddDays(-1));
                InOrder.And(a => a.CreateTime >= time);
            }
            if (!entity.EndTime.IsEmpty())
            {
                DateTime time = ConvertHelper.ToType <DateTime>(entity.EndTime, DateTime.Now.Date.AddDays(1));
                InOrder.And(a => a.CreateTime < time);
            }
            if (entity.Status > 0)
            {
                InOrder.And(item => item.Status == entity.Status);
            }
            if (entity.CreateUser.IsNotEmpty())
            {
                InOrder.And(item => item.CreateUser == entity.CreateUser);
            }
            if (entity.InType > 0)
            {
                InOrder.And(item => item.InType == entity.InType);
            }
            if (entity.OrderNum.IsNotEmpty())
            {
                InOrder.And("OrderNum", ECondition.Like, "%" + entity.OrderNum + "%");
            }
            if (entity.ContractOrder.IsNotEmpty())
            {
                InOrder.And("ContractOrder", ECondition.Like, "%" + entity.ContractOrder + "%");
            }
            AdminEntity admin = new AdminEntity();

            admin.Include(a => new { CreateUserName = a.UserName });
            InOrder.Left <AdminEntity>(admin, new Params <string, string>()
            {
                Item1 = "CreateUser", Item2 = "UserNum"
            });

            AdminEntity auditeUser = new AdminEntity();

            auditeUser.Include(a => new { AuditeUserName = a.UserName });
            InOrder.Left <AdminEntity>(auditeUser, new Params <string, string>()
            {
                Item1 = "AuditUser", Item2 = "UserNum"
            });

            int rowCount = 0;
            List <InStorDetailEntity> listResult = this.InStorDetail.GetList(detail, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;
            if (!listResult.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider(this.CompanyID).GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;
                foreach (InStorDetailEntity item in listResult)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.LocalNum);
                    item.LocalName   = location == null ? "" : location.LocalName;
                    item.StorageName = location == null ? "" : location.StorageName;
                }
            }
            return(listResult);
        }
Esempio n. 10
0
        /// <summary>
        /// 查询单据详细数据分页
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public override List <MoveOrderDetailEntity> GetDetailList(MoveOrderDetailEntity entity, ref Framework.DataTypes.PageInfo pageInfo)
        {
            MoveOrderDetailEntity detail = new MoveOrderDetailEntity();

            detail
            .And(a => a.CompanyID == this.CompanyID);

            if (entity.OrderSnNum.IsNotEmpty())
            {
                detail.And(item => item.OrderSnNum == entity.OrderSnNum);
            }
            if (entity.ProductName.IsNotEmpty())
            {
                detail.And("ProductName", ECondition.Like, "%" + entity.ProductName + "%");
            }
            if (entity.BarCode.IsNotEmpty())
            {
                detail.And("BarCode", ECondition.Like, "%" + entity.BarCode + "%");
            }
            detail.IncludeAll();
            detail.OrderBy(a => a.ID, EOrderBy.DESC);

            MoveOrderEntity moveOrder = new MoveOrderEntity();

            moveOrder.Include(item => new { Status = item.Status, MoveType = item.MoveType, AuditeTime = item.AuditeTime });
            detail.Left <MoveOrderEntity>(moveOrder, new Params <string, string>()
            {
                Item1 = "OrderSnNum", Item2 = "SnNum"
            });
            moveOrder.And(item => item.IsDelete == (int)EIsDelete.NotDelete);
            if (entity.OrderNum.IsNotEmpty())
            {
                moveOrder.And("OrderNum", ECondition.Like, "%" + entity.OrderNum + "%");
            }
            if (entity.Status > 0)
            {
                moveOrder.And(item => item.Status == entity.Status);
            }
            if (entity.BeginTime.IsNotEmpty())
            {
                DateTime begin = ConvertHelper.ToType <DateTime>(entity.BeginTime, DateTime.Now.AddDays(-10)).Date;
                moveOrder.And(item => item.CreateTime >= begin);
            }
            if (entity.EndTime.IsNotEmpty())
            {
                DateTime end = ConvertHelper.ToType <DateTime>(entity.EndTime, DateTime.Now).AddDays(1).Date;
                moveOrder.And(item => item.CreateTime < end);
            }
            if (entity.MoveType > 0)
            {
                moveOrder.And(item => item.MoveType == entity.MoveType);
            }
            if (entity.StorageNum.IsNotEmpty())
            {
                moveOrder.And(item => item.StorageNum == entity.StorageNum);
            }

            AdminEntity admin = new AdminEntity();

            admin.Include(a => new { CreateUserName = a.UserName });
            moveOrder.Left <AdminEntity>(admin, new Params <string, string>()
            {
                Item1 = "CreateUser", Item2 = "UserNum"
            });

            AdminEntity auditeAdmin = new AdminEntity();

            auditeAdmin.Include(a => new { AuditUserName = a.UserName });
            moveOrder.Left <AdminEntity>(auditeAdmin, new Params <string, string>()
            {
                Item1 = "AuditUser", Item2 = "UserNum"
            });

            int rowCount = 0;
            List <MoveOrderDetailEntity> listResult = this.MoveOrderDetail.GetList(detail, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;
            if (!listResult.IsNullOrEmpty())
            {
                List <LocationEntity> listLocation = new LocationProvider(this.CompanyID).GetList();
                listLocation = listLocation == null ? new List <LocationEntity>() : listLocation;

                ProductProvider productProvider = new ProductProvider(this.CompanyID);
                foreach (MoveOrderDetailEntity item in listResult)
                {
                    LocationEntity location = listLocation.FirstOrDefault(a => a.LocalNum == item.FromLocalNum);
                    item.FromLocalName = location == null ? "" : location.LocalName;
                    location           = listLocation.FirstOrDefault(a => a.LocalNum == item.ToLocalNum);
                    item.ToLocalName   = location == null ? "" : location.LocalName;
                    item.StorageName   = location == null ? "" : location.StorageName;

                    ProductEntity productEntity = productProvider.GetProduct(item.ProductNum);
                    item.UnitName = productEntity != null ? productEntity.ProductName : string.Empty;
                    item.Size     = productEntity != null ? productEntity.Size : string.Empty;
                }
            }
            return(listResult);
        }