AddTransformerDetail() public method

用于创建订单类型的 增加明细.如:退货,移库,上下架,投料,盘点等 检查重复扫描 自动生成序号 匹配 自动新增明细未加控制
public AddTransformerDetail ( TransformerDetail transformerDetail ) : void
transformerDetail TransformerDetail
return void
 protected override void SetDetail(Resolver resolver)
 {
     LocationLotDetail locationLotDetail = locationLotDetailMgrE.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
     TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
     resolver.AddTransformerDetail(transformerDetail);
     resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMERDETAIL;
 }
 /// <summary>
 /// 仅校验投料的物料号,库位是否一致,不校验单位单包装等信息
 /// todo:不允许投入的又有数量又有Hu //可以前台控制
 /// </summary>
 /// <param name="resolver"></param>
 protected override void SetDetail(Resolver resolver)
 {
     if (resolver.CodePrefix == string.Empty)
     {
         throw new BusinessErrorException("Common.Business.Error.ScanProductLineFirst");
     }
     LocationLotDetail locationLotDetail = locationLotDetailMgrE.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
     TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
     var query = resolver.Transformers.Where
             (t => (t.ItemCode == transformerDetail.ItemCode && t.LocationCode == transformerDetail.LocationCode));
     if (query.Count() < 1)
     {
         throw new BusinessErrorException("Warehouse.HuMatch.NotMatch", transformerDetail.HuId);
     }
     resolver.AddTransformerDetail(transformerDetail);
 }
 protected override void SetDetail(Resolver resolver)
 {
     Hu hu = huMgrE.CheckAndLoadHu(resolver.Input);
     if (this.locationMgrE.IsHuOcuppyByPickList(resolver.Input))
     {
         throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", resolver.Input);
     }
     if (resolver.BinCode == string.Empty || resolver.BinCode == null)
     {
         throw new BusinessErrorException("Warehouse.PutAway.PlzScanBin");
     }
     if (hu.StorageBin != null && hu.StorageBin.Trim() != string.Empty && hu.StorageBin == resolver.BinCode)
     {
         throw new BusinessErrorException("Warehouse.PutAway.AlreadyInThisBin");
     }
     //校验Bin
     StorageBin bin = storageBinMgrE.CheckAndLoadStorageBin(resolver.BinCode);
     LocationLotDetail locationLotDetail = locationLotDetailMgrE.CheckLoadHuLocationLotDetail(resolver.Input, string.Empty, bin.Area.Location.Code);
     locationLotDetail.NewStorageBin = bin;
     TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, true);
     resolver.AddTransformerDetail(transformerDetail);
 }
        protected override void SetDetail(Resolver resolver)
        {
            //setDetailMgrE.CheckHuInTransformerDetails(resolver);
            LocationLotDetail locationLotDetail = locationLotDetailMgrE.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
            //Hu hu = locationLotDetail.Hu;
            //hu.Qty = locationLotDetail.Qty / hu.UnitQty;
            if (this.locationMgrE.IsHuOcuppyByPickList(resolver.Input))
            {
                throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", resolver.Input);
            }

            //已经下架
            if (locationLotDetail.StorageBin == null)
            {
                throw new BusinessErrorException("Warehouse.PickUp.Error.IsAlreadyPickUp", resolver.Input);
            }
            TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
            resolver.AddTransformerDetail(transformerDetail);
            //transformerDetail.CurrentQty = transformerDetail.Qty;
            //int maxSeq = setDetailMgrE.FindMaxSeq(resolver.Transformers);
            //transformerDetail.Sequence = maxSeq + 1;
            //resolver.Transformers[0].TransformerDetails.Add(transformerDetail);
            //resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMERDETAIL;
        }
