充电订单bug修改

zw
rszn 6 months ago
parent e71014e383
commit d5d847064a

@ -1,8 +1,9 @@
namespace Service.Equipment;
namespace Common.Const;
public enum EquipmentType
{
Charger,
Ammeter,
WaterCool
WaterCool,
Plc
}

@ -10,10 +10,12 @@
/// </summary>
public int Status { get; set; } = 200;
/// <summary>
/// 操作是否成功
/// </summary>
public bool IsSuccess { get; set; } = false;
/// <summary>
/// 返回信息
/// </summary>
@ -29,13 +31,11 @@
/// </summary>
/// <param name="msg">消息</param>
/// <returns></returns>
public static Result<T> Success(string msg = "成功")
public static Result<T> Success(T t = default)
{
return Message(true, msg, default);
return Message(true, "成功", t);
}
/// <summary>
/// 返回成功
/// </summary>
@ -48,7 +48,6 @@
}
/// <summary>
/// 返回失败
/// </summary>
@ -92,13 +91,7 @@
/// <returns></returns>
public static Result<T> Message(bool success, T data)
{
return new Result<T>() { Msg="查询成功", Data = data, IsSuccess = success };
return new Result<T>() { Msg = "查询成功", Data = data, IsSuccess = success };
}
}
}

@ -72,7 +72,7 @@ public class ChargerService
chargerClient.SendRemoteStopCharging();
return Result<bool>.Success("发送停止命令成功");
return Result<bool>.Success(true, "发送停止命令成功");
}
/// <summary>
/// 下发尖峰平谷

@ -503,7 +503,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
string? lockKey = redisHelper.GetStrValue($"chargeNo{BinNo}Start");
if (!string.IsNullOrWhiteSpace(lockKey))
{
return Result<bool>.Success($"charger-{BinNo} is starting");
return Result<bool>.Success(true, $"charger-{BinNo} is starting");
}
redisHelper.SetKeyValueStr($"chargeNo{BinNo}Start", DateTime.Now.ToString("f"), TimeSpan.FromMinutes(1));

@ -1,4 +1,5 @@
using Autofac;
using Common.Const;
using DotNetty.Transport.Channels;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac;
@ -7,7 +8,6 @@ using HybirdFrameworkDriver.Session;
using log4net;
using Repository.Station;
using Service.Charger.Common;
using Service.Equipment;
namespace Service.Charger.Client;

Loading…
Cancel
Save