更新查询电价

master
lch 6 months ago
parent 8e78621716
commit 40fa536ac2

@ -0,0 +1,20 @@
namespace Entity.Api.Req;
public partial class ElecPriceModelVersionDetailReq
{
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
/// <summary>
/// 版本
/// </summary>
public int Version {get;set;}
/// <summary>
/// 价格
/// </summary>
public int? Price {get;set;}
/// <summary>
/// Desc:尖峰平谷类型;1-尖2-峰3-平4-谷
/// </summary>
public int? Type {get;set;}
}

@ -35,7 +35,7 @@ public class BaseSetStationConfigInfo
/// </summary>
public int SwapType{ get; set; }
/// <summary>
/// 电价模型板 版本号
/// 电价模型板 版本号 0-数据库不存在 尖峰平谷版本
/// </summary>
public int Version{ get; set; }
}

@ -0,0 +1,24 @@
namespace Entity.Api.Resp;
/// <summary>
/// 电价模型详情
/// </summary>
public class ElecPriceModelVersionDetailResp
{
public int Version { get; set; }
public TimeSpan StartTime { get; set; }
public TimeSpan EndTime { get; set; }
/// <summary>
/// Desc:价格;以分为单位存储
/// Default:
/// Nullable:True
/// </summary>
public int? Price {get;set;}
/// <summary>
/// Desc:尖峰平谷类型;1-尖2-峰3-平4-谷
/// Default:
/// Nullable:True
/// </summary>
public int? Type {get;set;}
}

@ -20,6 +20,9 @@ public class ElecPriceModelVersionService : BaseServices<ElecPriceModelVersion>
public async Task<int> GetNowVersion()
{
ElecPriceModelVersion elecPriceModelVersion =await _elecPriceModelVersionRepository.QueryByClauseAsync(u => u.EndTime > DateTime.Now);
if (elecPriceModelVersion != null)
return elecPriceModelVersion.Version;
else
return 0;
}
}
Loading…
Cancel
Save