调整组织管理,工位绑定工序代码

This commit is contained in:
DEVICE8\12494
2023-05-04 15:40:17 +08:00
parent c98236d10a
commit ca43cd8bfe
2 changed files with 9 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ namespace Tnb.BasicData
if (organize != null)
{
var whereExpr = Expressionable.Create<BasProcess, BasProcessStation>();
var curProcessIds = await db.Queryable<BasProcessStation>().Where(it => it.station_id == organize.Id).Select(it => it.process_id).ToListAsync();
var curProcessIds = await db.Queryable<BasProcessStation>().Where(it => it.station_id == organize.Id).Select(it => it.process_id).Distinct().ToListAsync();
if (curProcessIds?.Count > 0)
{
whereExpr = whereExpr.And((a, b) => curProcessIds.Contains(a.id)).Or((a, b) => string.IsNullOrEmpty(b.process_id));