예제 #1
0
        public void DoKitOrderScanKeyPart(string[][] huDetails, string orderNo)
        {
            var receiptDetails = this.genericMgr.FindAll<com.Sconit.Entity.ORD.ReceiptDetail>("select rd from ReceiptDetail rd where rd.OrderNo=?", orderNo);

            var inventoryPackList = new List<Entity.INV.InventoryPack>();
            foreach (var hu in huDetails)
            {
                if (receiptDetails.All(rd => rd.Item != hu[1]))
                {
                    throw new BusinessException("分装生产单{0}上的物料{1}没有收货.", receiptDetails[0].ReceiptNo, hu[1]);
                }
                var receiptDetail = receiptDetails.FirstOrDefault(rd => rd.Item == hu[1]);
                var receiptLocationDet = this.genericMgr.FindAll<com.Sconit.Entity.ORD.ReceiptLocationDetail>("select rld from ReceiptLocationDetail rld where rld.ReceiptDetailId=?", receiptDetail.Id).FirstOrDefault(r => r.ReceiptDetailId == receiptDetail.Id);
                if (!string.IsNullOrEmpty(receiptLocationDet.HuId))
                {
                    throw new BusinessException("分装生产单{0}上的物料{1}已扫描.", receiptDetails[0].ReceiptNo, hu[1]);
                }
                receiptLocationDet.HuId = hu[0];
                this.genericMgr.Update(receiptLocationDet);
                var inventoryPack = new Entity.INV.InventoryPack();
                inventoryPack.HuId = hu[0];
                inventoryPack.Location = receiptDetails[0].LocationTo;
                inventoryPackList.Add(inventoryPack);
            }
            locationDetailMgr.InventoryPack(inventoryPackList);
        }
예제 #2
0
 public void DoPack(List<string> huIdList, string location, DateTime? effDate)
 {
     if (huIdList == null || huIdList.Count == 0)
     {
         throw new Entity.Exception.BusinessException("没有装箱的明细");
     }
     var inventoryPackList = new List<Entity.INV.InventoryPack>();
     foreach (var huId in huIdList)
     {
         var inventoryPack = new Entity.INV.InventoryPack();
         inventoryPack.HuId = huId;
         inventoryPack.Location = location;
         inventoryPackList.Add(inventoryPack);
     }
     if (effDate.HasValue)
     {
         locationDetailMgr.InventoryPack(inventoryPackList, effDate.Value);
     }
     else
     {
         locationDetailMgr.InventoryPack(inventoryPackList);
     }
 }