using Aliyun.OSS; using DOAN.Model.MES.dev; using DOAN.Model.MES.dev.Dto; using DOAN.Repository; using DOAN.Service.MES.dev.IService; using Infrastructure.Attribute; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DOAN.Service.MES.dev { [AppService(ServiceType = typeof(IDeviceMaintenancePerformanceService), ServiceLifetime = LifeTime.Transient)] public class DeviceMaintenancePerformanceService:BaseService,IDeviceMaintenancePerformanceService { public async Task>> DeviceUptimesAsync(string startTime, string endTime,string workshop) { var query = Context.Queryable() .Where(x => x.Workshop == workshop) .Where(x => x.FillTime.CompareTo($"{startTime}") >= 0) .Where(x => x.FillTime.CompareTo($"{endTime}") <= 0) .OrderBy(x=>x.FillTime); var result = (await query.ToListAsync()).GroupBy(x => x.Type) .ToDictionary(g => g.Key, g => g.ToList()); return result; } } }