From 7146351f4fc82d6e367ede9fab4df044e8f43d9d Mon Sep 17 00:00:00 2001
From: zby <24947@USER>
Date: Sun, 15 Sep 2024 14:05:03 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A8=E6=B5=81=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Entity/Api/Resp/SwapOrderBatteryResp.cs | 1 +
Entity/Dto/SwapOrderDto.cs | 191 ++++++++++--------
Service/Execute/Api/RfidApi.cs | 5 +-
Service/Execute/Step/SwapDoneState.cs | 4 +-
WebStarter/Controllers/SwapOrderController.cs | 1 +
5 files changed, 112 insertions(+), 90 deletions(-)
diff --git a/Entity/Api/Resp/SwapOrderBatteryResp.cs b/Entity/Api/Resp/SwapOrderBatteryResp.cs
index 3c27b18..55d1d22 100644
--- a/Entity/Api/Resp/SwapOrderBatteryResp.cs
+++ b/Entity/Api/Resp/SwapOrderBatteryResp.cs
@@ -220,5 +220,6 @@ namespace Entity.Api.Resp
/// 电量
///
public string ElectricQuantity { get; set; }
+
}
}
diff --git a/Entity/Dto/SwapOrderDto.cs b/Entity/Dto/SwapOrderDto.cs
index 0eb98ef..c5c654f 100644
--- a/Entity/Dto/SwapOrderDto.cs
+++ b/Entity/Dto/SwapOrderDto.cs
@@ -16,13 +16,6 @@ public class SwapOrderDto
[ExporterHeader(DisplayName = "站号", IsBold = true)]
public string StationNumber { get; set; }
- ///
- /// Desc:订单编号
- /// Default:
- /// Nullable:True
- ///
- [ExporterHeader(DisplayName = "订单编号", IsBold = true)]
- public string Sn { get; set; }
///
/// Desc:车牌号
@@ -121,6 +114,98 @@ public class SwapOrderDto
public string FailReason { get; set; }
+ ///
+ /// Desc:换电类型:;1自动换电;2手动换电
+ /// Default:0
+ /// Nullable:True
+ ///
+ [ExporterHeader(IsIgnore = true)]
+ public int? SwapWay { get; set; }
+
+
+ ///
+ /// Desc:亏电包编码
+ /// Default:
+ /// Nullable:True
+ ///
+ [ExporterHeader(DisplayName = "电池编号(存)", IsBold = true)]
+
+ public string? DownBatteryNo { get; set; }
+ ///
+ /// Desc:亏电包soc
+ /// Default:
+ /// Nullable:True
+ ///
+ [ExporterHeader(DisplayName = "soc(存)", IsBold = true)]
+
+ public decimal? DownBatterySoc { get; set; }
+
+ ///
+ /// Desc:放电池仓位号 亏电包仓号
+ /// Default:
+ /// Nullable:True
+ ///
+ [ExporterHeader(DisplayName = "放电池仓位号", IsBold = true)]
+ public int? DownBatteryBinNo { get; set; }
+
+ ///
+ /// Desc:取电池仓位号 满电包仓号
+ /// Default:
+ /// Nullable:True
+ ///
+ [ExporterHeader(DisplayName = "取电池仓位号", IsBold = true)]
+
+ public int? UpBatteryBinNo { get; set; }
+
+ ///
+ /// Desc:满电包编码
+ /// Default:
+ /// Nullable:True
+ ///
+ [ExporterHeader(DisplayName = "满电包编码(取)", IsBold = true)]
+
+ public string? UpBatteryNo { get; set; }
+
+ ///
+ /// Desc:满电包soc
+ /// Default:
+ /// Nullable:True
+ ///
+ [ExporterHeader(DisplayName = "满电包soc", IsBold = true)]
+
+ public decimal? UpBatterySoc { get; set; }
+ ///
+ /// 满电包电量
+ ///
+ [ExporterHeader(DisplayName = "电池电量(取)", IsBold = true)]
+ public string? UpBatteryElectricQuantity { get; set; }
+
+
+
+ ///
+ /// 亏电包电量
+ ///
+ [ExporterHeader(DisplayName = "电池电量(存)", IsBold = true)]
+ public string? DownBatteryElectricQuantity { get; set; }
+
+
+ ///
+ /// 电量差
+ ///
+ [ExporterHeader(DisplayName = "电池差值", IsBold = true)]
+ public string ElectricQuantity { get; set; }
+
+
+ ///
+ /// Desc:订单编号
+ /// Default:
+ /// Nullable:True
+ ///
+ [ExporterHeader(DisplayName = "订单编号", IsBold = true)]
+ public string Sn { get; set; }
+
+
+
///
/// Desc:上传云平台状态;0-未上传;1-已上传
/// Default:0
@@ -140,6 +225,10 @@ public class SwapOrderDto
}
}
+
+
+
+
// [ExporterHeader(DisplayName = "上传云平台状态", IsBold = true)]
[ExporterHeader(IsIgnore = true)] public int? CloudReportStatus { get; set; }
@@ -170,25 +259,6 @@ public class SwapOrderDto
}
-
- ///
- /// Desc:换电类型:;1自动换电;2手动换电
- /// Default:0
- /// Nullable:True
- ///
- [ExporterHeader(IsIgnore = true)]
- public int? SwapWay { get; set; }
-
-
- ///
- /// Desc:亏电包soc
- /// Default:
- /// Nullable:True
- ///
- [ExporterHeader(DisplayName = "亏电包soc", IsBold = true)]
-
- public decimal? DownBatterySoc { get; set; }
-
///
/// Desc:亏电包真实soc
/// Default:
@@ -198,6 +268,9 @@ public class SwapOrderDto
public decimal? DownBatteryRealSoc { get; set; }
+
+
+
///
/// Desc:亏电包上次换电结算时soc
/// Default:
@@ -207,76 +280,22 @@ public class SwapOrderDto
public decimal? DownBatteryLastSoc { get; set; }
+
///
- /// Desc:亏电包编码
+ /// Desc:满电包真实soc
/// Default:
/// Nullable:True
///
- [ExporterHeader(DisplayName = "亏电包编码", IsBold = true)]
+ [ExporterHeader(DisplayName = "满电包真实soc", IsBold = true)]
+
+ public decimal? UpBatteryRealSoc { get; set; }
+
- public string? DownBatteryNo { get; set; }
- ///
- /// Desc:满电包编码
- /// Default:
- /// Nullable:True
- ///
- [ExporterHeader(DisplayName = "满电包编码", IsBold = true)]
- public string? UpBatteryNo { get; set; }
- ///
- /// Desc:满电包soc
- /// Default:
- /// Nullable:True
- ///
- [ExporterHeader(DisplayName = "满电包soc", IsBold = true)]
- public decimal? UpBatterySoc { get; set; }
- ///
- /// Desc:满电包真实soc
- /// Default:
- /// Nullable:True
- ///
- [ExporterHeader(DisplayName = "满电包真实soc", IsBold = true)]
- public decimal? UpBatteryRealSoc { get; set; }
-
-
- ///
- /// Desc:放电池仓位号 亏电包仓号
- /// Default:
- /// Nullable:True
- ///
- [ExporterHeader(DisplayName = "放电池仓位号", IsBold = true)]
- public int? DownBatteryBinNo { get; set; }
-
- ///
- /// Desc:取电池仓位号 满电包仓号
- /// Default:
- /// Nullable:True
- ///
- [ExporterHeader(DisplayName = "取电池仓位号", IsBold = true)]
- public int? UpBatteryBinNo { get; set; }
-
-
-
- ///
- /// 电量
- ///
- [ExporterHeader(DisplayName = "电量", IsBold = true)]
- public string ElectricQuantity { get; set; }
-
- ///
- /// 亏电包电量
- ///
- [ExporterHeader(DisplayName = "Down Battery Electric Quantity", IsBold = true)]
- public string? DownBatteryElectricQuantity { get; set; }
- ///
- /// 满电包电量
- ///
- [ExporterHeader(DisplayName = "Up Battery Electric Quantity", IsBold = true)]
- public string? UpBatteryElectricQuantity { get; set; }
}
\ No newline at end of file
diff --git a/Service/Execute/Api/RfidApi.cs b/Service/Execute/Api/RfidApi.cs
index a7fc8e1..3db95c5 100644
--- a/Service/Execute/Api/RfidApi.cs
+++ b/Service/Execute/Api/RfidApi.cs
@@ -103,11 +103,12 @@ public class RfidApi
Log.Info("RfidApi ReadRfid");
- string readUrl = BASE_URL + "/Api/BeginRead";
+ // string readUrl = BASE_URL + "/Api/BeginRead";
string url = BASE_URL + "/Api/ReadRfidData";
+ Log.Info($"url={url}");
try
{
- var vBeginRead = await _httpClient.GetStringAsync(readUrl);
+ //var vBeginRead = await _httpClient.GetStringAsync(readUrl);
string s = await _httpClient.GetStringAsync(url);
Log.Info($"ReadRfid resp={s}");
if (s != String.Empty)
diff --git a/Service/Execute/Step/SwapDoneState.cs b/Service/Execute/Step/SwapDoneState.cs
index 4e96239..4a1da2b 100644
--- a/Service/Execute/Step/SwapDoneState.cs
+++ b/Service/Execute/Step/SwapDoneState.cs
@@ -184,7 +184,7 @@ public class SwapDoneState : IState
public InvokeStatus LockCar(SwappingStateMachine machine)
{
- return Invoker.Invoke("LockCar", 500, 100, machine.IsCanceled, machine.IsManualSwapSucc,
+ return Invoker.Invoke("LockCar", 1000, 20, machine.IsCanceled, machine.IsManualSwapSucc,
() => machine.VelLockFlag, () =>
{
Task result = TBoxApi.LockCarManyTimes(machine.RfidReadModel.VelVin);
@@ -234,7 +234,7 @@ public class SwapDoneState : IState
//TODO::加锁失败是否需要播报
LedClient.SendMsgByKey(InfoEnum.SwapInfo.ErrLockCar.GetLed());
}, false, () => { machine.ExceptionReason = ExceptionReason.LockCarError; }
- , 10, InvokeStatus.None);
+ , 3, InvokeStatus.None);
}
diff --git a/WebStarter/Controllers/SwapOrderController.cs b/WebStarter/Controllers/SwapOrderController.cs
index 832156b..474d2cb 100644
--- a/WebStarter/Controllers/SwapOrderController.cs
+++ b/WebStarter/Controllers/SwapOrderController.cs
@@ -395,6 +395,7 @@ public class SwapOrderController : ControllerBase
dto.UpBatteryElectricQuantity = ((double)dto.UpBatterySoc * 3.75).ToString();
double ElectricQuantity = ((float)(dto.UpBatterySoc - dto.DownBatterySoc)) * 3.75;
dto.ElectricQuantity = ElectricQuantity.ToString();
+
}
catch (Exception e)
{