master
lxw 6 months ago
parent 9d7a6e553e
commit 83244ba0d6

@ -36,4 +36,6 @@ public class StationConfigReq
public int SwapFinishChargeTime { get; set; }
public int StationStatus { get; set; }
public byte ChargeSoc { get; set; }
}

@ -37,4 +37,9 @@ public class StationConfigResp
public int StationStatus { get; set; }
/// <summary>
/// 充电soc
/// </summary>
public byte ChargeSoc { get; set; }
}

@ -149,6 +149,7 @@ namespace WebStarter.Controllers.BasicConfig
stationBaseRespResp.AutoChargeEnabled = StaticStationInfo.AutoChargeEnabled;
stationBaseRespResp.Oid = StaticStationInfo.Oid;
stationBaseRespResp.StationStatus = StaticStationInfo.StationStatus;
stationBaseRespResp.ChargeSoc = StaticStationInfo.ChargeSoc;
return Result<StationConfigResp>.Success(stationBaseRespResp);
}
@ -167,6 +168,8 @@ namespace WebStarter.Controllers.BasicConfig
StaticStationInfo.SwapFinishChargeTime = input.SwapFinishChargeTime;
StaticStationInfo.AutoChargeEnabled = input.AutoChargeEnabled;
StaticStationInfo.ChargeSoc = input.ChargeSoc;
return Result<bool>.Success();
}
@ -193,6 +196,7 @@ namespace WebStarter.Controllers.BasicConfig
Type = item.Type
});
}
return Result<List<ElecPriceModelVersionDetailResp>>.Success(elecPriceModelVersionDetailResps);
}
@ -255,6 +259,7 @@ namespace WebStarter.Controllers.BasicConfig
{
Result<bool>.Fail("参数不能为空");
}
List<ElecPriceModelVersionDetail> elecPriceModelVersionDetails = new List<ElecPriceModelVersionDetail>();
foreach (var item in model)
{
@ -271,19 +276,21 @@ namespace WebStarter.Controllers.BasicConfig
Type = item.Type
});
}
if (!TimeListIfContains(elecPriceModelVersionDetails))
{
return 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)
{
await _elecPriceModelVersionDetailServices.DeleteAsync(i => i.Version == model[0].Version);
}
await _elecPriceModelVersionDetailServices.InsertAsync(elecPriceModelVersionDetails);
return Result<bool>.Success(true);
}

Loading…
Cancel
Save