Example #5
0
        protected override void SetDetail(Resolver resolver)
        {
            #region Hu状态查询
            if (resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_HUSTATUS)
            {
                Hu hu = null;
                //检查库存
                LocationLotDetail locationLotDetail = locationLotDetailMgr.LoadHuLocationLotDetail(resolver.Input);
                if (locationLotDetail == null)//库存中没有,检查HuDet
                {
                    hu = huMgr.CheckAndLoadHu(resolver.Input);
                    //修正状态
                    if (hu.Status == BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_INVENTORY)
                    {
                        hu.Status = "ERROR";
                    }
                }
                else
                {
                    hu = locationLotDetail.Hu;
                    //修正库位 数量
                    hu.Location = locationLotDetail.Location.Code;
                    hu.Qty = locationLotDetail.Qty / hu.UnitQty;
                    if (hu.Status == BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_INVENTORY)
                    {
                        if (this.locationMgr.IsHuOcuppyByPickList(resolver.Input))
                        {
                            hu.Status += languageMgr.TranslateMessage("MasterDate.PickList.Ocuppied", resolver.UserCode);
                        }
                    }
                }
                TransformerDetail transformerDetail = TransformerHelper.ConvertHuToTransformerDetail(hu);
                if (locationLotDetail != null && locationLotDetail.StorageBin != null)
                {
                    transformerDetail.StorageBinCode = locationLotDetail.StorageBin.Code;
                }
                resolver.Transformers = null;
                resolver.AddTransformerDetail(transformerDetail);
            }
            #endregion

            #region 盘点
            else
            {
                if (resolver.WorkingHours == null || resolver.WorkingHours.Count != 2)
                {
                    //出错
                    throw new BusinessErrorException("CycCnt.Error.ScanCycCountFirst");
                }
                if (resolver.LocationCode == null || resolver.LocationCode == string.Empty)
                {
                    throw new BusinessErrorException("CycCnt.Error.HasNoLocation");
                }
                //如果指定了库格或启用了高级仓库管理,需要先扫描库格.
                //if ((resolver.BinCode == null || resolver.BinCode == string.Empty)
                //    && (resolver.WorkingHours[1].Length > 0 || resolver.IsPickFromBin))
                //{
                //    throw new BusinessErrorException("CycCnt.Error.ScanStorageBinFirst");
                //}

                //检查当月盘点重复扫描
                this.cycleCountMgr.CheckHuExistThisCount(resolver.Input);
                Hu hu = huMgr.CheckAndLoadHu(resolver.Input);

                if (hu.Status == BusinessConstants.CODE_MASTER_HU_STATUS_VALUE_CLOSE)
                {
                    throw new BusinessErrorException("CycCnt.Error.HuStatusError",hu.Status);
                }

                if (resolver.WorkingHours[0].Length > 0 && !resolver.WorkingHours[0].Contains(hu.Item.Code))
                {
                    if (resolver.WorkingHours[0].Length > 0)
                    {
                        throw new BusinessErrorException("CycCnt.Error.NotContainTheItem");
                    }
                    else
                    {
                        //nothing todo
                    }
                }

                TransformerDetail transformerDetail = Utility.TransformerHelper.ConvertHuToTransformerDetail(hu);
                transformerDetail.StorageBinCode = resolver.BinCode;
                resolver.AddTransformerDetail(transformerDetail);
            }
            #endregion
        }
Example #6
0
 public void MatchHuByFlowView(Resolver resolver, FlowView flowView, Hu hu)
 {
     TransformerDetail transformerDetail = Utility.TransformerHelper.ConvertHuToTransformerDetail(flowView, hu);
     transformerDetail.StorageBinCode = resolver.BinCode;//库格
     resolver.AddTransformerDetail(transformerDetail);
 }
 protected override void SetDetail(Resolver resolver)
 {
     if (resolver.CodePrefix == string.Empty)
     {
         throw new BusinessErrorException("Common.Business.Error.ScanFlowFirst");
     }
     if (resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_PRODUCTIONRECEIVE)
     {
         LocationLotDetail locationLotDetail = locationLotDetailMgrE.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
         TransformerDetail newTransformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
         resolver.AddTransformerDetail(newTransformerDetail);
     }
     else
     {
         setDetailMgrE.MatchReceive(resolver);
         if (resolver.BinCode != null && resolver.BinCode != string.Empty)
         {
             resolver.Result = languageMgrE.TranslateMessage("Warehouse.CurrentBinCode", resolver.UserCode, resolver.BinCode);
         }
     }
 }
 protected override void SetDetail(Resolver resolver)
 {
     InspectOrderDetail inspectOrderDetail = inspectOrderDetailMgr.CheckAndGetInspectOrderDetail(resolver.Input);
     TransformerDetail transformerDetail = TransformerHelper.ConvertInspectDetailToTransformerDetail(inspectOrderDetail);
     resolver.AddTransformerDetail(transformerDetail);
     resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMERDETAIL;
 }
Example #9
0
        /// <summary>
        /// 仅校验投料的物料号,库位是否一致,不校验单位单包装等信息
        /// todo:不允许投入的又有数量又有Hu //可以前台控制
        /// </summary>
        /// <param name="resolver"></param>
        protected override void SetDetail(Resolver resolver)
        {
            if (resolver.CodePrefix == string.Empty)
            {
                throw new BusinessErrorException("Common.Business.Error.ScanProductLineFirst");
            }
            LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(resolver.Input, resolver.UserCode);
            TransformerDetail transformerDetail = TransformerHelper.ConvertLocationLotDetailToTransformerDetail(locationLotDetail, false);
            var query = resolver.Transformers.Where
                    (t => (t.ItemCode == transformerDetail.ItemCode && t.LocationCode == transformerDetail.LocationCode));
            if (query.Count() < 1)
            {
                throw new BusinessErrorException("Warehouse.HuMatch.NotMatch", transformerDetail.HuId);
            }

            #region 先进先出校验
            Flow flow = flowMgr.CheckAndLoadFlow(resolver.Code);
            if (flow.IsGoodsReceiveFIFO)
            {
                Hu hu = huMgr.CheckAndLoadHu(resolver.Input);
                IList<string> huIdList = new List<string>();
                if (resolver.Transformers != null && resolver.Transformers.Count > 0)
                {
                    foreach (Transformer transformer in resolver.Transformers)
                    {
                        if (transformer.TransformerDetails != null && transformer.TransformerDetails.Count > 0)
                        {
                            foreach (TransformerDetail det in transformer.TransformerDetails)
                            {
                                if (det.CurrentQty != decimal.Zero)
                                {
                                    huIdList.Add(det.HuId);
                                }
                            }
                        }
                    }
                }
                string maxLot = setDetailMgr.CheckFIFO(hu, huIdList);
                if (maxLot != string.Empty && maxLot != null)
                {
                    throw new BusinessErrorException("FIFO.ERROR", hu.HuId, maxLot);
                }
            }
            #endregion

            resolver.AddTransformerDetail(transformerDetail);
        }