执行代码清理,修复warning
This commit is contained in:
@@ -33,14 +33,17 @@ namespace Tnb.EquipMgr
|
||||
public async Task AddEquipSpareParts(EquipSparePartsInput input)
|
||||
{
|
||||
List<EqpEquipSpareParts> oldList = await _repository.GetListAsync(x => x.equip_id == input.equip_id);
|
||||
List<EqpEquipSpareParts> list = new List<EqpEquipSpareParts>();
|
||||
List<EqpEquipSpareParts> list = new();
|
||||
string orgId = _userManager?.GetUserInfo().Result.organizeId ?? "";
|
||||
if (input != null && input.spare_parts_ids != null)
|
||||
{
|
||||
foreach (var spare_parts_id in input.spare_parts_ids)
|
||||
foreach (string spare_parts_id in input.spare_parts_ids)
|
||||
{
|
||||
if (oldList.Any(x => x.spare_parts_id == spare_parts_id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
list.Add(new EqpEquipSpareParts()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
@@ -53,19 +56,19 @@ namespace Tnb.EquipMgr
|
||||
}
|
||||
}
|
||||
|
||||
await _repository.InsertRangeAsync(list);
|
||||
_ = await _repository.InsertRangeAsync(list);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetEquipSparePartsList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
Dictionary<string, string>? queryJson = new();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
}
|
||||
var result = await db.Queryable<EqpEquipSpareParts>()
|
||||
SqlSugarPagedList<EquipSparePartsQueryOutput> result = await db.Queryable<EqpEquipSpareParts>()
|
||||
.LeftJoin<EqpSpareParts>((a, b) => a.spare_parts_id == b.id)
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b, c) => c.EnCode == Tnb.BasicData.DictConst.SparePartsType && c.DeleteMark == null)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d) => d.DictionaryTypeId == c.Id && b.type_id == d.EnCode)
|
||||
|
||||
Reference in New Issue
Block a user