You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.Text;
|
|
|
|
|
using Common.Util;
|
|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using NewLife.Remoting;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Service.Cloud.Client;
|
|
|
|
|
using Service.Cloud.Common;
|
|
|
|
|
using Service.Cloud.Msg.Cloud.Req.OutCharger.Req;
|
|
|
|
|
using Service.Cloud.Msg.Host.Resp.OutCharger;
|
|
|
|
|
|
|
|
|
|
namespace Service.Cloud.Handler.OutCharger;
|
|
|
|
|
|
|
|
|
|
[Scope("InstancePerDependency")]
|
|
|
|
|
public class PileStartChargeHandler : IBaseHandler
|
|
|
|
|
{
|
|
|
|
|
public bool CanHandle(string cmd)
|
|
|
|
|
{
|
|
|
|
|
return CloudConst.pileStartCharge == cmd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Handle(string t)
|
|
|
|
|
{
|
|
|
|
|
PileStartCharge? pileStartCharge = JsonConvert.DeserializeObject<PileStartCharge>(t);
|
|
|
|
|
if(string.IsNullOrEmpty(pileStartCharge.cp))
|
|
|
|
|
pileStartCharge.cp = "0";
|
|
|
|
|
if (pileStartCharge != null)
|
|
|
|
|
{
|
|
|
|
|
HttpUtil.SendPostRequest(pileStartCharge, "http://127.0.0.1:5035/api/OutCharger/SendStartOutCharger");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PileStartChargeResp res = new()
|
|
|
|
|
{
|
|
|
|
|
rs="1",
|
|
|
|
|
con=pileStartCharge.con,
|
|
|
|
|
pn=pileStartCharge.pn,
|
|
|
|
|
};
|
|
|
|
|
CloudClientMgr.CloudClient?.Publish(res);
|
|
|
|
|
}
|
|
|
|
|
}
|