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