充电订单bug修改

master
rszn 6 months ago
parent e71014e383
commit d5d847064a

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

@ -10,10 +10,12 @@
/// </summary> /// </summary>
public int Status { get; set; } = 200; public int Status { get; set; } = 200;
/// <summary> /// <summary>
/// 操作是否成功 /// 操作是否成功
/// </summary> /// </summary>
public bool IsSuccess { get; set; } = false; public bool IsSuccess { get; set; } = false;
/// <summary> /// <summary>
/// 返回信息 /// 返回信息
/// </summary> /// </summary>
@ -29,13 +31,11 @@
/// </summary> /// </summary>
/// <param name="msg">消息</param> /// <param name="msg">消息</param>
/// <returns></returns> /// <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>
/// 返回成功 /// 返回成功
/// </summary> /// </summary>
@ -48,7 +48,6 @@
} }
/// <summary> /// <summary>
/// 返回失败 /// 返回失败
/// </summary> /// </summary>
@ -94,11 +93,5 @@
{ {
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(); chargerClient.SendRemoteStopCharging();
return Result<bool>.Success("发送停止命令成功"); return Result<bool>.Success(true, "发送停止命令成功");
} }
/// <summary> /// <summary>
/// 下发尖峰平谷 /// 下发尖峰平谷

@ -503,7 +503,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
string? lockKey = redisHelper.GetStrValue($"chargeNo{BinNo}Start"); string? lockKey = redisHelper.GetStrValue($"chargeNo{BinNo}Start");
if (!string.IsNullOrWhiteSpace(lockKey)) 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)); redisHelper.SetKeyValueStr($"chargeNo{BinNo}Start", DateTime.Now.ToString("f"), TimeSpan.FromMinutes(1));

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

Loading…
Cancel
Save