|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Service.Cloud.Client;
|
|
|
|
|
using Service.Cloud.Common;
|
|
|
|
|
using Service.Cloud.Msg.Cloud.Req;
|
|
|
|
|
using Service.Cloud.Msg.Host.Resp;
|
|
|
|
|
using Service.Init;
|
|
|
|
|
|
|
|
|
|
namespace Service.Cloud.Handler;
|
|
|
|
|
|
|
|
|
|
[Scope("InstancePerDependency")]
|
|
|
|
|
public class DeliverBasicInformationHandler : IBaseHandler
|
|
|
|
|
{
|
|
|
|
|
public bool CanHandle(string cmd)
|
|
|
|
|
{
|
|
|
|
|
return CloudConst.setStBaseInfo == cmd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Handle(string t)
|
|
|
|
|
{
|
|
|
|
|
SetStBaseInfo? deliverBasicInformation = JsonConvert.DeserializeObject<SetStBaseInfo>(t);
|
|
|
|
|
if (deliverBasicInformation != null)
|
|
|
|
|
{
|
|
|
|
|
StaticStationInfo.StationNo = deliverBasicInformation.sn;
|
|
|
|
|
StaticStationInfo.StationName = deliverBasicInformation.Sm;
|
|
|
|
|
StaticStationInfo.StationSn = deliverBasicInformation.SS;
|
|
|
|
|
StaticStationInfo.StationLocation = deliverBasicInformation.sl;
|
|
|
|
|
StaticStationInfo.StationType = deliverBasicInformation.st;
|
|
|
|
|
StaticStationInfo.Longitude = deliverBasicInformation.ld;
|
|
|
|
|
StaticStationInfo.Latitude = deliverBasicInformation.lt;
|
|
|
|
|
StaticStationInfo.AreaCode = deliverBasicInformation.ac;
|
|
|
|
|
StaticStationInfo.AreaName = deliverBasicInformation.am;
|
|
|
|
|
StaticStationInfo.OperationStartTime = deliverBasicInformation.ot.ToString();
|
|
|
|
|
StaticStationInfo.LaunchTime = deliverBasicInformation.lm.ToString();
|
|
|
|
|
StaticStationInfo.ContactWay = deliverBasicInformation.cw;
|
|
|
|
|
StaticStationInfo.Principal = deliverBasicInformation.pp;
|
|
|
|
|
StaticStationInfo.StationCompany = deliverBasicInformation.sc;
|
|
|
|
|
StaticStationInfo.SocialCreditCode = deliverBasicInformation.cc;
|
|
|
|
|
StaticStationInfo.StationSftVer = deliverBasicInformation.sv;
|
|
|
|
|
StaticStationInfo.SupplierCode = deliverBasicInformation.sp;
|
|
|
|
|
StaticStationInfo.Cover = deliverBasicInformation.cb.ToString();
|
|
|
|
|
StaticStationInfo.StationVersion = deliverBasicInformation.bs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetStBaseInfoRes resp = new SetStBaseInfoRes();
|
|
|
|
|
CloudClientMgr.CloudClient?.Publish(resp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|