using Autofac;
using Entity.Constant;
using HybirdFrameworkCore.Autofac;
using Service.System;
namespace Service.Init;
///
/// 换电站基本信息静态数据
///
public class StaticStationInfo
{
public static int StationStatus
{
get => int.Parse(Resolve(StationParamConst.StationStatus));
set => Set(StationParamConst.StationStatus, value);
}
public static int Sevstatus
{
get => int.Parse(Resolve(StationParamConst.Sevstatus));
set => Set(StationParamConst.Sevstatus, value);
}
public static string OperationStartTime
{
get => Resolve(StationParamConst.OperationStartTime);
set => Set(StationParamConst.OperationStartTime, value);
}
public static string OperationEndTime
{
get => Resolve(StationParamConst.OperationEndTime);
set => Set(StationParamConst.OperationEndTime, value);
}
public static string LaunchTime
{
get => Resolve(StationParamConst.LaunchTime);
set => Set(StationParamConst.LaunchTime, value);
}
public static int StationWay
{
get => int.Parse(Resolve(StationParamConst.StationWay));
set => Set(StationParamConst.StationWay, value);
}
public static int StationModel
{
get => int.Parse(Resolve(StationParamConst.StationModel));
set => Set(StationParamConst.StationModel, value);
}
public static string StationName
{
get => Resolve(StationParamConst.StationName);
set => Set(StationParamConst.StationName, value);
}
public static string StationNo
{
get => Resolve(StationParamConst.StationNo);
set => Set(StationParamConst.StationNo, value);
}
public static string StationSn
{
get => Resolve(StationParamConst.StationSn);
set => Set(StationParamConst.StationSn, value);
}
public static string StationLocation
{
get => Resolve(StationParamConst.StationLocation);
set => Set(StationParamConst.StationLocation, value);
}
public static string StationType
{
get => Resolve(StationParamConst.StationType);
set => Set(StationParamConst.StationType, value);
}
public static int SwapFinishChargeTime
{
get => int.Parse(Resolve(StationParamConst.SwapFinishChargeTime));
set => Set(StationParamConst.SwapFinishChargeTime, value);
}
public static int SwapSoc
{
get => int.Parse(Resolve(StationParamConst.SwapSoc));
set => Set(StationParamConst.SwapSoc, value);
}
public static string StationSftVer
{
get => Resolve(StationParamConst.StationSftVer);
set => Set(StationParamConst.StationSftVer, value);
}
public static string Faultlevel
{
get => Resolve(StationParamConst.Faultlevel);
set => Set(StationParamConst.Faultlevel, value);
}
public static string DistributionCapacity
{
get => Resolve(StationParamConst.DistributionCapacity);
set => Set(StationParamConst.DistributionCapacity, value);
}
public static string TotalPower
{
get => Resolve(StationParamConst.TotalPower);
set => Set(StationParamConst.TotalPower, value);
}
public static string ModifyTime
{
get => Resolve(StationParamConst.ModifyTime);
set => Set(StationParamConst.ModifyTime, value);
}
public static string StationVersion
{
get => Resolve(StationParamConst.StationVersion);
set => Set(StationParamConst.StationVersion, value);
}
public static string Longitude
{
get => Resolve(StationParamConst.Longitude);
set => Set(StationParamConst.Longitude, value);
}
public static string Latitude
{
get => Resolve(StationParamConst.Latitude);
set => Set(StationParamConst.Latitude, value);
}
public static string AreaCode
{
get => Resolve(StationParamConst.AreaCode);
set => Set(StationParamConst.AreaCode, value);
}
public static string AreaName
{
get => Resolve(StationParamConst.AreaName);
set => Set(StationParamConst.AreaName, value);
}
public static string ContactWay
{
get => Resolve(StationParamConst.ContactWay);
set => Set(StationParamConst.ContactWay, value);
}
public static string Principal
{
get => Resolve(StationParamConst.Principal);
set => Set(StationParamConst.Principal, value);
}
public static string StationCompany
{
get => Resolve(StationParamConst.StationCompany);
set => Set(StationParamConst.StationCompany, value);
}
public static string SocialCreditCode
{
get => Resolve(StationParamConst.SocialCreditCode);
set => Set(StationParamConst.SocialCreditCode, value);
}
public static string SupplierCode
{
get => Resolve(StationParamConst.SupplierCode);
set => Set(StationParamConst.SupplierCode, value);
}
public static string Cover
{
get => Resolve(StationParamConst.Cover);
set => Set(StationParamConst.Cover, value);
}
#region Tbox
public static bool TboxStateConnect
{
get => bool.Parse(Resolve(StationParamConst.TboxStateConnect));
set => Set(StationParamConst.TboxStateConnect, value);
}
public static bool TboxStateFlameout
{
get => bool.Parse(Resolve(StationParamConst.TboxStateFlameout));
set => Set(StationParamConst.TboxStateFlameout, value);
}
public static bool TboxStateN
{
get => bool.Parse(Resolve(StationParamConst.TboxStateN));
set => Set(StationParamConst.TboxStateN, value);
}
public static bool TboxStateCarList
{
get => bool.Parse(Resolve(StationParamConst.TboxStateCarList));
set => Set(StationParamConst.TboxStateCarList, value);
}
public static bool TboxStateBreak
{
get => bool.Parse(Resolve(StationParamConst.TboxStateBreak));
set => Set(StationParamConst.TboxStateBreak, value);
}
public static bool TboxStateDisConnect
{
get => bool.Parse(Resolve(StationParamConst.TboxStateDisConnect));
set => Set(StationParamConst.TboxStateDisConnect, value);
}
public static string TboxUrlDisConnect
{
get => Resolve(StationParamConst.TboxUrlDisConnect);
set => Set(StationParamConst.TboxUrlDisConnect, value);
}
public static string TboxUrlConnect
{
get => Resolve(StationParamConst.TboxUrlConnect);
set => Set(StationParamConst.TboxUrlConnect, value);
}
public static string TboxUrlLock
{
get => Resolve(StationParamConst.TboxUrlLock);
set => Set(StationParamConst.TboxUrlLock, value);
}
public static string TboxUrlUnLock
{
get => Resolve(StationParamConst.TboxUrlUnLock);
set => Set(StationParamConst.TboxUrlUnLock, value);
}
public static string TboxUrlCarInfoList
{
get => Resolve(StationParamConst.TboxUrlCarInfoList);
set => Set(StationParamConst.TboxUrlCarInfoList, value);
}
public static string TboxUrlCarInfo
{
get => Resolve(StationParamConst.TboxUrlCarInfo);
set => Set(StationParamConst.TboxUrlUnLock, value);
}
public static string TboxUrlClear
{
get => Resolve(StationParamConst.TboxUrlClear);
set => Set(StationParamConst.TboxUrlClear, value);
}
#endregion
#region 充电相关
public static int Eid
{
get => int.Parse(Resolve(StationParamConst.Eid));
set => Set(StationParamConst.Eid, value);
}
///
/// 运营版本号
///
public static string Oid
{
get => Resolve(StationParamConst.Oid);
set => Set(StationParamConst.Oid, value);
}
public static int Ceid
{
get => int.Parse(Resolve(StationParamConst.Ceid));
set => Set(StationParamConst.Ceid, value);
}
public static byte ChargeSoc
{
get => byte.Parse(Resolve(StationParamConst.ChargeSoc));
set => Set(StationParamConst.ChargeSoc, value);
}
public static float ChargePower
{
get => float.Parse(Resolve(StationParamConst.ChargePower));
set => Set(StationParamConst.ChargeSoc, value);
}
///
/// 0-关闭 1-开启
///
public static byte AutoChargeEnabled
{
get => byte.Parse(Resolve(StationParamConst.AutoChargeEnabled));
set => Set(StationParamConst.AutoChargeEnabled, value);
}
#endregion
#region cloud
public static string CloudServerIp
{
get => Resolve(StationParamConst.CloudServerIp);
set => Set(StationParamConst.CloudServerIp, value);
}
public static int CloudServerPort
{
get
{
string port = Resolve(StationParamConst.CloudServerPort, "33000");
return int.Parse(port);
}
set => Set(StationParamConst.CloudServerPort, value);
}
public static string CloudServerMqttVersion
{
get => Resolve(StationParamConst.CloudServerMqttVersion, "4.0.0");
set => Set(StationParamConst.CloudServerMqttVersion, value);
}
public static string CloudClientId
{
get => Resolve(StationParamConst.CloudClientId);
set => Set(StationParamConst.CloudClientId, value);
}
public static string CloudUsername
{
get => Resolve(StationParamConst.CloudUsername);
set => Set(StationParamConst.CloudUsername, value);
}
public static string CloudPassword
{
get => Resolve(StationParamConst.CloudPassword);
set => Set(StationParamConst.CloudPassword, value);
}
public static string CloudSubTopic
{
get => Resolve(StationParamConst.CloudSubTopic);
set => Set(StationParamConst.CloudSubTopic, value);
}
public static string CloudPubTopic
{
get => Resolve(StationParamConst.CloudPubTopic);
set => Set(StationParamConst.CloudPubTopic, value);
}
#endregion
#region db method
private static SysConfigService _sysConfigService;
private static string Resolve(string key, string? value = default)
{
if (_sysConfigService == null)
{
_sysConfigService = AppInfo.Container.Resolve();
}
string? s = _sysConfigService.Get(key);
if (s != null)
{
return s;
}
return value;
}
private static void Set(string key, object value)
{
if (_sysConfigService == null)
{
_sysConfigService = AppInfo.Container.Resolve();
}
_sysConfigService.Set(key, value);
}
#endregion
}