diff --git a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs index 12d3f01a..cca4cf4a 100644 --- a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs +++ b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs @@ -472,7 +472,9 @@ namespace BLL join n in db.Base_Project on x.ProjectId equals n.ProjectId join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt from t in tt.DefaultIfEmpty() - select new { x, n, t }; + join train in db.HJGL_TrainNumberManage on x.TrainNumberId equals train.Id into trains + from train in trains.DefaultIfEmpty() + select new { x, n, t , train }; if (filter != null) { @@ -510,7 +512,7 @@ namespace BLL } if (!string.IsNullOrEmpty(filter.ReceiveMan)) { - baseQuery = baseQuery.Where(z => z.x.ReceiveMan == filter.ReceiveMan || (z.t != null && z.t.PersonName.Contains(filter.ReceiveMan))); + baseQuery = baseQuery.Where(z => z.train.ContactName == filter.ReceiveMan || (z.train != null && z.train.ContactName.Contains(filter.ReceiveMan))); } if (!string.IsNullOrEmpty(filter.ReceiveDate)) { @@ -524,7 +526,7 @@ namespace BLL } if (!string.IsNullOrEmpty(filter.TrainNumberId)) { - baseQuery = baseQuery.Where(z => z.x.TrainNumber != null && z.x.TrainNumber.Contains(filter.TrainNumberId)); + baseQuery = baseQuery.Where(z => z.train.Id != null && z.train.Id.Contains(filter.TrainNumberId)); } } @@ -540,9 +542,9 @@ namespace BLL ContactPhone = z.x.ContactPhone, StackingPosition = z.x.StackingPosition, State = z.x.State, - ReceiveMan = z.t.PersonName, + ReceiveMan = z.train.ContactName, ReceiveDate = string.Format("{0:g}", z.x.ReceiveDate), - TrainNumber = z.x.TrainNumber, + TrainNumber = z.train.TrainNumber, }).Distinct(); totalCount = q.Count(); diff --git a/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs b/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs index f08e7895..b69b4495 100644 --- a/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs +++ b/SGGL/BLL/HJGL/TestPackage/TestPackagePrintService.cs @@ -593,16 +593,17 @@ namespace BLL var q = iosList[0]; var isoNos = string.Join(",", iosList.Select(x => x.PipelineCode).ToArray()); var isoIds = string.Join("','", iosList.Select(x => x.PipelineId).ToArray()); + var pipelineIdList = iosList.Select(x => x.PipelineId).ToList(); // 修复:创建实际的ID列表 //获取打底和盖面的焊工单位名称 var CoverWelderUnitName = (from x in Funs.DB.HJGL_WeldJoint join y in Funs.DB.SitePerson_Person on x.CoverWelderId equals y.PersonId join z in Funs.DB.Base_Unit on y.UnitId equals z.UnitId - where isoIds.Contains(x.PipelineId) + where pipelineIdList.Contains(x.PipelineId) // 修复:使用实际的列表 select z.UnitName ).Distinct().ToList(); var BackingWelderUnitName = (from x in Funs.DB.HJGL_WeldJoint join y in Funs.DB.SitePerson_Person on x.BackingWelderId equals y.PersonId join z in Funs.DB.Base_Unit on y.UnitId equals z.UnitId - where isoIds.Contains(x.PipelineId) + where pipelineIdList.Contains(x.PipelineId) // 修复:使用实际的列表 select z.UnitName).Distinct().ToList(); CoverWelderUnitName.AddRange(BackingWelderUnitName); Dictionary keyValuePairs = new Dictionary();