diff --git a/Entity/DbModel/Station/BinInfo.cs b/Entity/DbModel/Station/BinInfo.cs
index f9f53a5..e830a1c 100644
--- a/Entity/DbModel/Station/BinInfo.cs
+++ b/Entity/DbModel/Station/BinInfo.cs
@@ -7,7 +7,7 @@ namespace Entity.DbModel.Station
///仓位信息表
///
[SugarTable("bin_info")]
- public partial class BinInfo
+ public partial class BinInfo
{
public BinInfo()
{
@@ -179,9 +179,9 @@ namespace Entity.DbModel.Station
/// Nullable:True
///
/// [SugarColumn(IsPrimaryKey = false, , ColumnDescription = "创建时间")]
- [SugarColumn(ColumnName = "created_time", IsOnlyIgnoreUpdate = true)]
- public DateTime? CreatedTime { get; set; }= DateTime.Now;
-
+ [SugarColumn(ColumnName = "created_time", InsertServerTime = true)]
+ public DateTime? CreatedTime { get; set; }
+
///
/// Desc:更新人
@@ -204,28 +204,25 @@ namespace Entity.DbModel.Station
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
///
- [SugarColumn(ColumnName = "updated_time")]
- public DateTime? UpdatedTime { get; set; }= DateTime.Now;
+ [SugarColumn(ColumnName = "updated_time", UpdateServerTime = true)]
+ public DateTime? UpdatedTime { get; set; } = DateTime.Now;
///
/// 缓存仓标记 0:不是 1:是
///
[SugarColumn(ColumnName = "cache_bin_flag")]
public int? CacheBinFlag { get; set; }
-
+
///
/// 是否可以换电 0:不可换 1:可换
///
[SugarColumn(ColumnName = "can_swap_flag")]
- public int? CanSwapFlag { get; set; }
-
+ public int? CanSwapFlag { get; set; }
+
///
/// 是否可以充电 0:不可换 1:可换
///
[SugarColumn(ColumnName = "can_charge_flag")]
- public int? CanChargeFlag { get; set; }
-
-
-
+ public int? CanChargeFlag { get; set; }
}
}
\ No newline at end of file
diff --git a/Service/BusinessTask/MyTask/SwapOrderReportCloudTask.cs b/Service/BusinessTask/MyTask/SwapOrderReportCloudTask.cs
index ef81278..2ce035f 100644
--- a/Service/BusinessTask/MyTask/SwapOrderReportCloudTask.cs
+++ b/Service/BusinessTask/MyTask/SwapOrderReportCloudTask.cs
@@ -99,7 +99,9 @@ public class SwapOrderReportCloudTask : AbstractTaskHandler
}
//TODO::获取本日第几次换电
- var uploadSwapOrder = CloudApi.UploadSwapOrder(swapOrder, 0, swapOrderBattery, 1);
+ var count = _swapOrderRepository.GetCount(i =>
+ i.SwapResult == 1 && i.SwapEndTime >= DateTime.Today && i.SwapEndTime < swapOrder.SwapEndTime);
+ var uploadSwapOrder = CloudApi.UploadSwapOrder(swapOrder, count++, swapOrderBattery, 1);
if (uploadSwapOrder == 0)
{
swapOrder.CloudReportStatus = 1;
diff --git a/Service/Execute/Api/CloudApi.cs b/Service/Execute/Api/CloudApi.cs
index d23a94d..1ef9d97 100644
--- a/Service/Execute/Api/CloudApi.cs
+++ b/Service/Execute/Api/CloudApi.cs
@@ -6,6 +6,7 @@ using Service.Cloud.Msg.Cloud.Req;
using Service.Cloud.Msg.Cloud.Resp;
using Service.Cloud.Msg.Host.Req;
using Service.Execute.Model;
+using Service.Init;
namespace Service.Execute.Api;
@@ -55,6 +56,7 @@ public abstract class CloudApi
{
UploadSwapOrder uploadSwapOrder = new()
{
+ sn=StaticStationInfo.StationNo,
son = swapOrder.CloudSn,
cn = swapOrder.VehicleNo,
so = seq,