|
|
@ -13,6 +13,7 @@ using Service.Execute.Model;
|
|
|
|
using Service.Execute.Model.Tbox;
|
|
|
|
using Service.Execute.Model.Tbox;
|
|
|
|
using Service.Init;
|
|
|
|
using Service.Init;
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
|
|
|
using Entity.Dto.Req;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Service.Execute.Api;
|
|
|
|
namespace Service.Execute.Api;
|
|
|
|
|
|
|
|
|
|
|
@ -32,13 +33,13 @@ public abstract class CloudApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CarAuth carAuth = new()
|
|
|
|
CarAuth carAuth = new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ty = 2,
|
|
|
|
authType = 1,
|
|
|
|
rfid = rfidReadModel.VelVin,
|
|
|
|
rfid = rfidReadModel.VelVin,
|
|
|
|
cn = rfidReadModel.VelNo,
|
|
|
|
carNo = rfidReadModel.VelNo,
|
|
|
|
vi = rfidReadModel.VelVin,
|
|
|
|
vin = rfidReadModel.VelVin,
|
|
|
|
// mac = rfidReadModel.VelMac,
|
|
|
|
// mac = rfidReadModel.VelMac,
|
|
|
|
en = 0,
|
|
|
|
channel = 0,
|
|
|
|
dt = swapOrder.VehicleEnterTime,
|
|
|
|
enterTime = swapOrder.VehicleEnterTime,
|
|
|
|
mode = 0,
|
|
|
|
mode = 0,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -61,37 +62,47 @@ public abstract class CloudApi
|
|
|
|
/// <param name="rfidReadModel"></param>
|
|
|
|
/// <param name="rfidReadModel"></param>
|
|
|
|
/// <param name="swapOrder"></param>
|
|
|
|
/// <param name="swapOrder"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public static int UploadSwapOrder(SwapOrder swapOrder, int seq, SwapOrderBattery swapOrderBattery, int uploadType
|
|
|
|
public static int UploadSwapOrder(SwapOrder swapOrder, int seq, List<SwapOrderBattery> swapOrderBattery, int uploadType
|
|
|
|
,SwapOrderReportCloud orderReportCloud)
|
|
|
|
,SwapOrderReportCloud orderReportCloud)
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
List<SwapOrderBatteryRecord> swapOrderBatteryList = new List<SwapOrderBatteryRecord>();
|
|
|
|
|
|
|
|
foreach (var orderBattery in swapOrderBattery)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SwapOrderBatteryRecord batteryRecord = new SwapOrderBatteryRecord();
|
|
|
|
|
|
|
|
batteryRecord.outBatteryNo = orderBattery.UpBatteryNo;
|
|
|
|
|
|
|
|
batteryRecord.outBin = orderBattery.UpBatteryBinNo;
|
|
|
|
|
|
|
|
batteryRecord.outSoc = orderBattery.UpBatterySoc.ToInt();
|
|
|
|
|
|
|
|
batteryRecord.enterBatteryNo = orderBattery.DownBatteryNo;
|
|
|
|
|
|
|
|
batteryRecord.enterBin = orderBattery.DownBatteryBinNo;
|
|
|
|
|
|
|
|
batteryRecord.enterSoc = orderBattery.DownBatterySoc.ToInt();
|
|
|
|
|
|
|
|
batteryRecord.outSoe = orderBattery.UpBatterySoe.ToInt();
|
|
|
|
|
|
|
|
batteryRecord.enterSoe = orderBattery.DownBatterySoe.ToInt();
|
|
|
|
|
|
|
|
swapOrderBatteryList.Add(batteryRecord);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
StaSwapRecord staSwapRecord = new()
|
|
|
|
StaSwapRecord staSwapRecord = new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rfid = swapOrder.VehicleVin,
|
|
|
|
rfid = swapOrder.VehicleVin,
|
|
|
|
sn = StaticStationInfo.StationNo,
|
|
|
|
stationNo = StaticStationInfo.StationNo,
|
|
|
|
son = swapOrder.CloudSn,
|
|
|
|
orderNo = swapOrder.CloudSn,
|
|
|
|
cn = swapOrder.VehicleNo,
|
|
|
|
carNo = swapOrder.VehicleNo,
|
|
|
|
so = seq,
|
|
|
|
swapDayCount = seq,
|
|
|
|
ct = swapOrder.VehicleEnterTime,
|
|
|
|
recognizeTime = swapOrder.VehicleEnterTime,
|
|
|
|
st = swapOrder.SwapBeginTime,
|
|
|
|
startTime = swapOrder.SwapBeginTime,
|
|
|
|
dbid = swapOrderBattery.UpBatteryNo,
|
|
|
|
|
|
|
|
deno = swapOrderBattery.UpBatteryBinNo,
|
|
|
|
|
|
|
|
dsoc = swapOrderBattery.UpBatterySoc.ToInt(),
|
|
|
|
|
|
|
|
//dsoe = swapOrderBattery.UpBatterySoe.ToInt(),
|
|
|
|
//dsoe = swapOrderBattery.UpBatterySoe.ToInt(),
|
|
|
|
et = swapOrder.SwapEndTime,
|
|
|
|
endTime = swapOrder.SwapEndTime,
|
|
|
|
od = 0,
|
|
|
|
cancelFlag = 0,
|
|
|
|
ot = swapOrder.VehicleLeaveTime,
|
|
|
|
leaveTime = swapOrder.VehicleLeaveTime,
|
|
|
|
rs = 0,
|
|
|
|
result = 0,
|
|
|
|
sflx = 0,
|
|
|
|
offlineFlag = 0,
|
|
|
|
sfs = uploadType,
|
|
|
|
reportType = uploadType,
|
|
|
|
ubid = swapOrderBattery.DownBatteryNo,
|
|
|
|
|
|
|
|
ueno = swapOrderBattery.DownBatteryBinNo,
|
|
|
|
|
|
|
|
usoc = swapOrderBattery.DownBatterySoc.ToInt(),
|
|
|
|
|
|
|
|
// usoe = swapOrderBattery.DownBatterySoe.ToInt(),
|
|
|
|
// usoe = swapOrderBattery.DownBatterySoe.ToInt(),
|
|
|
|
vin = swapOrder.VehicleVin,
|
|
|
|
vin = swapOrder.VehicleVin,
|
|
|
|
wt = new TimeSpan((swapOrder.SwapEndTime.ToDateTime().Ticks - swapOrder.SwapBeginTime.ToDateTime().Ticks))
|
|
|
|
swapTime = new TimeSpan((swapOrder.SwapEndTime.ToDateTime().Ticks - swapOrder.SwapBeginTime.ToDateTime().Ticks))
|
|
|
|
.TotalSeconds.ToInt(),
|
|
|
|
.TotalSeconds.ToInt(),
|
|
|
|
vtm=orderReportCloud.Vtm,
|
|
|
|
vehicleTotalMiles=orderReportCloud.Vtm,
|
|
|
|
|
|
|
|
batteryList=swapOrderBatteryList,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Log.Info(
|
|
|
|
Log.Info(
|
|
|
|
$" CloudApi UploadSwapOrder seq={seq} SendUploadPowerChangeOrder param={JsonConvert.SerializeObject(staSwapRecord)}");
|
|
|
|
$" CloudApi UploadSwapOrder seq={seq} SendUploadPowerChangeOrder param={JsonConvert.SerializeObject(staSwapRecord)}");
|
|
|
@ -107,7 +118,7 @@ public abstract class CloudApi
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return sendUploadPowerChangeOrder.re;
|
|
|
|
return sendUploadPowerChangeOrder.result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -128,13 +139,13 @@ public abstract class CloudApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
stationChnRunStatus = new()
|
|
|
|
stationChnRunStatus = new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ec = 0,
|
|
|
|
passageNo = 0,
|
|
|
|
ws = StationSoftMgr.SwappingStateMachine.SwapStatus == 0 ? 2 : 3,
|
|
|
|
status = StationSoftMgr.SwappingStateMachine.SwapStatus == 0 ? 2 : 3,
|
|
|
|
cs = (int)StationSoftMgr.SwappingStateMachine.BusinessSwappingForCloudState,
|
|
|
|
passageStatus = (int)StationSoftMgr.SwappingStateMachine.BusinessSwappingForCloudState,
|
|
|
|
iv = StationSoftMgr.SwappingStateMachine.RadarInFlag == true ? 1 : 2,
|
|
|
|
carFlag = StationSoftMgr.SwappingStateMachine.RadarInFlag == true ? 1 : 2,
|
|
|
|
ls = StationSoftMgr.SwappingStateMachine.VelUnlockFlag == true ? 2 : 1,
|
|
|
|
lockStatus = StationSoftMgr.SwappingStateMachine.VelUnlockFlag == true ? 2 : 1,
|
|
|
|
fl = Convert.ToInt32(StaticStationInfo.Faultlevel),
|
|
|
|
faultLevel = Convert.ToInt32(StaticStationInfo.Faultlevel),
|
|
|
|
ut = DateTime.Now,
|
|
|
|
updateTime = DateTime.Now,
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -143,13 +154,13 @@ public abstract class CloudApi
|
|
|
|
|
|
|
|
|
|
|
|
stationChnRunStatus = new()
|
|
|
|
stationChnRunStatus = new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ec = 0,
|
|
|
|
passageNo = 0,
|
|
|
|
ws = 1,
|
|
|
|
status = 1,
|
|
|
|
cs = 1,
|
|
|
|
passageStatus = 1,
|
|
|
|
iv = 2,
|
|
|
|
carFlag = 2,
|
|
|
|
ls = 0,
|
|
|
|
lockStatus = 0,
|
|
|
|
fl = Convert.ToInt32(StaticStationInfo.Faultlevel),
|
|
|
|
faultLevel = Convert.ToInt32(StaticStationInfo.Faultlevel),
|
|
|
|
ut = DateTime.Now,
|
|
|
|
updateTime = DateTime.Now,
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -385,28 +396,26 @@ public abstract class CloudApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SignIn signIn = new()
|
|
|
|
SignIn signIn = new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sn = StaticStationInfo.StationNo,
|
|
|
|
stationNo = StaticStationInfo.StationNo,
|
|
|
|
ky = StaticStationInfo.StationSn,
|
|
|
|
supplierCode = StaticStationInfo.StationSn,
|
|
|
|
st = "02",
|
|
|
|
stationType = "02",
|
|
|
|
dv = "",
|
|
|
|
equipmentType = "",
|
|
|
|
sv = StaticStationInfo.StationSftVer,
|
|
|
|
version = StaticStationInfo.StationSftVer,
|
|
|
|
ss = StaticStationInfo.Sevstatus,
|
|
|
|
stationStatus = StaticStationInfo.Sevstatus,
|
|
|
|
ca = Convert.ToSingle(StaticStationInfo.DistributionCapacity),
|
|
|
|
stationCapacity = Convert.ToSingle(StaticStationInfo.DistributionCapacity),
|
|
|
|
|
|
|
|
|
|
|
|
VS = "1.0",
|
|
|
|
equipmentVersion = "1.0",
|
|
|
|
cp = Convert.ToInt32(StaticStationInfo.TotalPower),
|
|
|
|
chargePower = Convert.ToInt32(StaticStationInfo.TotalPower),
|
|
|
|
bs= StaticStationInfo.StationVersion,
|
|
|
|
stationVersion= StaticStationInfo.StationVersion,
|
|
|
|
lo= StaticStationInfo.Longitude,
|
|
|
|
lo= StaticStationInfo.Longitude,
|
|
|
|
la= StaticStationInfo.Latitude,
|
|
|
|
la= StaticStationInfo.Latitude,
|
|
|
|
en=1,
|
|
|
|
channelNumber=1,
|
|
|
|
cn=7,
|
|
|
|
chargerNumber=7,
|
|
|
|
eid= Convert.ToInt32(StaticStationInfo.Ceid),
|
|
|
|
electricityId= Convert.ToInt32(StaticStationInfo.Ceid),
|
|
|
|
oid = Convert.ToInt32(StaticStationInfo.Oid),
|
|
|
|
billingId = Convert.ToInt32(StaticStationInfo.Oid),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//CloudClientMgr.CloudClient?.SendSignIn(signIn,
|
|
|
|
CloudClientMgr.CloudClient?.SendSignIn(signIn,
|
|
|
|
// global::System.TimeSpan.FromSeconds(TimeSpan));
|
|
|
|
global::System.TimeSpan.FromSeconds(TimeSpan));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|