执行代码清理,修复warning

This commit is contained in:
2023-11-06 19:59:12 +08:00
parent c6b8dfc861
commit 1dbb17f103
118 changed files with 5046 additions and 4111 deletions

View File

@@ -48,23 +48,22 @@ namespace Tnb.EquipMgr
string? locationId = "";
if (input.data.TryGetValue("location_id", out var value))
if (input.data.TryGetValue("location_id", out object? value))
{
locationId = value.ToString();
}
string moldId = input.data.ContainsKey("mold_id") ? input.data["mold_id"].ToString() : "";
string? moldId = input.data.ContainsKey("mold_id") ? input.data["mold_id"].ToString() : "";
if (!string.IsNullOrEmpty(moldId))
{
await _db.Updateable<ToolMolds>()
_ = await _db.Updateable<ToolMolds>()
.SetColumns(x => x.mold_status == Tnb.BasicData.DictConst.ZKTypeId)
.SetColumnsIF(!string.IsNullOrEmpty(locationId), x => x.location_id == locationId)
.Where(X => X.id == moldId).ExecuteCommandAsync();
}
});
if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
return result.IsSuccess ? "保存成功" : result.ErrorMessage;
return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "保存成功" : result.ErrorMessage);
}
}
}