|
|
@ -10,6 +10,7 @@ using Entity.DbModel.System.SysBaseObject;
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
using Microsoft.VisualBasic;
|
|
|
|
using Microsoft.VisualBasic;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
|
|
using Service.Init;
|
|
|
|
using Service.Station;
|
|
|
|
using Service.Station;
|
|
|
|
using Service.System;
|
|
|
|
using Service.System;
|
|
|
|
|
|
|
|
|
|
|
@ -133,105 +134,44 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 获取换电策略设置 、灯光日间时间、充电运营模式、营业时间段、换电运营模式
|
|
|
|
/// 获取换电策略设置 、灯光日间时间、充电运营模式、营业时间段、换电运营模式
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("BaseSetStationConfigInfo")]
|
|
|
|
[HttpPost("StationBaseConfig")]
|
|
|
|
public async Task<Result<BaseSetStationConfigInfo>> BaseSetStationConfigInfo()
|
|
|
|
public async Task<Result<StationConfigResp>> StationBaseConfig()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BaseSetStationConfigInfo stationBaseInfoResp = new BaseSetStationConfigInfo();
|
|
|
|
StationConfigResp stationBaseRespResp = new StationConfigResp();
|
|
|
|
List<SysConfig> sysConfigs = await _sysConfigService.GetGroupList("Station");
|
|
|
|
|
|
|
|
foreach (var item in sysConfigs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stationBaseInfoResp.Version = await _elecPriceModelVersionService.GetNowVersion();
|
|
|
|
|
|
|
|
return Result<BaseSetStationConfigInfo>.Success(stationBaseInfoResp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stationBaseRespResp.SwapSoc = StaticStationInfo.SwapSoc;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
stationBaseRespResp.SwapFinishChargeTime = StaticStationInfo.SwapFinishChargeTime;
|
|
|
|
/// 提交换电策略设置
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpPost("SetReplacementStrategy")]
|
|
|
|
|
|
|
|
public async Task<Result<bool>> SetReplacementStrategy([FromBody] SetReplacementStrategyReq input)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
stationBaseRespResp.StationWay = StaticStationInfo.StationWay;
|
|
|
|
/// 日间时间设置
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[HttpPost("SetDaytime")]
|
|
|
|
|
|
|
|
public async Task<Result<bool>> SetDaytime([FromBody] SetDayTimeReq input)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
stationBaseRespResp.Ceid = StaticStationInfo.Ceid;
|
|
|
|
/// 充电运营模式 0:手动充电;1:自动充电
|
|
|
|
stationBaseRespResp.AutoChargeEnabled = StaticStationInfo.AutoChargeEnabled;
|
|
|
|
/// </summary>
|
|
|
|
stationBaseRespResp.Oid = StaticStationInfo.Oid;
|
|
|
|
/// <param name="input"></param>
|
|
|
|
stationBaseRespResp.StationStatus = StaticStationInfo.StationStatus;
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpPost("SetChargingOperationMode")]
|
|
|
|
|
|
|
|
public async Task<Result<bool>> SetChargingOperationMode([FromBody] SetChargingOperationModeReq input)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
return Result<StationConfigResp>.Success(stationBaseRespResp);
|
|
|
|
/// 营业时间设置
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpPost("SetBusinessHours")]
|
|
|
|
|
|
|
|
public async Task<Result<bool>> SetBusinessHours([FromBody] SetBusinessHoursReq input)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 换电运营模式:1:自动;2:手动
|
|
|
|
/// 提交换电策略设置
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("SetSwitchingOperaModeReq")]
|
|
|
|
[HttpPost("SetStationConfig")]
|
|
|
|
public async Task<Result<bool>> SetSwitchingOperationMode([FromBody] SetSwitchingOperaModeReq input)
|
|
|
|
public async Task<Result<bool>> SetStationConfig([FromBody] StationConfigReq input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool setResult = SetConfigPorperty(input);
|
|
|
|
StaticStationInfo.SwapSoc = input.SwapSoc;
|
|
|
|
return Result<bool>.Success(setResult);
|
|
|
|
StaticStationInfo.StationStatus = input.StationStatus;
|
|
|
|
|
|
|
|
StaticStationInfo.SwapFinishChargeTime = input.SwapFinishChargeTime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StaticStationInfo.AutoChargeEnabled = input.AutoChargeEnabled;
|
|
|
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 查询电价信息
|
|
|
|
/// 查询电价信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -248,12 +188,13 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
elecPriceModelVersionDetailResps.Add(new ElecPriceModelVersionDetailResp()
|
|
|
|
elecPriceModelVersionDetailResps.Add(new ElecPriceModelVersionDetailResp()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Version = item.Version,
|
|
|
|
Version = item.Version,
|
|
|
|
StartTime = new TimeSpan(item.StartHour,item.StartMinute,item.StartSecond),
|
|
|
|
StartTime = new TimeSpan(item.StartHour, item.StartMinute, item.StartSecond),
|
|
|
|
EndTime = new TimeSpan(item.EndHour,item.EndMinute,item.EndSecond),
|
|
|
|
EndTime = new TimeSpan(item.EndHour, item.EndMinute, item.EndSecond),
|
|
|
|
Price = item.Price,
|
|
|
|
Price = item.Price,
|
|
|
|
Type = item.Price
|
|
|
|
Type = item.Price
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Result<List<ElecPriceModelVersionDetailResp>>.Success(elecPriceModelVersionDetailResps);
|
|
|
|
return Result<List<ElecPriceModelVersionDetailResp>>.Success(elecPriceModelVersionDetailResps);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -263,13 +204,14 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("AddStationElecPriceInfoList")]
|
|
|
|
[HttpPost("AddStationElecPriceInfoList")]
|
|
|
|
public async Task<Result<bool>> AddStationElecPriceInfoList([FromBody] List<ElecPriceModelVersionDetailReq> model)
|
|
|
|
public async Task<Result<bool>> AddStationElecPriceInfoList(
|
|
|
|
|
|
|
|
[FromBody] List<ElecPriceModelVersionDetailReq> model)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (null == model || model.Count == 0)
|
|
|
|
if (null == model || model.Count == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Result<bool>.Fail("参数不能为空");
|
|
|
|
Result<bool>.Fail("参数不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<ElecPriceModelVersionDetail> elecPriceModelVersionDetails = new List<ElecPriceModelVersionDetail>();
|
|
|
|
List<ElecPriceModelVersionDetail> elecPriceModelVersionDetails = new List<ElecPriceModelVersionDetail>();
|
|
|
|
foreach (var item in model)
|
|
|
|
foreach (var item in model)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -286,12 +228,13 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
Type = item.Type
|
|
|
|
Type = item.Type
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<ElecPriceModelVersionDetail> modelFromDbs = await _elecPriceModelVersionDetailServices.QueryListByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
List<ElecPriceModelVersionDetail> modelFromDbs =
|
|
|
|
|
|
|
|
await _elecPriceModelVersionDetailServices.QueryListByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
if (modelFromDbs != null)
|
|
|
|
if (modelFromDbs != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
modelFromDbs.AddRange(elecPriceModelVersionDetails);
|
|
|
|
modelFromDbs.AddRange(elecPriceModelVersionDetails);
|
|
|
|
if ( TimeListIfContains(modelFromDbs))
|
|
|
|
if (TimeListIfContains(modelFromDbs))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await _elecPriceModelVersionDetailServices.InsertAsync(elecPriceModelVersionDetails);
|
|
|
|
await _elecPriceModelVersionDetailServices.InsertAsync(elecPriceModelVersionDetails);
|
|
|
|
return Result<bool>.Success(true);
|
|
|
|
return Result<bool>.Success(true);
|
|
|
@ -300,26 +243,28 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 更新电价信息
|
|
|
|
/// 更新电价信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("UpdateStationElecPriceInfoList")]
|
|
|
|
[HttpPost("UpdateStationElecPriceInfoList")]
|
|
|
|
public async Task<Result<bool>> UpdateStationElecPriceInfoList([FromBody] List<ElecPriceModelVersionDetailReq> model)
|
|
|
|
public async Task<Result<bool>> UpdateStationElecPriceInfoList(
|
|
|
|
|
|
|
|
[FromBody] List<ElecPriceModelVersionDetailReq> model)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (null == model || model.Count == 0)
|
|
|
|
if (null == model || model.Count == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Result<bool>.Fail("参数不能为空");
|
|
|
|
Result<bool>.Fail("参数不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<ElecPriceModelVersionDetail> modelFromDbs = await _elecPriceModelVersionDetailServices.QueryListByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
List<ElecPriceModelVersionDetail> modelFromDbs =
|
|
|
|
|
|
|
|
await _elecPriceModelVersionDetailServices.QueryListByClauseAsync(u => u.Version == model[0].Version);
|
|
|
|
if (modelFromDbs != null)
|
|
|
|
if (modelFromDbs != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await _elecPriceModelVersionDetailServices.DeleteAsync(i => i.Version == model[0].Version);
|
|
|
|
await _elecPriceModelVersionDetailServices.DeleteAsync(i => i.Version == model[0].Version);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<ElecPriceModelVersionDetail> elecPriceModelVersionDetails = new List<ElecPriceModelVersionDetail>();
|
|
|
|
List<ElecPriceModelVersionDetail> elecPriceModelVersionDetails = new List<ElecPriceModelVersionDetail>();
|
|
|
|
foreach (var item in model)
|
|
|
|
foreach (var item in model)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -337,11 +282,12 @@ namespace WebStarter.Controllers.BasicConfig
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( TimeListIfContains(elecPriceModelVersionDetails))
|
|
|
|
if (TimeListIfContains(elecPriceModelVersionDetails))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await _elecPriceModelVersionDetailServices.InsertAsync(elecPriceModelVersionDetails);
|
|
|
|
await _elecPriceModelVersionDetailServices.InsertAsync(elecPriceModelVersionDetails);
|
|
|
|
return Result<bool>.Success(true);
|
|
|
|
return Result<bool>.Success(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
return Result<bool>.Fail("时间区间重复请检查");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|