初始化CRICS
This commit is contained in:
21
CommonEntity/CacheDTO.cs
Normal file
21
CommonEntity/CacheDTO.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class Host_DTO
|
||||
{
|
||||
public string HostId { get; set; }
|
||||
public string RoomTypeId { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string HotelId { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public string XiaoDuCUID { get; set; }
|
||||
public string TianMaoCUID { get; set; }
|
||||
public string SysHotel_WelcomeSpeech { get; set; }
|
||||
public string SysHotel_IsPowerOffResetXiaoDu { get; set; }
|
||||
public string SysHotel_DeviceStatusPushURL { get; set; }
|
||||
}
|
||||
}
|
||||
130
CommonEntity/CacheKey.cs
Normal file
130
CommonEntity/CacheKey.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class CacheKey
|
||||
{
|
||||
public static string HostInfo_ByHostNumber = "HostInfo_ByHostNumber";
|
||||
public static string NewVersionDeviceStatus = "NewVersionDeviceStatus";
|
||||
public static string Key = "monitor_host";
|
||||
public static string IOTKey = "iot_monitor_host";
|
||||
|
||||
public static string MonitorLogPrefix = "AllLogKey";
|
||||
|
||||
public static string CarbonVIP_Prefix = "CarbonVIP";
|
||||
|
||||
public static string HostModalStatus_Prefix = "HostModalStatusReceiver";
|
||||
public static string HostModalStatus_Prefix_ByHostNumber = "HostModalStatus_Prefix_ByHostNumber";
|
||||
public static string HostModalStatus_BoolFilterPrefix = "HostModalBoolFilter";
|
||||
|
||||
|
||||
public static string RoomStatus_Prefix = "RoomStatusReceiver";
|
||||
public static string AllReadyDealWith0E_Prefix = "SAME_0E";
|
||||
public static string AllReadyDealWith01_Prefix = "SAME_01";
|
||||
//C#自身缓存
|
||||
|
||||
/// <summary>
|
||||
/// string KKK1 = CacheKey.HostInfo_Key_MAC + hhotelcode + "_" + mac;
|
||||
/// </summary>
|
||||
public static string HostInfo_Key_MAC = "HostInfo_Key_MAC";
|
||||
|
||||
//通过 host_numbe 来存储
|
||||
public static string HostInfo_Key_HostNumber = "HostInfo_Key_HostNumber";
|
||||
|
||||
//通过hotelcode
|
||||
public static string HotelInfo_Key_Code = "HotelInfo_Key_Code";
|
||||
|
||||
/// <summary>
|
||||
/// 这个主要是结合 hotelid 和room_number来使用
|
||||
/// </summary>
|
||||
public static string WebAPIGetRCUStatus = "WebAPIGetRCUStatus";
|
||||
|
||||
|
||||
public static string FCSToken = "FCS_Security_Authenticate";
|
||||
public static string TCLToken = "TCL_Security_Authenticate";
|
||||
|
||||
/// <summary>
|
||||
/// 升级进度
|
||||
/// </summary>
|
||||
public static string UPGradeProgressBar = "UPProgressBar";
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static string SendDataRepeatKey = "SendDataRepeatKey";
|
||||
public static string LieECOKey = "LieECOKey";
|
||||
|
||||
/// <summary>
|
||||
/// 省电模式,小坑用户
|
||||
/// </summary>
|
||||
public static string LieECOTask = "LieECOTask";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 2025-08-05 开会,08 0E 如果超过2秒钟不再处理
|
||||
/// </summary>
|
||||
public static string TimeIntercept = "TimeIntercept";
|
||||
public static string SyncTimeIntercept = "SyncTimeIntercept";
|
||||
|
||||
public static string RCUOnLine = "RCUOnLine";
|
||||
public static string TakeCardOnLine = "TakeCardOnLine";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 天猫精灵
|
||||
/// </summary>
|
||||
public static string TianMaoJingLing = "TianMaoJingLing";
|
||||
public static string TianMaoJingLingQuerryAll = "TianMaoJingLingQuerryAll";
|
||||
|
||||
/// <summary>
|
||||
/// 小度语音
|
||||
/// </summary>
|
||||
public static string XiaoDuYuYin = "XiaoDuYuYin";
|
||||
public static string TCLYuYin = "TCLYuYin";
|
||||
|
||||
public static string PublicKeyboard = "PublicKeyboard";
|
||||
|
||||
public static string HostFrameNo = "HostFrameNo";
|
||||
public static string PowerSupply = "PowerSupply";
|
||||
public static string LockVoltage = "LockVoltage";
|
||||
public static string HostTemp = "HostTemp";
|
||||
public static string NengHao = "NengHao";
|
||||
public static string SyncRoomStatus = "SyncRoommStatus";
|
||||
public static string ServiceInfoOther = "ServiceInfoOther";
|
||||
|
||||
public static string InvokeHttpInterface = "redis-invoke_httpinterface";
|
||||
|
||||
public static string XiaoDuCacheUpdate = "XiaoDuCacheUpdate";
|
||||
|
||||
public static string TouChuanKey = "TouChuanKey";
|
||||
|
||||
public static string HostId_HostNumber = "HostId_HostNumber";
|
||||
public static string RoomNumber_HostNumber = "RoomNumber_HostNumber";
|
||||
|
||||
public static string DingShiReportData = "TimerReportData";
|
||||
|
||||
/// <summary>
|
||||
/// 空调凌晨定时控制
|
||||
/// </summary>
|
||||
public static string KT_Timer_Controller = "KT_Timer_Controller";
|
||||
|
||||
/// <summary>
|
||||
/// 清理 在开的状态下,3分钟之内只能触发一次
|
||||
/// </summary>
|
||||
public static string CleanFCS_TriggerCount = "CleanFCS_TriggerCount";
|
||||
public static string FCSOrder = "FCSOrder";
|
||||
public static string FCSRoom_Mapping_Order = "FCS_R_M_O";
|
||||
}
|
||||
public class ChangLiangValue
|
||||
{
|
||||
public static string CommandType_FCS = "FCS";
|
||||
public static string TCL = "TCL";
|
||||
public static string SkyWorth = "SkyWorth";
|
||||
public static string TianMao = "TianMao";
|
||||
public static string XiaoDu = "XiaoDu";
|
||||
}
|
||||
}
|
||||
108
CommonEntity/CommonEntity.csproj
Normal file
108
CommonEntity/CommonEntity.csproj
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{1D7073B2-4CC3-49F5-9F37-50A21D74A39D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CommonEntity</RootNamespace>
|
||||
<AssemblyName>CommonEntity</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="jose-jwt">
|
||||
<HintPath>..\lib\jwt\jose-jwt.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\lib\log4net\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\lib\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath>..\lib\RestSharp\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CacheDTO.cs" />
|
||||
<Compile Include="CacheKey.cs" />
|
||||
<Compile Include="DataTongJi.cs" />
|
||||
<Compile Include="FCS.cs" />
|
||||
<Compile Include="ForkSystem.cs" />
|
||||
<Compile Include="GaiXie.cs" />
|
||||
<Compile Include="GetHostIDByNumber.cs" />
|
||||
<Compile Include="HisenseData.cs" />
|
||||
<Compile Include="HiWei.cs" />
|
||||
<Compile Include="HostMappingData.cs" />
|
||||
<Compile Include="HostModal_Cache.cs" />
|
||||
<Compile Include="HostNumber_CacheData.cs" />
|
||||
<Compile Include="HostSearchEntity.cs" />
|
||||
<Compile Include="JWTData.cs" />
|
||||
<Compile Include="KongQi.cs" />
|
||||
<Compile Include="LieECOTaskExtra.cs" />
|
||||
<Compile Include="LingChenECO.cs" />
|
||||
<Compile Include="LogRecorrd.cs" />
|
||||
<Compile Include="LostData.cs" />
|
||||
<Compile Include="MissionRequestData.cs" />
|
||||
<Compile Include="MonitorLog.cs" />
|
||||
<Compile Include="MyHttp.cs" />
|
||||
<Compile Include="NewDataSQL.cs" />
|
||||
<Compile Include="NewRoomStatusPush.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RedisTakeCardStatus.cs" />
|
||||
<Compile Include="RedisTongJiData.cs" />
|
||||
<Compile Include="RoomStatusRequest.cs" />
|
||||
<Compile Include="SkyWorth.cs" />
|
||||
<Compile Include="SmartVoiceData.cs" />
|
||||
<Compile Include="TCLToken.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj">
|
||||
<Project>{B3F29715-E925-4E56-9248-580F06C3BC11}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Domain\Domain.csproj">
|
||||
<Project>{A42D287A-8EF4-48F6-B14C-7F9CA834F786}</Project>
|
||||
<Name>Domain</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
338
CommonEntity/DataTongJi.cs
Normal file
338
CommonEntity/DataTongJi.cs
Normal file
@@ -0,0 +1,338 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Common;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Threading;
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class DataTongJi
|
||||
{
|
||||
public static ConcurrentDictionary<string, UDPPackageCount> TotalCount = new ConcurrentDictionary<string, UDPPackageCount>();
|
||||
public static ConcurrentBag<double> CPU_Data = new ConcurrentBag<double>();
|
||||
|
||||
/// <summary>
|
||||
/// 下位机黑名单
|
||||
/// </summary>
|
||||
//public static UDPPackageBlockFilter BlockLowerMachineList = new UDPPackageBlockFilter();
|
||||
public static ConcurrentDictionary<string, ConcurrentBag<string>> BlockLowerMachineList = new ConcurrentDictionary<string, ConcurrentBag<string>>();
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(DataTongJi));
|
||||
|
||||
/// <summary>
|
||||
/// 0x19数据
|
||||
/// </summary>
|
||||
public static ConcurrentBag<string> ZeroX19_PassHotelCode = new ConcurrentBag<string>();
|
||||
/// <summary>
|
||||
/// RCU在线数量
|
||||
/// </summary>
|
||||
public static ConcurrentDictionary<string, RCUOnLineExtra> ONLINERCU = new ConcurrentDictionary<string, RCUOnLineExtra>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 取电开关
|
||||
/// </summary>
|
||||
public static ConcurrentDictionary<string, MTakeCardData> TakeCardOnLine = new ConcurrentDictionary<string, MTakeCardData>();
|
||||
|
||||
/// <summary>
|
||||
/// 在线用户
|
||||
/// </summary>
|
||||
public static ConcurrentDictionary<string, OnLineUser> OnLineUserList_IP = new ConcurrentDictionary<string, OnLineUser>();
|
||||
//public static ConcurrentDictionary<string, OnLineUser> OnLineUserList_Account = new ConcurrentDictionary<string, OnLineUser>();
|
||||
|
||||
public class MTakeCardData
|
||||
{
|
||||
public string HostNUMBER { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public byte Status { get; set; }
|
||||
public DateTime LastUpdateTime { get; set; }
|
||||
}
|
||||
public class OtherServiceInfo
|
||||
{
|
||||
public string HotelCode { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string Address { get; set; }
|
||||
public ushort StatusReceiver { get; set; }
|
||||
public DateTime LastUpdateTime { get; set; }
|
||||
}
|
||||
|
||||
public static long DefineLostPackage = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 记录丢失的数据
|
||||
/// </summary>
|
||||
public static long RecordLostPackage = 0;
|
||||
public static int LostPackage_Interval = 60;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断 A数组是否包含B数组
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="subsequence"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ContainsSubsequence<T>(List<T> source, List<T> subsequence)
|
||||
{
|
||||
if (subsequence.Count == 0) return true;
|
||||
if (source.Count < subsequence.Count) return false;
|
||||
|
||||
for (int i = 0; i <= source.Count - subsequence.Count; i++)
|
||||
{
|
||||
var subList = source.GetRange(i, subsequence.Count);
|
||||
if (subList.SequenceEqual(subsequence))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static void CeShi()
|
||||
{
|
||||
List<byte> A = new List<byte> { 0x01, 0x02, 0x04, 0x00, 0x01, 0xff, 0xff, 0xff, 0x04, 0x00, 0x01, 0xAA, 0xBB, 0xCC, 0x04, 0x00, 0x01, 0xCC, 0xDD, 0x01 };
|
||||
List<byte> target = new List<byte> { 0x04, 0x00, 0x01 };
|
||||
|
||||
// 查找所有匹配的位置
|
||||
List<int> matchIndices = FindAllMatches(A, target);
|
||||
|
||||
if (matchIndices.Count > 0)
|
||||
{
|
||||
Console.WriteLine("找到匹配的序列:");
|
||||
foreach (int index in matchIndices)
|
||||
{
|
||||
// 提取匹配序列及其后两个字节
|
||||
int start = index;
|
||||
int end = Math.Min(index + target.Count + 3, A.Count);
|
||||
List<byte> extracted = A.GetRange(start, end - start);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("未找到匹配的序列");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找匹配的位置
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="target"></param>
|
||||
/// <returns></returns>
|
||||
public static List<int> FindAllMatches(List<byte> source, List<byte> target)
|
||||
{
|
||||
List<int> indices = new List<int>();
|
||||
if (target.Count == 0 || source.Count < target.Count) return indices;
|
||||
|
||||
for (int i = 0; i <= source.Count - target.Count; i++)
|
||||
{
|
||||
bool match = true;
|
||||
for (int j = 0; j < target.Count; j++)
|
||||
{
|
||||
if (source[i + j] != target[j])
|
||||
{
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (match)
|
||||
{
|
||||
indices.Add(i);
|
||||
}
|
||||
}
|
||||
return indices;
|
||||
}
|
||||
/// <summary>
|
||||
/// 给某个模块添加 调用次数统计,统计是每个小时 调用的总数
|
||||
/// </summary>
|
||||
/// <param name="ModuleName"></param>
|
||||
public static void InvokeCount(string ModuleName)
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime DDT = DateTime.Now;
|
||||
int Year = DDT.Year;
|
||||
int MM = DDT.Month;
|
||||
int dd = DDT.Day;
|
||||
int HH = DDT.Hour;
|
||||
|
||||
string Key = ModuleName + Year + "-" + MM + "-" + dd + "#" + HH;
|
||||
//string hotelid = Session["CurrentHotelID"].ToString();
|
||||
//string HotelName = Session["CurrentHotelName"].ToString();
|
||||
long data = CSRedisCacheHelper.Get_Partition<long>(Key, 1);
|
||||
if (data == 0)
|
||||
{
|
||||
CSRedisCacheHelper.Set_PartitionWithTime<long>(Key, 1, 120, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
CSRedisCacheHelper.Set_PartitionWithTime<long>(Key, data += 1, 120, 1);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public class RCUOnLineExtra
|
||||
{
|
||||
public DateTime CurrentDateTime { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
}
|
||||
|
||||
public class StepInfo
|
||||
{
|
||||
public long EveryMessageId { get; set; }
|
||||
public long Monitor_0E_01 { get; set; }
|
||||
|
||||
public string HotelCode { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string MessageId { get; set; }
|
||||
public string TriggerTime { get; set; }
|
||||
public double Step { get; set; }
|
||||
public string StepDescription { get; set; }
|
||||
public byte[] Content { get; set; }
|
||||
}
|
||||
|
||||
public class OnLineUser
|
||||
{
|
||||
public string Account { get; set; }
|
||||
public string IP { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public int HotelId { get; set; }
|
||||
public DateTime LastUpdateTime { get; set; }
|
||||
}
|
||||
|
||||
public class NengHao
|
||||
{
|
||||
public long HotelCode { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string Mac { get; set; }
|
||||
public string EndPoint { get; set; }
|
||||
public string Version { get; set; }
|
||||
public bool IsTakeCard { get; set; }
|
||||
public int CarbonVIP { get; set; }
|
||||
public double V { get; set; }
|
||||
public double A { get; set; }
|
||||
public double P { get; set; }
|
||||
public double KW_H { get; set; }
|
||||
public double Sum_KW_H { get; set; }
|
||||
|
||||
public long CreateTime { get; set; }
|
||||
|
||||
public DateTime ReportTime { get; set; }
|
||||
}
|
||||
|
||||
public class NengHao4BaoJing
|
||||
{
|
||||
public long HotelCode { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string Mac { get; set; }
|
||||
public string EndPoint { get; set; }
|
||||
public string Version { get; set; }
|
||||
public bool IsTakeCard { get; set; }
|
||||
public int CarbonVIP { get; set; }
|
||||
public double V { get; set; }
|
||||
public double A { get; set; }
|
||||
public double P { get; set; }
|
||||
public double Energy_Consumption { get; set; }
|
||||
public double Sum_Energy_Consumption { get; set; }
|
||||
public long CreateTime { get; set; }
|
||||
public string ReportTime { get; set; }
|
||||
public List<DingShiReportDate> AllDeviceData { get; set; }
|
||||
public int IdentityInfo {get;set;}
|
||||
}
|
||||
|
||||
public class Interface3Log
|
||||
{
|
||||
public string HotelCode { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public HttpActionData ActionData { get; set; }
|
||||
public DateTime TriggerTime { get; set; }
|
||||
public string CommandType { get; set; }
|
||||
}
|
||||
public class HttpActionData
|
||||
{
|
||||
public double Step { get; set; }
|
||||
public string RequestData { get; set; }
|
||||
public string ResponseData { get; set; }
|
||||
}
|
||||
|
||||
public class WelcomeAction
|
||||
{
|
||||
public string CUID { get; set; }
|
||||
public string VoiceDeviceClass { get; set; }
|
||||
public string CommandType { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class StepTongJi
|
||||
{
|
||||
/// <summary>
|
||||
/// 每一条消息都有一个ID
|
||||
/// </summary>
|
||||
public static long EveryMessageIDNo = 0;
|
||||
/// <summary>
|
||||
/// 每一个01和0E的编号
|
||||
/// </summary>
|
||||
public static long Every_0E_01_MessageID = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 每 一条消息都有一个ID
|
||||
/// </summary>
|
||||
public static string EveryMessageID = "";
|
||||
|
||||
/// <summary>
|
||||
/// 1000包抓取一包,抓包计数器
|
||||
/// </summary>
|
||||
public static long LookDataCounter = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 要监听的数据包编号
|
||||
/// </summary>
|
||||
public static string GlobalListenID = "";
|
||||
public static string GlobalListenIDNo = "";
|
||||
|
||||
/// <summary>
|
||||
/// 是否要锁定
|
||||
/// </summary>
|
||||
public static int IsLocked = 0;
|
||||
|
||||
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(StepTongJi));
|
||||
/// <summary>
|
||||
/// 发送Redis广播
|
||||
/// </summary>
|
||||
/// <param name="step"></param>
|
||||
/// <param name="desc"></param>
|
||||
/// <param name="context_messageid"></param>
|
||||
public static void SendInfo(double step, string desc, string context_messageid, bool ismonitor)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ismonitor)
|
||||
{
|
||||
StepInfo s = new StepInfo();
|
||||
s.MessageId = context_messageid;
|
||||
s.Step = step;
|
||||
s.StepDescription = desc;
|
||||
//string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff");
|
||||
string ti = CPUData.GetNowPrecise().ToString("yyyy-MM-dd HH:mm:ss.ffffff");
|
||||
s.TriggerTime = ti;
|
||||
|
||||
string NNN = Newtonsoft.Json.JsonConvert.SerializeObject(s);
|
||||
CSRedisCacheHelper.Publish("redis-roomstatus-monitor", NNN);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("StepTongJi Error:" + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
473
CommonEntity/FCS.cs
Normal file
473
CommonEntity/FCS.cs
Normal file
@@ -0,0 +1,473 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using RestSharp;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Common;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public string username { get; set; }
|
||||
public string password { get; set; }
|
||||
public int oauth_id { get; set; }
|
||||
}
|
||||
public class FCS_ReturnInfo
|
||||
{
|
||||
public int success { get; set; }
|
||||
public FCS_ReturnData data { get; set; }
|
||||
}
|
||||
// {"success": 1, "data": true, "rmsg": {"code": "s_job_orders", "param": ["JO-0001970-01"]}}
|
||||
public class FCS_JobResponse
|
||||
{
|
||||
public int success { get; set; }
|
||||
public bool data { get; set; }
|
||||
//"rmsg":
|
||||
//[
|
||||
//{
|
||||
// "code": "s_user_not_found",
|
||||
// "param": []
|
||||
//}
|
||||
//]
|
||||
public List<FCSJobResponseData> rmsg { get; set; }
|
||||
|
||||
}
|
||||
public class FCSJobResponseData
|
||||
{
|
||||
public string code { get; set; }
|
||||
public List<string> param { get; set; }
|
||||
}
|
||||
public class FCS_ReturnData
|
||||
{
|
||||
public bool is_authenticated { get; set; }
|
||||
public string access_token { get; set; }
|
||||
public string refresh_token { get; set; }
|
||||
public bool show_password_expire { get; set; }
|
||||
public string password_expired_date { get; set; }
|
||||
public bool password_expired { get; set; }
|
||||
public bool valid_license_access { get; set; }
|
||||
public bool require_reset { get; set; }
|
||||
public string property_config { get; set; }
|
||||
public string show_pp { get; set; }
|
||||
public int oauth_id { get; set; }
|
||||
public bool is_ip_valid { get; set; }
|
||||
public bool is_support_aliyun { get; set; }
|
||||
}
|
||||
|
||||
public class FCS_JobRequest
|
||||
{
|
||||
public List<string> location_uuid { get; set; }
|
||||
public List<FCS_service_items> service_items { get; set; }
|
||||
public string remark { get; set; }
|
||||
public string assigned_to { get; set; }
|
||||
public int user_type { get; set; }
|
||||
public bool get_details { get; set; }
|
||||
}
|
||||
public class FCS_service_items
|
||||
{
|
||||
public string item_uuid { get; set; }
|
||||
public int quantity { get; set; }
|
||||
}
|
||||
public struct FCS_OrderData
|
||||
{
|
||||
public string LocationUUID { get; set; }
|
||||
public string ItemUUID { get; set; }
|
||||
public string PropertyID { get; set; }
|
||||
public string ItemType { get; set; }
|
||||
public string OrderUUID { get; set; }
|
||||
public string OrderNo { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public string RoomNUMBER { get; set; }
|
||||
public string HostNUMBER { get; set; }
|
||||
}
|
||||
public class FCS_Response
|
||||
{
|
||||
public int success { get; set; }
|
||||
public List<FCS_R_DataItem> data { get; set; }
|
||||
public RMSG rmsg { get; set; }
|
||||
}
|
||||
public class FCS_R_DataItem
|
||||
{
|
||||
public string job_no { get; set; }
|
||||
public string job_status_colour { get; set; }
|
||||
public string job_uuid { get; set; }
|
||||
}
|
||||
public class RMSG
|
||||
{
|
||||
public string code { get; set; }
|
||||
public List<string> param { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询 类
|
||||
/// </summary>
|
||||
public class QueryFCSOrder
|
||||
{
|
||||
public string filter { get; set; }
|
||||
public OrderQueryItem column_filter { get; set; }
|
||||
}
|
||||
public class OrderQueryItem
|
||||
{
|
||||
public string field { get; set; }
|
||||
public List<string> value { get; set; }
|
||||
}
|
||||
|
||||
public class QueryOrderResponse
|
||||
{
|
||||
public string success { get; set; }
|
||||
public List<Dictionary<string, string>> data { get; set; }
|
||||
public object[] rmsg { get; set; }
|
||||
}
|
||||
|
||||
public class RR
|
||||
{
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(RR));
|
||||
private static void SSLXieYi()
|
||||
{
|
||||
//ssl 协议不兼容
|
||||
var A = (SecurityProtocolType)48;
|
||||
var B = (SecurityProtocolType)192;
|
||||
var C = (SecurityProtocolType)768;
|
||||
var D = (SecurityProtocolType)3072;
|
||||
var E = (SecurityProtocolType)12288;
|
||||
ServicePointManager.SecurityProtocol = A | B | C | D | E;
|
||||
}
|
||||
public static void Login(string FCSLoginUrl, string FCSLoginUserName, string FCSLoginPassWord, string HotelCode, string RoomNum)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
SSLXieYi();
|
||||
|
||||
var client1 = new RestClient(FCSLoginUrl);
|
||||
var request1 = new RestRequest("/api/security/authenticate", Method.POST);
|
||||
|
||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||
User us = new User();
|
||||
us.username = FCSLoginUserName;
|
||||
us.password = FCSLoginPassWord;
|
||||
us.oauth_id = 1;
|
||||
request1.AddJsonBody(us);
|
||||
|
||||
|
||||
Interface3Log w1 = new Interface3Log();
|
||||
w1.HotelCode = HotelCode;
|
||||
w1.RoomNumber = RoomNum;
|
||||
w1.TriggerTime = DateTime.Now;
|
||||
w1.ActionData = new HttpActionData() { RequestData = Newtonsoft.Json.JsonConvert.SerializeObject(dic) };
|
||||
w1.CommandType = ChangLiangValue.CommandType_FCS;
|
||||
|
||||
var q1 = Newtonsoft.Json.JsonConvert.SerializeObject(w1);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q1);
|
||||
|
||||
var QQQ = client1.Execute(request1);
|
||||
HttpStatusCode HHH = QQQ.StatusCode;
|
||||
if (HHH == HttpStatusCode.Created || HHH == HttpStatusCode.OK)
|
||||
{
|
||||
string ddd = QQQ.Content;
|
||||
|
||||
Interface3Log w2 = new Interface3Log();
|
||||
w2.HotelCode = HotelCode;
|
||||
w2.RoomNumber = RoomNum;
|
||||
w2.TriggerTime = DateTime.Now;
|
||||
w2.ActionData = new HttpActionData() { ResponseData = ddd };
|
||||
w2.CommandType = ChangLiangValue.CommandType_FCS;
|
||||
|
||||
var q2 = Newtonsoft.Json.JsonConvert.SerializeObject(w2);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q2);
|
||||
|
||||
var FFFA = Newtonsoft.Json.JsonConvert.DeserializeObject<FCS_ReturnInfo>(ddd);
|
||||
|
||||
string TokenKey = CacheKey.FCSToken;
|
||||
CSRedisCacheHelper.Set_Partition(TokenKey, FFFA, 1);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("FCS Login Error" + ex.Message);
|
||||
logger.Error(ex.StackTrace);
|
||||
}
|
||||
|
||||
//client1.ExecuteAsync(request1, (response) =>
|
||||
//{
|
||||
// Console.WriteLine(response.Content);
|
||||
//});
|
||||
}
|
||||
|
||||
|
||||
public static void JobRequest(string AccessToken, string location_uuid, string item_uuid, string FCSLoginUrl, string UserName, string PassWord, string PropertyID, string code, string roomno, string remarkdata, string itemclass)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item_uuid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SSLXieYi();
|
||||
|
||||
var client1 = new RestClient(FCSLoginUrl);
|
||||
var request1 = new RestRequest("/api-secure/job/request", Method.POST);
|
||||
|
||||
FCS_JobRequest fff = new FCS_JobRequest();
|
||||
fff.location_uuid = new List<string>() { location_uuid };
|
||||
fff.service_items = new List<FCS_service_items>()
|
||||
{
|
||||
new FCS_service_items()
|
||||
{
|
||||
item_uuid=item_uuid,
|
||||
quantity=1
|
||||
}
|
||||
};
|
||||
fff.remark = remarkdata;
|
||||
fff.assigned_to = "auto";
|
||||
fff.user_type = 1;
|
||||
fff.get_details = true;
|
||||
|
||||
|
||||
string WER = Newtonsoft.Json.JsonConvert.SerializeObject(fff);
|
||||
|
||||
logger.Error("push data is " + WER);
|
||||
logger.Error("push token is " + AccessToken);
|
||||
request1.AddHeader("token", AccessToken);
|
||||
//下面这个是个定值
|
||||
request1.AddHeader("property", PropertyID);
|
||||
request1.AddParameter("payload", WER);
|
||||
|
||||
Interface3Log w1 = new Interface3Log();
|
||||
w1.HotelCode = code;
|
||||
w1.RoomNumber = roomno;
|
||||
w1.TriggerTime = DateTime.Now;
|
||||
w1.ActionData = new HttpActionData() { RequestData = Newtonsoft.Json.JsonConvert.SerializeObject(WER) };
|
||||
w1.CommandType = ChangLiangValue.CommandType_FCS;
|
||||
|
||||
var q1 = Newtonsoft.Json.JsonConvert.SerializeObject(w1);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q1);
|
||||
|
||||
client1.ExecuteAsync(request1, (QQQ) =>
|
||||
{
|
||||
HttpStatusCode HHH = QQQ.StatusCode;
|
||||
|
||||
string FHS = QQQ.Content;
|
||||
|
||||
Interface3Log w2 = new Interface3Log();
|
||||
w2.HotelCode = code;
|
||||
w2.RoomNumber = roomno;
|
||||
w2.TriggerTime = DateTime.Now;
|
||||
w2.ActionData = new HttpActionData() { ResponseData = FHS };
|
||||
w2.CommandType = ChangLiangValue.CommandType_FCS;
|
||||
|
||||
var q2 = Newtonsoft.Json.JsonConvert.SerializeObject(w2);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q2);
|
||||
|
||||
//{
|
||||
// "success": 1,
|
||||
// "data": [
|
||||
// {
|
||||
// "job_no": "JO-0004548-01",
|
||||
// "job_status_colour": "#FA8C16",
|
||||
// "job_uuid": "b1dcb088-6dbc-4ca5-a1c4-0a8b951113fd"
|
||||
// }
|
||||
// ],
|
||||
// "rmsg": {
|
||||
// "code": "s_job_orders",
|
||||
// "param": [
|
||||
// "JO-0004548-01"
|
||||
// ]
|
||||
// }
|
||||
//}
|
||||
logger.Error("PushData 返回值为:" + FHS);
|
||||
logger.Error("PushData Status:" + HHH.ToString());
|
||||
if (string.IsNullOrEmpty(FHS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
JObject jsonObject = JObject.Parse(FHS);
|
||||
var error = jsonObject.SelectToken("error");
|
||||
//如果有错
|
||||
if (error != null)
|
||||
{
|
||||
Login(FCSLoginUrl, UserName, PassWord, code, roomno);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (itemclass.Equals("Clean"))
|
||||
{
|
||||
logger.Error("写入订单"+FHS);
|
||||
//FCS_Response
|
||||
var FFF = JsonConvert.DeserializeObject<FCS_Response>(FHS);
|
||||
var JJJ = FFF.data.FirstOrDefault();
|
||||
if (JJJ != null)
|
||||
{
|
||||
string orderuuid = JJJ.job_uuid;
|
||||
FCS_OrderData f = new FCS_OrderData();
|
||||
f.OrderUUID = orderuuid;
|
||||
f.PropertyID = PropertyID;
|
||||
f.ItemType = "Clean";
|
||||
f.OrderNo = JJJ.job_no;
|
||||
f.ItemUUID = item_uuid;
|
||||
f.LocationUUID = location_uuid;
|
||||
f.HotelCode = code;
|
||||
f.RoomNUMBER = roomno;
|
||||
string fsa = Newtonsoft.Json.JsonConvert.SerializeObject(f);
|
||||
//这个是 供轮循的时候调用使用
|
||||
CSRedisCacheHelper.HMSet(3, 60 * 24, CacheKey.FCSOrder, fsa);
|
||||
|
||||
//这个是供 取消订单的时候使用的
|
||||
//这个只 支持 取消 清理
|
||||
logger.Error("记录入循环:"+orderuuid);
|
||||
CSRedisCacheHelper.Set_PartitionWithTime(CacheKey.FCSRoom_Mapping_Order + "_" + location_uuid, orderuuid, 24 * 60, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (HHH == HttpStatusCode.OK)
|
||||
{
|
||||
}
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
/// FCS数据推送
|
||||
/// </summary>
|
||||
/// <param name="Item_UUID"></param>
|
||||
public static void FCS_PushData(string Item_UUID, string location_UUID, string PropertyUUID, string LoginUrl, string UserName, string PassWord, string code, string roomno, string remarkdata = "", string HOSTNUMBER = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(Item_UUID))
|
||||
{
|
||||
return;
|
||||
}
|
||||
//logger.Error("FCS push data");
|
||||
if (!string.IsNullOrEmpty(location_UUID))
|
||||
{
|
||||
string Key = CacheKey.FCSToken;
|
||||
var TokenTakeOut = CSRedisCacheHelper.Get_Partition<FCS_ReturnInfo>(Key, 1);
|
||||
if (TokenTakeOut == null)
|
||||
{
|
||||
logger.Error("FCS login");
|
||||
RR.Login(LoginUrl, UserName, PassWord, code, roomno);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Error("FCS push action data");
|
||||
|
||||
string ItemClass = "";
|
||||
if (!string.IsNullOrEmpty(HOSTNUMBER))
|
||||
{
|
||||
ItemClass = "Clean";
|
||||
}
|
||||
logger.Error("FCS push action itemclass:" + ItemClass);
|
||||
RR.JobRequest(TokenTakeOut.data.access_token, location_UUID, Item_UUID, LoginUrl, UserName, PassWord, PropertyUUID, code, roomno, remarkdata, ItemClass);
|
||||
|
||||
if (!string.IsNullOrEmpty(HOSTNUMBER))
|
||||
{
|
||||
string CleanTrigger = CacheKey.CleanFCS_TriggerCount + "_" + HOSTNUMBER;
|
||||
CSRedisCacheHelper.Set_PartitionWithTime<int>(CleanTrigger, 1, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("FCS PushData Error: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 取消Job
|
||||
/// </summary>
|
||||
/// <param name="AccessToken"></param>
|
||||
/// <param name="location_uuid"></param>
|
||||
/// <param name="item_uuid"></param>
|
||||
/// <param name="FCSLoginUrl"></param>
|
||||
/// <param name="UserName"></param>
|
||||
/// <param name="PassWord"></param>
|
||||
/// <param name="PropertyID"></param>
|
||||
/// <param name="HotelCode"></param>
|
||||
/// <param name="RoomNo"></param>
|
||||
/// <param name="remarkdata"></param>
|
||||
/// <param name="itemclass"></param>
|
||||
public static void JobCancelRequest(string AccessToken, string FCSLoginUrl, string PropertyID, string HotelCode, string RoomNo, string OrderId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(OrderId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
SSLXieYi();
|
||||
|
||||
string RUrl = string.Format("/job/order/{0}/cancelled", OrderId);
|
||||
var client1 = new RestClient(FCSLoginUrl);
|
||||
var request1 = new RestRequest(RUrl, Method.POST);
|
||||
|
||||
logger.Error("push data is " + OrderId);
|
||||
logger.Error("push token is " + AccessToken);
|
||||
request1.AddHeader("token", AccessToken);
|
||||
//下面这个是个定值
|
||||
request1.AddHeader("property", PropertyID);
|
||||
|
||||
Interface3Log w1 = new Interface3Log();
|
||||
w1.HotelCode = HotelCode;
|
||||
w1.RoomNumber = RoomNo;
|
||||
w1.TriggerTime = DateTime.Now;
|
||||
w1.ActionData = new HttpActionData() { RequestData = OrderId };
|
||||
w1.CommandType = ChangLiangValue.CommandType_FCS;
|
||||
|
||||
var q1 = Newtonsoft.Json.JsonConvert.SerializeObject(w1);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q1);
|
||||
|
||||
client1.ExecuteAsync(request1, (QQQ) =>
|
||||
{
|
||||
HttpStatusCode HHH = QQQ.StatusCode;
|
||||
|
||||
string FHS = QQQ.Content;
|
||||
logger.Error("cancel PushData not data is" + FHS);
|
||||
|
||||
Interface3Log w2 = new Interface3Log();
|
||||
w2.HotelCode = HotelCode;
|
||||
w2.RoomNumber = RoomNo;
|
||||
w2.TriggerTime = DateTime.Now;
|
||||
w2.ActionData = new HttpActionData() { ResponseData = FHS };
|
||||
w2.CommandType = ChangLiangValue.CommandType_FCS;
|
||||
|
||||
var q2 = Newtonsoft.Json.JsonConvert.SerializeObject(w2);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q2);
|
||||
|
||||
});
|
||||
}
|
||||
public static void FCS_CancelOrderJob(string location_UUID, string PropertyUUID, string LoginUrl, string UserName, string PassWord, string code, string roomno, string OrderUUID = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(OrderUUID))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(location_UUID))
|
||||
{
|
||||
string Key = CacheKey.FCSToken;
|
||||
var TokenTakeOut = CSRedisCacheHelper.Get_Partition<FCS_ReturnInfo>(Key, 1);
|
||||
if (TokenTakeOut == null)
|
||||
{
|
||||
logger.Error("FCS login");
|
||||
RR.Login(LoginUrl, UserName, PassWord, code, roomno);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Error("FCS cancel push action data");
|
||||
RR.JobCancelRequest(TokenTakeOut.data.access_token, LoginUrl, PropertyUUID, code, roomno, OrderUUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("FCS PushData Error: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
CommonEntity/ForkSystem.cs
Normal file
23
CommonEntity/ForkSystem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Common;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class ForkSystem
|
||||
{
|
||||
public string EndPoint { get; set; }
|
||||
public byte[] Data { get; set; }
|
||||
public DateTime CurrentTime { get; set; }
|
||||
}
|
||||
public class Fork_Function
|
||||
{
|
||||
public static void PublishData<T>(T f)
|
||||
{
|
||||
string mns2 = Newtonsoft.Json.JsonConvert.SerializeObject(f);
|
||||
CSRedisCacheHelper.Publish("redis-forksystemdata", mns2);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
CommonEntity/GaiXie.cs
Normal file
13
CommonEntity/GaiXie.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public struct GaiXie
|
||||
{
|
||||
public byte[] Data { get; set; }
|
||||
public string IPEndPoint { get; set; }
|
||||
}
|
||||
}
|
||||
59
CommonEntity/GetHostIDByNumber.cs
Normal file
59
CommonEntity/GetHostIDByNumber.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Domain;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class GetHostIDByNumber
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
}
|
||||
public class NewVersionHexData
|
||||
{
|
||||
public byte CmdType { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string RemoteEndPoint { get; set; }
|
||||
public string HexData { get; set; }
|
||||
public DateTime CurrentTime { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 新版本的设备状态
|
||||
/// </summary>
|
||||
public class NewVersionDeviceStatus
|
||||
{
|
||||
public string HotelCode { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string DeviceAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前设备是 空调 灯光
|
||||
/// </summary>
|
||||
public DeviceType ModalType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 调光亮度
|
||||
/// </summary>
|
||||
public int Brightness { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开关状态
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 空调
|
||||
/// </summary>
|
||||
public AirConditionData AirConditionData { get; set; }
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
public int Time { get; set; }
|
||||
}
|
||||
}
|
||||
39
CommonEntity/HiWei.cs
Normal file
39
CommonEntity/HiWei.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
using System.Net;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class HiWei
|
||||
{
|
||||
public static string BaseUrl = "tvos.hw-iot.com.cn";
|
||||
public void Login()
|
||||
{
|
||||
try
|
||||
{
|
||||
var client1 = new RestClient(BaseUrl);
|
||||
var request1 = new RestRequest("/api/security/authenticate", Method.POST);
|
||||
|
||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||
User us = new User();
|
||||
us.username = "";
|
||||
us.password = "";
|
||||
us.oauth_id = 1;
|
||||
request1.AddJsonBody(us);
|
||||
|
||||
var QQQ = client1.Execute(request1);
|
||||
HttpStatusCode HHH = QQQ.StatusCode;
|
||||
if (HHH == HttpStatusCode.Created||HHH==HttpStatusCode.OK)
|
||||
{
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
37
CommonEntity/HisenseData.cs
Normal file
37
CommonEntity/HisenseData.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class HaiXinData
|
||||
{
|
||||
public string baiduReqBody { get; set; }
|
||||
public string deviceFactory { get; set; }
|
||||
public string forceUpdate { get; set; }
|
||||
public string deleteFlag { get; set; }
|
||||
public string hotelContract { get; set; }
|
||||
public List<string> macList { get; set; }
|
||||
}
|
||||
|
||||
public class HaiXinHeader
|
||||
{
|
||||
public header header { get; set; }
|
||||
public payload payload { get; set; }
|
||||
}
|
||||
public class header
|
||||
{
|
||||
public string @namespace { get; set; }
|
||||
public string name { get; set; }
|
||||
public string messageId { get; set; }
|
||||
public string payloadVersion { get; set; }
|
||||
}
|
||||
public class payload
|
||||
{
|
||||
public string accessToken { get; set; }
|
||||
public string openUid { get; set; }
|
||||
public string cuid { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
18
CommonEntity/HostMappingData.cs
Normal file
18
CommonEntity/HostMappingData.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class HostMappingData
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string HostNumber { get; set; }
|
||||
}
|
||||
public class HostRoomNumberMapping
|
||||
{
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
}
|
||||
}
|
||||
109
CommonEntity/HostModal_Cache.cs
Normal file
109
CommonEntity/HostModal_Cache.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Domain;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 这个类是 组合 式的
|
||||
///
|
||||
/// 意思是 根据类型,来选取相应的字段
|
||||
/// 比如说 空调只就需要使用空调的
|
||||
/// 调光灯 只需要 一个亮度。
|
||||
///
|
||||
/// 这样修改最原来的代码是 最简单,最快的,但是不是最合理的
|
||||
///
|
||||
/// 如果分开写的话,设备类型太多,写不过来
|
||||
/// </summary>
|
||||
public class HostModal_Cache
|
||||
{
|
||||
public int HostID { get; set; }
|
||||
/// <summary>
|
||||
/// 设备的一些基础信息,如地址,名称
|
||||
/// </summary>
|
||||
public RoomTypeModalCache Modal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前设备是 空调 灯光
|
||||
/// </summary>
|
||||
public DeviceType ModalType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 调光亮度
|
||||
/// </summary>
|
||||
public int Brightness { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开关状态
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 空调
|
||||
/// </summary>
|
||||
public AirConditionData AirConditionData { get; set; }
|
||||
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
public int Time { get; set; }
|
||||
|
||||
}
|
||||
public class AirConditionData
|
||||
{
|
||||
/// <summary>
|
||||
/// 开关
|
||||
/// </summary>
|
||||
public int AirStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 当前温度
|
||||
/// </summary>
|
||||
public int CurrentTemp { get; set; }
|
||||
/// <summary>
|
||||
/// 设定温度
|
||||
/// </summary>
|
||||
public int SettingTemp { get; set; }
|
||||
/// <summary>
|
||||
/// 风速
|
||||
/// </summary>
|
||||
public int FanSpeed { get; set; }
|
||||
/// <summary>
|
||||
/// 模式
|
||||
/// </summary>
|
||||
public int Mode { get; set; }
|
||||
/// <summary>
|
||||
/// 阀门
|
||||
/// </summary>
|
||||
public int Valve { get; set; }
|
||||
/// <summary>
|
||||
/// 当天开启时长
|
||||
/// </summary>
|
||||
public int Time { get; set; }
|
||||
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
}
|
||||
|
||||
public class RoomTypeModalCache
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备的名字
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 设备的地址
|
||||
/// </summary>
|
||||
public string ModalAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备所属的房型
|
||||
/// </summary>
|
||||
public int RoomTypeID { get; set; }
|
||||
public int Sort { get; set; }
|
||||
public bool ActiveIndicator { get; set; }
|
||||
}
|
||||
}
|
||||
93
CommonEntity/HostNumber_CacheData.cs
Normal file
93
CommonEntity/HostNumber_CacheData.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Domain;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class SomeDeviceExistsData
|
||||
{
|
||||
public string HostNUMBER { get; set; }
|
||||
|
||||
public string IP { get; set; }
|
||||
public string MAC { get; set; }
|
||||
|
||||
public int HotelID { get; set; }
|
||||
public int RoomTypeID { get; set; }
|
||||
|
||||
public int HostID { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
|
||||
public int FrameNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电源锁定(0正常,1锁定)
|
||||
/// </summary>
|
||||
public bool PowerSupply { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 门锁电量
|
||||
/// </summary>
|
||||
public ushort LockVoltage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主机温度
|
||||
/// </summary>
|
||||
public byte HostTemp { get; set; }
|
||||
|
||||
public string CreatDate { get; set; }
|
||||
/// <summary>
|
||||
/// 有的时候有用
|
||||
/// </summary>
|
||||
public string ModalID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房门开还是关
|
||||
/// </summary>
|
||||
public bool DoorLockStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 门锁状态
|
||||
/// </summary>
|
||||
public int LockStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 房态 是出租房,还是空房
|
||||
/// </summary>
|
||||
public RoomStatus RoomStatus { get; set; }
|
||||
|
||||
public string RoomCard{get;set;}
|
||||
public string OutCardTime { get; set; }
|
||||
|
||||
public RoomCard RoomCardData { get; set; }
|
||||
|
||||
public string DeviceStatusPushURL { get; set; }
|
||||
public string TianMaoCUID { get; set; }
|
||||
public string XiaoDuCUID { get; set; }
|
||||
public string WelcomeSpeech { get; set; }
|
||||
public string GoodbyeSpeech { get; set; }
|
||||
|
||||
//断电重置智能音箱
|
||||
public bool IsPowerOffResetXiaoDu { get; set; }
|
||||
|
||||
public string FaultPushURL { get; set; }
|
||||
|
||||
public string DisableStartTime { get; set; }
|
||||
public string DisableEndTime { get; set; }
|
||||
public bool IsWelcomeDisableTime { get; set; }
|
||||
}
|
||||
public class AirCondition
|
||||
{
|
||||
public int AirID = 0;
|
||||
public int AirStatus = 2;
|
||||
public string ModalAddress = "";
|
||||
public int RoomTemp = 0;
|
||||
public int SettingTemp = 0;
|
||||
public int Mode = 0;
|
||||
public int FanSpeed = 0;
|
||||
public int Valve = 0;
|
||||
public string ValveName; //阀门
|
||||
}
|
||||
}
|
||||
33
CommonEntity/HostSearchEntity.cs
Normal file
33
CommonEntity/HostSearchEntity.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class HostSearchEntity
|
||||
{
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string DNS { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string ConfigVersion { get; set; }
|
||||
public string SubnetMask { get; set; }
|
||||
public string Gateway { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public DateTime? Last_Modified_Time { get; set; }
|
||||
|
||||
public string IP { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string MAC { get; set; }
|
||||
|
||||
public string DeviceName { get; set; }
|
||||
|
||||
public bool IsAutoGetKey { get; set; }
|
||||
public string DeviceSecret { get; set; }
|
||||
|
||||
public string IotId { get; set; }
|
||||
public string ProductKey { get; set; }
|
||||
public bool IsPublish { get; set; }
|
||||
}
|
||||
}
|
||||
135
CommonEntity/JWTData.cs
Normal file
135
CommonEntity/JWTData.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Jose;
|
||||
using Common;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class JWTData
|
||||
{
|
||||
/// <summary>
|
||||
/// 主题
|
||||
/// </summary>
|
||||
public string sub { get; set; }
|
||||
/// <summary>
|
||||
/// 发行人
|
||||
/// </summary>
|
||||
public string iss { get; set; }
|
||||
/// <summary>
|
||||
/// 到期时间
|
||||
/// </summary>
|
||||
public long exp { get; set; }
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
public string aud { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 在此之前不可用
|
||||
/// </summary>
|
||||
public string nbf { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
public string iat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///用于标识该JWT
|
||||
/// </summary>
|
||||
public string jti { get; set; }
|
||||
|
||||
public string username { get; set; }
|
||||
}
|
||||
public class ChuangWeiUser
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Version { get; set; }
|
||||
}
|
||||
public class ReturnInfo
|
||||
{
|
||||
public int code { get; set; }
|
||||
public string msg { get; set; }
|
||||
public object data { get; set; }
|
||||
}
|
||||
public class TokenData
|
||||
{
|
||||
public string accessToken { get; set; }
|
||||
public string refreshToken { get; set; }
|
||||
}
|
||||
|
||||
public class SignKeyCommon
|
||||
{
|
||||
public readonly static string ChuangWei_JWTKey = "#这x是98一个uv永远$不可0能到的a一个数据*";
|
||||
|
||||
public static ReturnInfo GetTokenData(string username)
|
||||
{
|
||||
DateTime dt = DateTime.Now.AddMonths(6);
|
||||
string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
long l = Tools.GetCurrentTimeStamp(dt);
|
||||
CommonEntity.JWTData j = new CommonEntity.JWTData();
|
||||
j.sub = "创维电视登录";
|
||||
j.exp = l;
|
||||
j.aud = "创维电视accesstoken";
|
||||
j.nbf = DateTime.Now.AddMinutes(3).ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
j.iat = ti;
|
||||
j.jti = Guid.NewGuid().ToString("N");
|
||||
j.username = username;
|
||||
|
||||
var secretKey = Encoding.UTF8.GetBytes(SignKeyCommon.ChuangWei_JWTKey);
|
||||
string token = Jose.JWT.Encode(j, secretKey, JwsAlgorithm.HS256);
|
||||
|
||||
j.aud = "创维电视refresh_token";
|
||||
j.jti = Guid.NewGuid().ToString("N");
|
||||
string refresh_token = Jose.JWT.Encode(j, secretKey, JwsAlgorithm.HS256);
|
||||
|
||||
ReturnInfo r = new ReturnInfo();
|
||||
r.code = 200;
|
||||
r.msg = "登录成功";
|
||||
r.data = new TokenData()
|
||||
{
|
||||
accessToken = token,
|
||||
refreshToken = refresh_token
|
||||
};
|
||||
return r;
|
||||
}
|
||||
|
||||
public static bool TokenValidate(string retoken, out JWTData data, out int code, out string msg)
|
||||
{
|
||||
data = new JWTData();
|
||||
bool isv = false;
|
||||
code = 200;
|
||||
msg = "sucess";
|
||||
|
||||
byte[] secretKey = Encoding.UTF8.GetBytes(SignKeyCommon.ChuangWei_JWTKey);
|
||||
JWTData MMU = Jose.JWT.Decode<JWTData>(retoken, secretKey, JwsAlgorithm.HS256);
|
||||
if (MMU != null)
|
||||
{
|
||||
DateTime dt = Tools.GetCurrentDateTime(MMU.exp);
|
||||
string username = MMU.username;
|
||||
if (dt > DateTime.Now)
|
||||
{
|
||||
isv = true;
|
||||
data = MMU;
|
||||
}
|
||||
else
|
||||
{
|
||||
isv = false;
|
||||
code = 10042;
|
||||
msg = "Token值已经过期";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isv = false;
|
||||
code = 10021;
|
||||
msg = "非法token";
|
||||
}
|
||||
|
||||
return isv;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
CommonEntity/KongQi.cs
Normal file
29
CommonEntity/KongQi.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class KongQi
|
||||
{
|
||||
public string HotelID { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string CreatDate { get; set; }
|
||||
}
|
||||
public class KongQiReport
|
||||
{
|
||||
public string hotel_code { get; set; }
|
||||
public string time { get; set; }
|
||||
public string sign { get; set; }
|
||||
public string room_no { get; set; }
|
||||
public string pm25 { get; set; }
|
||||
public string co2 { get; set; }
|
||||
public string tvoc { get; set; }
|
||||
public string humidness { get; set; }
|
||||
public string temperature { get; set; }
|
||||
public string methanal { get; set; }
|
||||
public string pm10 { get; set; }
|
||||
}
|
||||
}
|
||||
23
CommonEntity/LieECOTaskExtra.cs
Normal file
23
CommonEntity/LieECOTaskExtra.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class LieECOTaskExtra
|
||||
{
|
||||
public string MissionKey { get; set; }
|
||||
public string TaskType { get; set; }
|
||||
|
||||
public string HostNUMBER { get; set; }
|
||||
public string MAC { get; set; }
|
||||
|
||||
public string ModalAddress { get; set; }
|
||||
public int Status { get; set; }
|
||||
public int Brightness { get; set; }
|
||||
public int FanSpeed { get; set; }
|
||||
public int Mode { get; set; }
|
||||
public int SetTemperatureValue { get; set; }
|
||||
}
|
||||
}
|
||||
20
CommonEntity/LingChenECO.cs
Normal file
20
CommonEntity/LingChenECO.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class LingChenECO
|
||||
{
|
||||
public string StartTime { get; set; }
|
||||
public string RelativeValue { get; set; }
|
||||
public bool IsEnable { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
}
|
||||
public class TimerECOData
|
||||
{
|
||||
public string Key = "HotelCode";
|
||||
public List<LingChenECO> Data { get; set; }
|
||||
}
|
||||
}
|
||||
38
CommonEntity/LogRecorrd.cs
Normal file
38
CommonEntity/LogRecorrd.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
using System.Configuration;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class LogRecorrd
|
||||
{
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(LogRecorrd));
|
||||
public static readonly string LogReportUrl = ConfigurationManager.AppSettings["debug_log_report_url"];
|
||||
public static void WebAPI_DataSend<T>(T t, string topic)
|
||||
{
|
||||
try
|
||||
{
|
||||
//这个是 定阅的服务器要写的
|
||||
//string debug_log_report_mqtt_topic = "blw/webapi/monitor/";
|
||||
string str = Newtonsoft.Json.JsonConvert.SerializeObject(t);
|
||||
var client1 = new RestClient(LogReportUrl);
|
||||
var request1 = new RestRequest("/", Method.POST);
|
||||
|
||||
//注意方法是POST
|
||||
//两个参数名字必须是 topic 和payload ,区分大小写的
|
||||
request1.AddParameter("topic", topic);
|
||||
request1.AddParameter("payload", str);
|
||||
|
||||
|
||||
client1.ExecuteAsync(request1, (response) => { });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("SendMQTTData: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
CommonEntity/LostData.cs
Normal file
11
CommonEntity/LostData.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class LostData
|
||||
{
|
||||
}
|
||||
}
|
||||
14
CommonEntity/MissionRequestData.cs
Normal file
14
CommonEntity/MissionRequestData.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Domain;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class MissionRequestData
|
||||
{
|
||||
public KongTiaoTimer KT { get; set; }
|
||||
public int DelayTimer { get; set; }
|
||||
}
|
||||
}
|
||||
50
CommonEntity/MonitorLog.cs
Normal file
50
CommonEntity/MonitorLog.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class MonitorLog
|
||||
{
|
||||
public long HotelCode{get;set;}
|
||||
public int HostID{get;set;}
|
||||
public string HostNumber { get; set; }
|
||||
public string RoomNo{get;set;}
|
||||
public string LanIP { get; set; }
|
||||
public int LanPort { get; set; }
|
||||
public string WWW_IP { get; set; }
|
||||
public int WWW_Port { get; set; }
|
||||
public string MAC{get;set;}
|
||||
public string CommandType { get; set; }
|
||||
public string SendOrReceive { get; set; }
|
||||
public string Data { get; set; }
|
||||
public string CreateTime { get; set; }
|
||||
}
|
||||
|
||||
public class MonitorRedis:MonitorLog
|
||||
{
|
||||
public string RemoteEndPointIP { get; set; }
|
||||
public int RemoteEndPointPort { get; set; }
|
||||
}
|
||||
public class Monitor_Host
|
||||
{
|
||||
public string HotelCode { get; set; }
|
||||
public string Key_HostNumber { get; set; }
|
||||
public string HostID { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string MAC { get; set; }
|
||||
public string CreateDateTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 语音控制监控类
|
||||
/// </summary>
|
||||
public class IOT_Monitor_Host
|
||||
{
|
||||
public string HotelCode { get; set; }
|
||||
public string HotelID { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string CreateDateTime { get; set; }
|
||||
}
|
||||
}
|
||||
48
CommonEntity/MyHttp.cs
Normal file
48
CommonEntity/MyHttp.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
using System.Net;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class MyHttp
|
||||
{
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(MyHttp));
|
||||
/// <summary>
|
||||
/// 发送HTTP请求
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="Url"></param>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public static string SendHttpData<T>(string Url, T obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
var A = (SecurityProtocolType)48;
|
||||
var B = (SecurityProtocolType)192;
|
||||
var C = (SecurityProtocolType)768;
|
||||
var D = (SecurityProtocolType)3072;
|
||||
var E = (SecurityProtocolType)12288;
|
||||
ServicePointManager.SecurityProtocol = A | B | C | D | E;
|
||||
var client1 = new RestClient(Url);
|
||||
var request1 = new RestRequest("", Method.POST);
|
||||
var jsa= Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
||||
request1.AddJsonBody(obj);
|
||||
var QQQ = client1.Execute(request1);
|
||||
HttpStatusCode HHH = QQQ.StatusCode;
|
||||
string fanhuizhi = QQQ.Content;
|
||||
|
||||
return fanhuizhi;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("Fault Push Error:" + ex.Message);
|
||||
logger.Error("Fault Push Error:" + ex.StackTrace);
|
||||
return ex.Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
CommonEntity/NewDataSQL.cs
Normal file
28
CommonEntity/NewDataSQL.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class NewDataSQL
|
||||
{
|
||||
//public static string BaseUrl = "http://localhost:5108/";
|
||||
public static string BaseUrl = "http://localhost:7000/";
|
||||
public static void GenericHOSTNUMBER(string HotelID,string Code)
|
||||
{
|
||||
//string str = Newtonsoft.Json.JsonConvert.SerializeObject("");
|
||||
var client1 = new RestClient(BaseUrl);
|
||||
var request1 = new RestRequest("api/Values/GenericHOSTNUMBER", Method.POST);
|
||||
|
||||
//注意方法是POST
|
||||
request1.AddParameter("HotelID", HotelID);
|
||||
request1.AddParameter("HotelCode", Code);
|
||||
//request1.AddParameter("payload", str);
|
||||
|
||||
|
||||
client1.ExecuteAsync(request1, (response) => { });
|
||||
}
|
||||
}
|
||||
}
|
||||
105
CommonEntity/NewRoomStatusPush.cs
Normal file
105
CommonEntity/NewRoomStatusPush.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class NewRoomStatusPush
|
||||
{
|
||||
/// <summary>
|
||||
/// 酒店编码
|
||||
/// </summary>
|
||||
public string code { get; set; }
|
||||
|
||||
public string hostnumber { get; set; }
|
||||
/// <summary>
|
||||
/// 房号
|
||||
/// </summary>
|
||||
public string roomNumber { get; set; }
|
||||
/// <summary>
|
||||
/// 回路地址
|
||||
/// </summary>
|
||||
public string address { get; set; }
|
||||
/// <summary>
|
||||
/// 回路名称
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 亮度
|
||||
/// </summary>
|
||||
public int brightness { get; set; }
|
||||
/// <summary>
|
||||
/// 当前温度
|
||||
/// </summary>
|
||||
public int currentTemp { get; set; }
|
||||
/// <summary>
|
||||
/// 设定温度
|
||||
/// </summary>
|
||||
public int settingTemp { get; set; }
|
||||
/// <summary>
|
||||
/// 风速
|
||||
/// </summary>
|
||||
public int fanSpeed { get; set; }
|
||||
/// <summary>
|
||||
/// 模式
|
||||
/// </summary>
|
||||
public int mode { get; set; }
|
||||
/// <summary>
|
||||
/// 阀门
|
||||
/// </summary>
|
||||
public int valve { get; set; }
|
||||
|
||||
public long createtime { get; set; }
|
||||
}
|
||||
public class DingShiReportDate
|
||||
{
|
||||
/// <summary>
|
||||
/// HostID
|
||||
/// </summary>
|
||||
public int HostID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备类型
|
||||
/// </summary>
|
||||
public string DeviceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备地址
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
/// <summary>
|
||||
/// 状态:1开,2关
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
/// <summary>
|
||||
/// 亮度
|
||||
/// </summary>
|
||||
public int Brightness { get; set; }
|
||||
/// <summary>
|
||||
/// 当前温度
|
||||
/// </summary>
|
||||
public int CurrentTemp { get; set; }
|
||||
/// <summary>
|
||||
/// 设定温度
|
||||
/// </summary>
|
||||
public int SettingTemp { get; set; }
|
||||
/// <summary>
|
||||
/// 风速
|
||||
/// </summary>
|
||||
public int FanSpeed { get; set; }
|
||||
/// <summary>
|
||||
/// 模式
|
||||
/// </summary>
|
||||
public int Mode { get; set; }
|
||||
/// <summary>
|
||||
/// 阀门
|
||||
/// </summary>
|
||||
public int Valve { get; set; }
|
||||
}
|
||||
}
|
||||
36
CommonEntity/Properties/AssemblyInfo.cs
Normal file
36
CommonEntity/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的常规信息通过以下
|
||||
// 特性集控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("CommonEntity")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("CommonEntity")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 使此程序集中的类型
|
||||
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
|
||||
// 则将该类型上的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("961ad106-c2d8-4768-8301-6e12a794bd64")]
|
||||
|
||||
// 程序集的版本信息由下面四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 内部版本号
|
||||
// 修订号
|
||||
//
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
13
CommonEntity/RedisTakeCardStatus.cs
Normal file
13
CommonEntity/RedisTakeCardStatus.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class RedisTakeCardStatus
|
||||
{
|
||||
public string HostNUMBER { get; set; }
|
||||
public List<byte> OriginalDat { get; set; }
|
||||
}
|
||||
}
|
||||
14
CommonEntity/RedisTongJiData.cs
Normal file
14
CommonEntity/RedisTongJiData.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class RedisTongJiData
|
||||
{
|
||||
public string url { get; set; }
|
||||
public string cron_exp { get; set; }
|
||||
public string mission_key { get; set; }
|
||||
}
|
||||
}
|
||||
15
CommonEntity/RoomStatusRequest.cs
Normal file
15
CommonEntity/RoomStatusRequest.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Domain;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class RoomStatusRequest
|
||||
{
|
||||
public string HostNumber { get; set; }
|
||||
public string MAC { get; set; }
|
||||
public RoomStatus Status { get; set; }
|
||||
}
|
||||
}
|
||||
97
CommonEntity/SkyWorth.cs
Normal file
97
CommonEntity/SkyWorth.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
using System.Net;
|
||||
using Common;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class SkyWorth
|
||||
{
|
||||
private static readonly string BaseUrl = "http://localhost:9000/";
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(SkyWorth));
|
||||
public static void Invoke(string hotelcode, string roomnum, string authCode, int cmd_no)
|
||||
{
|
||||
try
|
||||
{
|
||||
string R_ID = System.Guid.NewGuid().ToString("N");
|
||||
|
||||
string tiA = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
Dictionary<string, string> RequestData = new Dictionary<string, string>();
|
||||
RequestData.Add("HotelCode", hotelcode);
|
||||
RequestData.Add("RoomNumber", roomnum);
|
||||
RequestData.Add("RequestId", R_ID);
|
||||
|
||||
var R_cmd = new Dictionary<string, string>();
|
||||
R_cmd.Add("room", roomnum);
|
||||
R_cmd.Add("event", cmd_no.ToString());
|
||||
R_cmd.Add("authCode", authCode);
|
||||
|
||||
var cmdstr = Newtonsoft.Json.JsonConvert.SerializeObject(R_cmd);
|
||||
RequestData.Add("RequestCmd", cmdstr);
|
||||
RequestData.Add("RequestTime", tiA);
|
||||
//LogRecorrd.WebAPI_DataSend(RequestData, "api/skyworth");
|
||||
|
||||
|
||||
var client1 = new RestClient(BaseUrl);
|
||||
var request1 = new RestRequest("api/skyworth", Method.POST);
|
||||
|
||||
request1.AddParameter("room", roomnum);
|
||||
request1.AddParameter("event", cmd_no);
|
||||
request1.AddParameter("authCode", authCode);
|
||||
|
||||
logger.Error("调用子创维电视:数据为:" + authCode + " RoomNUM" + roomnum);
|
||||
|
||||
|
||||
Interface3Log w1 = new Interface3Log();
|
||||
w1.HotelCode = hotelcode;
|
||||
w1.RoomNumber = roomnum;
|
||||
w1.TriggerTime = DateTime.Now;
|
||||
w1.ActionData = new HttpActionData() { RequestData = Newtonsoft.Json.JsonConvert.SerializeObject(RequestData) };
|
||||
w1.CommandType = ChangLiangValue.SkyWorth;
|
||||
|
||||
var q1 = Newtonsoft.Json.JsonConvert.SerializeObject(w1);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q1);
|
||||
|
||||
|
||||
client1.ExecuteAsync(request1, (QQQ) =>
|
||||
{
|
||||
HttpStatusCode HHH = QQQ.StatusCode;
|
||||
string FHS = QQQ.Content;
|
||||
|
||||
logger.Error("调用创维电视,结果为:" + FHS);
|
||||
|
||||
//string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
//Dictionary<string, string> ResponseData = new Dictionary<string, string>();
|
||||
//ResponseData.Add("HotelCode", hotelcode);
|
||||
//ResponseData.Add("RoomNumber", roomnum);
|
||||
//ResponseData.Add("RequestId", R_ID);
|
||||
//ResponseData.Add("ResponseMsg", FHS);
|
||||
//ResponseData.Add("ResponseTime", ti);
|
||||
//LogRecorrd.WebAPI_DataSend(ResponseData, "api/skyworth");
|
||||
|
||||
Interface3Log ww = new Interface3Log();
|
||||
ww.HotelCode = hotelcode;
|
||||
ww.RoomNumber = roomnum;
|
||||
ww.TriggerTime = DateTime.Now;
|
||||
ww.ActionData = new HttpActionData() { ResponseData = FHS };
|
||||
ww.CommandType = ChangLiangValue.SkyWorth;
|
||||
|
||||
var qq = Newtonsoft.Json.JsonConvert.SerializeObject(ww);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, qq);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("创维电视前台叫出问题了:" + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
public class iotVoiceData
|
||||
{
|
||||
public string room { get; set; }
|
||||
public string @event { get; set; }
|
||||
}
|
||||
}
|
||||
23
CommonEntity/SmartVoiceData.cs
Normal file
23
CommonEntity/SmartVoiceData.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class SmartVoiceData
|
||||
{
|
||||
//小度
|
||||
public string HotelCode { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
|
||||
public string XiaoDuCUID { get; set; }
|
||||
public string TianMaoCUID { get; set; }
|
||||
public string WelcomeSpeech { get; set; }
|
||||
|
||||
//断电重置
|
||||
public bool IsPowerOffResetXiaoDu { get; set; }
|
||||
public string GoodbyeSpeech { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
158
CommonEntity/TCLToken.cs
Normal file
158
CommonEntity/TCLToken.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
using Common;
|
||||
using System.Configuration;
|
||||
|
||||
namespace CommonEntity
|
||||
{
|
||||
public class TCLToken
|
||||
{
|
||||
public int errno { get; set; }
|
||||
public string errmsg { get; set; }
|
||||
public TCLTokenData data { get; set; }
|
||||
}
|
||||
public class TCLTokenData
|
||||
{
|
||||
public string access_token { get; set; }
|
||||
public long expires_in { get; set; }
|
||||
public long deadline { get; set; }
|
||||
public string refresh_token { get; set; }
|
||||
}
|
||||
|
||||
public class TCLCommon
|
||||
{
|
||||
public static string TCLLoginUrl = ConfigurationManager.AppSettings["TCLLoginUrl"];
|
||||
public static string TCLAppId = ConfigurationManager.AppSettings["TCLAppId"];
|
||||
public static string TCLAppSecret = ConfigurationManager.AppSettings["TCLAppSecret"];
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(TCLCommon));
|
||||
|
||||
/// <summary>
|
||||
/// 获取TCL Token
|
||||
/// </summary>
|
||||
public static void GetTCLTV_Token()
|
||||
{
|
||||
try
|
||||
{
|
||||
var client1 = new RestClient(TCLLoginUrl);
|
||||
var request1 = new RestRequest("oauth/token", Method.GET);
|
||||
|
||||
request1.AddParameter("app_id", TCLAppId);
|
||||
request1.AddParameter("app_secret", TCLAppSecret);
|
||||
var QQQ = client1.Execute(request1);
|
||||
string ddd = QQQ.Content;
|
||||
var FFFA = Newtonsoft.Json.JsonConvert.DeserializeObject<TCLToken>(ddd);
|
||||
string TokenKey = CacheKey.TCLToken;
|
||||
CSRedisCacheHelper.Set_Partition<TCLToken>(TokenKey, FFFA, 1);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("TCL Token Error" + ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 给TCL发送数据
|
||||
/// </summary>
|
||||
/// <param name="CUID"></param>
|
||||
/// <param name="skillid"></param>
|
||||
/// <param name="sceneCode"></param>
|
||||
/// <param name="count"></param>
|
||||
public static void SendData(string hotelcode, string roomnum, string CUID, string skillid, string sceneCode, int count = 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
string ID = Guid.NewGuid().ToString("N");
|
||||
string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
Dictionary<string, string> dicg = new Dictionary<string, string>();
|
||||
dicg.Add("Step", "1");
|
||||
dicg.Add("HotelCode", hotelcode);
|
||||
dicg.Add("RoomNumber", roomnum);
|
||||
dicg.Add("RequestTime", roomnum);
|
||||
dicg.Add("CmdType", sceneCode);
|
||||
dicg.Add("RequestId", ID);
|
||||
|
||||
var dic1 = new Dictionary<string, string>();
|
||||
dic1.Add("cuid", roomnum);
|
||||
dic1.Add("sceneCode", sceneCode);
|
||||
dic1.Add("botId", skillid);
|
||||
|
||||
|
||||
logger.Error("TCL send data");
|
||||
string TokenKey = CacheKey.TCLToken;
|
||||
var T = CSRedisCacheHelper.Get_Partition<TCLToken>(TokenKey, 1);
|
||||
if (T != null)
|
||||
{
|
||||
logger.Equals("TCL Token是" + T.data.access_token);
|
||||
dic1.Add("token", T.data.access_token);
|
||||
|
||||
var jsondic = Newtonsoft.Json.JsonConvert.SerializeObject(dic1);
|
||||
dicg.Add("RequestCmd", jsondic);
|
||||
|
||||
//LogRecorrd.WebAPI_DataSend(dicg, "api/tcl_tv");
|
||||
|
||||
Interface3Log w1 = new Interface3Log();
|
||||
w1.HotelCode = hotelcode;
|
||||
w1.RoomNumber = roomnum;
|
||||
w1.TriggerTime = DateTime.Now;
|
||||
w1.ActionData = new HttpActionData() { RequestData = Newtonsoft.Json.JsonConvert.SerializeObject(dicg) };
|
||||
w1.CommandType = ChangLiangValue.TCL;
|
||||
|
||||
var q1 = Newtonsoft.Json.JsonConvert.SerializeObject(w1);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, q1);
|
||||
|
||||
var client1 = new RestClient(TCLLoginUrl);
|
||||
var request1 = new RestRequest("open/countercontrol/scene_trigger", Method.POST);
|
||||
|
||||
request1.AddHeader("Authorization", "Bearer " + T.data.access_token);
|
||||
|
||||
Dictionary<string, string> dic = new Dictionary<string, string>();
|
||||
dic.Add("cuid", CUID);
|
||||
dic.Add("sceneCode", sceneCode);
|
||||
dic.Add("botId", skillid);
|
||||
|
||||
request1.AddJsonBody(dic);
|
||||
var QQQ = client1.Execute(request1);
|
||||
string ddd = QQQ.Content;
|
||||
|
||||
|
||||
//string ti1 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
//Dictionary<string, string> dicg1 = new Dictionary<string, string>();
|
||||
//dicg1.Add("HotelCode", hotelcode);
|
||||
//dicg1.Add("RoomNumber", roomnum);
|
||||
//dicg1.Add("RequestId", ID);
|
||||
//dicg1.Add("ResponseMsg", ddd);
|
||||
//dicg1.Add("ResponseTime", ti1);
|
||||
//LogRecorrd.WebAPI_DataSend(dicg1, "api/tcl_tv");
|
||||
logger.Error("TCL 电视触发了 情景。返回数据为:" + ddd);
|
||||
|
||||
|
||||
Interface3Log ww = new Interface3Log();
|
||||
ww.HotelCode = hotelcode;
|
||||
ww.RoomNumber = roomnum;
|
||||
ww.TriggerTime = DateTime.Now;
|
||||
ww.ActionData = new HttpActionData() { ResponseData = ddd };
|
||||
ww.CommandType = ChangLiangValue.TCL;
|
||||
|
||||
var qq = Newtonsoft.Json.JsonConvert.SerializeObject(ww);
|
||||
CSRedisCacheHelper.Publish(CacheKey.InvokeHttpInterface, qq);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Equals("TCL Token 为空");
|
||||
if (count == 0)
|
||||
{
|
||||
GetTCLTV_Token();
|
||||
count = count + 1;
|
||||
SendData(hotelcode, roomnum, CUID, skillid, sceneCode, count++);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("TCL SenData" + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user