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 HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using NewLife;
|
|
|
|
|
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 BusinessHourHandler : IBaseHandler
|
|
|
|
|
{
|
|
|
|
|
public bool CanHandle(string cmd)
|
|
|
|
|
{
|
|
|
|
|
return CloudConst.setOpTime == cmd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Handle(string t)
|
|
|
|
|
{
|
|
|
|
|
SetOpTime? req = JsonConvert.DeserializeObject<SetOpTime>(t);
|
|
|
|
|
if (req != null)
|
|
|
|
|
{
|
|
|
|
|
List<SEG> reqSeg = req.seg;
|
|
|
|
|
if (reqSeg is { Count: > 0 })
|
|
|
|
|
{
|
|
|
|
|
StaticStationInfo.OperationStartTime = reqSeg.Select(i => i.st).Join();
|
|
|
|
|
StaticStationInfo.OperationEndTime = reqSeg.Select(i => i.et).Join();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetOpTimeRes resp = new SetOpTimeRes();
|
|
|
|
|
CloudClientMgr.CloudClient?.Publish(resp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|