充电日志

zw
smartwyy 6 months ago
parent ab819afb97
commit 2346edcd4c

@ -7,6 +7,7 @@ using HybirdFrameworkCore.Redis;
using HybirdFrameworkCore.Utils; using HybirdFrameworkCore.Utils;
using HybirdFrameworkDriver.Session; using HybirdFrameworkDriver.Session;
using HybirdFrameworkDriver.TcpClient; using HybirdFrameworkDriver.TcpClient;
using log4net;
using Newtonsoft.Json; using Newtonsoft.Json;
using Repository.Station; using Repository.Station;
using Service.Charger.Codec; using Service.Charger.Codec;
@ -27,6 +28,8 @@ namespace Service.Charger.Client;
[Scope("InstancePerDependency")] [Scope("InstancePerDependency")]
public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder> public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(ChargerClient));
#region 属性 #region 属性
public ushort AuthTimes { get; set; } = 0; public ushort AuthTimes { get; set; } = 0;
@ -239,6 +242,8 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
chargeOrderNo = ChargerUtils.GenChargeOrderSn(); chargeOrderNo = ChargerUtils.GenChargeOrderSn();
} }
Log.Info($"SendRemoteStartCharging soc={socLimit}, changePower={changePower}, changePowerCmdType={changePowerCmdType}, chargeOrderNo={chargeOrderNo}");
var remoteStartCharging = new RemoteStartCharging(socLimit, changePowerCmdType, changePower, chargeOrderNo); var remoteStartCharging = new RemoteStartCharging(socLimit, changePowerCmdType, changePower, chargeOrderNo);
CurrentCmd = JsonConvert.SerializeObject(remoteStartCharging, Formatting.Indented) + "\r\n" + CurrentCmd = JsonConvert.SerializeObject(remoteStartCharging, Formatting.Indented) + "\r\n" +
BitUtls.BytesToHexStr(remoteStartCharging.ToBytes()); BitUtls.BytesToHexStr(remoteStartCharging.ToBytes());

@ -1,5 +1,5 @@
using System.Text; using System.Text;
using Service.Station; using Service.Init;
namespace Service.Charger.Common; namespace Service.Charger.Common;
@ -55,7 +55,7 @@ public static class ChargerUtils
public static string GenChargeOrderSn() public static string GenChargeOrderSn()
{ {
return StationParamConst.StationNo + DateTime.Now.ToString(ChargerConst.DateFormat) + return StaticStationInfo.StationNo + DateTime.Now.ToString(ChargerConst.DateFormat) +
GetRandomNumLimit99(); GetRandomNumLimit99();
} }

@ -6,7 +6,6 @@ using Microsoft.AspNetCore.Mvc;
using Repository.Station; using Repository.Station;
using Service.Charger; using Service.Charger;
using Service.Charger.Client; using Service.Charger.Client;
using Service.Charger.Msg.Charger.Req;
namespace WebStarter.Controllers; namespace WebStarter.Controllers;
@ -102,6 +101,6 @@ public class ChargeController : ControllerBase
[Route("StopChargeByBinNo/{binNo}")] [Route("StopChargeByBinNo/{binNo}")]
public Result<bool> StopChargeByBinNo(string binNo) public Result<bool> StopChargeByBinNo(string binNo)
{ {
return _chargerService.StartChargeByBinNo(binNo); return _chargerService.StopChargeByBinNo(binNo);
} }
} }
Loading…
Cancel
Save