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

@@ -32,11 +32,11 @@ namespace Tnb.EquipMgr
[HttpGet("{itemGroupId}")]
public async Task<dynamic> GetMaintianItemListByGroupId(string itemGroupId)
{
var list = new List<MoldMaintainItemListOutput>();
var itemIds = await _db.Queryable<ToolMoldMaintainGroupItem>().Where(it => it.item_group_id == itemGroupId).Select(it => it.item_id).ToListAsync();
List<MoldMaintainItemListOutput> list = new();
List<string> itemIds = await _db.Queryable<ToolMoldMaintainGroupItem>().Where(it => it.item_group_id == itemGroupId).Select(it => it.item_id).ToListAsync();
if (itemIds?.Count > 0)
{
var items = await _db.Queryable<MoldMaintenance>().Where(it => itemIds.Contains(it.id)).ToListAsync();
List<MoldMaintenance> items = await _db.Queryable<MoldMaintenance>().Where(it => itemIds.Contains(it.id)).ToListAsync();
list = items.Adapt<List<MoldMaintainItemListOutput>>();
}
return list;
@@ -49,11 +49,11 @@ namespace Tnb.EquipMgr
[HttpGet("{itemGroupId}")]
public async Task<dynamic> GetMoldListByGroupId(string itemGroupId)
{
var list = new List<RelevanceMoldListOutput>();
var moldIds = await _db.Queryable<ToolMoldMaintainGroupRelation>().Where(it => it.item_group_id == itemGroupId).Select(it => it.mold_id).ToListAsync();
List<RelevanceMoldListOutput> list = new();
List<string> moldIds = await _db.Queryable<ToolMoldMaintainGroupRelation>().Where(it => it.item_group_id == itemGroupId).Select(it => it.mold_id).ToListAsync();
if (moldIds?.Count > 0)
{
var items = await _db.Queryable<ToolMolds>().Where(it => moldIds.Contains(it.id)).ToListAsync();
List<ToolMolds> items = await _db.Queryable<ToolMolds>().Where(it => moldIds.Contains(it.id)).ToListAsync();
list = items.Adapt<List<RelevanceMoldListOutput>>();
}
return list;
@@ -107,9 +107,9 @@ namespace Tnb.EquipMgr
#endregion
private async Task Delete<T>(Expression<Func<T, bool>> deleteExp) where T : BaseEntity<string>, new()
private new async Task Delete<T>(Expression<Func<T, bool>> deleteExp) where T : BaseEntity<string>, new()
{
await _db.Deleteable<T>().Where(deleteExp).ExecuteCommandAsync();
_ = await _db.Deleteable<T>().Where(deleteExp).ExecuteCommandAsync();
}
}