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

@@ -30,8 +30,8 @@ namespace Tnb.EquipMgr
private readonly IToolMoldsService _moldService;
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
private static Dictionary<string, object> _dicHouse = new Dictionary<string, object>();
private static Dictionary<string, object> _dicLocation = new Dictionary<string, object>();
private static Dictionary<string, object> _dicHouse = new();
private static Dictionary<string, object> _dicLocation = new();
public ToolMoldMaintainPlanService(
ISqlSugarRepository<ToolMoldMaintainPlan> repository,
@@ -75,7 +75,7 @@ namespace Tnb.EquipMgr
[HttpGet]
public async Task<dynamic> GetMoldListByPlanId([FromRoute] string planId)
{
var result = new List<MaintainPlanMoldLstOutput>();
List<MaintainPlanMoldLstOutput> result = new();
if (_dicHouse.Count < 1)
{
_dicHouse = await _moldHouseService.GetHouseDictionary();
@@ -84,13 +84,13 @@ namespace Tnb.EquipMgr
{
_dicLocation = await _moldLocationService.GetLocationDictionary();
}
var list = await _db.Queryable<ToolMoldMaintainPlanRelation>().Where(it => it.maintain_plan_id == planId).ToListAsync();
List<ToolMoldMaintainPlanRelation> list = await _db.Queryable<ToolMoldMaintainPlanRelation>().Where(it => it.maintain_plan_id == planId).ToListAsync();
if (list?.Count > 0)
{
var ids = list.Select(it => it.mold_id).Distinct().ToList();
List<string> ids = list.Select(it => it.mold_id).Distinct().ToList();
if (ids?.Count > 0)
{
var items = await _moldService.GetListByIds(ids);
List<ToolMolds> items = await _moldService.GetListByIds(ids);
_db.ThenMapper(items, it =>
{
if (!it.warehosue_id!.IsNullOrEmpty())
@@ -114,16 +114,21 @@ namespace Tnb.EquipMgr
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task RelevanceMoldFromPlan(RelevanceMoldFromPlanInput input) =>
public async Task RelevanceMoldFromPlan(RelevanceMoldFromPlanInput input)
{
await Relevance<RelevanceMoldFromPlanInput, ToolMoldMaintainPlanRelation>(input, nameof(ToolMoldMaintainPlanRelation.maintain_plan_id), nameof(ToolMoldMaintainPlanRelation.mold_id), it => it.maintain_plan_id == input.id);
}
/// <summary>
/// 删除计划与模具关联关系
/// </summary>
/// <param name="input">输入参数</param>
/// <returns></returns>
[HttpPost]
public async Task DeleteMold(RelevanceMoldFromPlanInput input) =>
public async Task DeleteMold(RelevanceMoldFromPlanInput input)
{
await Delete<ToolMoldMaintainPlanRelation>(it => it.maintain_plan_id == input.id && input.ids.Contains(it.mold_id));
}
}
}