执行代码清理,修复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

@@ -83,13 +83,13 @@ namespace Tnb.ProductionMgr
if (!string.IsNullOrEmpty(input.queryJson))
{
Dictionary<string, string> queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
if (queryJson.TryGetValue("mo_task_code", out var value))
if (queryJson.TryGetValue("mo_task_code", out string? value))
{
moTaskCode = value;
}
}
var db = _repository.AsSugarClient();
var result = await db.Queryable<PrdReportRecord>()
ISqlSugarClient db = _repository.AsSugarClient();
SqlSugarPagedList<ReportRecordListOutput> result = await db.Queryable<PrdReportRecord>()
.LeftJoin<DictionaryDataEntity>((a, b) => a.mo_task_type == b.Id)
.LeftJoin<DictionaryDataEntity>((a, b, c) => a.status == c.EnCode)
.LeftJoin<PrdMoTask>((a, b, c, d) => a.mo_task_id == d.id)
@@ -125,11 +125,11 @@ namespace Tnb.ProductionMgr
private async Task<dynamic> AddRecord(string id, VisualDevModelDataUpInput input)
{
var db = _repository.AsSugarClient();
var result = await db.Ado.UseTranAsync(async () =>
ISqlSugarClient db = _repository.AsSugarClient();
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
{
List<PrdReport> prdReports = new List<PrdReport>();
foreach (var item in (JArray)input.data["tablefield107"])
List<PrdReport> prdReports = new();
foreach (JToken item in (JArray)input.data["tablefield107"])
{
if (item["id"] == null)
{
@@ -144,10 +144,10 @@ namespace Tnb.ProductionMgr
}
}
await db.Insertable<PrdReport>(prdReports).ExecuteCommandAsync();
_ = await db.Insertable<PrdReport>(prdReports).ExecuteCommandAsync();
int? sum = prdReports.Sum(x => x.reported_qty);
await db.Updateable<PrdReportRecord>()
_ = await db.Updateable<PrdReportRecord>()
.SetColumns(x => x.completed_qty == x.completed_qty + sum)
.SetColumns(x => x.reported_work_qty == x.reported_work_qty + sum)
.Where(x => x.id == input.data["id"].ToString()).ExecuteCommandAsync();