|
|
|
@ -25,13 +25,18 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
private readonly SysConfigService _sysConfigService;
|
|
|
|
|
private readonly ElecPriceModelVersionDetailServices _elecPriceModelVersionDetailServices;
|
|
|
|
|
private readonly ElecPriceModelVersionService _elecPriceModelVersionService;
|
|
|
|
|
public BaseConfigController(SysConfigService sysConfigService, ElecPriceModelVersionDetailServices elecPriceModelVersionDetailServices)
|
|
|
|
|
|
|
|
|
|
public BaseConfigController(SysConfigService sysConfigService,
|
|
|
|
|
ElecPriceModelVersionDetailServices elecPriceModelVersionDetailServices,
|
|
|
|
|
ElecPriceModelVersionService priceModelVersionService)
|
|
|
|
|
{
|
|
|
|
|
_sysConfigService = sysConfigService;
|
|
|
|
|
_elecPriceModelVersionDetailServices = elecPriceModelVersionDetailServices;
|
|
|
|
|
_elecPriceModelVersionService = priceModelVersionService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region RFID配置
|
|
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
|
// /// 预览
|
|
|
|
|
// /// 车型 的ASCLL、解析后信息
|
|
|
|
@ -122,6 +127,7 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
|
|
|
|
|
// return Result<List<string>>.Success();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
#endregion RFID配置
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -136,23 +142,38 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
{
|
|
|
|
|
switch (item.Code)
|
|
|
|
|
{
|
|
|
|
|
case "LightDayStartTime": stationBaseInfoResp.LigthStartTime = item.Value; break;
|
|
|
|
|
case "LightDayEndTime": stationBaseInfoResp.LigthEndTime = item.Value; break;
|
|
|
|
|
case "SwapSoc": stationBaseInfoResp.SetSwapSoc = Convert.ToInt32(item.Value); break;
|
|
|
|
|
case "FullSoc": stationBaseInfoResp.SetFullSoc = Convert.ToInt32(item.Value); break;
|
|
|
|
|
case "ChargeType": stationBaseInfoResp.ChargeType = Convert.ToInt32(item.Value); break;
|
|
|
|
|
case "SwapType": stationBaseInfoResp.SwapType = Convert.ToInt32(item.Value); break;
|
|
|
|
|
case "BusinessStartHours": stationBaseInfoResp.BusinessStartHours = item.Value; break;
|
|
|
|
|
case "BusinessEndHours": stationBaseInfoResp.BusinessEndHours = item.Value; break;
|
|
|
|
|
case "LightDayStartTime":
|
|
|
|
|
stationBaseInfoResp.LigthStartTime = item.Value;
|
|
|
|
|
break;
|
|
|
|
|
case "LightDayEndTime":
|
|
|
|
|
stationBaseInfoResp.LigthEndTime = item.Value;
|
|
|
|
|
break;
|
|
|
|
|
case "SwapSoc":
|
|
|
|
|
stationBaseInfoResp.SetSwapSoc = Convert.ToInt32(item.Value);
|
|
|
|
|
break;
|
|
|
|
|
case "FullSoc":
|
|
|
|
|
stationBaseInfoResp.SetFullSoc = Convert.ToInt32(item.Value);
|
|
|
|
|
break;
|
|
|
|
|
case "ChargeType":
|
|
|
|
|
stationBaseInfoResp.ChargeType = Convert.ToInt32(item.Value);
|
|
|
|
|
break;
|
|
|
|
|
case "SwapType":
|
|
|
|
|
stationBaseInfoResp.SwapType = Convert.ToInt32(item.Value);
|
|
|
|
|
break;
|
|
|
|
|
case "BusinessStartHours":
|
|
|
|
|
stationBaseInfoResp.BusinessStartHours = item.Value;
|
|
|
|
|
break;
|
|
|
|
|
case "BusinessEndHours":
|
|
|
|
|
stationBaseInfoResp.BusinessEndHours = item.Value;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
stationBaseInfoResp.Version=await _elecPriceModelVersionService.GetNowVersion();
|
|
|
|
|
|
|
|
|
|
stationBaseInfoResp.Version = await _elecPriceModelVersionService.GetNowVersion();
|
|
|
|
|
return Result<BaseSetStationConfigInfo>.Success(stationBaseInfoResp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提交换电策略设置
|
|
|
|
|
/// </summary>
|
|
|
|
@ -164,7 +185,7 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 日间时间设置
|
|
|
|
|
/// </summary>
|
|
|
|
@ -174,7 +195,7 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 充电运营模式 0:手动充电;1:自动充电
|
|
|
|
|
/// </summary>
|
|
|
|
@ -186,7 +207,7 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 营业时间设置
|
|
|
|
|
/// </summary>
|
|
|
|
@ -198,6 +219,7 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 换电运营模式:1:自动;2:手动
|
|
|
|
|
/// </summary>
|
|
|
|
@ -209,7 +231,7 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询电价信息
|
|
|
|
|
/// </summary>
|
|
|
|
@ -221,7 +243,7 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
var data = await _elecPriceModelVersionDetailServices.QueryListByClauseAsync(u => u.Version == version);
|
|
|
|
|
return Result<List<ElecPriceModelVersionDetail>>.Success(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加电价信息
|
|
|
|
|
/// </summary>
|
|
|
|
@ -230,22 +252,25 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
[HttpPost("AddStationElecPriceInfoList")]
|
|
|
|
|
public async Task<Result<bool>> AddStationElecPriceInfoList([FromBody] List<ElecPriceModelVersionDetail> model)
|
|
|
|
|
{
|
|
|
|
|
if (null==model||model.Count==0)
|
|
|
|
|
if (null == model || model.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
Result<bool>.Fail("参数不能为空");
|
|
|
|
|
}
|
|
|
|
|
var queryByClauseAsync = _elecPriceModelVersionDetailServices.QueryByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
|
if(queryByClauseAsync!=null)
|
|
|
|
|
await _elecPriceModelVersionDetailServices.DeleteAsync(i => i.Version ==model[0].Version);
|
|
|
|
|
|
|
|
|
|
var queryByClauseAsync =
|
|
|
|
|
_elecPriceModelVersionDetailServices.QueryByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
|
if (queryByClauseAsync != null)
|
|
|
|
|
await _elecPriceModelVersionDetailServices.DeleteAsync(i => i.Version == model[0].Version);
|
|
|
|
|
if (TimeListIfContains(model))
|
|
|
|
|
{
|
|
|
|
|
await _elecPriceModelVersionDetailServices.InsertAsync(model);
|
|
|
|
|
return Result<bool>.Success(true);
|
|
|
|
|
}
|
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 修改电价信息
|
|
|
|
|
/// </summary>
|
|
|
|
@ -254,25 +279,25 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
[HttpPost("UpdateStationElecPriceInfo")]
|
|
|
|
|
public async Task<Result<bool>> UpdateStationElecPriceInfo([FromBody] List<ElecPriceModelVersionDetail> model)
|
|
|
|
|
{
|
|
|
|
|
if (null==model||model.Count==0)
|
|
|
|
|
if (null == model || model.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
Result<bool>.Fail("参数不能为空");
|
|
|
|
|
}
|
|
|
|
|
var queryByClauseAsync = _elecPriceModelVersionDetailServices.QueryByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
|
if(queryByClauseAsync!=null)
|
|
|
|
|
await _elecPriceModelVersionDetailServices.DeleteAsync(i => i.Version ==model[0].Version);
|
|
|
|
|
|
|
|
|
|
var queryByClauseAsync =
|
|
|
|
|
_elecPriceModelVersionDetailServices.QueryByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
|
if (queryByClauseAsync != null)
|
|
|
|
|
await _elecPriceModelVersionDetailServices.DeleteAsync(i => i.Version == model[0].Version);
|
|
|
|
|
if (TimeListIfContains(model))
|
|
|
|
|
{
|
|
|
|
|
await _elecPriceModelVersionDetailServices.InsertAsync(model);
|
|
|
|
|
return Result<bool>.Success(true);
|
|
|
|
|
}
|
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// List中判断一个时间段是否包含另一个时间段(包括开始和结束时间的秒数)
|
|
|
|
|
/// </summary>
|
|
|
|
@ -287,13 +312,14 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
{
|
|
|
|
|
for (int j = i + 1; j < timePeriods.Count; j++)
|
|
|
|
|
{
|
|
|
|
|
if (timePeriods[i].Contains(timePeriods[j]) || timePeriods[j].Contains(timePeriods[i]))
|
|
|
|
|
{
|
|
|
|
|
hasOverlap = true;
|
|
|
|
|
if (timePeriods[i].Contains(timePeriods[j]) || timePeriods[j].Contains(timePeriods[i]))
|
|
|
|
|
{
|
|
|
|
|
hasOverlap = true;
|
|
|
|
|
return hasOverlap;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return hasOverlap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -314,7 +340,8 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
if (getContent != null)
|
|
|
|
|
setResult = _sysConfigService.Set(newConstConfigInfo, getContent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return setResult;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|