This commit is contained in:
2024-09-27 18:17:21 +08:00
parent be070f85e2
commit 064a849b97
73 changed files with 3248 additions and 589 deletions
+29 -21
View File
@@ -340,30 +340,38 @@ namespace BLL
/// <returns></returns>
public static List<string> GetNoComPipelinesByUnitWordId(string unitworkId)
{
var q = (from x in Funs.DB.View_HJGL_WeldJoint
where x.UnitWorkId == unitworkId
select new
{
PipelineId = x.PipelineId,
WeldingDate = x.WeldingDate,
PipelineCode = x.PipelineCode
}).Distinct();
if (q.Count() == 0)
var q = Funs.DB.View_HJGL_WeldJoint
.Where(x => x.UnitWorkId == unitworkId)
.Select(x => new
{
x.PipelineId,
x.WeldingDate,
x.PipelineCode
})
.Distinct()
.ToList(); // 立即执行查询并加载数据
if (q.Count == 0)
{
return new List<string>();
}
var noCompipeline = from x in q
group x by x.PipelineId into g
select new
{
PipelineId = g.Key,
Count = (from x2 in g where x2.WeldingDate != null && x2.WeldingDate != "" select x2).Count(),
};
var NowComPipelineCode = (from x in q
join y in noCompipeline on x.PipelineId equals y.PipelineId
where y.Count == 0
select x.PipelineCode
).Distinct().ToList();
// 分组并计算焊接日期不为null或空字符串的数量
var noCompipeline = q.GroupBy(x => x.PipelineId)
.Select(g => new
{
PipelineId = g.Key,
Count = g.Count(x => !string.IsNullOrEmpty(x.WeldingDate)) // 直接计算
})
.ToList(); // 立即执行查询并加载数据
// 过滤出未完成的管道代码
var NowComPipelineCode = noCompipeline
.Where(y => y.Count == 0)
.Join(q, y => y.PipelineId, x => x.PipelineId, (y, x) => x.PipelineCode)
.Distinct()
.ToList();
return NowComPipelineCode;
}
/// <summary>