1.移植查询电压值功能

This commit is contained in:
hehaibing-1996
2024-05-28 20:09:24 +08:00
parent ac14b22507
commit 08850a2f15
9 changed files with 227 additions and 6 deletions

View File

@ -397,6 +397,53 @@ namespace WCS.BLL.Services.Service
};
}
}
/// <summary>
/// 发送指令获取模组的电压值
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<ResponseCommon> queryModuleVoltage(QueryModuleVoltageRequest request)
{
try
{
var modules = await DbHelp.db.Queryable<ModuleInfo>().Where(t => request.MouduleIds.Contains(t.Id)).ToListAsync();
var isSend = false;
foreach (var module in modules)
{
var shelf = ShelfManager.Shelves.Where(t => t.ShelfId == module.ShelfId).FirstOrDefault();
if (shelf != null && shelf is SmartShelf)
{
var smartShelf = (SmartShelf)shelf;
smartShelf.QueryVoltage(module.Id);
isSend = true;
}
}
if (isSend)
return new ResponseCommon()
{
Code = 200,
Message = "Success"
};
else
return new ResponseCommon()
{
Code = 201,
Message = "操作失败:未找到对应模组"
};
}
catch (Exception ex)
{
return new ResponseCommon()
{
Code = 300,
Message = "操作失败:" + ex.Message
};
}
}
#endregion
#region
@ -534,6 +581,7 @@ namespace WCS.BLL.Services.Service
}
}
#endregion
}
}