From 47d685738ee67341a777bfc0544c71278e2be2ba Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Thu, 27 Jul 2023 14:33:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E8=A3=85=E4=BB=BB=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E6=89=80=E6=9C=89=E5=AD=90=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=98=AF=E4=B8=80=E4=B8=AA=E7=8A=B6=E6=80=81=E6=94=B9=E7=88=B6?= =?UTF-8?q?=E7=BA=A7=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index d4e57270..165b087b 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1076,6 +1076,18 @@ namespace Tnb.ProductionMgr #endregion prdTaskList.ForEach(x => x.mo_task_status = status); row = await db.Updateable(prdTaskList).ExecuteCommandAsync(); + foreach (var item in prdTaskList) + { + if (string.IsNullOrEmpty(item.parent_id)) continue; + //子任务所有状态相同才修改父任务状态 + int count1 = await db.Queryable().CountAsync(y => y.parent_id == item.parent_id); + int count2 = await db.Queryable().CountAsync(y => y.parent_id == item.parent_id && y.mo_task_status==status); + if (count1 == count2) + { + await db.Updateable().SetColumns(x => x.mo_task_status == status) + .Where(x => x.id == item.parent_id).ExecuteCommandAsync(); + } + } if (row > 0) { taskReportLogs.AddRange(prdTaskList);