|
|
|
@ -7,6 +7,7 @@ using Repository.Station;
|
|
|
|
|
using Service.Charger.Client;
|
|
|
|
|
using Service.Charger.Msg.Host.Req;
|
|
|
|
|
using Service.Init;
|
|
|
|
|
using Service.WaterCool.Client;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
|
|
|
|
namespace Service.Charger;
|
|
|
|
@ -77,6 +78,21 @@ public class ChargerService
|
|
|
|
|
return Result<bool>.Fail(@"充电机未连接");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
WaterCoolClientMgr.Dictionary.TryGetValue(StaticStationInfo.RelationMap[chargerClient.Sn].WaterCoolerCode,
|
|
|
|
|
out WaterCoolClient client);
|
|
|
|
|
if (client == null)
|
|
|
|
|
{
|
|
|
|
|
return Result<bool>.Fail("未初始化液冷");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!client.HeartManageStop())
|
|
|
|
|
{
|
|
|
|
|
return Result<bool>.Fail("液冷系统断开失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
client.StopFlag = true;
|
|
|
|
|
|
|
|
|
|
chargerClient.SendRemoteStopCharging();
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Success(true, "发送停止命令成功");
|
|
|
|
@ -114,30 +130,78 @@ public class ChargerService
|
|
|
|
|
SetPeakValleyTime setPeakValleyTime = new SetPeakValleyTime()
|
|
|
|
|
{
|
|
|
|
|
NumberTime = Convert.ToByte(elecPriceModelVersionDetails.Count),
|
|
|
|
|
StartHH1 = (byte)(elecPriceModelVersionDetails.Count > 0?Convert.ToByte(elecPriceModelVersionDetails[0].StartHour) :0),
|
|
|
|
|
StartHH2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].StartHour) : 0),
|
|
|
|
|
StartHH3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].StartHour):0),
|
|
|
|
|
StartHH4 = (byte)(elecPriceModelVersionDetails.Count > 3?Convert.ToByte(elecPriceModelVersionDetails[3].StartHour):0),
|
|
|
|
|
StartHH5 = (byte)(elecPriceModelVersionDetails.Count > 4?Convert.ToByte(elecPriceModelVersionDetails[4].StartHour):0),
|
|
|
|
|
StartHH6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartHour):0),
|
|
|
|
|
StartHH7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartHour):0),
|
|
|
|
|
StartHH8 = (byte)(elecPriceModelVersionDetails.Count > 7?Convert.ToByte(elecPriceModelVersionDetails[7].StartHour) : 0),
|
|
|
|
|
StartMM1 = (byte)(elecPriceModelVersionDetails.Count > 0?Convert.ToByte(elecPriceModelVersionDetails[0].StartMinute):0),
|
|
|
|
|
StartMM2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].StartMinute):0),
|
|
|
|
|
StartMM3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].StartMinute):0),
|
|
|
|
|
StartMM4 = (byte)(elecPriceModelVersionDetails.Count > 3?Convert.ToByte(elecPriceModelVersionDetails[3].StartMinute):0),
|
|
|
|
|
StartMM5 = (byte)(elecPriceModelVersionDetails.Count > 4?Convert.ToByte(elecPriceModelVersionDetails[4].StartMinute):0),
|
|
|
|
|
StartMM6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].StartMinute):0),
|
|
|
|
|
StartMM7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].StartMinute) : 0),
|
|
|
|
|
StartMM8 = (byte)(elecPriceModelVersionDetails.Count > 7 ? Convert.ToByte(elecPriceModelVersionDetails[7].StartMinute) : 0),
|
|
|
|
|
TimePeak1 = (byte)(elecPriceModelVersionDetails.Count > 0 ? Convert.ToByte(elecPriceModelVersionDetails[0].Type):0),
|
|
|
|
|
TimePeak2 = (byte)(elecPriceModelVersionDetails.Count > 1?Convert.ToByte(elecPriceModelVersionDetails[1].Type):0),
|
|
|
|
|
TimePeak3 = (byte)(elecPriceModelVersionDetails.Count > 2?Convert.ToByte(elecPriceModelVersionDetails[2].Type):0),
|
|
|
|
|
TimePeak4 = (byte)(elecPriceModelVersionDetails.Count > 3?Convert.ToByte(elecPriceModelVersionDetails[3].Type):0),
|
|
|
|
|
TimePeak5 = (byte)(elecPriceModelVersionDetails.Count > 4?Convert.ToByte(elecPriceModelVersionDetails[4].Type):0),
|
|
|
|
|
TimePeak6 = (byte)(elecPriceModelVersionDetails.Count > 5?Convert.ToByte(elecPriceModelVersionDetails[5].Type):0),
|
|
|
|
|
TimePeak7 = (byte)(elecPriceModelVersionDetails.Count > 6?Convert.ToByte(elecPriceModelVersionDetails[6].Type):0),
|
|
|
|
|
TimePeak8 = (byte)(elecPriceModelVersionDetails.Count > 7?Convert.ToByte(elecPriceModelVersionDetails[7].Type):0)
|
|
|
|
|
StartHH1 = (byte)(elecPriceModelVersionDetails.Count > 0
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[0].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartHH2 = (byte)(elecPriceModelVersionDetails.Count > 1
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[1].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartHH3 = (byte)(elecPriceModelVersionDetails.Count > 2
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[2].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartHH4 = (byte)(elecPriceModelVersionDetails.Count > 3
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[3].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartHH5 = (byte)(elecPriceModelVersionDetails.Count > 4
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[4].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartHH6 = (byte)(elecPriceModelVersionDetails.Count > 5
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[5].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartHH7 = (byte)(elecPriceModelVersionDetails.Count > 6
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[6].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartHH8 = (byte)(elecPriceModelVersionDetails.Count > 7
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[7].StartHour)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM1 = (byte)(elecPriceModelVersionDetails.Count > 0
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[0].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM2 = (byte)(elecPriceModelVersionDetails.Count > 1
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[1].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM3 = (byte)(elecPriceModelVersionDetails.Count > 2
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[2].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM4 = (byte)(elecPriceModelVersionDetails.Count > 3
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[3].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM5 = (byte)(elecPriceModelVersionDetails.Count > 4
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[4].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM6 = (byte)(elecPriceModelVersionDetails.Count > 5
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[5].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM7 = (byte)(elecPriceModelVersionDetails.Count > 6
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[6].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
StartMM8 = (byte)(elecPriceModelVersionDetails.Count > 7
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[7].StartMinute)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak1 = (byte)(elecPriceModelVersionDetails.Count > 0
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[0].Type)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak2 = (byte)(elecPriceModelVersionDetails.Count > 1
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[1].Type)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak3 = (byte)(elecPriceModelVersionDetails.Count > 2
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[2].Type)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak4 = (byte)(elecPriceModelVersionDetails.Count > 3
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[3].Type)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak5 = (byte)(elecPriceModelVersionDetails.Count > 4
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[4].Type)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak6 = (byte)(elecPriceModelVersionDetails.Count > 5
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[5].Type)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak7 = (byte)(elecPriceModelVersionDetails.Count > 6
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[6].Type)
|
|
|
|
|
: 0),
|
|
|
|
|
TimePeak8 = (byte)(elecPriceModelVersionDetails.Count > 7
|
|
|
|
|
? Convert.ToByte(elecPriceModelVersionDetails[7].Type)
|
|
|
|
|
: 0)
|
|
|
|
|
};
|
|
|
|
|
return setPeakValleyTime;
|
|
|
|
|
}
|
|
|
|
@ -153,7 +217,8 @@ public class ChargerService
|
|
|
|
|
if (binInfos.Count > 0)
|
|
|
|
|
batteryStatusInfoResp.btyTotalCount = binInfos.Count();
|
|
|
|
|
List<BinInfo> canSwapCounts = BinInfoRepository.QueryListByClause(i =>
|
|
|
|
|
i.Exists == 1 && i.Status == 1 && i.Soc >= Convert.ToDecimal(StaticStationInfo.SwapSoc) && i.ChargeStatus!=1);
|
|
|
|
|
i.Exists == 1 && i.Status == 1 && i.Soc >= Convert.ToDecimal(StaticStationInfo.SwapSoc) &&
|
|
|
|
|
i.ChargeStatus != 1);
|
|
|
|
|
if (canSwapCounts.Count > 0)
|
|
|
|
|
batteryStatusInfoResp.canSwapCount = canSwapCounts.Count();
|
|
|
|
|
List<BinInfo> chargingCounts =
|
|
|
|
|