上报换电订单 查询次数

master
lxw 6 months ago
parent 40fa536ac2
commit 848dcc4d3a

@ -7,7 +7,7 @@ namespace Entity.DbModel.Station
///仓位信息表
///</summary>
[SugarTable("bin_info")]
public partial class BinInfo
public partial class BinInfo
{
public BinInfo()
{
@ -179,9 +179,9 @@ namespace Entity.DbModel.Station
/// Nullable:True
/// </summary>
/// [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; }
/// <summary>
/// Desc:更新人
@ -204,28 +204,25 @@ namespace Entity.DbModel.Station
/// Default:CURRENT_TIMESTAMP
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "updated_time")]
public DateTime? UpdatedTime { get; set; }= DateTime.Now;
[SugarColumn(ColumnName = "updated_time", UpdateServerTime = true)]
public DateTime? UpdatedTime { get; set; } = DateTime.Now;
/// <summary>
/// 缓存仓标记 0:不是 1:是
/// </summary>
[SugarColumn(ColumnName = "cache_bin_flag")]
public int? CacheBinFlag { get; set; }
/// <summary>
/// 是否可以换电 0:不可换 1可换
/// </summary>
[SugarColumn(ColumnName = "can_swap_flag")]
public int? CanSwapFlag { get; set; }
public int? CanSwapFlag { get; set; }
/// <summary>
/// 是否可以充电 0:不可换 1可换
/// </summary>
[SugarColumn(ColumnName = "can_charge_flag")]
public int? CanChargeFlag { get; set; }
public int? CanChargeFlag { get; set; }
}
}

@ -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;

@ -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,

Loading…
Cancel
Save