34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
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<DeviceUptime>,IDeviceMaintenancePerformanceService
|
|
{
|
|
public async Task<Dictionary<string, List<DeviceUptime>>> DeviceUptimesAsync(string startTime, string endTime,string workshop)
|
|
{
|
|
|
|
var query = Context.Queryable<DeviceUptime>()
|
|
.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;
|
|
}
|
|
}
|
|
|
|
}
|