米其林项目Giraf的新接口,采用WebAPI形式,会应用在上海玉兰,印度米其林及波兰米其林项目中
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

using WMS_GIRAF_Interface.Data;
using WMS_GIRAF_Interface.Entities;
using WMS_GIRAF_Interface.Repositories.Interface;
namespace WMS_GIRAF_Interface.Repositories.Implement;
public class IoControlRouteRepository(MichelinDbContext context, ILogger<ManageMainRepository> logger)
: IIoControlRouteRepository
{
public IO_CONTROL_ROUTE? GetIoControlRoute(int? lineNumber)
{
try
{
var ioControlRoute = context.IoControlRoute.FirstOrDefault(x => x.CONTROL_ROUTE_TYPE == lineNumber);
return ioControlRoute;
}
catch (Exception ex)
{
logger.LogError(ex, "Error in GetIoControlRoute");
return null;
}
}
public List<IO_CONTROL_ROUTE?> GetEnableControlRoutes(string startDeviceCode, string endDeviceCode)
{
//查看起点终点之间是否有可用路径
List<IO_CONTROL_ROUTE?> getAvailableControlRoutes = context.IoControlRoute.Where(x => x.START_DEVICE == startDeviceCode && x.END_DEVICE == endDeviceCode && x.CONTROL_ROUTE_STATUS == 1).ToList()!;
return getAvailableControlRoutes;
}
}