/// <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); }
public void FillResolverByFlow(Resolver resolver) { Flow flow = flowMgr.CheckAndLoadFlow(resolver.Input); FillResolverByFlow(resolver, flow); }