This commit is contained in:
FanLian
2023-07-25 09:25:48 +08:00
4 changed files with 23 additions and 9 deletions

View File

@@ -43,5 +43,10 @@ public partial class BasMbomInput : BaseEntity<string>
/// 数量
/// </summary>
public decimal num { get; set; }
/// <summary>
/// 单位id
/// </summary>
public string? unit_id { get; set; }
}

View File

@@ -43,5 +43,10 @@ public partial class BasMbomOutput : BaseEntity<string>
/// 产出数量(可小数分数)
/// </summary>
public string num { get; set; } = string.Empty;
/// <summary>
/// 单位id
/// </summary>
public string? unit_id { get; set; }
}

View File

@@ -598,6 +598,7 @@ namespace Tnb.BasicData
material_id = input.material_id,
num = input.num,
org_id = orgId,
unit_id = input.unit_id,
});
}
}
@@ -616,6 +617,7 @@ namespace Tnb.BasicData
material_id = output.material_id,
num = output.num,
org_id = orgId,
unit_id = output.unit_id,
});
}
}
@@ -713,6 +715,7 @@ namespace Tnb.BasicData
material_id = input.material_id,
num = input.num,
org_id = orgId,
unit_id = input.unit_id,
});
}
}
@@ -731,6 +734,7 @@ namespace Tnb.BasicData
material_id = output.material_id,
num = output.num,
org_id = orgId,
unit_id = output.unit_id
});
}
}

View File

@@ -1330,11 +1330,11 @@ namespace Tnb.ProductionMgr
}
bool flag = (prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty == prdMoTask.scheduled_qty;
if ((prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty)
{
throw Oops.Bah("已完成数量不能大于任务单数量");
}
// bool flag = (prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty == prdMoTask.scheduled_qty;
// if ((prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty)
// {
// throw Oops.Bah("已完成数量不能大于任务单数量");
// }
report = input.Adapt<PrdReport>();
report.id = SnowflakeIdHelper.NextId();
@@ -1369,7 +1369,7 @@ namespace Tnb.ProductionMgr
await db.Updateable<PrdMoTask>()
// .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty)
.SetColumns(x => x.reported_work_qty == input.reported_qty)
.SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
// .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
.Where(x => x.id == input.mo_task_id).ExecuteCommandAsync();
}
else
@@ -1377,7 +1377,7 @@ namespace Tnb.ProductionMgr
await db.Updateable<PrdMoTask>()
// .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty)
.SetColumns(x => x.reported_work_qty == x.reported_work_qty + input.reported_qty)
.SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
// .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
.Where(x => x.id == input.mo_task_id).ExecuteCommandAsync();
}
@@ -1391,13 +1391,13 @@ namespace Tnb.ProductionMgr
{
await db.Updateable<PrdMoTask>()
.SetColumns(x => x.last_process_complete_qty == input.reported_qty)
.SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
// .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
.Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync();
}else if (parentMoTask?.last_process_complete_qty != null)
{
await db.Updateable<PrdMoTask>()
.SetColumns(x => x.last_process_complete_qty == x.last_process_complete_qty + input.reported_qty)
.SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
// .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode)
.Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync();
}
}