组装任务管理,所有子任务是一个状态改父级状态
This commit is contained in:
@@ -1076,6 +1076,18 @@ namespace Tnb.ProductionMgr
|
|||||||
#endregion
|
#endregion
|
||||||
prdTaskList.ForEach(x => x.mo_task_status = status);
|
prdTaskList.ForEach(x => x.mo_task_status = status);
|
||||||
row = await db.Updateable(prdTaskList).ExecuteCommandAsync();
|
row = await db.Updateable(prdTaskList).ExecuteCommandAsync();
|
||||||
|
foreach (var item in prdTaskList)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(item.parent_id)) continue;
|
||||||
|
//子任务所有状态相同才修改父任务状态
|
||||||
|
int count1 = await db.Queryable<PrdMoTask>().CountAsync(y => y.parent_id == item.parent_id);
|
||||||
|
int count2 = await db.Queryable<PrdMoTask>().CountAsync(y => y.parent_id == item.parent_id && y.mo_task_status==status);
|
||||||
|
if (count1 == count2)
|
||||||
|
{
|
||||||
|
await db.Updateable<PrdMoTask>().SetColumns(x => x.mo_task_status == status)
|
||||||
|
.Where(x => x.id == item.parent_id).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (row > 0)
|
if (row > 0)
|
||||||
{
|
{
|
||||||
taskReportLogs.AddRange(prdTaskList);
|
taskReportLogs.AddRange(prdTaskList);
|
||||||
|
|||||||
Reference in New Issue
Block a user