生产工单 任务单 提报表 相关数量的类型 int 改成 decimal

This commit is contained in:
2024-09-20 10:20:48 +08:00
parent 28742d05d0
commit ab4eddc079
24 changed files with 85 additions and 73 deletions

View File

@@ -57,6 +57,7 @@ namespace Tnb.ProductionMgr
Log.Information($"生产工单接收参数:{JsonConvert.SerializeObject(input)}");
List<PrdMo> moList = new List<PrdMo>();
List<string> deleteMoList = new List<string>();
List<ErpExtendField> extendFieldList = new List<ErpExtendField>();
foreach (var item in input)
{
@@ -146,6 +147,11 @@ namespace Tnb.ProductionMgr
Log.Error($"【SavePrdMo】生产工单{mocode}状态不是待下发无法覆盖");
throw Oops.Bah($"【SavePrdMo】生产工单{mocode}状态不是待下发无法覆盖");
}
if (existMo != null)
{
deleteMoList.Add(mocode);
}
item.id = SnowflakeIdHelper.NextId();
item.material_id = basMaterial.id;
@@ -165,6 +171,10 @@ namespace Tnb.ProductionMgr
}
DbResult<bool> result = await _db.Ado.UseTranAsync(async () =>
{
if (!deleteMoList.IsEmpty())
{
await _db.Deleteable<PrdMo>(x => deleteMoList.Contains(x.mo_code)).ExecuteCommandAsync();
}
await _db.Insertable(moList).ExecuteCommandAsync();
});
if (result.IsSuccess)