Пример #1
0
        private static InventoryDetailEntity TranslateInventoryDetailEntity(InventoryDetailInfo info)
        {
            InventoryDetailEntity entity = new InventoryDetailEntity();

            if (info != null)
            {
                entity.GoodsID       = info.GoodsID;
                entity.StorageID     = info.StorageID;
                entity.Quantity      = info.Quantity;
                entity.CustomerID    = info.CustomerID;
                entity.InventoryType = info.InventoryType;

                entity.BatchNumber   = info.BatchNumber;
                entity.ProductDate   = info.ProductDate;
                entity.InventoryDate = info.InventoryDate;
                entity.UnitPrice     = info.UnitPrice;
                entity.Remark        = info.Remark;

                entity.OrderNo           = info.OrderNo;
                entity.OrderType         = info.OrderType;
                entity.OrderTypeDesc     = StringHelper.getOrderType(info.OrderType);
                entity.OperatorID        = info.OperatorID;
                entity.CreateDate        = info.CreateDate;
                entity.ChangeDate        = info.ChangeDate;
                entity.InventoryDetailID = info.InventoryDetailID;
                entity.InventoryID       = info.InventoryID;
                entity.goods             = GoodsService.GetGoodsEntityById(info.GoodsID);
                entity.customer          = CustomerService.GetCustomerEntityById(info.CustomerID);
                entity.storages          = StorageService.GetStorageEntityById(info.StorageID);
            }

            return(entity);
        }
Пример #2
0
        /// <summary>
        /// 新增盘差数据
        /// </summary>
        /// <returns></returns>
        public ActionResult AddDif()
        {
            string CompanyID = WebUtil.GetFormValue <string>("CompanyID");

            InventoryDifEntity entity   = WebUtil.GetFormObject <InventoryDifEntity>("Entity");
            CheckOrderExt      provider = new CheckOrderExt(CompanyID);

            InventoryDetailEntity check = new InventoryDetailEntity();

            check.OrderSnNum = entity.OrderSnNum;
            check.TargetNum  = entity.ProductNum;
            check.CompanyID  = CompanyID;
            DataResult dataResult = null;
            int        count      = provider.GetCount(check);

            if (count == 0)
            {
                dataResult = new DataResult()
                {
                    Code    = (int)EResponseCode.Exception,
                    Message = "该产品不在盘点任务内"
                };

                return(Content(JsonHelper.SerializeObject(dataResult)));
            }
            int line = provider.AddDif(entity);

            dataResult = new DataResult()
            {
                Code    = (int)EResponseCode.Success,
                Message = "响应成功"
            };
            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Пример #3
0
        /// <summary>
        /// 检查盘点产品是否满足要求
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int GetCount(InventoryDetailEntity entity)
        {
            entity.Where(a => a.TargetNum == entity.TargetNum)
            .And(a => a.OrderSnNum == entity.OrderSnNum)
            .And(a => a.CompanyID == this.CompanyID)
            ;

            int count = this.InventoryDetail.GetCount(entity);

            return(count);
        }
Пример #4
0
        public static List <InventoryDetailEntity> GetInventoryDetailInfoPager(PagerInfo pager)
        {
            List <InventoryDetailEntity> all    = new List <InventoryDetailEntity>();
            InventoryDetailRepository    mr     = new InventoryDetailRepository();
            List <InventoryDetailInfo>   miList = mr.GetAllInventoryDetailInfoPager(pager);

            if (!miList.IsEmpty())
            {
                foreach (InventoryDetailInfo mInfo in miList)
                {
                    InventoryDetailEntity carEntity = TranslateInventoryDetailEntity(mInfo);
                    all.Add(carEntity);
                }
            }
            return(all);
        }
Пример #5
0
        public static List <InventoryDetailEntity> GetInventoryDetailInfoByRule(string name, string inventoryType, int StorageID, int customerID, string inventoryDate, string orderType, PagerInfo pager)
        {
            List <InventoryDetailEntity> all    = new List <InventoryDetailEntity>();
            InventoryDetailRepository    mr     = new InventoryDetailRepository();
            List <InventoryDetailInfo>   miList = mr.GetInventoryDetailInfoByRule(name, inventoryType, StorageID, customerID, inventoryDate, orderType, pager);

            if (!miList.IsEmpty())
            {
                foreach (InventoryDetailInfo mInfo in miList)
                {
                    InventoryDetailEntity storeEntity = TranslateInventoryDetailEntity(mInfo);
                    all.Add(storeEntity);
                }
            }

            return(all);
        }
Пример #6
0
        /// <summary>
        /// 根据盘点单唯一编号查询盘点单详细信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetDetail()
        {
            string SnNum                 = WebUtil.GetFormValue <string>("SnNum");
            string CompanyID             = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            InventoryDetailEntity entity = new InventoryDetailEntity();

            entity.OrderSnNum = SnNum;
            entity.CompanyID  = CompanyID;
            Bill <InventoryOrderEntity, InventoryDetailEntity> bill = new CheckOrder(CompanyID);
            List <InventoryDetailEntity> list = bill.GetOrderDetail(entity);

            DataResult <List <InventoryDetailEntity> > dataResult = new DataResult <List <InventoryDetailEntity> >();

            dataResult.Code    = (int)EResponseCode.Success;
            dataResult.Message = "响应成功";
            dataResult.Result  = list;
            return(Content(JsonHelper.SerializeObject(dataResult)));
        }