Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -43,5 +43,10 @@ public partial class BasMbomInput : BaseEntity<string>
|
|||||||
/// 数量
|
/// 数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal num { get; set; }
|
public decimal num { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位id
|
||||||
|
/// </summary>
|
||||||
|
public string? unit_id { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,5 +43,10 @@ public partial class BasMbomOutput : BaseEntity<string>
|
|||||||
/// 产出数量(可小数分数)
|
/// 产出数量(可小数分数)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string num { get; set; } = string.Empty;
|
public string num { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位id
|
||||||
|
/// </summary>
|
||||||
|
public string? unit_id { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -598,6 +598,7 @@ namespace Tnb.BasicData
|
|||||||
material_id = input.material_id,
|
material_id = input.material_id,
|
||||||
num = input.num,
|
num = input.num,
|
||||||
org_id = orgId,
|
org_id = orgId,
|
||||||
|
unit_id = input.unit_id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -616,6 +617,7 @@ namespace Tnb.BasicData
|
|||||||
material_id = output.material_id,
|
material_id = output.material_id,
|
||||||
num = output.num,
|
num = output.num,
|
||||||
org_id = orgId,
|
org_id = orgId,
|
||||||
|
unit_id = output.unit_id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -713,6 +715,7 @@ namespace Tnb.BasicData
|
|||||||
material_id = input.material_id,
|
material_id = input.material_id,
|
||||||
num = input.num,
|
num = input.num,
|
||||||
org_id = orgId,
|
org_id = orgId,
|
||||||
|
unit_id = input.unit_id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -731,6 +734,7 @@ namespace Tnb.BasicData
|
|||||||
material_id = output.material_id,
|
material_id = output.material_id,
|
||||||
num = output.num,
|
num = output.num,
|
||||||
org_id = orgId,
|
org_id = orgId,
|
||||||
|
unit_id = output.unit_id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1330,11 +1330,11 @@ namespace Tnb.ProductionMgr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool flag = (prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty == prdMoTask.scheduled_qty;
|
// 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)
|
// if ((prdMoTask.reported_work_qty ?? 0) + (prdMoTask.scrap_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty)
|
||||||
{
|
// {
|
||||||
throw Oops.Bah("已完成数量不能大于任务单数量");
|
// throw Oops.Bah("已完成数量不能大于任务单数量");
|
||||||
}
|
// }
|
||||||
|
|
||||||
report = input.Adapt<PrdReport>();
|
report = input.Adapt<PrdReport>();
|
||||||
report.id = SnowflakeIdHelper.NextId();
|
report.id = SnowflakeIdHelper.NextId();
|
||||||
@@ -1369,7 +1369,7 @@ namespace Tnb.ProductionMgr
|
|||||||
await db.Updateable<PrdMoTask>()
|
await db.Updateable<PrdMoTask>()
|
||||||
// .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty)
|
// .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty)
|
||||||
.SetColumns(x => x.reported_work_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();
|
.Where(x => x.id == input.mo_task_id).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1377,7 +1377,7 @@ namespace Tnb.ProductionMgr
|
|||||||
await db.Updateable<PrdMoTask>()
|
await db.Updateable<PrdMoTask>()
|
||||||
// .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty)
|
// .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty)
|
||||||
.SetColumns(x => x.reported_work_qty == x.reported_work_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();
|
.Where(x => x.id == input.mo_task_id).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1391,13 +1391,13 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
await db.Updateable<PrdMoTask>()
|
await db.Updateable<PrdMoTask>()
|
||||||
.SetColumns(x => x.last_process_complete_qty == input.reported_qty)
|
.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();
|
.Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync();
|
||||||
}else if (parentMoTask?.last_process_complete_qty != null)
|
}else if (parentMoTask?.last_process_complete_qty != null)
|
||||||
{
|
{
|
||||||
await db.Updateable<PrdMoTask>()
|
await db.Updateable<PrdMoTask>()
|
||||||
.SetColumns(x => x.last_process_complete_qty == x.last_process_complete_qty + input.reported_qty)
|
.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();
|
.Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user