diff --git a/Entity/Api/Req/ElecPriceModelVersionDetailReq.cs b/Entity/Api/Req/ElecPriceModelVersionDetailReq.cs new file mode 100644 index 0000000..cb1a620 --- /dev/null +++ b/Entity/Api/Req/ElecPriceModelVersionDetailReq.cs @@ -0,0 +1,20 @@ +namespace Entity.Api.Req; + +public partial class ElecPriceModelVersionDetailReq +{ + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } + /// + /// 版本 + /// + public int Version {get;set;} + /// + /// 价格 + /// + public int? Price {get;set;} + /// + /// Desc:尖峰平谷类型;1-尖;2-峰;3-平;4-谷 + /// + public int? Type {get;set;} + + } \ No newline at end of file diff --git a/Entity/Api/Resp/BaseSetStationConfigInfo.cs b/Entity/Api/Resp/BaseSetStationConfigInfo.cs index 971da49..6cbb07c 100644 --- a/Entity/Api/Resp/BaseSetStationConfigInfo.cs +++ b/Entity/Api/Resp/BaseSetStationConfigInfo.cs @@ -35,7 +35,7 @@ public class BaseSetStationConfigInfo /// public int SwapType{ get; set; } /// - /// 电价模型板 版本号 + /// 电价模型板 版本号 0-数据库不存在 尖峰平谷版本 /// public int Version{ get; set; } } \ No newline at end of file diff --git a/Entity/Api/Resp/ElecPriceModelVersionDetailResp.cs b/Entity/Api/Resp/ElecPriceModelVersionDetailResp.cs new file mode 100644 index 0000000..07131c4 --- /dev/null +++ b/Entity/Api/Resp/ElecPriceModelVersionDetailResp.cs @@ -0,0 +1,24 @@ +namespace Entity.Api.Resp; + +/// +/// 电价模型详情 +/// +public class ElecPriceModelVersionDetailResp +{ + public int Version { get; set; } + public TimeSpan StartTime { get; set; } + public TimeSpan EndTime { get; set; } + /// + /// Desc:价格;以分为单位存储 + /// Default: + /// Nullable:True + /// + public int? Price {get;set;} + + /// + /// Desc:尖峰平谷类型;1-尖;2-峰;3-平;4-谷 + /// Default: + /// Nullable:True + /// + public int? Type {get;set;} +} \ No newline at end of file diff --git a/Service/Station/ElecPriceModelVersionService.cs b/Service/Station/ElecPriceModelVersionService.cs index ae6e261..e70ba8e 100644 --- a/Service/Station/ElecPriceModelVersionService.cs +++ b/Service/Station/ElecPriceModelVersionService.cs @@ -20,6 +20,9 @@ public class ElecPriceModelVersionService : BaseServices public async Task GetNowVersion() { ElecPriceModelVersion elecPriceModelVersion =await _elecPriceModelVersionRepository.QueryByClauseAsync(u => u.EndTime > DateTime.Now); - return elecPriceModelVersion.Version; + if (elecPriceModelVersion != null) + return elecPriceModelVersion.Version; + else + return 0; } } \ No newline at end of file