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.

25 lines
808 B

using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using Repository.Station;
namespace Service.Station;
[Scope("SingleInstance")]
public class ElecPriceModelVersionService : BaseServices<ElecPriceModelVersion>
{
ElecPriceModelVersionRepository _elecPriceModelVersionRepository;
public ElecPriceModelVersionService(ElecPriceModelVersionRepository dal)
{
_elecPriceModelVersionRepository = dal;
BaseDal = dal;
}
/// <summary>
/// 返回当前版本号
/// </summary>
/// <returns></returns>
public async Task<int> GetNowVersion()
{
ElecPriceModelVersion elecPriceModelVersion =await _elecPriceModelVersionRepository.QueryByClauseAsync(u => u.EndTime > DateTime.Now);
return elecPriceModelVersion.Version;
}
}