using Microsoft.Extensions.Logging; using SlnMesnac.Common; using SlnMesnac.Model.domain; using SlnMesnac.Repository.service.@base; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; namespace SlnMesnac.Repository.service.Impl { public class AGVStateServiceImpl : BaseServiceImpl, IAGVStateService { private ILogger _logger; public AGVStateServiceImpl(Repository repository, ILogger logger) :base(repository) { _logger = logger; } public List GetAgvState() { List agvStateInfoList = null; try { Expression> exp = x => true; exp = exp.And(x => x.agvno != "" && (x.taskno == null || x.taskno == "") && x.agvworkstate == "任务空闲"); agvStateInfoList = base._rep.GetList(exp); } catch (Exception ex) { _logger.LogError($"通过物料类型获取物料信息异常:{ex.Message}"); } return agvStateInfoList; } public async Task UpdateAsync(AGVState record) { bool result = await _rep.UpdateAsync(record); return result; } } }