public void DoInspect(List<string> huIdList, DateTime? effDate) { if (huIdList == null || huIdList.Count == 0) { throw new Entity.Exception.BusinessException("没有要检验的明细"); } var inspectMaster = new Entity.INP.InspectMaster(); inspectMaster.Status = CodeMaster.InspectStatus.Submit; inspectMaster.Type = CodeMaster.InspectType.Barcode; var inspectDetailList = new List<Entity.INP.InspectDetail>(); foreach (var huId in huIdList) { var inspectDetail = new Entity.INP.InspectDetail(); inspectDetail.HuId = huId; //var hu = this.genericMgr.FindById<Entity.INV.Hu>(huId); //var item = this.genericMgr.FindById<Entity.MD.Item>(hu.Item); //inspectDetail.BaseUom = hu.BaseUom; ////inspectDetail.InspectNo = //inspectDetail.InspectQty = hu.Qty; //inspectDetail.Item = hu.Item; //inspectDetail.ItemDescription = item.Description; ////inspectDetail.LocationFrom = hu. //inspectDetail.LotNo = hu.LotNo; //inspectDetail.ReferenceItemCode = hu.ReferenceItemCode; //inspectDetail.UnitCount = hu.UnitCount; //inspectDetail.UnitQty = hu.UnitQty; //inspectDetail.Uom = hu.Uom; inspectDetailList.Add(inspectDetail); } inspectMaster.InspectDetails = inspectDetailList; inspectMgr.CreateInspectMaster(inspectMaster, effDate.HasValue ? effDate.Value : DateTime.Now); }
public void DoWorkersWaste(List<string> huIdList, DateTime? effDate) { if (huIdList == null || huIdList.Count == 0) { throw new Entity.Exception.BusinessException("没有要检验的明细"); } var inspectMaster = new Entity.INP.InspectMaster(); inspectMaster.Status = CodeMaster.InspectStatus.Submit; inspectMaster.Type = CodeMaster.InspectType.Barcode; var inspectDetailList = new List<Entity.INP.InspectDetail>(); foreach (var huId in huIdList) { var inspectDetail = new Entity.INP.InspectDetail(); inspectDetail.HuId = huId; inspectDetailList.Add(inspectDetail); } inspectMaster.InspectDetails = inspectDetailList; inspectMgr.CreateWorkersWaste(inspectMaster, effDate.HasValue ? effDate.Value : DateTime.Now); }
public void DoInspect(List<string> huIdList, DateTime? effDate) { if (huIdList == null || huIdList.Count == 0) { throw new Entity.Exception.BusinessException("没有要检验的明细"); } var inspectMaster = new Entity.INP.InspectMaster(); inspectMaster.Status = CodeMaster.InspectStatus.Submit; inspectMaster.Type = CodeMaster.InspectType.Barcode; var inspectDetailList = new List<Entity.INP.InspectDetail>(); foreach (var huId in huIdList) { var inspectDetail = new Entity.INP.InspectDetail(); inspectDetail.HuId = huId; inspectDetailList.Add(inspectDetail); } inspectMaster.InspectDetails = inspectDetailList; inspectMgr.CreateInspectMaster(inspectMaster, effDate.HasValue ? effDate.Value : DateTime.Now); //try //{ // var subPrintOrderList = this.genericMgr.FindAll<SubPrintOrder>(); // var pubPrintOrders = subPrintOrderList.Where(p => (p.UserId == inspectMaster.CreateUserId || p.UserId == 0) // && (p.Region == inspectMaster.Region || string.IsNullOrWhiteSpace(p.Region)) // && (p.Location == inspectMaster.InspectDetails[0].LocationFrom || string.IsNullOrWhiteSpace(p.Location) // && p.ExcelTemplate == "InspectOrder.xls") // ).Select(p => new PubPrintOrder // { // Client = p.Client, // ExcelTemplate = p.ExcelTemplate, // Code = inspectMaster.InspectNo, // Printer = p.Printer // }); // foreach (var pubPrintOrder in pubPrintOrders) // { // this.genericMgr.Create(pubPrintOrder); // } //} //catch (Exception ex) //{ // //log.Error("Send data to print sevrer error:", ex); //} }