修正 换电结束重置了云平台上报字段

master
CZ 5 months ago
parent aba1508185
commit 4ce092fc32

@ -203,6 +203,8 @@ public class CommonMgr
/// <param name="machine"></param>
public void UpdateSwapOrder(SwappingStateMachine machine)
{
SwapOrder swapOrder = _swapOrderRepository.QueryById(machine.SwapOrder.Id);
machine.SwapOrder.CloudReportStatus = swapOrder.CloudReportStatus;
_swapOrderRepository.Update(machine.SwapOrder);
}

@ -4,13 +4,14 @@ using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac;
using log4net;
using Repository.Station;
using Service.Execute.Utils;
using Service.Mgr;
namespace Service.Execute.Step;
public class CancelState : IState
{
private readonly SwapOrderRepository _swapOrderRepository = AppInfo.Container.Resolve<SwapOrderRepository>();
private readonly CommonMgr _CommonMgr = AppInfo.Container.Resolve<CommonMgr>();
private readonly SwapAmtOrderRepository _swapAmtOrderRepository =
AppInfo.Container.Resolve<SwapAmtOrderRepository>();
@ -37,7 +38,7 @@ public class CancelState : IState
if (machine.SwapOrder != null)
{
machine.SwapOrder.SwapResult = (byte)InfoEnum.SwapOrderResult.Fail;
_swapOrderRepository.Update(machine.SwapOrder);
_CommonMgr.UpdateSwapOrder(machine);
}
_manualOperationRecordRepository.Insert(new ManualOperationRecord()

@ -4,6 +4,7 @@ using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac;
using log4net;
using Repository.Station;
using Service.Execute.Utils;
using Service.Mgr;
namespace Service.Execute.Step;
@ -13,11 +14,11 @@ namespace Service.Execute.Step;
/// </summary>
public class ManualSuccState : IState
{
private readonly SwapOrderRepository _swapOrderRepository = AppInfo.Container.Resolve<SwapOrderRepository>();
private readonly SwapAmtOrderRepository _swapAmtOrderRepository =
AppInfo.Container.Resolve<SwapAmtOrderRepository>();
private readonly CommonMgr _CommonMgr = AppInfo.Container.Resolve<CommonMgr>();
private static readonly ILog _log = LogManager.GetLogger(typeof(CancelState));
private static readonly ManualOperationRecordRepository _manualOperationRecordRepository =
AppInfo.Container.Resolve<ManualOperationRecordRepository>();
@ -37,7 +38,7 @@ public class ManualSuccState : IState
{
machine.SwapOrder.SwapResult = (byte)InfoEnum.SwapOrderResult.Success;
machine.SwapOrder.VehicleLeaveTime = DateTime.Now;
_swapOrderRepository.Update(machine.SwapOrder);
_CommonMgr.UpdateSwapOrder(machine);
}
_manualOperationRecordRepository.Insert(new ManualOperationRecord()

@ -78,16 +78,19 @@ public class SwapOrderMgr
{
swapOrder.CloudReportStatus = 1;
updateDbOrder.Add(swapOrder);
value.CloudReportStatus = 1000;
value.UploadTime = DateTime.Now;
updateDbCloudReport.Add(value);
}
else
{
//当 cloudReportStatus >=100 就不需要上传了
value.CloudReportStatus++;
}
updateDbCloudReport.Add(value);
}
if (updateDbOrder.Count > 0)

Loading…
Cancel
Save