Compare commits

..

11 Commits

Author SHA1 Message Date
6f59da74c4 一个非常平稳的版本
一个非常平稳的版本,兼容了新老服务器
2026-04-10 19:08:44 +08:00
36c2fa4061 修改新版协议主机 协议触发的机制,新增 缓存机制 2026-04-09 13:37:09 +08:00
c13ab0cb56 增加一些功能,比如 修正重启后,队列消费会报错的问题 2026-04-02 15:16:13 +08:00
182186e1fb 增加电量报警模块
但是只是一部分功能
2026-03-30 17:55:55 +08:00
696144b2ff 修改一些可能在某些条件 下可能会触发的BUG 2026-03-26 14:18:52 +08:00
d0c626c189 修改长时间内存会炸 2026-03-25 17:51:43 +08:00
1840794f40 增加微信锁电量功能 2026-03-23 08:48:22 +08:00
e46b19016b 增加一系列功能
屏蔽 下位机 故障上报上报正常的数据。增加 日志系统的功能
2026-03-19 08:56:39 +08:00
a93c11fbfe 增加 升级功能的 日志监控 2026-03-17 15:58:22 +08:00
ddd4f5a6b4 修改 在线离线的判断逻辑 2026-03-16 13:57:23 +08:00
8ce4017100 增加新的功能 2026-03-13 19:28:17 +08:00
89 changed files with 1988 additions and 3773 deletions

9
.gitignore vendored
View File

@@ -39,3 +39,12 @@
/WebSite/Logs
WebSite/welcomebgm
MvcApplication1
ConsoleApplication4
RCUHost内存泄漏分析报告.md
CRICS_V3_1124.suo
ConsoleApplication5
ConsoleApplication1
ConsoleApplication666
ConsoleApplication666
ConsoleApplication1
ConsoleApplication2

View File

@@ -33,6 +33,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcApplication1", "MvcAppli
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication4", "ConsoleApplication4\ConsoleApplication4.csproj", "{85BC55B1-083D-4AE9-8DE8-3DE59B654990}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication5", "ConsoleApplication5\ConsoleApplication5.csproj", "{346B2008-1D95-4604-84A8-247D33FB8DED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -203,6 +205,16 @@ Global
{85BC55B1-083D-4AE9-8DE8-3DE59B654990}.Release|Mixed Platforms.Build.0 = Release|x86
{85BC55B1-083D-4AE9-8DE8-3DE59B654990}.Release|x86.ActiveCfg = Release|x86
{85BC55B1-083D-4AE9-8DE8-3DE59B654990}.Release|x86.Build.0 = Release|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Debug|Any CPU.ActiveCfg = Debug|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Debug|Mixed Platforms.Build.0 = Debug|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Debug|x86.ActiveCfg = Debug|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Debug|x86.Build.0 = Debug|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Release|Any CPU.ActiveCfg = Release|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Release|Mixed Platforms.ActiveCfg = Release|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Release|Mixed Platforms.Build.0 = Release|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Release|x86.ActiveCfg = Release|x86
{346B2008-1D95-4604-84A8-247D33FB8DED}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Binary file not shown.

View File

@@ -12,10 +12,17 @@ namespace Common
public static PerformanceCounter cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
public static double GetCPU()
{
cpuCounter.NextValue(); // 初始化计数器,让它开始计数
System.Threading.Thread.Sleep(1000); // 等待一秒
double cpuUsage = cpuCounter.NextValue(); // 获取CPU使用率
return cpuUsage;
try
{
cpuCounter.NextValue(); // 初始化计数器,让它开始计数
System.Threading.Thread.Sleep(1000); // 等待一秒
double cpuUsage = cpuCounter.NextValue(); // 获取CPU使用率
return cpuUsage;
}
catch (Exception ex)
{
throw;
}
}
[DllImport("kernel32.dll")]
@@ -31,4 +38,50 @@ namespace Common
}
}
public class CpuMonitor
{
// 将静态初始化改为延迟加载,并将异常处理移至初始化时
private static PerformanceCounter _cpuCounter = null;
private static readonly object _lock = new object();
private static Exception _initException = null;
private static void InitializeCounter()
{
if (_initException != null) throw _initException;
if (_cpuCounter != null) return;
lock (_lock)
{
if (_cpuCounter != null) return;
try
{
// 尝试创建计数器
_cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
// 立即调用一次 NextValue 来初始化
_cpuCounter.NextValue();
}
catch (Exception ex)
{
throw _initException;
}
}
}
public static double GetCurrentCpuUsage()
{
try
{
CpuMonitor.InitializeCounter(); // 确保计数器已初始化
_cpuCounter.NextValue(); // 首次调用返回0用于初始化本次采样
System.Threading.Thread.Sleep(1000); // 等待采样间隔
return _cpuCounter.NextValue(); // 返回过去一秒内的平均使用率
}
catch
{
// 记录日志或返回一个错误标识值,例如 -1
return -1;
}
}
}
}

View File

@@ -21,6 +21,8 @@ namespace Common
public static CSRedisClient redis4;
public static CSRedisClient redis5;
public static CSRedisClient redis6;
public static CSRedisClient redis7;
public static CSRedisClient redis8;
public static CSRedisClient redis_webchat;
//private static readonly string[] redisHosts = null;
private static int SessionExpireMinutes = int.Parse(ConfigurationManager.AppSettings["session_expire_minutes"]);
@@ -59,6 +61,8 @@ namespace Common
redis4 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=4");
redis5 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=5");
redis6 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=6");
redis7 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=7");
redis8 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=8");
redis_webchat = new CSRedisClient(string.Format(webchat_redisstr + ",password={0},defaultDatabase=0",webchat_redis_pwd));
//Native subscribe
@@ -205,6 +209,14 @@ namespace Common
{
client = redis6;
}
else if (SliceNo == 7)
{
client = redis7;
}
else if (SliceNo == 8)
{
client = redis8;
}
else
{
client = redis;
@@ -324,7 +336,7 @@ namespace Common
CSRedisClient client = WhitchRedisSlice(SliceNo);
client.LPush(key, obj);
}
public static long MaxLen = 1000000;
public static long MaxLen = 500000;
public static void StreamAdd(int SliceNo, string key, string Value)
{
try

View File

@@ -484,6 +484,15 @@ namespace Common
}
return result.ToString();
}
public static string ByteToString_NoWhiteSpace(byte[] bytesData)
{
StringBuilder result = new StringBuilder();
foreach (byte r in bytesData)
{
result.Append(r.ToString("X2"));
}
return result.ToString();
}
/// <summary>
/// 把int32类型的数据转存到2个字节的byte数组中
/// </summary>
@@ -497,6 +506,22 @@ namespace Common
arry[1] = (byte)(data & 0xFF);
return arry;
}
// 方法B自定义字符数组判断
public static bool ContainsSpecialChars(string input)
{
// 定义特殊字符数组
char[] specialChars = {
'!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
'+', '=', '[', ']', '{', '}', '|', '\\', ':', ';',
'"', '\'', '<', '>', ',', '.', '?', '/', '`', '~'
};
// 判断是否包含空白字符(空格、制表符、换行符等)
bool hasWhiteSpace = input.Any(char.IsWhiteSpace);
return input.Any(c => specialChars.Contains(c))&&hasWhiteSpace;
}
/// <summary>
/// 把int32类型的数据转存到2个字节的byte数组中小端
/// </summary>
@@ -772,6 +797,12 @@ namespace Common
long current_timestamp = Convert.ToInt64(ts.TotalSeconds);
return current_timestamp;
}
public static long GetCurrentTimeStamp_MS(DateTime dt)
{
TimeSpan ts = dt - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local);
long current_timestamp = Convert.ToInt64(ts.TotalMilliseconds);
return current_timestamp;
}
public static DateTime GetCurrentDateTime(long timestampMilliseconds)
{
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local);

View File

@@ -132,6 +132,11 @@ namespace CommonEntity
/// 济南同派 特殊处理
/// </summary>
public static string JiNan_TongPai_Spec = "jntp_spec";
/// <summary>
/// 微信 锁电量
/// </summary>
public static string DianLiang = "DL";
}
public class ChangLiangValue
{

View File

@@ -59,6 +59,7 @@
<Compile Include="CacheDTO.cs" />
<Compile Include="CacheKey.cs" />
<Compile Include="DataTongJi.cs" />
<Compile Include="FangTaiData.cs" />
<Compile Include="FCS.cs" />
<Compile Include="ForkSystem.cs" />
<Compile Include="GaiXie.cs" />
@@ -84,6 +85,7 @@
<Compile Include="NewDataSQL.cs" />
<Compile Include="NewRoomStatusPush.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="QuanJuVar.cs" />
<Compile Include="RedisTakeCardStatus.cs" />
<Compile Include="RedisTongJiData.cs" />
<Compile Include="RoomStatusRequest.cs" />

View File

@@ -270,6 +270,11 @@ namespace CommonEntity
/// </summary>
public int IdentityInfo { get; set; }
public int Bright_G { get; set; }
/// <summary>
/// 微信锁电量
/// </summary>
public int WeiXinSuo_DianLiang { get; set; }
}
/// <summary>
@@ -309,9 +314,9 @@ namespace CommonEntity
}
public class ts_faultitem
{
public short dev_type { get; set; }
public short dev_addr { get; set; }
public short dev_loop { get; set; }
public ushort dev_type { get; set; }
public ushort dev_addr { get; set; }
public ushort dev_loop { get; set; }
public short error_type { get; set; }
public int error_data { get; set; }
}
@@ -336,6 +341,7 @@ namespace CommonEntity
/// "上报" 或 "下发"
/// </summary>
public string direction { get; set; }
public string ip { get; set; }
public string cmd_word { get; set; }
public int frame_id { get; set; }

View File

@@ -228,7 +228,7 @@ namespace CommonEntity
};
fff.remark = remarkdata;
fff.assigned_to = "auto";
fff.user_type = 1;
fff.user_type = 2;
fff.get_details = true;

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;
namespace CommonEntity
{
public class FangTaiData
{
public int hotelID { get; set; }
public RoomStatus roomStatus { get; set; }
public string RoomNUM { get; set; }
}
}

View File

@@ -9,6 +9,7 @@ namespace CommonEntity
{
public int Id { get; set; }
public string HostNumber { get; set; }
public int RoomTypeId { get; set; }
}
public class HostRoomNumberMapping
{

View File

@@ -67,7 +67,7 @@ namespace CommonEntity
public static ReturnInfo GetTokenData(string username)
{
DateTime dt = DateTime.Now.AddMonths(6);
DateTime dt = DateTime.Now.AddYears(20);
string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
long l = Tools.GetCurrentTimeStamp(dt);
CommonEntity.JWTData j = new CommonEntity.JWTData();

View File

@@ -12,5 +12,26 @@ namespace CommonEntity
public string hotel_id { get; set; }
public string device_id { get; set; }
public string room_id { get; set; }
public string ip { get; set; }
}
public struct ShengJi_Log
{
public string hotel_id { get; set; }
public string device_id { get; set; }
public string room_id { get; set; }
public long ts_ms { get; set; }
public int is_send { get; set; }
public byte[] udp_raw { get; set; }
public object extra { get; set; }
public string remote_endpoint { get; set; }
public string md5 { get; set; }
public int partition { get; set; }
public int file_type { get; set; }
public string file_path { get; set; }
public int upgrade_state { get; set; }
public string app_version { get; set; }
}
}

View File

@@ -48,7 +48,7 @@ namespace CommonEntity
public string subnet_mask { get; set; }
public string gateway { get; set; }
public string dns { get; set; }
public string version { get; set; }
public string app_version { get; set; }
/// <summary>
/// RCU 时间,年月日 那种
/// </summary>
@@ -68,8 +68,8 @@ namespace CommonEntity
/// <summary>
/// 授权时间
/// </summary>
public long authorization_time { get; set; }
public long authorization_days { get; set; }
public string authorization_time { get; set; }
public string authorization_days { get; set; }
public string room_num_remark { get; set; }
public string room_type_remark { get; set; }
public string room_remark { get; set; }
@@ -78,5 +78,10 @@ namespace CommonEntity
public string central_control_name { get; set; }
public string configure_hotel_name { get; set; }
public string configure_room_type_name { get; set; }
/// <summary>
/// 最后一次升级时间
/// </summary>
public long upgrade_ts_ms { get; set; }
}
}

View File

@@ -28,6 +28,10 @@ namespace CommonEntity
var D = (SecurityProtocolType)3072;
var E = (SecurityProtocolType)12288;
ServicePointManager.SecurityProtocol = A | B | C | D | E;
// 或者方法3使用所有现代TLS协议
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
var client1 = new RestClient(Url);
var request1 = new RestRequest("", Method.POST);
//var jsa= Newtonsoft.Json.JsonConvert.SerializeObject(obj);

16
CommonEntity/QuanJuVar.cs Normal file
View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;
namespace CommonEntity
{
public class QuanJuVar
{
public static IList<RoomTypeModal> BaoJingUpLoad = new List<RoomTypeModal>();
public static IList<RoomTypeModal> RoomTypeDeviceModal = new List<RoomTypeModal>();
public static IList<HotelSeason> HotelSeaon = new List<HotelSeason>();
public static List<HotelAirControl> HotelAirControl = new List<HotelAirControl>();
}
}

View File

@@ -119,12 +119,6 @@ namespace CommonEntity
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);
//dic.Add("params", Newtonsoft.Json.JsonConvert.SerializeObject(extra_params));
TCLBell tsa = new TCLBell();
tsa.cuid = CUID;
tsa.sceneCode = sceneCode;
@@ -139,15 +133,6 @@ namespace CommonEntity
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);

View File

@@ -1,128 +0,0 @@
<?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)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BE0C3821-67F3-4FF5-B688-E727BD4C90AE}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ConsoleApplication1</RootNamespace>
<AssemblyName>ConsoleApplication1</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<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|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="C5">
<HintPath>..\..\..\..\lib\Quart\quartznet-2.3.3\quartznet-2.3.3\build\4.0\Debug\Quartz\C5.dll</HintPath>
</Reference>
<Reference Include="CacheManager.Core, Version=0.7.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\CacheManager.Core.0.7.4\lib\net40\CacheManager.Core.dll</HintPath>
</Reference>
<Reference Include="CacheManager.Memcached">
<HintPath>..\lib\CacheManager.Memcached.0.7.4\lib\net40\CacheManager.Memcached.dll</HintPath>
</Reference>
<Reference Include="CacheManager.SystemRuntimeCaching">
<HintPath>..\lib\CacheManager.SystemRuntimeCaching.0.7.4\lib\net40\CacheManager.SystemRuntimeCaching.dll</HintPath>
</Reference>
<Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\Quart\quartznet-2.3.3\quartznet-2.3.3\build\4.0\Debug\Quartz\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Common.Logging.Core">
<HintPath>..\..\..\..\lib\Quart\quartznet-2.3.3\quartznet-2.3.3\build\4.0\Debug\Quartz\Common.Logging.Core.dll</HintPath>
</Reference>
<Reference Include="CSRedisCore, Version=3.8.670.0, Culture=neutral, PublicKeyToken=9aa6a3079358d437, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Redis\CSRedisCore.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="Quartz">
<HintPath>..\..\..\..\lib\Quart\quartznet-2.3.3\quartznet-2.3.3\build\4.0\Debug\Quartz\Quartz.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath>..\lib\RestSharp\RestSharp.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Common">
<HintPath>..\lib\Redis\ServiceStack.Common.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Interfaces">
<HintPath>..\lib\Redis\ServiceStack.Interfaces.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Redis">
<HintPath>..\lib\Redis\ServiceStack.Redis.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text">
<HintPath>..\lib\Redis\ServiceStack.Text.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple">
<HintPath>..\lib\Redis\System.ValueTuple.dll</HintPath>
</Reference>
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonEntity\CommonEntity.csproj">
<Project>{1D7073B2-4CC3-49F5-9F37-50A21D74A39D}</Project>
<Name>CommonEntity</Name>
</ProjectReference>
<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>
<ProjectReference Include="..\RCUHost\RCUHost.csproj">
<Project>{3AF4C628-0B47-412C-950A-DBC0161F2A7F}</Project>
<Name>RCUHost</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</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>

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ConsoleApplication1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApplication1")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("294a52c2-b3d2-4af1-a63e-358eb085073d")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,18 +0,0 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="TCLLoginUrl" value="https://ai.tclyun.cn/"/>
<add key="TCLAppId" value="3fc1fe5560bdf2efda50a8dc23521d8a"/>
<add key="TCLAppSecret" value="48c30d8fcca4e14ab4842e9bfd54c082"/>
<!-- redis Start -->
<add key="session_expire_minutes" value="5" />
<add key="redis_server_session" value="127.0.0.1:6379" />
<add key="redis_max_read_pool" value="1000" />
<add key="redis_max_write_pool" value="1000" />
<add key="monitor_log_expire_minutes" value="30" />
<!--redis end-->
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View File

@@ -1,139 +0,0 @@
<?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)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4646F920-6D41-4519-8E03-5528B64EC7FE}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ConsoleApplication2</RootNamespace>
<AssemblyName>ConsoleApplication2</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;AAA;BBB;CCC;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CSRedisCore, Version=3.8.670.0, Culture=neutral, PublicKeyToken=9aa6a3079358d437, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Redis\CSRedisCore.dll</HintPath>
</Reference>
<Reference Include="FluentScheduler">
<HintPath>..\lib\taskschedule\FluentScheduler.dll</HintPath>
</Reference>
<Reference Include="jose-jwt">
<HintPath>..\lib\jwt\jose-jwt.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, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\RestSharp\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple">
<HintPath>..\lib\Redis\System.ValueTuple.dll</HintPath>
</Reference>
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonEntity\CommonEntity.csproj">
<Project>{1D7073B2-4CC3-49F5-9F37-50A21D74A39D}</Project>
<Name>CommonEntity</Name>
</ProjectReference>
<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>
<ProjectReference Include="..\RCUHost\RCUHost.csproj">
<Project>{3AF4C628-0B47-412C-950A-DBC0161F2A7F}</Project>
<Name>RCUHost</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</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>

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

View File

@@ -1,784 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jose;
using System.Timers;
using Common;
using System.IO;
using System.Threading.Tasks;
using System.Threading;
using FluentScheduler;
using System.Xml;
using System.Xml.Linq;
using System.Collections;
using System.Security.Cryptography.X509Certificates;
using System.Diagnostics;
using System.Runtime.InteropServices;
using RCUHost.Protocols;
using RestSharp;
using Domain.IoTFerErEntity;
using System.Net;
using System.Collections.Concurrent;
using RCUHost.Implement;
using Domain;
using Newtonsoft.Json;
using CommonEntity;
using Newtonsoft.Json.Linq;
using CSRedis;
namespace ConsoleApplication2
{
class Program
{
public static string NormalizeVersion(string version, int desiredParts = 3)
{
// 移除末尾的冗余点并分割
var parts = version.TrimEnd('.').Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
// 补零到目标位数
while (parts.Length < desiredParts)
{
parts = parts.Concat(new[] { "0" }).ToArray();
}
return string.Join(".", parts);
}
public struct A
{
public string id { get; set; }
public string name { get; set; }
}
static System.Timers.Timer t = null;
public enum Fruit
{
Apple, Bear
}
public class GA
{
public string NNN { get; set; }
public Fruit FFF { get; set; }
}
public class GGG
{
public string Name { get; set; }
}
[DllImport("kernel32.dll")]
private static extern void GetSystemTimePreciseAsFileTime(out long fileTime);
// 将 FILETIME (long) 转换为 DateTime
public static DateTime GetNowPrecise()
{
long fileTime;
GetSystemTimePreciseAsFileTime(out fileTime);
DateTime localTime = DateTime.FromFileTimeUtc(fileTime).ToLocalTime();
return localTime;
}
static byte[] GetBytesFromString(string hexString)
{
byte[] bytes = new byte[hexString.Length / 2]; // 计算字节数组的长度
for (int i = 0; i < bytes.Length; i++)
{
bytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16); // 每次取两个字符转换为字节
}
return bytes;
}
static void JieXi()
{
NewVersionLog s = new NewVersionLog();
var nas = JsonConvert.SerializeObject(s);
var data = Encoding.UTF8.GetBytes(nas);
Encoding.UTF8.GetString(data);
string strnn1 = "AA 55 2F 00 54 33 53 41 02 34 80 EB 03 6B 24 34 D0 B8 11 6B 24 01 01 01 39 01 01 00 10 F0 55 E8 03 E8 03 00 00 E8 03 00 00 E8 03 00 00 9E 00";
//AA 55 2F 00 54 33 53 41 02 34 80 EB 03 6B 24
//34 D0 B8 11 6B 24
//01 解析版本
//01 取电
//01 设备数量
//39
//01
//01
//00
//10 ///长度
//F0 55 //电压
//E8 03 //电流
//E8 03 00 00 功率
//E8 03 00 00 能耗
//E8 03 00 00 总能耗
//9E 00
byte[] nnnafd = GetBytesFromString(strnn1.Replace(" ", ""));
byte[] Data = GetBytesFromString(strnn1.Replace(" ", ""));
byte[] MAC = Data.Skip(15).Take(6).ToArray();
byte Version = Data.Skip(21).Take(1).FirstOrDefault();
//从第21个数据开始
byte TakeCard = Data.Skip(22).Take(1).FirstOrDefault();
//设备数量
byte DeviceCount = Data.Skip(23).Take(1).FirstOrDefault();
byte LeiXing = Data.Skip(24).Take(1).FirstOrDefault();
byte Address = Data.Skip(25).Take(1).FirstOrDefault();
byte[] Num = Data.Skip(26).Take(2).ToArray();
List<byte> lll = new List<byte>();
lll.Add(LeiXing);
lll.Add(Address);
lll.AddRange(Num);
string address = new DeviceAddress(lll.ToArray()).ToString();
byte Len = Data.Skip(28).Take(1).FirstOrDefault();
byte[] DianYa = Data.Skip(29).Take(2).ToArray();
byte[] DianLiu = Data.Skip(31).Take(2).ToArray();
byte[] Power = Data.Skip(33).Take(4).ToArray();
byte[] PowerUsed = Data.Skip(37).Take(4).ToArray();
byte[] TotalPowerUsed = Data.Skip(41).Take(4).ToArray();
int dianya = BitConverter.ToUInt16(DianYa, 0);
int dianliu = BitConverter.ToInt16(DianLiu, 0);
int gonglv = BitConverter.ToInt32(Power, 0);
int nenghao = BitConverter.ToInt32(PowerUsed, 0);
int zongnenghao = BitConverter.ToInt32(TotalPowerUsed, 0);
int V = dianya * 10 / 1000;
int A = dianliu * 10 / 1000;
int P = gonglv * 10 / 1000;
decimal KW_H = nenghao / 1000;
decimal Sum_KW_H = zongnenghao / 1000;
}
public class VVV
{
public DateTime ddd { get; set; }
public VVV()
{
this.ddd = DateTime.Now;
}
}
public class AUser
{
public string username { get; set; }
public string password { get; set; }
public int oauth_id { get; set; }
}
public static void FCSLLL()
{
try
{
//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;
string FCSLoginUrl = "https://api.fcs1cloud.com";
string FCSLoginUserName = "hb.rcu";
string FCSLoginPassWord = "P@1234";
var client1 = new RestClient(FCSLoginUrl);
var request1 = new RestRequest("/api/security/authenticate", Method.POST);
//request1.AddHeader("Content-Type", "application/json");
AUser us = new AUser();
us.username = FCSLoginUserName;
us.password = FCSLoginPassWord;
us.oauth_id = 1;
request1.AddJsonBody(us);
//request1.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(us), DataFormat.Json);
var QQQ = client1.Execute(request1);
var UUN = QQQ.Content;
HttpStatusCode HHH = QQQ.StatusCode;
if (HHH == HttpStatusCode.Created || HHH == HttpStatusCode.OK)
{
string ddd = QQQ.Content;
}
}
catch (Exception ex)
{
}
}
public static ConcurrentQueue<string> ssslist = new ConcurrentQueue<string>();
public class A1
{
public string id { get; set; }
public string name { get; set; }
}
public struct Tiao
{
public string Nsa { get; set; }
}
public static void Data()
{
XuanZhuResponse resp = new XuanZhuResponse();
resp.code = "1085";
resp.roomNumber = "1001";
resp.address = "";
resp.name = "";
resp.status = 1;
if (resp.status == 1)
{
resp.brightness = 0;
resp.currentTemp = 25;
resp.settingTemp = 25;
resp.mode = 1;
resp.fanSpeed = 1;
resp.valve = 0;
}
MyHttp.SendHttpData("http://f-xcx.blv-oa.com/rcu/report", resp);
}
static void RedisTest()
{
var redis_webchat = new CSRedisClient(string.Format("47.119.147.104:26379" + ",password={0},defaultDatabase=0", "1001^_^lool"));
redis_webchat.HMSet("a", "b", "c");
}
static void AAA()
{
string nnn = "AA 55 30 00 54 33 53 41 0F 15 71 FF FF FF FF 05 07 01 00 00 00 80 07 02 00 00 00 80 07 03 00 00 00 80 07 04 00 00 00 80 07 05 00 00 00 80 CA 7C";
var data = Tools.GetBytesFromString(nnn.Replace(" ", ""));
string hostNumber = "233003055055";
var cmdtype = data[8];
var device_count = data[15];
if (cmdtype == 0x0F)
{
byte[] framenolist = data.Skip(7).Take(2).ToArray();
var zhenhao = BitConverter.ToUInt16(framenolist, 0);
string RoomNUMBER = CSRedisCacheHelper.HMGet<string>(5, CacheKey.RoomNumber_HostNumber, hostNumber)[0];
if (!string.IsNullOrEmpty(RoomNUMBER))
{
var code = Tools.HostNumberToHotelCode(hostNumber);
DeviceActionData d1 = new DeviceActionData();
d1.ts_ms = Tools.GetUnixTime();
d1.hotel_id = code.ToString();
d1.room_id = RoomNUMBER;
d1.device_id = hostNumber;
d1.frame_id = zhenhao;
d1.cmd_word = "0F";
//d1.udp_raw = Tools.ByteToString(data);
d1.udp_raw = data;
d1.direction = "下发";
List<ts_deviceitem> lll1 = new List<ts_deviceitem>();
List<ts_faultitem> lll2 = new List<ts_faultitem>();
List<ts_controlitem> lll3 = new List<ts_controlitem>();
int skip = 16;
for (int i = 1; i <= device_count; i++)
{
var t1 = data.Skip(skip + (i - 1) * 6).Take(6).ToArray();
ts_controlitem ts = new ts_controlitem();
ts.dev_addr = t1[0];
ts.dev_type = t1[1];
ts.dev_loop = t1[2];
ts.type_h = t1[3];
ts.type_l = BitConverter.ToInt16(new byte[] { t1[5], t1[4] }, 0);
lll3.Add(ts);
}
d1.control_list = lll3;
}
}
}
static void Main(string[] args)
{
byte[] ss111= Base64Url.Decode("qlUuAFQzU0E01oL4CIZhAQIABgAgAAAAAAAA/wICBwEAAAIbKgcCAAACGyp4Ig==");
var vv1= Tools.ByteToString(ss111);
#if AAA
Console.WriteLine("aaaaaaaaaaaaa");
#endif
var ggg= BitConverter.ToString(new byte[]{0xaa,0xcc});
AAA();
string aaa111 = "233003";
var bj1 = aaa111.Substring(0, 3);
var a1 = int.Parse(bj1);
var a2 = int.Parse(aaa111.Substring(3, 3));
var a3 = new byte[] { Convert.ToByte(a1), Convert.ToByte(a2) };
var uuua = BitConverter.ToUInt16(a3, 0);
BitArray bit_a = new BitArray(new byte[] { 0xAA });
bool bfa = bit_a.Get(0);
bool bfaa = bit_a.Get(1);
var DDD = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff");
Console.WriteLine(DDD);
var qqqhj = CSRedisCacheHelper.Get_Partition<HostModal_Cache>("HostModalStatusReceiver_13_000000001");
var qq223 = JsonConvert.DeserializeObject<HostModal_Cache>(File.ReadAllText("3.txt"));
RedisTest();
Data();
Console.ReadLine();
string uuawer = string.Concat("h", "eeeelll");
string QQQQSSS = File.ReadAllText("3.txt", Encoding.UTF8);
var FFF = JsonConvert.DeserializeObject<FCS_Response>(QQQQSSS);
JObject jsonObject = JObject.Parse(QQQQSSS);
var error = jsonObject.SelectToken("error");
var JJJ = FFF.data.FirstOrDefault();
if (JJJ != null)
{
string orderuuid = JJJ.job_uuid;
FCS_OrderData f = new FCS_OrderData();
f.OrderUUID = orderuuid;
f.PropertyID = "";
f.ItemType = "Clean";
f.OrderNo = JJJ.job_no;
f.ItemUUID = "";
f.LocationUUID = "";
f.HotelCode = "";
f.RoomNUMBER = "";
string fsa = Newtonsoft.Json.JsonConvert.SerializeObject(f);
//这个是 供轮循的时候调用使用
CSRedisCacheHelper.HMSet(3, 60 * 24, CacheKey.FCSOrder, "aaa", fsa);
//这个是供 取消订单的时候使用的
//这个只 支持 取消 清理
//logger.Error("记录入循环:"+orderuuid);
CSRedisCacheHelper.Set_PartitionWithTime(CacheKey.FCSRoom_Mapping_Order + "_" + "", orderuuid, 24 * 60, 3);
}
//string orderuuid = JJJ.job_uuid;
AskRoomStatusChangedReceiver h = new AskRoomStatusChangedReceiver();
RoomStatus vv = new RoomStatus();
vv.ID = 0x10;
h.SendRoomStatusSelfNew("123", "321", vv, new byte[] { 0xee, 0xff }, 0x70);
string NNU11232 = Guid.NewGuid().ToString("N");
List<A1> list112 = new List<A1>(){new A1{id="1",name="A"},
new A1(){id="2",name="B"}};
List<string> flattenedList = list112.SelectMany(a => new[] { a.id, a.name }).ToList();
string result3432432 = string.Join(",", flattenedList); // 输出 "1,A,2,B"
CSRedisCacheHelper.HMSet(5, "UUU", "1", "333333", "2", "3434342");
int afdfdsa = 1;
string fdfd = afdfdsa.ToString("000");
ssslist.Enqueue("aaaaaa");
string wer = "233003112125";
var nnha = Tools.HostNumberToHotelCode(wer);
bool isNumeric = wer.All(char.IsDigit);
byte Chaka = CSRedisCacheHelper.Get_Partition<byte>("NNNNNNNNNNN", 5);
CSRedisCacheHelper.HMSet(5, "A", "1", "333333");
CSRedisCacheHelper.HMSet(5, "A", "2", "2222222222");
CSRedisCacheHelper.HMSet(5, "A", "3", "1111111111111");
var nnafdssfd = CSRedisCacheHelper.HMGetAll(5, "A");
var nnafdssfd1 = CSRedisCacheHelper.HMGet<string>(5, "A", "3");
var bb = new byte[] { 0x00, 0x01, 0x02, 0x03 };
var KKKFFF = BitConverter.ToString(bb);
VVV vva = new VVV();
Console.WriteLine(vva.ddd);
uint yua = 30;
double ddaf = (double)yua / 1000;
double dddjkl = Math.Round(13.722);
System.Timers.Timer timer2 = new System.Timers.Timer(1000);//每20秒扫描一次
timer2.Elapsed += new ElapsedEventHandler(timer2_Elapsed); ;//定时同步PMS房态
timer2.Enabled = true;
timer2.AutoReset = true;
long lln = Tools.GetUnixTime();
DateTime nd = Tools.GetTimeFromUnixTime(lln);
// 小端数字节数组(低位在前,高位在后)
byte[] littleEndianBytes = { 0xE8, 0x03, 0x00, 0x00 }; // 表示1000
// 直接转换为intBitConverter会自动处理端序
int result = BitConverter.ToInt32(littleEndianBytes, 0);
JieXi();
DateTime ddd = GetNowPrecise();
string tii = ddd.ToString("yyyy-MM-dd HH:mm:ss.ffffff");
Console.WriteLine(tii);
Console.ReadLine();
List<GGG> lllus = new List<GGG>();
for (int i = 0; i < 10; i++)
{
GGG g = new GGG();
g.Name = i.ToString();
lllus.Add(g);
}
//Tuple<List<GGG>> lllaf = new Tuple<List<GGG>>(lllus);
List<GGG> newlist = lllus;
foreach (var item in lllus)
{
Task.Factory.StartNew(() =>
{
Console.WriteLine(item.Name);
});
}
Console.ReadLine();
System.Collections.Concurrent.ConcurrentQueue<string> NNA = new System.Collections.Concurrent.ConcurrentQueue<string>();
Task.Factory.StartNew(() =>
{
}).ContinueWith((mytask) =>
{
});
string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff");
Console.WriteLine(ti);
byte[] b1 = new byte[] { 0x01, 0x02, 0x03, 0x04 };
byte[] b2 = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 };
bool bbbnfm = b1.SequenceEqual<byte>(b2);
foreach (var name in Enum.GetNames(typeof(Domain.DeviceType)))
{
Console.WriteLine(name);
}
long lll = Tools.GetCurrentTimeStamp(DateTime.Now);
DateTime ddf = Tools.GetCurrentDateTime(lll);
var payload = new Dictionary<string, object>()
{
//{ "sub", "mr.x@contoso.com" },
//{ "exp", 1300819380 }
//iss发行人
//exp到期时间
//sub主题
//aud用户
//nbf在此之前不可用
//iat发布时间
//jtiJWT ID用于标识该JWT
};
var secretKey = Encoding.UTF8.GetBytes("#myemqtt123");
string token = Jose.JWT.Encode(payload, secretKey, JwsAlgorithm.HS256);
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJtci54QGNvbnRvc28uY29tIiwiZXhwIjoxMzAwODE5MzgwfQ.nch1wu8T_rsT_bywCOm2W-qO2jcv69RsrrmpWU6fdDE";
//var MMU = Jose.JWT.DecodeBytes(token, secretKey, JwsAlgorithm.HS256);
//var NNN = Jose.JWT.Decode(token, secretKey);
//var n1 = Jose.JWT.Verify(token, secretKey);
var privateKey = new X509Certificate2("mycert.p12", "123456").PrivateKey;
string token3 = Jose.JWT.Encode(payload, privateKey, JwsAlgorithm.RS256);
Console.WriteLine(token);
GA gvb = new GA();
gvb.NNN = "fdfdf";
gvb.FFF = Fruit.Apple;
string qwerty = Newtonsoft.Json.JsonConvert.SerializeObject(gvb);
var QQR = Newtonsoft.Json.JsonConvert.DeserializeObject<GA>(qwerty);
var JK = new A { id = "1", name = "1" };
var JJ = new A { id = "1", name = "1" };
Console.WriteLine(JK.Equals(JJ));
List<A> lla = new List<A>() {
new A{id="1",name="1"},
new A{id="2",name="2"}
};
List<A> llb = new List<A>() {
new A{id="1",name="1"},
new A{id="3",name="3"},
};
var QQQ = llb.Except<A>(lla).ToList();
t = new System.Timers.Timer();
t.Interval = 1000;
t.Elapsed += new ElapsedEventHandler(t_Elapsed);
t.Start();
do
{
Console.WriteLine("输入时间");
string nnn = Console.ReadLine();
int a = int.Parse(nnn);
t.Interval = a;
} while (true);
//XmlDocument xmlDoc = new XmlDocument();
//XmlElement element = xmlDoc.CreateElement("item"); // 创建元素
//element.SetAttribute("id", "1"); // 设置属性
//element.InnerText = "示例文本"; // 设置文本内容
//xmlDoc.DocumentElement.AppendChild(element); // 将元素添加到根元素下
//xmlDoc.Save("example.xml"); // 保存XML文件
XElement xelement = new XElement("interface",
new XAttribute[]
{
new XAttribute("orderno",""),
new XAttribute("cost",""),
new XAttribute("roomtype",""),
new XAttribute("breakfast",""),
new XAttribute("occupancy",""),
new XAttribute("deposit","")
},
new XElement("item",
new XAttribute[]
{
new XAttribute("idtype", "1"),
new XAttribute("idcard", "1"),
new XAttribute("customer", "1"),
new XAttribute("sex", "1"),
new XAttribute("country", "1"),
new XAttribute("checkindate", "1"),
new XAttribute("checkoutdate", "1")
},
"示例文本")
);
string hhh = xelement.ToString();
List<int> lllg = new List<int>();
lllg = null;
lllg.DefaultIfEmpty();
double aaq = double.Parse("10.0");
int gh = Convert.ToInt32(aaq);
// 调用示例
string input = "15.0.1";
string output = NormalizeVersion(input); // 输出 "15.0.0"
// 添加调度任务
JobManager.AddJob(
// 调度业务
() => Console.WriteLine("5 minutes just passed."),
// 触发时间
s => s.ToRunEvery(5).Seconds()
);
//// 立即停止
//JobManager.Stop();
//// 在任务完成后等待或者停止
//JobManager.StopAndBlock();
Console.ReadLine();
for (int i = 0; i < 10000; i++)
{
Task.Factory.StartNew(() =>
{
Thread.Sleep(5000);
Console.WriteLine("iiiii");
});
}
Console.ReadKey();
string aaa = File.ReadAllText("1.txt", Encoding.UTF8);
aaa = aaa.Replace("\\\\\\", "\\");
int? bba1 = null;
Console.WriteLine(bba1);
bool bba = SmartRobotDisable();
ChuangWeiCommandData mmm = new ChuangWeiCommandData();
mmm.nlp_namespace = "hotelcontrol";
mmm.nlp_name = "LocalDDD";
mmm.query = "打开房灯";
mmm.resourcePackage = new PackageData()
{
skillSource = "智能家居",
domain = "iot",
aiState = 0,
voiceprint = "",
skillTitle = "",
tips = "你可以对我说,小度小度"
};
List<MessageData> c = new List<MessageData>();
MessageData mc = new MessageData();
mc.header = new header()
{
messageId = "3432423423",
name = "",
@namespace = "",
payloadVersion = "0.1.1"
};
mc.payload = new payload()
{
accessToken = "33434343",
appliance = new Appliance()
{
applianceId = "id",
additionalApplianceDetails = new Device()
{
deviceId = "lightid_0_01",
deviceName = "走廊灯",
deviceType = "LIGHT",
type = "Device"
}
}
};
c.Add(mc);
chuangweidata c12 = new chuangweidata();
c12.data = c;
mmm.nlp_cmd = c12;
var YU = Newtonsoft.Json.JsonConvert.SerializeObject(mmm);
Console.ReadKey();
}
static void timer2_Elapsed(object sender, ElapsedEventArgs e)
{
Console.WriteLine("111111111111");
}
public static bool SmartRobotDisable()
{
string st = "23:00";
string et = "08:00";
string[] st_a = st.Split(':');
string[] et_a = et.Split(':');
int h_st = int.Parse(st_a[0]);
int M_st = int.Parse(st_a[1]);
int h_et = int.Parse(et_a[0]);
int M_et = int.Parse(et_a[1]);
int y = DateTime.Now.Year;
int m = DateTime.Now.Month;
int d = DateTime.Now.Day;
int hh = DateTime.Now.Hour;
int mm = DateTime.Now.Minute;
int ss = DateTime.Now.Second;
var t1 = new DateTime(y, m, d, h_st, M_st, ss);
var t2 = new DateTime(y, m, d, h_et, M_et, ss);
bool ShiJian = false;
//正常逻辑
if (t2 >= t1)
{
var ti = DateTime.Now;
//如果当前时间大于 起 小于 至,就代表 确实是 禁用
if (ti >= t1 && ti <= t2)
{
ShiJian = true;
}
}
else
{
var ti = DateTime.Now;
var zero_ti = new DateTime(y, m, d, 23, 59, 59);
var zero_ti_0 = new DateTime(y, m, d, 0, 0, 0);
//var t3 = t2.AddDays(1);
//如果当前时间 小于0点
//或者说 当前时间 大于
if ((ti > t1 && ti < zero_ti) || ti >= zero_ti_0 && ti <= t2)
{
ShiJian = true;
}
}
return ShiJian;
}
static void t_Elapsed(object sender, ElapsedEventArgs e)
{
Console.WriteLine("1111111111111");
}
static void t_Elapsed1(object sender, ElapsedEventArgs e)
{
Console.WriteLine("22222222222222");
}
}
public class FFFA : IEquatable<FFFA>
{
public bool Equals(FFFA other)
{
throw new NotImplementedException();
}
}
public class Device
{
public string deviceType { get; set; }
public string type { get; set; }
public string deviceId { get; set; }
public string deviceName { get; set; }
}
public class Appliance
{
public string applianceId { get; set; }
public Device additionalApplianceDetails { get; set; }
}
public class header
{
public string messageId { get; set; }
public string @namespace { get; set; }
public string name { get; set; }
public string payloadVersion { get; set; }
}
public class payload
{
public string accessToken { get; set; }
public Appliance appliance { get; set; }
}
public class MessageData
{
public header header { get; set; }
public payload payload { get; set; }
}
public class chuangweidata
{
public List<MessageData> data { get; set; }
}
public class ChuangWeiCommandData
{
public string nlp_namespace { get; set; }
public string nlp_name { get; set; }
public string query { get; set; }
public chuangweidata nlp_cmd { get; set; }
public PackageData resourcePackage { get; set; }
}
public class PackageData
{
public string skillTitle { get; set; }
public string domain { get; set; }
public int aiState { get; set; }
public string voiceprint { get; set; }
public string skillSource { get; set; }
public string tips { get; set; }
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ConsoleApplication2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApplication2")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("0ecfb694-a7eb-4ecc-8809-4cb705cceb73")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,13 +0,0 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="session_expire_minutes" value="5" />
<add key="redis_server_session" value="127.0.0.1:6379" />
<add key="redis_max_read_pool" value="1000" />
<add key="redis_max_write_pool" value="1000" />
<add key="monitor_log_expire_minutes" value="30" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

View File

@@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA1EvziSvbI3eETULroiF71wbYze4aO/yj5A2LN2seiRZNTLKe
lOnu4svMDwfpKizMfqYvXV9Z2NwUNdFsDd/FWl2Xfdravzwz4z5u8agQ4Qwd8fVT
naFY5DQLv+6l3nAI01eUxaKHER/FpHSZ48o8CpH/VtzqeS/bA5+LTyMODdETI0fb
futFQS4xUIjoifN2oeggL5grhk39udyKfnwc0WG6086yb9uzr39oA39vKJNKTQqL
cDiuLzooBBOq8YuKQ8qnuIt14SdxTrKmeHQ+azKlgPykzA/exTboORPAHpFk99tz
6vuMdJBgrx93wt+ljoM8uKV2/J/6CKAOQZzYUQIDAQABAoH/KS/oZQnHz28LO/IV
Gl9kp1MCEkcfeoPenWADTRJ7L3LO4b0bBx5bj6Sk8kWWoZgPadgpWEl8z5XjAI32
E2Wr5DGZh9FDSda5j7I30//HRoy97TNWBZRH//4Y9COuCnmx507BOOv58wM2/7D0
1OdnaVA/OZr34osQ8qMBZAO+YO9/HKXRQ5FUuq2R7AdSHsXoDeJHa8L1lK/62VT/
0XlSmyCpEiaoIrig/B64EeZQjdS70yFgWNlLUr8XDPK0dLtoucMW0tyi9rr+id0g
N/zhcMo1E5zxsoAQK+bJ5Whai1RItir9Xc8RCVDWHQl9RJ0V1HbHkyIeeLVyx6Nv
e7p9AoGBAPl2p1Sh46iGItr8nAu3b8Ri7WUV2KvGeGUBcmtjXUvxYD6OmYFl0bFA
urHzXxXZcuCS9+GZoTKxZThaOvT3eoqQ7mrX56MT9gdUmKjGexxbaGLvLJK8xNT+
hIuTp0HnVLd8VxFxa1A0MAQtFTLCjY0nylaU7JVISm0jp7Y2tDX/AoGBANnb/atm
Nl8Q5265pSsWwWlBxzAUYnqMZL8wyx5U0MYnkG84b0sNPsRgmZEA6RrWG35mlewa
J+9v4I0PBOyXmW0EcqtBG3AMlv/JAfL2HLOcp/6IbgfenQZQVBIXhrIB5DhwmNLV
qX5WdaJ08ouW/BYdcsAkK9smnh/aNs33KhGvAoGAJX1gbkaaCQSHjnNyHAyoPlJD
rPJYipAcHcnW4S6gob4Xoa8agKjFl6bLp9yUSJtSOU+88ul8oTqppIti2teqUdKw
Edx6kjZ4vedHve1+KOfPyzZ4c2DtD7lkP/mjpDLYt253Q0bRQs9k++uuiN9WGIWH
UfW1jEW98aLvHGIiOQ8CgYEA0MwqLAqTU7ukw5dDeK+fgNzdJfRzidZifGcsVQ6e
5TtoD2B8Meco4BdhNvszblgEE7oIODe9TJriEO9zHboR/s0DhaSpwlMeqVmh95Tv
XylmTOm+4uX1guacHJbVrmdnrrwji/XhM0d0CNai2yxCwINKxmIkci5p4EdIvVAE
ztsCgYEA01lI/DHP3IYK5L2tV2svm/aoSxnAta3ZLoR5/SYmCPKbw0G1G3xIqKfe
1lbmtju/czzbQQFIDeRPRavK24RtU1INQSUs4xS0YDYr43rOK2hIaW+xZtpiEHVP
0i9SXCpM2H8Z2t8L/MHxkwYS1LmzmCj2p5JGvAoL5LuFZBYwIaE=
-----END RSA PRIVATE KEY-----

View File

@@ -1,61 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIF9TCCBN2gAwIBAgIQDoWTGuJgNSPCq9HqcbGHuzANBgkqhkiG9w0BAQsFADBu
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg
RFYgVExTIENBIC0gRzIwHhcNMjUwMjI1MDAwMDAwWhcNMjUwNTI1MjM1OTU5WjAZ
MRcwFQYDVQQDEw5ndWEuYmx2LW9hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBANRL84kr2yN3hE1C66Ihe9cG2M3uGjv8o+QNizdrHokWTUyynpTp
7uLLzA8H6SoszH6mL11fWdjcFDXRbA3fxVpdl33a2r88M+M+bvGoEOEMHfH1U52h
WOQ0C7/upd5wCNNXlMWihxEfxaR0mePKPAqR/1bc6nkv2wOfi08jDg3REyNH237r
RUEuMVCI6InzdqHoIC+YK4ZN/bncin58HNFhutPOsm/bs69/aAN/byiTSk0Ki3A4
ri86KAQTqvGLikPKp7iLdeEncU6ypnh0PmsypYD8pMwP3sU26DkTwB6RZPfbc+r7
jHSQYK8fd8LfpY6DPLildvyf+gigDkGc2FECAwEAAaOCAuIwggLeMB8GA1UdIwQY
MBaAFHjfkZBf7t6s9sV169VMVVPvJEq2MB0GA1UdDgQWBBSEiNOIfFWUVnj42gC0
f8oQAzw/rDAZBgNVHREEEjAQgg5ndWEuYmx2LW9hLmNvbTA+BgNVHSAENzA1MDMG
BmeBDAECATApMCcGCCsGAQUFBwIBFhtodHRwOi8vd3d3LmRpZ2ljZXJ0LmNvbS9D
UFMwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD
AjCBgAYIKwYBBQUHAQEEdDByMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdp
Y2VydC5jb20wSgYIKwYBBQUHMAKGPmh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNv
bS9FbmNyeXB0aW9uRXZlcnl3aGVyZURWVExTQ0EtRzIuY3J0MAwGA1UdEwEB/wQC
MAAwggF/BgorBgEEAdZ5AgQCBIIBbwSCAWsBaQB3AE51oydcmhDDOFts1N8/Uusd
8OCOG41pwLH6ZLFimjnfAAABlTwVmYwAAAQDAEgwRgIhAJ1QHHoibeFYP8WP2iBH
iHFvb23t1KGX5mIyz/qaDOiVAiEA9YoJLf4iN/cBscs34Au2/Q+8XV1vp6jAGHrS
g96cWn0AdgBzICIPCBaK+fPEposKsmqaSgDu9XeFighNBQDUpUJEWQAAAZU8FZnK
AAAEAwBHMEUCIAyZ5B3Qz8SM6B7Lo6roMIuJq90hviYxnWnJHRtA6x1CAiEAjzIJ
nm9dxUEO5LklQzgfXyZYupNxPVDqgs2AiEXrvCUAdgDm0jFjQHeMwRBBBtdxuc7B
0kD2loSG+7qHMh39HjeOUAAAAZU8FZncAAAEAwBHMEUCIAb+1GsDd5tXLQgyXD7i
eXdSKCig3skMucdMrwGDSlQEAiEAq8nSgfWhU8bTFTppmuYV3TxFyAs6wCo6Beu8
b6WpodQwDQYJKoZIhvcNAQELBQADggEBAGD5u3aznYiDyCORluAQRUTEsDNvx0X1
Y/MYfyF1Zc2qd3HbzwLAeIqy7QLtSmW5hQ/Xm2/G0jGYrrfH7VpHsEfaOBUFyYtk
A2C9XoLqFGz4ihBel/v8EbbbLpbIwE1bfEzU88aniwX1TT4ZL6qY7dlkpPThuI4T
DPyk/FaXFUh94B426EX6uVs3kYDbCvTJ3SnxKz5AmPKsn1oSgd4feKNmRSCfo38W
Q5z+7X8LxDmyD/9K1FghATTGridG3K7MhjJIhnYHkCrC8Q/DElppoQnW0rc6IEH9
QN+JR6S1lXGXN2KGmonQvKNhArWAwBuA8eZ+NKMjHAIX1jRk+fvhkLM=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEqjCCA5KgAwIBAgIQDeD/te5iy2EQn2CMnO1e0zANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xNzExMjcxMjQ2NDBaFw0yNzExMjcxMjQ2NDBaMG4xCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xLTArBgNVBAMTJEVuY3J5cHRpb24gRXZlcnl3aGVyZSBEViBUTFMgQ0EgLSBH
MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO8Uf46i/nr7pkgTDqnE
eSIfCFqvPnUq3aF1tMJ5hh9MnO6Lmt5UdHfBGwC9Si+XjK12cjZgxObsL6Rg1njv
NhAMJ4JunN0JGGRJGSevbJsA3sc68nbPQzuKp5Jc8vpryp2mts38pSCXorPR+sch
QisKA7OSQ1MjcFN0d7tbrceWFNbzgL2csJVQeogOBGSe/KZEIZw6gXLKeFe7mupn
NYJROi2iC11+HuF79iAttMc32Cv6UOxixY/3ZV+LzpLnklFq98XORgwkIJL1HuvP
ha8yvb+W6JislZJL+HLFtidoxmI7Qm3ZyIV66W533DsGFimFJkz3y0GeHWuSVMbI
lfsCAwEAAaOCAU8wggFLMB0GA1UdDgQWBBR435GQX+7erPbFdevVTFVT7yRKtjAf
BgNVHSMEGDAWgBROIlQgGJXm427mD/r6uRLtBhePOTAOBgNVHQ8BAf8EBAMCAYYw
HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8C
AQAwNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdp
Y2VydC5jb20wQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQu
Y29tL0RpZ2lDZXJ0R2xvYmFsUm9vdEcyLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG
/WwBAjAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BT
MAgGBmeBDAECATANBgkqhkiG9w0BAQsFAAOCAQEAoBs1eCLKakLtVRPFRjBIJ9LJ
L0s8ZWum8U8/1TMVkQMBn+CPb5xnCD0GSA6L/V0ZFrMNqBirrr5B241OesECvxIi
98bZ90h9+q/X5eMyOD35f8YTaEMpdnQCnawIwiHx06/0BfiTj+b/XQih+mqt3ZXe
xNCJqKexdiB2IWGSKcgahPacWkk/BAQFisKIFYEqHzV974S3FAz/8LIfD58xnsEN
GfzyIDkH3JrwYZ8caPTf6ZX9M1GrISN8HnWTtdNCH2xEajRa/h9ZBXjUyFKQrGk2
n2hcLrfZSbynEC/pSw/ET7H5nWwckjmAJ1l9fcnbqkU/pf6uMQmnfl0JQjJNSg==
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -1,57 +0,0 @@
<?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)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{85BC55B1-083D-4AE9-8DE8-3DE59B654990}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ConsoleApplication4</RootNamespace>
<AssemblyName>ConsoleApplication4</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<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|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>

View File

@@ -1,50 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
namespace ConsoleApplication4
{
internal class UdpState
{
private UdpClient udpClient;
public UdpState(UdpClient client)
{
this.udpClient = client;
}
public UdpClient UdpClient
{
get { return this.udpClient; }
}
}
class Program
{
static void Main(string[] args)
{
var udpClient = new UdpClient(3340);
udpClient.Client.ReceiveBufferSize = 3 * 1024 * 1024;
udpClient.BeginReceive(ReceiveCallback, new UdpState(udpClient));
Console.ReadLine();
}
public static void ReceiveCallback(IAsyncResult ar)
{
UdpState state = ar.AsyncState as UdpState;
// 1. 结束异步接收,获取数据和远程端点
IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
byte[] receivedData = state.UdpClient.EndReceive(ar, ref remoteEndPoint);
state.UdpClient.BeginReceive(ReceiveCallback, state);
try
{
Console.WriteLine(11111111111111);
}
catch (Exception)
{
}
}
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ConsoleApplication4")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApplication4")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("3ac386f6-d433-4860-9b22-ee7e0dc298d4")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0,Profile=Client", FrameworkDisplayName = ".NET Framework 4 Client Profile")]

View File

@@ -1,4 +0,0 @@
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\ConsoleApplication4.exe
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\bin\Debug\ConsoleApplication4.pdb
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\obj\x86\Debug\ConsoleApplication4.exe
E:\tian\chongxin\NewGit\CRICS\CRICS_Web_Server_VS2010_Prod\ConsoleApplication4\obj\x86\Debug\ConsoleApplication4.pdb

View File

@@ -1,58 +0,0 @@
<?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)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E5890D7A-EB40-4864-B6D8-5B74A443A3F2}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ConsoleApplication666</RootNamespace>
<AssemblyName>ConsoleApplication666</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<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|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>

View File

@@ -1,59 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Numerics;
using System.Collections;
namespace ConsoleApplication666
{
class Program
{
[DllImport("kernel32.dll")]
private static extern void GetSystemTimePreciseAsFileTime(out long fileTime);
// 将 FILETIME (long) 转换为 DateTime
public static DateTime GetNowPrecise()
{
long fileTime;
GetSystemTimePreciseAsFileTime(out fileTime);
DateTime localTime = DateTime.FromFileTimeUtc(fileTime).ToLocalTime();
return localTime;
}
static void Main(string[] args)
{
bool NewResult = true || false;
BigInteger hugeNumber = BigInteger.Parse("1234567890123456789012345678901234567890");
var H= hugeNumber.ToByteArray();
BitArray bi = new BitArray(H);
// 从字节数组创建
byte[] bytes = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
BigInteger fromBytes = new BigInteger(bytes);
// 基本运算
BigInteger sum = hugeNumber + 1;
BigInteger product = hugeNumber * 2;
Console.WriteLine("大数字: {0}", hugeNumber);
Console.WriteLine("加1: {0}", sum);
Console.WriteLine("乘2: {0}", product);
// 比较操作
if (hugeNumber > BigInteger.Parse("100000000000000000000"))
{
Console.WriteLine("这是一个非常大的数字");
}
DateTime ddd = GetNowPrecise();
string tii = ddd.ToString("yyyy-MM-dd HH:mm:ss.ffffff");
Console.WriteLine(tii);
Console.ReadLine();
}
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ConsoleApplication666")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApplication666")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("0182759e-6111-44df-967d-cf14ebab598e")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -788,7 +788,7 @@ namespace Dao.Implement
/// <returns></returns>
public IList<HostMappingData> LoadAllID_HostNumberMapping()
{
return base.LoadAll().Where(A => A.SysHotel.IsNewVersionProtocol == true && A.IsDeleted == false).Select(A => new HostMappingData() { Id = A.ID, HostNumber = A.HostNumber }).ToList();
return base.LoadAll().Where(A => A.IsDeleted == false).Select(A => new HostMappingData() { Id = A.ID, HostNumber = A.HostNumber,RoomTypeId=A.RoomType.ID }).ToList();
}

View File

@@ -383,6 +383,11 @@ namespace Domain
public virtual string FCS_MenCi_Close { get; set; }
public virtual string FCS_MenCi_Open { get; set; }
/// <summary>
/// 门锁电量
/// </summary>
public virtual string FCS_MenSuo_DianLiang { get; set; }
public virtual bool IsUseSkyworthTV
{

View File

@@ -64,6 +64,7 @@
<property name="FCS_RCU_Online" column="FCS_RCU_Online" type="string" />
<property name="FCS_MenCi_Close" column="FCS_MenCi_Close" type="string" />
<property name="FCS_MenCi_Open" column="FCS_MenCi_Open" type="string" />
<property name="FCS_MenSuo_DianLiang" column="FCS_MenSuo_DianLiang" type="string" />
<property name="IsUseSkyworthTV" column="IsUseSkyworthTV" type="bool" />

View File

@@ -175,9 +175,10 @@
<!--阿宝添加的-->
<!--<property name="dev_MonitorLogRepository" ref="Repository.dev_MonitorLogRepository" />-->
<property name="HostRepository" ref="Repository.Host" />
<property name="SysHotelRepository" ref="Repository.SysHotel" />
<!--<property name="SysHotelRepository" ref="Repository.SysHotel" />-->
<property name="HostModalRepository" ref="Repository.HostModal" />
<property name="SysOauth2Repository" ref="Repository.SysOauth2" />
<property name="DeviceControlReceiver" ref="RCUHost.DeviceControlReceiver" />
</object>
<object id="RCUHost.TFTPReceiver" type="RCUHost.Implement.TFTPReceiver, RCUHost" parent="RCUHost.GenericReceiverBase" singleton="true">

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using Domain;
using RCUHost.Protocols;
using System.Net;
namespace RCUHost
{
@@ -15,6 +16,9 @@ namespace RCUHost
/// <param name="host"></param>
/// <param name="device"></param>
void Send(Host host, Device device);
void SendWithEndPoint( Device device,IPEndPoint endpoint);
void Send_Repeat(string Key,Host host, Device device);
/// <summary>

View File

@@ -7,6 +7,7 @@ using Common;
using Domain;
using RCUHost.Protocols;
using CommonEntity;
using System.Net;
namespace RCUHost.Implement
{
@@ -14,11 +15,21 @@ namespace RCUHost.Implement
{
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(DeviceControlReceiver));
public void SendWithEndPoint(Device device, IPEndPoint endpoint)
{
SendWithEndPoint(new List<Device> { device }, endpoint);
}
public void SendWithEndPoint(IList<Device> devices, IPEndPoint endpoint)
{
var data = CreateDeviceControlPacket(devices);
SendAndPushCommandQueueWithEndPoint(data, endpoint);// host.IP, host.Port);
}
public void Send(Host host, Device device)
{
Send(host, new List<Device> { device });
}
public void Send(Host host, IList<Device> devices)
{
var data = CreateDeviceControlPacket(devices);
@@ -33,9 +44,9 @@ namespace RCUHost.Implement
//string nnn = builder.ToString().Trim();
//logger.Error(string.Format("给酒店({0})客房({1})发送控制命令{2}", host.SysHotel.Code, host.RoomNumber,builder.ToString()));
}
public void Send_Repeat(string Key,Host host, Device device)
public void Send_Repeat(string Key, Host host, Device device)
{
Send_Repeat(Key,host, new List<Device> { device });
Send_Repeat(Key, host, new List<Device> { device });
}
public void Send_Repeat(string PrefixKey, Host host, IList<Device> devices)
{
@@ -223,5 +234,6 @@ namespace RCUHost.Implement
{
get { return CommandType.DeviceControl; }
}
}
}

View File

@@ -265,7 +265,7 @@ namespace RCUHost.Implement
}
d1.control_list = lll3;
d1.report_count = lll3.Count;
d1.ip = ipAndPort;
string sss = Newtonsoft.Json.JsonConvert.SerializeObject(d1);
CSRedisCacheHelper.Publish("redis-0X36-0X0F", sss);
@@ -278,7 +278,7 @@ namespace RCUHost.Implement
}
catch (Exception ex)
{
logger.Error("发送:"+ex.Message);
logger.Error("发送:" + ex.Message);
logger.Error(ex.StackTrace);
}
}
@@ -304,6 +304,10 @@ namespace RCUHost.Implement
HostServer.SendAndPushCommandQueue(data, ipAndPort.ToString().Split(':')[0], Convert.ToInt32(ipAndPort.ToString().Split(':')[1]));
}
}
protected void SendAndPushCommandQueueWithEndPoint(byte[] data, IPEndPoint endpoint)
{
HostServer.SendAndPushCommandQueue(data, endpoint);
}
/// <summary>
/// 回复下位机命令
/// </summary>

View File

@@ -263,7 +263,7 @@ namespace RCUHost.Implement
RegisterInfo rsg = new RegisterInfo()
{
ts_ms=Tools.GetUnixTime_MS(),
ts_ms = Tools.GetUnixTime_MS(),
hotel_id = hotel_code,
room_id = host.RoomNumber,
device_id = HostNumberOnly,
@@ -276,7 +276,7 @@ namespace RCUHost.Implement
subnet_mask = subnet_mask,
gateway = gateway,
dns = dns,
version = software_version,
app_version = software_version,
rcu_time = rcuTime,
launcher_version = launcher_version,
mac = mac,
@@ -285,20 +285,29 @@ namespace RCUHost.Implement
room_status = room_status_id,
season = hostRCU.Season,
sys_lock_status = hostRCU.LockStatus,
authorization_time = set_expiration_time,
authorization_days = expiration_time,
//hostRCU.ExpireTime = TimeHelper.ToDateTime(expiration_time);
// hostRCU.SetExpireTime = TimeHelper.ToDateTime(set_expiration_time)
//string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
authorization_time = set_expiration_time.ToString(),
authorization_days = expiration_time.ToString(),
room_num_remark = roomnumber,
room_type_remark = roomtype,
room_remark = room_remark,
mcu_name = core,
central_control_name = model,
configure_hotel_name = hotel_name,
configure_room_type_name = roomtype_remark
configure_room_type_name = roomtype_remark,
};
string N1N = Newtonsoft.Json.JsonConvert.SerializeObject(rsg);
CSRedisCacheHelper.Publish("redis-0XB1", N1N);
if (host.UpgradeTime.HasValue)
{
var upgrade_ts_ms = Tools.GetCurrentTimeStamp_MS(host.UpgradeTime.Value);
rsg.upgrade_ts_ms = upgrade_ts_ms;
}
HostRepository.SetModelAndLauncher(host, hostRCU.ConfigVersion, software_version, lan_ip, lan_port, model, launcher_version, hostRCU.ExpireTime, hostRCU.SetExpireTime);
@@ -306,6 +315,9 @@ namespace RCUHost.Implement
//logger.Error(string.Format("酒店({0})客房({1})主机已同步信息Model{2}Launcher{3}", host.SysHotel.Name + host.SysHotel.Code, host.RoomNumber, model, launcher_version));
string N1N = Newtonsoft.Json.JsonConvert.SerializeObject(rsg);
CSRedisCacheHelper.Publish("redis-0XB1", N1N);
#region
/*int count = reader.ReadByte();//个数
reader.ReadBytes(4);

View File

@@ -78,9 +78,7 @@ namespace RCUHost.Implement
StepTongJi.SendInfo(4, "注册命令Task内部开始执行", context.MessageID, context.IsMonitor);
//Reply(context);
string RoomNumber = "";
var OriginalByte = context.Data;
int lll = OriginalByte.Length;
var A1 = OriginalByte.Skip(15).Take(lll - 15 - 2).ToArray();
@@ -301,20 +299,6 @@ namespace RCUHost.Implement
}
else
{
//string KKK = "RegisterKey_" + hhostnumber;
//object OOO = MemoryCacheHelper.Get(KKK);
//if (OOO != null)
//{
// RCUHost.RCUHostCommon.tools.LanJieData(RegisterKey2, hotelCode);
//}
//else
//{
// string ti = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
// MemoryCacheHelper.Set(KKK, ti, DateTimeOffset.Now.AddMinutes(5));
// HostRepository.Update(sbSQL.ToString());//更新主机用sql语句更新更高效
// RCUHost.RCUHostCommon.tools.LanJieData(RegisterKey1, hotelCode);
//}
HostRepository.Update(sbSQL.ToString());//更新主机用sql语句更新更高效
//有升级的时候,不能被跳过
@@ -365,7 +349,7 @@ namespace RCUHost.Implement
string YiJingChuLiGuo = CacheKey.AllReadyDealWith01_Prefix + "_" + hostNumber;
MemoryCacheHelper.Set(YiJingChuLiGuo, A1, DateTimeOffset.Now.AddMinutes(5));
MemoryCacheHelper.Set(YiJingChuLiGuo, A1, DateTimeOffset.Now.AddSeconds(10));
StepTongJi.SendInfo(5, "注册命令Task内部执行完毕", context.MessageID, context.IsMonitor);
}
catch (Exception ex)

File diff suppressed because it is too large Load Diff

View File

@@ -123,7 +123,7 @@ namespace RCUHost.Implement
if (status.Devices != null && status.Devices.Count > 0)
{
//来一个数据,把所有的地址拼接起来
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor);//更新灯光及其他回路状态
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor, context.RemoteEndPoint.ToString());//更新灯光及其他回路状态
}
if (status.Faults != null && status.Faults.Count > 0)
@@ -183,7 +183,7 @@ namespace RCUHost.Implement
public static string Missionsys_Address = ConfigurationManager.AppSettings["missionsys_address"];
public static string MQTTInfo_report_url = ConfigurationManager.AppSettings["debug_log_report_url"].ToString();
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor)
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor, string EEndPoint)
{
string UUID = "9dc6a0ee-dcf1-4385-b05f-09cb463838cd";
UUID = host.FCS_locationUUID;
@@ -418,21 +418,32 @@ namespace RCUHost.Implement
else
{
//这里有点问题如果一个Model删除了又更新了那它的ID就变了。但是内存中记录的没变所以这里会出问题
var hostModal_old = HostModalRepository.Get(host.ID, device.Value.Address);
//var hostModal_old = HostModalRepository.Get(host.ID, device.Value.Address);
string HostID_O = CSRedisCacheHelper.HMGet<string>(5, CacheKey.HostId_HostNumber, HOSTNUMBER)[0];
if (string.IsNullOrEmpty(HostID_O))
{
return;
}
string[] NNN111 = HostID_O.Split('#');
string HostID = NNN111[0];
string RoomTypeID = NNN111[1];
int room_type_id = int.Parse(RoomTypeID);
var hostModal_old = QuanJuVar.RoomTypeDeviceModal.FirstOrDefault(A => A.RoomType.ID == room_type_id && A.ModalAddress.Equals(device.Value.Address));
if (hostModal_old != null)
{
HostModal_Cache c = new HostModal_Cache();
c.HostID = hostModal_old.HostID;
c.ModalType = hostModal_old.Modal.Type;
c.HostID = host.ID;
c.ModalType = hostModal_old.Type;
c.AirConditionData = new AirConditionData();
c.Modal = new RoomTypeModalCache()
{
RoomTypeID = hostModal_old.Modal.RoomType.ID,
ID = hostModal_old.Modal.ID,
Name = hostModal_old.Modal.Name,
ModalAddress = hostModal_old.Modal.ModalAddress,
ActiveIndicator = hostModal_old.Modal.ActiveIndicator,
Sort = hostModal_old.Modal.Sort
RoomTypeID = hostModal_old.RoomType.ID,
ID = hostModal_old.ID,
Name = hostModal_old.Name,
ModalAddress = hostModal_old.ModalAddress,
ActiveIndicator = hostModal_old.ActiveIndicator,
Sort = hostModal_old.Sort
};
hostModal = c;
}
@@ -735,93 +746,6 @@ namespace RCUHost.Implement
{
}
#region
//3、取电或断电时季节空调处理
HotelSeason hotelSeason = null;
string KKKAAA = "Season_" + host.SysHotel.ID;
string KongZhi = "Season_WuKong" + host.SysHotel.ID;
object ShiFouWeiKong = MemoryCacheHelper.Get(KongZhi);
int bf = 1;
if (ShiFouWeiKong != null)
{
bf = (int)ShiFouWeiKong;
}
if (bf == 0)
{
var UIO = MemoryCacheHelper.Get(KKKAAA);
if (UIO != null)
{
hotelSeason = (HotelSeason)UIO;
}
else
{
hotelSeason = HotelSeasonRepository.LoadByHotelID(host.SysHotel.ID);//获取该酒店下季节设置记录
if (hotelSeason != null)
{
MemoryCacheHelper.Set(KongZhi, 0, DateTimeOffset.Now.AddMinutes(20));
MemoryCacheHelper.Set(KKKAAA, hotelSeason, DateTimeOffset.Now.AddMinutes(20));
}
else
{
MemoryCacheHelper.Set(KongZhi, 1, DateTimeOffset.Now.AddMinutes(20));
}
}
}
else
{
hotelSeason = HotelSeasonRepository.LoadByHotelID(host.SysHotel.ID);//获取该酒店下季节设置记录
if (hotelSeason != null)
{
MemoryCacheHelper.Set(KongZhi, 0, DateTimeOffset.Now.AddMinutes(20));
MemoryCacheHelper.Set(KKKAAA, hotelSeason, DateTimeOffset.Now.AddMinutes(20));
}
else
{
MemoryCacheHelper.Set(KongZhi, 1, DateTimeOffset.Now.AddMinutes(20));
}
}
if (hotelSeason != null)
{
int conditonType = (hostModal.Status == 1 ? 2 : 3);
List<HotelAirControl> list = HotelAirControlRepository.LoadAll(host.SysHotel.ID, conditonType, true);
List<HostModal> hostModals = HostModalRepository.LoadByHostID(host.ID).Where(r => r.Modal.Type == DeviceType.AirConditioner && r.Modal.ActiveIndicator).ToList();//获取启用的空调回路
if (list.Count > 0 && hostModals.Count > 0)
{
System.Reflection.PropertyInfo[] properties = typeof(HotelSeason).GetProperties();//获取所有属性
foreach (HotelAirControl item in list)
{
foreach (System.Reflection.PropertyInfo prop in properties)//遍历属性
{
if (prop.Name == "Month" + DateTime.Now.Month.ToString() && Convert.ToInt16(prop.GetValue(hotelSeason, null)) == item.Season)//当前月份所属该季节则发送命令给rcu设置空调
{
System.Threading.Thread.Sleep(item.DelayTime * 1000);//延迟执行
var D2 = item;
foreach (HostModal hostModal1 in hostModals)
{
Device device1 = new Device();
device1.Address = hostModal1.Modal.ModalAddress;
device1.AddressType = AddressType.DeviceAddress;
device1.Type = DeviceType.AirConditioner;
device1.Status = (byte)D2.Status;
device1.Brightness = 0;
device1.Temperature = (byte)D2.SettingTemp;
device1.FanSpeed = (byte)D2.FanSpeed;
device1.Mode = (byte)D2.Mode;
device1.Valve = 0;
device1.AirExecMode = (D2.Status << 14) + (D2.Mode << 12) + (D2.FanSpeed << 10) + (0 << 8) + D2.SettingTemp;//空调执行方式和内容
//这里只需要host的mac和number或者 ip
DeviceControlReceiver.Send(host, device1);
}
break;
}
}
}
}
}
#endregion
#endregion
break;
}
@@ -1146,27 +1070,49 @@ namespace RCUHost.Implement
//MemoryModal.Mode = mode;
break;
case DeviceType.WXLock://微信锁
status = device.Value.StatusReceiver & 0x00FF;
if (status == 1)//设备开
//status = device.Value.StatusReceiver & 0x00FF;
status = device.Value.StatusReceiver;
var gs1 = BitConverter.GetBytes(status);
var f1 = gs1[0];
var f2 = gs1[1];
if (f1 == 1)//设备开
{
if (hostModal.Status != 1)//设备有变化时才去更改状态
{
hostModal.Status = 1;
//sbSQL.Append("Status=1,");
//MemoryModal.Status = 1;
}
}
else//设备关
else if (f1 == 2)//设备关
{
if (hostModal.Status != 2)//设备有变化时才去更改状态
{
hostModal.Status = 2;
//sbSQL.Append("Status=2,");
//MemoryModal.Status = 2;
}
}
//2026-03-29 阿文说 电量上报动作和 开关动作分两包数据上报
else if (f1 == 0x40)
{
//杨格锁:
//P4:
//Bit7:
//门锁动作上报
//Bit6:
//门锁电量上报
//P5:
//门锁动作上报:
//0xE1防撬报警
//0xE2假锁
//0xE3反锁
//0xE4门磁
//0xE5钥匙开锁
//0xE6门锁常开
//门锁电量报警:
//电量0-100
ushort dianliang = (ushort)f2;
string DLKey = CacheKey.DianLiang + "_" + HOSTNUMBER;
CSRedisCacheHelper.Set_PartitionWithForever(DLKey, dianliang.ToString(), 5);
}
//更新主机主表
if (hostModal.Modal.Sort == 1)//.ModalAddress == "020001000")
{
@@ -1204,127 +1150,133 @@ namespace RCUHost.Implement
}
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
bool isonly_serviceinfo = true;
//if (hostModal.ModalType == DeviceType.ServiceInfo)
if (isonly_serviceinfo)
//bool isonly_serviceinfo = true;
if (hostModal.ModalType == DeviceType.ServiceInfo)
//if (isonly_serviceinfo)
{
int StatusFlag = hostModal.Status;
HostModal FinallyData = new HostModal();
FinallyData.HostID = hostModal.HostID;
FinallyData.Status = hostModal.Status;
FinallyData.Brightness = hostModal.Brightness;
FinallyData.CurrentTemp = hostModal.AirConditionData.CurrentTemp;
FinallyData.FanSpeed = hostModal.AirConditionData.FanSpeed;
FinallyData.Mode = hostModal.AirConditionData.Mode;
FinallyData.SettingTemp = hostModal.AirConditionData.SettingTemp;
FinallyData.UpdateTime = hostModal.UpdateTime;
FinallyData.Valve = hostModal.AirConditionData.Valve;
FinallyData.Modal = new RoomTypeModal()
if (!string.IsNullOrEmpty(hostModal.Modal.Name))
{
ID = hostModal.Modal.ID,
Name = hostModal.Modal.Name,
ModalAddress = hostModal.Modal.ModalAddress,
ActiveIndicator = hostModal.Modal.ActiveIndicator,
Sort = hostModal.Modal.Sort
};
FinallyData.Modal.RoomType = new RoomType()
{
ID = hostModal.Modal.RoomTypeID
};
FinallyData.Modal.ID = hostModal.Modal.ID;
FinallyData.UpdateTime = now;
#region
try
{
HostModalRecord hostModalRecord;
switch (StatusFlag)
bool bbbaaa = hostModal.Modal.Name.Contains("红外") || hostModal.Modal.Name.Contains("infrared") || hostModal.Modal.Name.Contains("雷达") || hostModal.Modal.Name.Contains("radar");
if (bbbaaa == false)
{
case 2://关闭设备
if (hostModal.UpdateTime.HasValue)
{
hostModal.Time += Convert.ToInt32((now - hostModal.UpdateTime.Value).TotalMinutes);
}
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
//阿宝添加内存
try
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 2;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
int StatusFlag = hostModal.Status;
HostModal FinallyData = new HostModal();
FinallyData.HostID = hostModal.HostID;
FinallyData.Status = hostModal.Status;
FinallyData.Brightness = hostModal.Brightness;
FinallyData.CurrentTemp = hostModal.AirConditionData.CurrentTemp;
FinallyData.FanSpeed = hostModal.AirConditionData.FanSpeed;
FinallyData.Mode = hostModal.AirConditionData.Mode;
FinallyData.SettingTemp = hostModal.AirConditionData.SettingTemp;
FinallyData.UpdateTime = hostModal.UpdateTime;
FinallyData.Valve = hostModal.AirConditionData.Valve;
}
}
break;
case 1://1打开设备
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
FinallyData.Modal = new RoomTypeModal()
{
ID = hostModal.Modal.ID,
Name = hostModal.Modal.Name,
ModalAddress = hostModal.Modal.ModalAddress,
ActiveIndicator = hostModal.Modal.ActiveIndicator,
Sort = hostModal.Modal.Sort
};
FinallyData.Modal.RoomType = new RoomType()
{
ID = hostModal.Modal.RoomTypeID
};
FinallyData.Modal.ID = hostModal.Modal.ID;
FinallyData.UpdateTime = now;
//阿宝这里修改
try
#region
try
{
HostModalRecord hostModalRecord;
switch (StatusFlag)
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception ex)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 1;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
case 2://关闭设备
if (hostModal.UpdateTime.HasValue)
{
hostModal.Time += Convert.ToInt32((now - hostModal.UpdateTime.Value).TotalMinutes);
}
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
//阿宝添加内存
try
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 2;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
}
}
}
break;
case 1://1打开设备
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
//阿宝这里修改
try
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception ex)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 1;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
}
}
break;
default:
break;
}
break;
default:
break;
string StatusKey = "RoomStatus_ServerInfo";
RCUHost.RCUHostCommon.tools.LanJieData(StatusKey, HOTEL_CODE);
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
}
catch (Exception ex)
{
logger.Error("数据处理error: " + ex.Message);
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
#endregion
}
string StatusKey = "RoomStatus_ServerInfo";
RCUHost.RCUHostCommon.tools.LanJieData(StatusKey, HOTEL_CODE);
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
}
catch (Exception ex)
{
logger.Error("数据处理error: " + ex.Message);
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
#endregion
}
#region kafka队列
@@ -1646,7 +1598,10 @@ namespace RCUHost.Implement
case 1://状态1离线,0在线
record.AbnormalStatus = fault.Value.Data;
record.StatusDate = now;
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber, devicename + "###" + deviceaddress);
if (fault.Value.Data == 1)
{
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber, devicename + "###" + deviceaddress);
}
//sbSQL.Append("AbnormalStatus=" + record.AbnormalStatus + ",StatusDate=GETDATE()");
break;
case 2://电量

View File

@@ -157,7 +157,7 @@ namespace RCUHost.Implement
//来一个数据,把所有的地址拼接起来
string YiJingChuLiGuo = CacheKey.AllReadyDealWith0E_Prefix + "_" + HostNumberOnly;
MemoryCacheHelper.Delete(YiJingChuLiGuo);
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor, context.Data, status);//更新灯光及其他回路状态
ProcessModal_NEW_NEW(host, status.Devices, isTriggerWelcomeMsg, context.MessageID, context.IsMonitor, context.Data, status, context.RemoteEndPoint.ToString());//更新灯光及其他回路状态
string nnn = VVV1 + VVV2;
if (!string.IsNullOrEmpty(nnn))
{
@@ -224,7 +224,7 @@ namespace RCUHost.Implement
public static string Missionsys_Address = ConfigurationManager.AppSettings["missionsys_address"];
public static string MQTTInfo_report_url = ConfigurationManager.AppSettings["debug_log_report_url"].ToString();
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor, byte[] OriginalByteList, Status yuanshidata)
private void ProcessModal_NEW_NEW(Host host, ConcurrentDictionary<string, Device> devices, bool IsTriggerWelcomeMsg, string ContextMessageId, bool ismonitor, byte[] OriginalByteList, Status yuanshidata, string EEndPoint)
{
string UUID = "9dc6a0ee-dcf1-4385-b05f-09cb463838cd";
UUID = host.FCS_locationUUID;
@@ -402,26 +402,6 @@ namespace RCUHost.Implement
}
//int hostid = host.ID;
//StringBuilder sb = new StringBuilder();
//sb.Append(CacheKey.CarbonVIP_Prefix);
//sb.Append("_");
//sb.Append(hostid.ToString());
//string Key = sb.ToString();
//CSRedisCacheHelper.Set<string>(Key, current_status);
//var data = CSRedisCacheHelper.Get<string>(Key);
//if (!string.IsNullOrEmpty(data))
//{
// if (!current_status.Equals(data))
// {
// CarbonDataSend(host, hhhg1);
// }
//}
//else
//{
// CarbonDataSend(host, hhhg1);
//}
CarbonDataSend(host, hhhg1);
var nfc = CarbonScene_SetRepository.GetDataBy(host.ID);
@@ -465,8 +445,6 @@ namespace RCUHost.Implement
}
string KKey = CacheKey.HostModalStatus_Prefix + "_" + host.ID + "_" + device.Value.Address;
var hostModal = CSRedisCacheHelper.Get_Partition<HostModal_Cache>(KKey);
if (hostModal != null)
{
@@ -475,21 +453,33 @@ namespace RCUHost.Implement
else
{
//这里有点问题如果一个Model删除了又更新了那它的ID就变了。但是内存中记录的没变所以这里会出问题
var hostModal_old = HostModalRepository.Get(host.ID, device.Value.Address);
//var hostModal_old = HostModalRepository.Get(host.ID, device.Value.Address);
string HostID_O = CSRedisCacheHelper.HMGet<string>(5, CacheKey.HostId_HostNumber, HOSTNUMBER)[0];
if (string.IsNullOrEmpty(HostID_O))
{
return;
}
string[] NNN111 = HostID_O.Split('#');
string HostID = NNN111[0];
string RoomTypeID = NNN111[1];
int room_type_id = int.Parse(RoomTypeID);
var hostModal_old= QuanJuVar.RoomTypeDeviceModal.FirstOrDefault(A=>A.RoomType.ID==room_type_id&&A.ModalAddress.Equals(device.Value.Address));
if (hostModal_old != null)
{
HostModal_Cache c = new HostModal_Cache();
c.HostID = hostModal_old.HostID;
c.ModalType = hostModal_old.Modal.Type;
c.HostID = host.ID;
c.ModalType = hostModal_old.Type;
c.AirConditionData = new AirConditionData();
c.Modal = new RoomTypeModalCache()
{
RoomTypeID = hostModal_old.Modal.RoomType.ID,
ID = hostModal_old.Modal.ID,
Name = hostModal_old.Modal.Name,
ModalAddress = hostModal_old.Modal.ModalAddress,
ActiveIndicator = hostModal_old.Modal.ActiveIndicator,
Sort = hostModal_old.Modal.Sort
RoomTypeID = hostModal_old.RoomType.ID,
ID = hostModal_old.ID,
Name = hostModal_old.Name,
ModalAddress = hostModal_old.ModalAddress,
ActiveIndicator = hostModal_old.ActiveIndicator,
Sort = hostModal_old.Sort
};
hostModal = c;
}
@@ -639,8 +629,8 @@ namespace RCUHost.Implement
// }
//}
string ebell_rtsp = host.EBell_RSTP;
int du = host.EBell_TV_duration;
string ebell_rtsp = host.EBell_RSTP;
int du = host.EBell_TV_duration;
if (hostModal.Modal.ModalAddress.Equals("004000021"))
{
Dictionary<string, string> ddd = new Dictionary<string, string>();
@@ -694,6 +684,7 @@ namespace RCUHost.Implement
}
else//设备关
{
#region
if (hostModal.Status != status)//设备有变化时才去更改状态窗帘6是停其他是关
{
flag = 0;
@@ -712,6 +703,7 @@ namespace RCUHost.Implement
hostModal.Status = status;
hostModal.Brightness = 0;
#endregion
}
}
catch (Exception ex)
@@ -721,7 +713,7 @@ namespace RCUHost.Implement
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
#endregion
#region
#region ,
switch (hostModal.Modal.ModalAddress)
{
case "004000013"://门磁
@@ -747,84 +739,61 @@ namespace RCUHost.Implement
break;
case "004000001"://取电
#region
#region
//0关闭设备
//1打开设备且当前设备处于关闭状态
//取电
//CommonEntity.DataTongJi.MTakeCardData t = new DataTongJi.MTakeCardData();
//t.HostNUMBER = HOSTNUMBER;
//t.HotelCode = HOTEL_CODE;
//t.Status = Convert.ToByte(device.Value.StatusReceiver);
//t.LastUpdateTime = DateTime.Now;
////不管是断电还是取电都要记录
//if (flag == 1||flag==0)
//{
// string sss = Newtonsoft.Json.JsonConvert.SerializeObject(t);
// CSRedisCacheHelper.Publish("redis-takecard_change", sss);
//}
//断电
//if (flag == 0)
//{
// string sss = Newtonsoft.Json.JsonConvert.SerializeObject(t);
// CSRedisCacheHelper.Publish("redis-takecard_change", sss);
//}
#endregion
//拨卡操作
if (flag == 0 && host.RoomCard != null)
{
host.RoomCard = null;
HostRepository.SetRoomCard(host, null);//拔卡操作
}
else if (flag == 1 && host.RoomCard == null)
{
//if (flag == 0 && host.RoomCard != null)
//{
//host.RoomCard = null;
//HostRepository.SetRoomCard(host, null);//拔卡操作
//}
//else if (flag == 1 && host.RoomCard == null)
//{
//CSRedisCacheHelper.HMSet(CacheKey.TakeCardOnLine,host.SysHotel.Code+"###"+ host.RoomNumber);
RoomCardType roomCardType = null;
//RoomCardType roomCardType = null;
#region
string MemoryCardKey = "MemoryRoomCardPrefix_1";
object ooo = MemoryCacheHelper.Get(MemoryCardKey);
if (ooo != null)
{
roomCardType = ooo as RoomCardType;
}
else
{
roomCardType = RoomCardTypeRepository.Get(1);//获取有人房卡类型
MemoryCacheHelper.SlideSet(MemoryCardKey, roomCardType);
}
#endregion
//#region 获取有人房卡类
//string MemoryCardKey = "MemoryRoomCardPrefix_1";
//object ooo = MemoryCacheHelper.Get(MemoryCardKey);
//if (ooo != null)
//{
// roomCardType = ooo as RoomCardType;
//}
//else
//{
// roomCardType = RoomCardTypeRepository.Get(1);//获取有人房卡类型
// MemoryCacheHelper.SlideSet(MemoryCardKey, roomCardType);
//}
//#endregion
#region
RoomCard roomCard = null;
string GetRoomCardBy = "GetRoomCardBy_" + roomCardType.ID + "_" + host.SysHotel.ID;
object ooo1 = MemoryCacheHelper.Get(GetRoomCardBy);
if (ooo1 != null)
{
roomCard = ooo as RoomCard;
}
else
{
roomCard = RoomCardRepository.Get(roomCardType, host.SysHotel.ID);
if (roomCard != null)
{
MemoryCacheHelper.Set(GetRoomCardBy, roomCard);
}
}
#endregion
//#region 获取当前酒店独属 这个房间的
//RoomCard roomCard = null;
//string GetRoomCardBy = "GetRoomCardBy_" + roomCardType.ID + "_" + host.SysHotel.ID;
//object ooo1 = MemoryCacheHelper.Get(GetRoomCardBy);
//if (ooo1 != null)
//{
// roomCard = ooo as RoomCard;
//}
//else
//{
// roomCard = RoomCardRepository.Get(roomCardType, host.SysHotel.ID);
// if (roomCard != null)
// {
// MemoryCacheHelper.Set(GetRoomCardBy, roomCard);
// }
//}
//#endregion
if (roomCard == null)//如果该房卡类型未创建记录,自动创建
{
roomCard = new RoomCard();
roomCard.CardNumber = "1";
roomCard.RoomCardType = roomCardType;
roomCard.HotelID = host.SysHotel.ID;
RoomCardRepository.Save(roomCard);
}
host.RoomCard = roomCard;
HostRepository.SetRoomCard(host, roomCard);//插卡操作
}
//if (roomCard == null)//如果该房卡类型未创建记录,自动创建
//{
// roomCard = new RoomCard();
// roomCard.CardNumber = "1";
// roomCard.RoomCardType = roomCardType;
// roomCard.HotelID = host.SysHotel.ID;
// RoomCardRepository.Save(roomCard);
//}
//host.RoomCard = roomCard;
//HostRepository.SetRoomCard(host, roomCard);//插卡操作
//}
#region
if (flag != 2)//取电或断电时处理
@@ -1721,139 +1690,144 @@ namespace RCUHost.Implement
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
//只有服务信息才会入库
bool isonly_serviceinfo = true;
//if (hostModal.ModalType == DeviceType.ServiceInfo)
if (isonly_serviceinfo)
//bool isonly_serviceinfo = true;
if (hostModal.ModalType == DeviceType.ServiceInfo)
{
HostModal FinallyData = new HostModal();
FinallyData.HostID = hostModal.HostID;
FinallyData.Status = hostModal.Status;
FinallyData.Brightness = hostModal.Brightness;
FinallyData.CurrentTemp = hostModal.AirConditionData.CurrentTemp;
FinallyData.FanSpeed = hostModal.AirConditionData.FanSpeed;
FinallyData.Mode = hostModal.AirConditionData.Mode;
FinallyData.SettingTemp = hostModal.AirConditionData.SettingTemp;
FinallyData.UpdateTime = hostModal.UpdateTime;
FinallyData.Valve = hostModal.AirConditionData.Valve;
FinallyData.Modal = new RoomTypeModal()
if (!string.IsNullOrEmpty(hostModal.Modal.Name))
{
ID = hostModal.Modal.ID,
Name = hostModal.Modal.Name,
ModalAddress = hostModal.Modal.ModalAddress,
ActiveIndicator = hostModal.Modal.ActiveIndicator,
Sort = hostModal.Modal.Sort
};
FinallyData.Modal.RoomType = new RoomType()
{
ID = hostModal.Modal.RoomTypeID
};
FinallyData.Modal.ID = hostModal.Modal.ID;
FinallyData.UpdateTime = now;
#region
try
{
HostModalRecord hostModalRecord;
switch (flag)
bool bbbaaa = hostModal.Modal.Name.Contains("红外") || hostModal.Modal.Name.Contains("infrared") || hostModal.Modal.Name.Contains("雷达") || hostModal.Modal.Name.Contains("radar");
if (bbbaaa == false)
{
case 0://0关闭设备
if (hostModal.UpdateTime.HasValue)
{
hostModal.Time += Convert.ToInt32((now - hostModal.UpdateTime.Value).TotalMinutes);
}
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
//阿宝添加内存
try
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
//CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 2;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
HostModal FinallyData = new HostModal();
FinallyData.HostID = hostModal.HostID;
FinallyData.Status = hostModal.Status;
FinallyData.Brightness = hostModal.Brightness;
FinallyData.CurrentTemp = hostModal.AirConditionData.CurrentTemp;
FinallyData.FanSpeed = hostModal.AirConditionData.FanSpeed;
FinallyData.Mode = hostModal.AirConditionData.Mode;
FinallyData.SettingTemp = hostModal.AirConditionData.SettingTemp;
FinallyData.UpdateTime = hostModal.UpdateTime;
FinallyData.Valve = hostModal.AirConditionData.Valve;
}
}
break;
case 1://1打开设备且当前设备处于关闭状态
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
//阿宝这里修改
try
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception ex)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
//CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 1;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
FinallyData.Modal = new RoomTypeModal()
{
ID = hostModal.Modal.ID,
Name = hostModal.Modal.Name,
ModalAddress = hostModal.Modal.ModalAddress,
ActiveIndicator = hostModal.Modal.ActiveIndicator,
Sort = hostModal.Modal.Sort
};
FinallyData.Modal.RoomType = new RoomType()
{
ID = hostModal.Modal.RoomTypeID
};
FinallyData.Modal.ID = hostModal.Modal.ID;
FinallyData.UpdateTime = now;
}
}
break;
case 2://2打开设备且当前设备处于打开状态
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
try
#region
try
{
HostModalRecord hostModalRecord;
switch (flag)
{
HostModalRepository.Update(FinallyData);
case 0://0关闭设备
if (hostModal.UpdateTime.HasValue)
{
hostModal.Time += Convert.ToInt32((now - hostModal.UpdateTime.Value).TotalMinutes);
}
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
//阿宝添加内存
try
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
//CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 2;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
}
}
break;
case 1://1打开设备且当前设备处于关闭状态
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
//阿宝这里修改
try
{
HostModalRepository.Update(FinallyData);//sbSQL.ToString());
}
catch (Exception ex)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
//CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
if (hostModal.Modal.ActiveIndicator)//处理回路状态记录,只记录启用的回路 add by wuzhuihui 20190918
{
hostModalRecord = new HostModalRecord();
hostModalRecord.HostID = host.ID;
hostModalRecord.RoomNumber = host.RoomNumber;
hostModalRecord.RoomTypeID = host.RoomType.ID;
hostModalRecord.RoomTypeModalID = hostModal.Modal.ID;
hostModalRecord.ModalAddress = hostModal.Modal.ModalAddress;
hostModalRecord.StartTime = now;
hostModalRecord.Status = 1;
try
{
HostModalRecordRepository.Save(hostModalRecord);
}
catch (Exception)
{
}
}
break;
case 2://2打开设备且当前设备处于打开状态
hostModal.UpdateTime = now;
FinallyData.UpdateTime = now;
try
{
HostModalRepository.Update(FinallyData);
}
catch (Exception ex)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
//CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
break;
}
catch (Exception ex)
{
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
//CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
break;
string StatusKey = "RoomStatus_ServerInfo";
RCUHost.RCUHostCommon.tools.LanJieData(StatusKey, HOTEL_CODE);
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
}
catch (Exception ex)
{
logger.Error("数据处理error: " + ex.Message);
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
#endregion
}
string StatusKey = "RoomStatus_ServerInfo";
RCUHost.RCUHostCommon.tools.LanJieData(StatusKey, HOTEL_CODE);
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey, hostModal);
}
catch (Exception ex)
{
logger.Error("数据处理error: " + ex.Message);
logger.Error(FinallyData.HostID + ":" + host.SysHotel.Code + " " + hostModal.Modal.ModalAddress);
}
#endregion
}
else
{
@@ -1973,9 +1947,7 @@ namespace RCUHost.Implement
else
{
string NoKey = CacheKey.HostModalStatus_BoolFilterPrefix + "_" + host.ID + "_" + device.Value.Address;
//var expiredata = new Random().Next(10, 50);
CSRedisCacheHelper.Set_PartitionWithTime<int>(NoKey, 1, 30);
//logger.Error("内存和数据库都不见这条数据:" + KKey);
}
#endregion
}
@@ -2012,9 +1984,9 @@ namespace RCUHost.Implement
{
string dizhi = item.Value.FaultNo;
ts_faultitem t1 = new ts_faultitem();
t1.dev_type = short.Parse(dizhi.Substring(0, 3));
t1.dev_addr = short.Parse(dizhi.Substring(3, 3));
t1.dev_loop = short.Parse(dizhi.Substring(6, 3));
t1.dev_type = ushort.Parse(dizhi.Substring(0, 3));
t1.dev_addr = ushort.Parse(dizhi.Substring(3, 3));
t1.dev_loop = ushort.Parse(dizhi.Substring(6, 3));
t1.error_type = item.Value.Type;
t1.error_data = item.Value.Data;
exception_list.Add(t1);
@@ -2025,6 +1997,7 @@ namespace RCUHost.Implement
d1.fault_list = exception_list;
d1.report_count = shebei_changeaction_list.Count;
d1.fault_count = exception_list.Count;
d1.ip = EEndPoint;
string sss111 = Newtonsoft.Json.JsonConvert.SerializeObject(d1);
CSRedisCacheHelper.Publish("redis-0X36-0X0F", sss111);
@@ -2212,7 +2185,10 @@ namespace RCUHost.Implement
case 1://状态1离线,0在线
record.AbnormalStatus = fault.Value.Data;
record.StatusDate = now;
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber);
if (record.AbnormalStatus == 1)
{
RR.FCS_PushData(FCS_RCU_Device_Offline, host.FCS_locationUUID, PropertyUUID, FCSLoginUrl, FCSLoginUserName, FCSLoginPassWord, host.SysHotel.Code, host.RoomNumber);
}
//sbSQL.Append("AbnormalStatus=" + record.AbnormalStatus + ",StatusDate=GETDATE()");
break;
case 2://电量

View File

@@ -10,6 +10,7 @@ using Common;
using Dao;
using Domain;
using RCUHost.Protocols;
using CommonEntity;
namespace RCUHost.Implement
{
@@ -30,6 +31,7 @@ namespace RCUHost.Implement
public override void Process(ReceiverContext context)
{
int startIndex = StructConverter.SizeOf(context.SystemHeader);
var endpoint = context.RemoteEndPoint.ToString();
UpdateHostPacketReply? reply = DecodeUpdateHostPacketReply(context.Data, startIndex);
if (reply.HasValue)
{
@@ -67,6 +69,8 @@ namespace RCUHost.Implement
break;
}
BarData bbb = new BarData();
bbb.HostID = updateHostWorker.Host.ID;
bbb.Upgrade_status = Upgrade_Status;
@@ -97,6 +101,9 @@ namespace RCUHost.Implement
Upgrade_Status = "升级失败";
break;
}
BarData bbb = new BarData();
bbb.HostID = host.ID;
bbb.Upgrade_status = Upgrade_Status;

View File

@@ -10,6 +10,7 @@ using Common;
using Dao;
using Domain;
using RCUHost.Protocols;
using CommonEntity;
namespace RCUHost.Implement
{
@@ -23,6 +24,12 @@ namespace RCUHost.Implement
private IList<UpdateHostWorker> updateHostList = new List<UpdateHostWorker>();
/// <summary>
/// 升级
///
///
///
/// 升级 成功 或者失败会在这里上报,
///
/// 唯 一的在这里上报,别的地方不会
/// </summary>
/// <param name="hostUpdate"></param>
/// <param name="fileType"></param>
@@ -146,6 +153,27 @@ namespace RCUHost.Implement
bbb.Upgrade_status = "升级失败";
break;
}
string endpoint = context.RemoteEndPoint.ToString();
var host = updateHostWorker.Host;
ShengJi_Log s1 = new ShengJi_Log();
s1.hotel_id = host.SysHotel.Code;
s1.room_id = host.RoomNumber;
s1.device_id = host.HostNumber;
s1.is_send = 0;
s1.udp_raw = context.Data;
s1.remote_endpoint = endpoint;
s1.md5 = "";
s1.partition = 0;
s1.file_type = 0;
s1.file_path = "";
s1.upgrade_state = reply.Value.Status;
s1.app_version = reply.Value.Version;
CSRedisCacheHelper.Publish("redis-up", Newtonsoft.Json.JsonConvert.SerializeObject(s1));
UploadCurrentVersionReceiver.UP_Grade_Json(updateHostWorker.Host, bbb);
}
else
@@ -195,6 +223,27 @@ namespace RCUHost.Implement
updateHostList.Remove(updateHostWorker);
break;
}
var host = hostUpdateStatus.Host;
string endpoint = context.RemoteEndPoint.ToString();
ShengJi_Log s1 = new ShengJi_Log();
s1.hotel_id = host.SysHotel.Code;
s1.room_id = host.RoomNumber;
s1.device_id = host.HostNumber;
s1.is_send = 0;
s1.udp_raw = context.Data;
s1.remote_endpoint = endpoint;
s1.md5 = "";
s1.partition = 0;
s1.file_type = 0;
s1.file_path = "";
s1.upgrade_state = reply.Value.Status;
s1.app_version = reply.Value.Version;
CSRedisCacheHelper.Publish("redis-up", Newtonsoft.Json.JsonConvert.SerializeObject(s1));
bbb.Upgrade_DateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
UploadCurrentVersionReceiver.UP_Grade_Json(updateHostWorker.Host, bbb);
hostUpdateStatus.UpdatedTime = DateTime.Now;
@@ -221,6 +270,28 @@ namespace RCUHost.Implement
byte[] data = CreateUpdateRequestPacket(updateFileMd5, blockNum, fileType, fileName);
logger.Error("升级HostNumber为" + host.HostNumber);
logger.Error("升级指令为:" + Tools.ByteToString(data));
ShengJi_Log s1 = new ShengJi_Log();
s1.hotel_id = host.SysHotel.Code;
s1.room_id = host.RoomNumber;
s1.device_id = host.HostNumber;
s1.is_send = 1;
s1.udp_raw = data;
string ipAndPort = CSRedisCacheHelper.Get<string>(host.HostNumber, host.MAC);
if (!string.IsNullOrEmpty(ipAndPort))
{
s1.remote_endpoint = ipAndPort;
}
s1.md5 = updateFileMd5;
s1.partition = blockNum;
s1.file_type = fileType;
s1.file_path = fileName;
s1.upgrade_state = 0;
s1.app_version = host.Version;
CSRedisCacheHelper.Publish("redis-up", Newtonsoft.Json.JsonConvert.SerializeObject(s1));
Send(data, host.HostNumber, host.MAC);// host.IP, host.Port);
}
/// <summary>

View File

@@ -31,6 +31,12 @@ namespace Service
/// <param name="sourceType">-1全部删除0后台1宝易</param>
/// <returns></returns>
IList<RoomTypeModal> LoadAll(RoomType roomType, DeviceType deviceType, int sourceType);
/// <summary>
/// 宝镜上传数据
/// </summary>
/// <returns></returns>
IList<RoomTypeModal> LoadAllBaoJingUpload();
/// <summary>
/// 删除房型回路
/// </summary>

View File

@@ -126,6 +126,7 @@ namespace Service.Implement
device.MusicExecMode = status + (brightness << 12) + (mode << 8);//背景音乐执行方式和内容
//device.ColorTempExecMode = status + (brightness << 12) + (temperature << 8);//色温执行方式和内容
//DeviceControlReceiver.Send(host, device);//发送命令
var t = new Tuple<Host, Device>(host, device);
System.Threading.Tasks.Task.Factory.StartNew((state) =>
{

View File

@@ -38,6 +38,13 @@ namespace Service.Implement
}
}
public IList<RoomTypeModal> LoadAllBaoJingUpload()
{
//return CurrentRepository.LoadAll().Where(r => r.IsUploadBaoJing == true).ToList();
return CurrentRepository.LoadAll().ToList();
}
public IList<RoomTypeModal> LoadAll(RoomType roomType, DeviceType deviceType, int sourceType)
{
if (sourceType == -1)

View File

@@ -66,13 +66,13 @@ namespace WebSite.Controllers
var LLL = LieECOManager.LoadAll().Where(A => A.HotelID == CurrentHotelID).OrderBy(A => A.ID).ToList();
string GGG = CacheKey.KT_Timer_Controller + "_" + CurrentHotelCode;
var LLL1= CSRedisCacheHelper.Get_Partition<List<LingChenECO>>(GGG, 5);
var LLL1 = CSRedisCacheHelper.Get_Partition<List<LingChenECO>>(GGG, 5);
string LieKey = CacheKey.LieECOKey + "_" + CurrentHotelID;
if (LLL != null && LLL.Count > 0)
{
var LLLData = LieECOManager.LoadAll().Where(A => A.HotelID == CurrentHotelID && A.IsEnable).ToList();
CSRedisCacheHelper.Set_Partition<List<LieECO>>(LieKey,LLLData,1);
CSRedisCacheHelper.Set_Partition<List<LieECO>>(LieKey, LLLData, 1);
}
if (nn != null)
{
@@ -85,7 +85,7 @@ namespace WebSite.Controllers
RoomNoBodyHowTo = nn,
ECO_Setting = ECO,
LieECOList = LLL,
TimerECO=LLL1
TimerECO = LLL1
}, JsonRequestBehavior.AllowGet);
}
else
@@ -98,7 +98,7 @@ namespace WebSite.Controllers
HotelData = new { StartDayTime = hotelData.StartDayTime, EndDayTime = hotelData.EndDayTime },
ECO_Setting = ECO,
LieECOList = LLL,
TimerECO=LLL1
TimerECO = LLL1
}, JsonRequestBehavior.AllowGet);
}
}
@@ -251,6 +251,11 @@ namespace WebSite.Controllers
RoomNoBodyMananger.Update(no);
id4 = id;
}
QuanJuVar.HotelSeaon = HotelSeasonManager.LoadAll().Where(A => !A.IsDeleted).ToList();
QuanJuVar.HotelAirControl = HotelAirControlManager.LoadAll().ToList();
//string logDetail = "【" + String.Join(",", roomNumberList.ToArray()) + "】【" + HttpContext.InnerLanguage("AirProperty" + property.ToString()) + "】";
//SaveSystemLog(AUTHORITY_AirConditionControl, HttpContext.InnerLanguage("SetRoomAirProperty"), logDetail);
return Json(new { IsSuccess = true, Message = HttpContext.InnerLanguage("SaveSuccess"), ID1 = id1, ID2 = id2, ID3 = id3, ID4 = id4 });

View File

@@ -801,7 +801,10 @@ namespace WebSite.Controllers
/// <returns></returns>
public ActionResult GetRoomSceneList(string jsonData)
{
if (string.IsNullOrEmpty(jsonData.Trim()))
{
return Json(new { IsSuccess = false, Result = "非法调用" }, JsonRequestBehavior.AllowGet);
}
Interlocked.Increment(ref WebAPI_TongJi.GetRoomSceneList);
string start_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
try
@@ -4421,7 +4424,7 @@ namespace WebSite.Controllers
Request.InputStream.Read(byts, 0, byts.Length);
string jsonData = System.Text.Encoding.UTF8.GetString(byts);
JWTData JJJ = null;
int code = 0;
int code = 401;
string msg = "";
var dic = JsonConvert.DeserializeObject<Dictionary<string, string>>(jsonData);
if (dic != null)
@@ -5327,13 +5330,30 @@ namespace WebSite.Controllers
}
long jishu_error = Interlocked.Read(ref MvcApplication.UDPServerErrorCount);
if (jishu_error >= 3)
if (jishu_error >= 5)
{
logger.Error("重启了UDP服务器");
Interlocked.Exchange(ref MvcApplication.UDPServerErrorCount, 0);
var hostServer = (IHostServer)MvcApplication.cxt.GetObject("RCUHost.HostServer");
hostServer.Start();
}
try
{
var len = CSRedisCacheHelper.redis1.XLen("All_UDPPackage_Data");
if (len >= 20)
{
logger.Error("Redis积压数据太多要重启一下");
var hostServer = (IHostServer)MvcApplication.cxt.GetObject("RCUHost.HostServer");
hostServer.Start();
}
}
catch (Exception ex)
{
}
var TotalKey = "UDPPackage_TotalRecvPackage";
UDPPackageCount LLL_T = null;
DataTongJi.TotalCount.TryGetValue(TotalKey, out LLL_T);
@@ -6081,7 +6101,6 @@ namespace WebSite.Controllers
}
#region
/// <summary>
@@ -6385,6 +6404,9 @@ namespace WebSite.Controllers
{
try
{
//Host hostua = new Host() { HostNumber = "096008126073", MAC = "" };
//HostModal hostModal1 = new HostModal() { Modal = new RoomTypeModal() { ModalAddress = "007001000", Type = DeviceType.AirConditioner } };
//HostModalManager.SetDevice(hostua, hostModal1, 0, 0, 25, 0, 1, 0);
var dic = CSRedisCacheHelper.HMGetAll(5, CacheKey.JiNan_TongPai_Spec);
foreach (var item in dic)
@@ -6398,9 +6420,20 @@ namespace WebSite.Controllers
if (span.TotalSeconds >= 60 && span.TotalMinutes <= 75)
{
string[] h_a = k.Split('_');
Host host = new Host() { HostNumber = h_a[0], MAC = "" };
HostModal hostModal = new HostModal() { Modal = new RoomTypeModal() { ModalAddress = h_a[1], Type = DeviceType.AirConditioner } };
HostModalManager.SetDevice(host, hostModal, 0, 0, 0, 0);
var hostnumber = h_a[0];
var address = h_a[1];
var hostid = h_a[2];
Host host = new Host() { HostNumber = hostnumber, MAC = "" };
HostModal hostModal = new HostModal() { Modal = new RoomTypeModal() { ModalAddress = address, Type = DeviceType.AirConditioner } };
string KKey = CacheKey.HostModalStatus_Prefix + "_" + hostid + "_" + address;
var HHostModalData = CSRedisCacheHelper.Get_Partition<HostModal_Cache>(KKey);
var temp = HHostModalData.AirConditionData.SettingTemp;
var mode = HHostModalData.AirConditionData.Mode;
HostModalManager.SetDevice(host, hostModal, 0, 0, temp, 0, mode, 0);
}
}
}
@@ -6408,6 +6441,7 @@ namespace WebSite.Controllers
}
catch (Exception ex)
{
logger.Error("同派出错:" + ex.Message);
return Json(new { IsSuccess = false, Message = HttpContext.InnerLanguage("SaveFailedBecause") + ex.Message });
}
}
@@ -6466,13 +6500,15 @@ namespace WebSite.Controllers
foreach (Host host in hosts)//该房型下所有主机关联回路
{
//删除掉上报的
CSRedisCacheHelper.Del_Partition(CacheKey.DingShiReportData + "_" + host.ID, 3);
//CSRedisCacheHelper.Del_Partition(CacheKey.DingShiReportData + "_" + host.ID, 3);
var hostModal = HostModalManager.GetByModalAddress(host.ID, roomTypeModal.ModalAddress);
if (null == hostModal)
{
HostModalManager.Save(new HostModal { HostID = host.ID, Modal = roomTypeModal, Status = 2, Time = 0, UpdateTime = DateTime.Now });
}
}
QuanJuVar.BaoJingUpLoad = RoomTypeModalManager.LoadAllBaoJingUpload();
QuanJuVar.BaoJingUpLoad = QuanJuVar.RoomTypeDeviceModal.Where(A => A.IsUploadBaoJing == true).ToList();
return true;
}
#endregion
@@ -6628,7 +6664,7 @@ namespace WebSite.Controllers
try
{
var qqq = HostManager.LoadAllID_HostNumberMapping();
var qqq1 = qqq.Select(a => new { a.HostNumber, a.Id }).ToList();
var qqq1 = qqq.Select(a => new { a.HostNumber, a.Id, a.RoomTypeId }).ToList();
if (qqq1.Count > 0)
@@ -6639,7 +6675,7 @@ namespace WebSite.Controllers
if (!string.IsNullOrEmpty(item.HostNumber))
{
//CSRedisCacheHelper.HMSet(5, CacheKey.RoomNumber_HostNumber, item.HostNumber, item.RoomNumber);
CSRedisCacheHelper.HMSet(5, CacheKey.HostId_HostNumber, item.HostNumber, item.Id);
CSRedisCacheHelper.HMSet(5, CacheKey.HostId_HostNumber, item.HostNumber, item.Id + "#" + item.RoomTypeId);
}
}
}
@@ -6801,6 +6837,7 @@ namespace WebSite.Controllers
{
try
{
//HostServer.StopConsumerTasks();
if (key.Equals("blw^_^wlb"))
{
var hostServer = (IHostServer)MvcApplication.cxt.GetObject("RCUHost.HostServer");
@@ -6815,6 +6852,20 @@ namespace WebSite.Controllers
}
}
[HttpPost()]
public ActionResult NewServerTest()
{
try
{
return Json(new { IsSuccess = true, Result = "success" }, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
logger.Error(ex.Message);
return Json(new { IsSuccess = false, Result = "操作异常:" + ex.Message }, JsonRequestBehavior.AllowGet);
}
}
}
public class NReturnInfo
{

View File

@@ -35,10 +35,29 @@ namespace WebSite.Controllers
[Authorize]
public ActionResult Index()
{
//ViewData["Account"] = User.Identity.Name;
ViewData["Account"] = User.Identity.Name;
return View("SimonIndex");
}
public ActionResult III()
{
return View("DencyLogin");
}
public ActionResult Loo()
{
var name = Request.Form["username"].ToString();
var pwd = Request.Form["password"].ToString();
if (name.Equals("mima") && pwd.Equals("3dfc3922112f460e81c2b7b7221bd9ad"))
{
return View("LogOn");
}
else
{
return View("DencyLogin");
}
}
[Authorize]
public ActionResult MenuIndex()
{
@@ -114,6 +133,7 @@ namespace WebSite.Controllers
return Redirect("/");//Request.UrlReferrer.ToString());
}
//[Authorize()]
public ActionResult LogOn()
{
string result = "";

View File

@@ -95,6 +95,10 @@ namespace WebSite.Controllers
if (hostModal != null)
{
item.Status = hostModal.Status;
if (hostModal.ModalType==DeviceType.AirConditioner)
{
item.Status = hostModal.AirConditionData.AirStatus;
}
item.Brightness = hostModal.Brightness;
var aaa = hostModal.AirConditionData;
item.CurrentTemp = aaa.CurrentTemp;

View File

@@ -137,6 +137,28 @@ namespace WebSite.Controllers
HttpContext.Cache.Remove(Key);
return Json(new { result = "success" }, JsonRequestBehavior.AllowGet);
}
public static string OldIOTServerUrl = "http://a.boonlive-rcu.com/";
public void ZhuanFa<T>(T reqData, string ActionMethod)
{
try
{
//string nsa = JsonConvert.SerializeObject(reqData);
logger.Error("进入转发" );
logger.Error("进入转发" + ActionMethod);
var client1 = new RestClient(OldIOTServerUrl);
var request1 = new RestRequest("iot/" + ActionMethod, Method.POST);
request1.AddJsonBody(reqData);
var QQQ = client1.Execute(request1);
string HHH = QQQ.Content;
//logger.Error("转发结果:" + HHH);
}
catch (Exception ex)
{
logger.Error("转发出错:" + ex.Message);
//return Json("语音机器人转发:"+ex.Message, JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// 小度对接
/// </summary>
@@ -164,10 +186,16 @@ namespace WebSite.Controllers
byte[] reqBody = new byte[Request.InputStream.Length];
Request.InputStream.Read(reqBody, 0, reqBody.Length);
string reqData = System.Text.Encoding.UTF8.GetString(reqBody);
string platformName = "小度音箱";
try
{
Domain.IoTXiaoDuEntity.Request.AppliancesRequest request = JsonConvert.DeserializeObject<Domain.IoTXiaoDuEntity.Request.AppliancesRequest>(reqData);//得到小度请求
if (NewOrOld.IsNew)
{
ZhuanFa<Domain.IoTXiaoDuEntity.Request.AppliancesRequest>(request, "XiaoDu");
}
if (string.IsNullOrEmpty(request.payload.cuid))
{
//logger.Error("设备cuid不能为空" + reqData + ",来自:" + GetClientIP());
@@ -606,7 +634,7 @@ namespace WebSite.Controllers
if (!is_online)
{
logger.Error(platformName + "当前访问酒店(" + host.SysHotel.Name + host.SysHotel.Code + ")客房rcu(" + host.RoomNumber + ")不在线");
return Json(ReturnXiaoDuError(request.header, "TargetOfflineError"), JsonRequestBehavior.AllowGet);//当技能检测到目标设备没有连接到设备云或者设备云不在线时会给DuerOS发送TargetOfflineError消息。
//return Json(ReturnXiaoDuError(request.header, "TargetOfflineError"), JsonRequestBehavior.AllowGet);//当技能检测到目标设备没有连接到设备云或者设备云不在线时会给DuerOS发送TargetOfflineError消息。
}
@@ -1576,6 +1604,13 @@ namespace WebSite.Controllers
bool wendu1 = KongTiaoControlName.Equals("IncrementTemperatureRequest") || KongTiaoControlName.Equals("IncrementTemperatureRequest") || KongTiaoControlName.Equals("SetTemperatureRequest");
bool fengsu1 = KongTiaoControlName.Equals("SetFanSpeedRequest") || KongTiaoControlName.Equals("IncrementFanSpeedRequest") || KongTiaoControlName.Equals("DecrementFanSpeedRequest");
bool moshi1 = KongTiaoControlName.Equals("SetModeRequest");
string tiaowen = request.header.name;
if (tiaowen.Equals("IncrementTemperatureRequest") || tiaowen.Equals("DecrementTemperatureRequest"))
{
HostModalManager.SetDevice(host, hostModal, 1, 0, temperature, 0, 0, 0);
Thread.Sleep(50);
}
//特殊酒店
if (AssertFault(hotel_code))
{
@@ -1626,13 +1661,6 @@ namespace WebSite.Controllers
}
else
{
string tiaowen = request.header.name;
if (tiaowen.Equals("IncrementTemperatureRequest") || tiaowen.Equals("DecrementTemperatureRequest"))
{
HostModalManager.SetDevice(host, hostModal, 1, 0);
Thread.Sleep(50);
}
//对房间设备进行操作
HostModalManager.SetDevice(host, hostModal, status, brightness, temperature, fanSpeed, mode, valve);
}
@@ -3906,6 +3934,7 @@ namespace WebSite.Controllers
byte[] reqBody = new byte[Request.InputStream.Length];
Request.InputStream.Read(reqBody, 0, reqBody.Length);
string reqData = System.Text.Encoding.UTF8.GetString(reqBody);
//logger.Error(reqData);
string g_requestid = "";
int g_hotelcode = 0;
@@ -3916,6 +3945,10 @@ namespace WebSite.Controllers
{
Domain.IoTAliGenieEntity.Request req = JsonConvert.DeserializeObject<Domain.IoTAliGenieEntity.Request>(reqData);//得到天猫精灵请求
if (NewOrOld.IsNew)
{
ZhuanFa<Domain.IoTAliGenieEntity.Request>(req, "aligenie");
}
if (string.IsNullOrEmpty(req.baseInfo.hotelId) || string.IsNullOrEmpty(req.baseInfo.roomNo))
{
@@ -4183,7 +4216,7 @@ namespace WebSite.Controllers
if (!is_online)
{
logger.Error(platformName + "当前访问酒店(" + host.SysHotel.Name + host.SysHotel.Code + ")客房rcu(" + host.RoomNumber + ")不在线");
return Json(ReturnAliGenieError("当前访问rcu主机不在线", req.baseInfo.requestId), JsonRequestBehavior.AllowGet);//当技能检测到目标设备没有连接到设备云或者设备云不在线时会给DuerOS发送TargetOfflineError消息。
//return Json(ReturnAliGenieError("当前访问rcu主机不在线", req.baseInfo.requestId), JsonRequestBehavior.AllowGet);//当技能检测到目标设备没有连接到设备云或者设备云不在线时会给DuerOS发送TargetOfflineError消息。
}
bool is_card_in = CheckGetPower(host);
@@ -5365,7 +5398,7 @@ namespace WebSite.Controllers
}
else
{
r.code = code;
r.code = 401;
r.msg = msg;
}
}
@@ -5413,7 +5446,7 @@ namespace WebSite.Controllers
}
else
{
r.code = code;
r.code = 401;
r.msg = msg;
}
r.data = list;
@@ -5637,9 +5670,10 @@ namespace WebSite.Controllers
var TuT = SignKeyCommon.TokenValidate(Token, out JJJ, out code, out msg);
if (!TuT)
{
code = 0;
code = 401;
result.code = code;
result.msg = "Token验证不通过";
logger.Error("chuangwei Token验证失败 " + AuthData);
return Json(result, JsonRequestBehavior.AllowGet);
}
}
@@ -5729,7 +5763,7 @@ namespace WebSite.Controllers
result.code = 0;
result.msg = "当前房间主机不在线,无法控制";
return Json(result, JsonRequestBehavior.AllowGet);
//return Json(result, JsonRequestBehavior.AllowGet);
}
@@ -6208,7 +6242,7 @@ namespace WebSite.Controllers
var TuT = SignKeyCommon.TokenValidate(Token, out JJJ, out code, out msg);
if (!TuT)
{
code = 0;
code = 401;
result.code = code;
result.msg = "Token验证不通过";
return Json(result, JsonRequestBehavior.AllowGet);
@@ -7460,7 +7494,7 @@ namespace WebSite.Controllers
var name = item.applianceName;
var area = item.area;
List<HostModal> q1 = new List<HostModal>();
if (name.Equals("灯"))
if (name.Equals("灯") || name.Equals("所有灯"))
{
q1 = hostModals.Where(A => A.Modal.Name.Contains("灯")).ToList();
}

View File

@@ -362,6 +362,22 @@ namespace WebSite.Controllers
var roomnum = room.RoomNumber;
var roomModel = new RoomModel();
#region
string DLKey = CacheKey.DianLiang + "_" + room.HostNumber;
string dianliang = CSRedisCacheHelper.Get_Partition<string>(DLKey, 5);
if (!string.IsNullOrEmpty(dianliang))
{
ushort usa = 0;
ushort.TryParse(dianliang, out usa);
roomModel.WeiXinSuo_DianLiang = usa.ToString();
}
else
{
roomModel.WeiXinSuo_DianLiang = "";
}
#endregion
#region
StringBuilder sb = new StringBuilder();
sb.Append(CacheKey.CarbonVIP_Prefix);
@@ -1065,10 +1081,16 @@ namespace WebSite.Controllers
//"Color": "#FF8C69",
//"Beep": false
string Address = row["Code"].ToString();
string Name1 = ReturnNameByLanguage(row["Name"].ToString(), row["EName"].ToString(), row["TWName"].ToString());
if (Name1.Contains("红外")||Name1.Contains("infrared")||Name1.Contains("雷达")||Name1.Contains("radar"))
{
continue;
}
services.Add(new
{
Code = row["Code"],
Name = ReturnNameByLanguage(row["Name"].ToString(), row["EName"].ToString(), row["TWName"].ToString()),// (bool)Session["isCN"] ? row["Name"] : row["EName"],
Name=Name1,
Value = row["Number"],
Color = row["Color"],
Beep = row["Beep"]

View File

@@ -1086,6 +1086,11 @@ namespace WebSite.Controllers
public ActionResult Save(string jsonData)
{
RoomType entity = Newtonsoft.Json.JsonConvert.DeserializeObject<RoomType>(jsonData);
if (Tools.ContainsSpecialChars(entity.Name) || Tools.ContainsSpecialChars(entity.HostName))
{
return Json(new { IsSuccess = false, Message = "房型名称不得包含特殊符号、空格,命名字数不得超过 N 个文字"});
}
RoomType existRoomType = RoomTypeManager.GetByCode(entity.Code, CurrentHotelID);
if (existRoomType != null)
{

View File

@@ -296,6 +296,7 @@ namespace WebSite.Controllers
sysHotel.FCS_RCU_Online = entity.FCS_RCU_Online;
sysHotel.FCS_MenCi_Close = entity.FCS_MenCi_Close;
sysHotel.FCS_MenCi_Open = entity.FCS_MenCi_Open;
sysHotel.FCS_MenSuo_DianLiang = entity.FCS_MenSuo_DianLiang;
sysHotel.IsUseSkyworthTV = entity.IsUseSkyworthTV;
@@ -387,6 +388,7 @@ namespace WebSite.Controllers
TakeOut.SysHotel.FCS_RCU_Online = entity.FCS_RCU_Online;
TakeOut.SysHotel.FCS_MenCi_Close = entity.FCS_MenCi_Close;
TakeOut.SysHotel.FCS_MenCi_Open = entity.FCS_MenCi_Open;
TakeOut.SysHotel.FCS_MenSuo_DianLiang = entity.FCS_MenSuo_DianLiang;
TakeOut.SysHotel.IsUseSkyworthTV = entity.IsUseSkyworthTV;//断电重置小度
TakeOut.SysHotel.IsUseTCLTV = entity.IsUseTCLTV;//断电重置小度

View File

@@ -47,9 +47,13 @@ namespace WebSite
private IRoomStatusManager RoomStatusManager;
private IDeviceControlReceiver DeviceControlReceiver;
private IOverviewManager OverviewManager { get; set; }
public IHostModalManager HostModalManager { get; set; }
private IHostModalManager HostModalManager { get; set; }
public static IHostServer hostServer { get; set; }
public IRoomTypeModalManager RoomTypeModalManager { get; set; }
public IHotelSeasonManager HotelSeasonRepository { get; set; }
public IHotelAirControlManager HotelAirControlRepository { get; set; }
//private IGroupManager GroupManager;
//private IHostRoomCardManager HostRoomCardManager;
private syncstatus.syncstatusSoapClient _client = null;//房态同步接口
@@ -95,6 +99,8 @@ namespace WebSite
}
protected override void Application_Start(object sender, EventArgs e)
{
//CSRedisCacheHelper.redis1.Del(UDPAllDataKey);
//CSRedisCacheHelper.redis1.XGroupCreate(UDPAllDataKey, "UDPData", "0", true);
logger.Error("Web重启了");
// 在应用程序启动时调用
PreHot();
@@ -122,10 +128,9 @@ namespace WebSite
}
catch { }
};
SetInitAccount();
StartHostServer();
//StartHostServerNew();
BLWMQTT.StartMqtt();
//if ("1" == send_to_debugger)
//{
// UDPLogServer.Init();
@@ -137,6 +142,12 @@ namespace WebSite
}
//HeartBeat();
QuanJuVar.RoomTypeDeviceModal = RoomTypeModalManager.LoadAllBaoJingUpload();
QuanJuVar.BaoJingUpLoad = QuanJuVar.RoomTypeDeviceModal.Where(A => A.IsUploadBaoJing == true).ToList();
QuanJuVar.HotelSeaon = HotelSeasonRepository.LoadAll().Where(A => A.IsDeleted==false).ToList();
QuanJuVar.HotelAirControl= HotelAirControlRepository.LoadAll().ToList();
StartHostServer();
BLWMQTT.StartMqtt();
long ll1 = CSRedisCacheHelper.ForeverGet<long>(UDPLostKey);
@@ -160,7 +171,7 @@ namespace WebSite
{
RedisTongJiData tq1 = new RedisTongJiData();
tq1.url = "api/CaiJiData";
tq1.cron_exp = string.Format("*/{0} * * * *", 10);
tq1.cron_exp = string.Format("*/{0} * * * *", 1);
tq1.mission_key = MvcApplication.IntervalKey;
CSRedisCacheHelper.Forever<RedisTongJiData>(IntervalKey, tq1);
}
@@ -229,15 +240,11 @@ namespace WebSite
T.Stop();
double d = CPUData.GetCPU();
DataTongJi.CPU_Data.Add(d);
// 简单的上限保护,避免长期积累导致内存膨胀
//if (DataTongJi.CPU_Data.Count > 1000)
//{
// DataTongJi.CPU_Data = new System.Collections.Concurrent.ConcurrentBag<double>();
//}
}
catch (Exception ex)
{
logger.Error("CPU 数量统计出错了:" + ex.Message);
logger.Error("CPU 数量统计出错了:" + ex.StackTrace);
}
finally
{
@@ -523,6 +530,9 @@ namespace WebSite
DeviceControlReceiver = (IDeviceControlReceiver)cxt.GetObject("RCUHost.DeviceControlReceiver");
OverviewManager = (IOverviewManager)cxt.GetObject("Manager.Overview");
HostModalManager = (IHostModalManager)cxt.GetObject("Manager.HostModal");
RoomTypeModalManager = (IRoomTypeModalManager)cxt.GetObject("Manager.RoomTypeModal");
HotelSeasonRepository = (IHotelSeasonManager)cxt.GetObject("Manager.HotelSeason");
HotelAirControlRepository = (IHotelAirControlManager)cxt.GetObject("Manager.HotelAirControl");
_client = new syncstatus.syncstatusSoapClient();
Timer timer2 = new Timer(20000);//每20秒扫描一次
@@ -743,7 +753,7 @@ namespace WebSite
int status_id16 = host.SysHotel.SwitchRoomStatus_PowerOff16;
if (status_id2 != 0 || status_id4 != 0 || status_id8 != 0 || status_id16 != 0)
{
if (status_id2 == roomStatus.ID||status_id4==roomStatus.ID||status_id8==roomStatus.ID||status_id16==roomStatus.ID)
if (status_id2 == roomStatus.ID || status_id4 == roomStatus.ID || status_id8 == roomStatus.ID || status_id16 == roomStatus.ID)
{
HostModal h1 = new HostModal();
h1.Modal = new RoomTypeModal() { ModalAddress = "004000001", Type = DeviceType.ServiceInfo };

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebSite.Models
{
public class NewOrOld
{
public static bool IsNew = false;
}
}

View File

@@ -114,6 +114,11 @@ namespace WebSite.Models
/// </summary>
public string CarbonVIP { get; set; }
/// <summary>
/// 微信锁电量
/// </summary>
public string WeiXinSuo_DianLiang { get; set; }
/// <summary>
/// 功率
/// </summary>

View File

@@ -1312,6 +1312,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 CheckIn 的本地化字符串。
/// </summary>
internal static string ChuZuHou {
get {
return ResourceManager.GetString("ChuZuHou", resourceCulture);
}
}
/// <summary>
/// 查找类似 Circuit 的本地化字符串。
/// </summary>
@@ -2725,6 +2734,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 Doorlockbattery 的本地化字符串。
/// </summary>
internal static string FCS_MenSuo_DianLiang {
get {
return ResourceManager.GetString("FCS_MenSuo_DianLiang", resourceCulture);
}
}
/// <summary>
/// 查找类似 FCS_RCU_Device_Offline 的本地化字符串。
/// </summary>
@@ -3013,6 +3031,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 Close air condition 的本地化字符串。
/// </summary>
internal static string GuanKongTiao {
get {
return ResourceManager.GetString("GuanKongTiao", resourceCulture);
}
}
/// <summary>
/// 查找类似 Guest Room 的本地化字符串。
/// </summary>
@@ -4453,6 +4480,24 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 No Action 的本地化字符串。
/// </summary>
internal static string MeiDongZuo {
get {
return ResourceManager.GetString("MeiDongZuo", resourceCulture);
}
}
/// <summary>
/// 查找类似 Minute when nobody 的本地化字符串。
/// </summary>
internal static string MeiYouRen {
get {
return ResourceManager.GetString("MeiYouRen", resourceCulture);
}
}
/// <summary>
/// 查找类似 Menu 的本地化字符串。
/// </summary>
@@ -7477,6 +7522,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 attemperation 的本地化字符串。
/// </summary>
internal static string TiaoWen {
get {
return ResourceManager.GetString("TiaoWen", resourceCulture);
}
}
/// <summary>
/// 查找类似 Tidy Up The Plate 的本地化字符串。
/// </summary>

View File

@@ -2911,4 +2911,22 @@ Single circuit status</value>
<data name="RoomStatusSwitch" xml:space="preserve">
<value>Switch RoomStatus To Power Off</value>
</data>
<data name="FCS_MenSuo_DianLiang" xml:space="preserve">
<value>Doorlockbattery</value>
</data>
<data name="ChuZuHou" xml:space="preserve">
<value>CheckIn</value>
</data>
<data name="GuanKongTiao" xml:space="preserve">
<value>Close air condition</value>
</data>
<data name="MeiDongZuo" xml:space="preserve">
<value>No Action</value>
</data>
<data name="MeiYouRen" xml:space="preserve">
<value>Minute when nobody</value>
</data>
<data name="TiaoWen" xml:space="preserve">
<value>attemperation</value>
</data>
</root>

View File

@@ -1311,6 +1311,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 出租后 的本地化字符串。
/// </summary>
internal static string ChuZuHou {
get {
return ResourceManager.GetString("ChuZuHou", resourceCulture);
}
}
/// <summary>
/// 查找类似 回路 的本地化字符串。
/// </summary>
@@ -2724,6 +2733,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 门锁电量 的本地化字符串。
/// </summary>
internal static string FCS_MenSuo_DianLiang {
get {
return ResourceManager.GetString("FCS_MenSuo_DianLiang", resourceCulture);
}
}
/// <summary>
/// 查找类似 RCU 设备断线 的本地化字符串。
/// </summary>
@@ -3012,6 +3030,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 关空调 的本地化字符串。
/// </summary>
internal static string GuanKongTiao {
get {
return ResourceManager.GetString("GuanKongTiao", resourceCulture);
}
}
/// <summary>
/// 查找类似 客房 的本地化字符串。
/// </summary>
@@ -4452,6 +4479,24 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 无动作 的本地化字符串。
/// </summary>
internal static string MeiDongZuo {
get {
return ResourceManager.GetString("MeiDongZuo", resourceCulture);
}
}
/// <summary>
/// 查找类似 分钟无人入住 的本地化字符串。
/// </summary>
internal static string MeiYouRen {
get {
return ResourceManager.GetString("MeiYouRen", resourceCulture);
}
}
/// <summary>
/// 查找类似 菜单 的本地化字符串。
/// </summary>
@@ -7485,6 +7530,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 调温 的本地化字符串。
/// </summary>
internal static string TiaoWen {
get {
return ResourceManager.GetString("TiaoWen", resourceCulture);
}
}
/// <summary>
/// 查找类似 收拾餐盘 的本地化字符串。
/// </summary>

View File

@@ -2913,4 +2913,22 @@
<data name="TuiFang" xml:space="preserve">
<value>退房</value>
</data>
<data name="FCS_MenSuo_DianLiang" xml:space="preserve">
<value>门锁电量</value>
</data>
<data name="ChuZuHou" xml:space="preserve">
<value>出租后</value>
</data>
<data name="GuanKongTiao" xml:space="preserve">
<value>关空调</value>
</data>
<data name="MeiDongZuo" xml:space="preserve">
<value>无动作</value>
</data>
<data name="MeiYouRen" xml:space="preserve">
<value>分钟无人入住</value>
</data>
<data name="TiaoWen" xml:space="preserve">
<value>调温</value>
</data>
</root>

View File

@@ -1311,6 +1311,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 出租后 的本地化字符串。
/// </summary>
internal static string ChuZuHou {
get {
return ResourceManager.GetString("ChuZuHou", resourceCulture);
}
}
/// <summary>
/// 查找类似 回路 的本地化字符串。
/// </summary>
@@ -2724,6 +2733,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 門鎖電量 的本地化字符串。
/// </summary>
internal static string FCS_MenSuo_DianLiang {
get {
return ResourceManager.GetString("FCS_MenSuo_DianLiang", resourceCulture);
}
}
/// <summary>
/// 查找类似 RCU 設備 OffLine 的本地化字符串。
/// </summary>
@@ -3012,6 +3030,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 关空调 的本地化字符串。
/// </summary>
internal static string GuanKongTiao {
get {
return ResourceManager.GetString("GuanKongTiao", resourceCulture);
}
}
/// <summary>
/// 查找类似 客房 的本地化字符串。
/// </summary>
@@ -4452,6 +4479,24 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 无动作 的本地化字符串。
/// </summary>
internal static string MeiDongZuo {
get {
return ResourceManager.GetString("MeiDongZuo", resourceCulture);
}
}
/// <summary>
/// 查找类似 分钟无人入住 的本地化字符串。
/// </summary>
internal static string MeiYouRen {
get {
return ResourceManager.GetString("MeiYouRen", resourceCulture);
}
}
/// <summary>
/// 查找类似 菜單 的本地化字符串。
/// </summary>
@@ -7487,6 +7532,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 调温 的本地化字符串。
/// </summary>
internal static string TiaoWen {
get {
return ResourceManager.GetString("TiaoWen", resourceCulture);
}
}
/// <summary>
/// 查找类似 收拾餐盤 的本地化字符串。
/// </summary>

View File

@@ -2915,4 +2915,22 @@
<data name="TuiFang" xml:space="preserve">
<value>退房</value>
</data>
<data name="FCS_MenSuo_DianLiang" xml:space="preserve">
<value>門鎖電量</value>
</data>
<data name="ChuZuHou" xml:space="preserve">
<value>出租后</value>
</data>
<data name="GuanKongTiao" xml:space="preserve">
<value>关空调</value>
</data>
<data name="MeiDongZuo" xml:space="preserve">
<value>无动作</value>
</data>
<data name="MeiYouRen" xml:space="preserve">
<value>分钟无人入住</value>
</data>
<data name="TiaoWen" xml:space="preserve">
<value>调温</value>
</data>
</root>

View File

@@ -104,6 +104,9 @@ function delProgramFile() {
}
//保存房型
function save() {
var a1= $("#txtHostName").val();
var a2 = $("#txtName").val();
console.log(a1+"#########"+a2);
var form = $('#dialog').find('form');
if (form.form('enableValidation').form('validate')) {
var entry = form.serializeJson();

View File

@@ -199,22 +199,30 @@ function loadRooms(opts, callback) {
type: "POST",
cache: false,
data: { page: page, rows: rows, groupId: options.group, isAirDetect: $("#chkAirDetect").is(':checked') },
success: function (r) {
if (r.IsSuccess) {
success: function (r)
{
if (r.IsSuccess)
{
var tdCount = Math.floor(document.documentElement.clientWidth / 124);
$('#rooms').html("");
var strHtml = "<tbody>";
for (var i = 0; i < r.Data.length; i++) {
for (var j = 0; j < r.Data[i].FloorRooms.length; j++) {
if (j == 0) {
for (var i = 0; i < r.Data.length; i++)
{
for (var j = 0; j < r.Data[i].FloorRooms.length; j++)
{
if (j == 0)
{
strHtml += "<tr>";
} else if ($("#chkSwitchLine").is(':checked') && (j + 1) % tdCount == 1) {
} else if ($("#chkSwitchLine").is(':checked') && (j + 1) % tdCount == 1)
{
strHtml += "</tr><tr>";
}
var strRoomTemp = "<font style='color:green'>"; //室内温度大于28°显示红色小于22°显示蓝色默认显示绿色
if (r.Data[i].FloorRooms[j].RoomTemp > 28) {
if (r.Data[i].FloorRooms[j].RoomTemp > 28)
{
strRoomTemp = "<font style='color:red'>";
} else if (r.Data[i].FloorRooms[j].RoomTemp < 22) {
} else if (r.Data[i].FloorRooms[j].RoomTemp < 22)
{
strRoomTemp = "<font style='color:blue'>";
}
strHtml += "<td><ul><li oncontextmenu='showContextMenu(" + r.Data[i].FloorRooms[j].ID + ",null);return false;'";
@@ -223,37 +231,55 @@ function loadRooms(opts, callback) {
strHtml += "<dl><dt>" + r.Data[i].FloorRooms[j].RoomNumber;
var CarbonVIP_Status = r.Data[i].FloorRooms[j].CarbonVIP;
if (CarbonVIP_Status == "open") {
strHtml += "<img src='../../Images/ECO/eco_g.png' width='16' height='16' style='margin-right:5px;'/>"+r.Data[i].FloorRooms[j].RoomNumber+"</dt>";
var WeiXinSuo_DianLiang = r.Data[i].FloorRooms[j].WeiXinSuo_DianLiang;
console.log("VIP:" + WeiXinSuo_DianLiang);
if (CarbonVIP_Status == "open")
{
strHtml += "<img src='../../Images/ECO/eco_g.png' width='16' height='16' style='margin-right:5px;'/>" + r.Data[i].FloorRooms[j].RoomNumber + "</dt>";
}
else if (CarbonVIP_Status == "close") {
strHtml += "<img src='../../Images/ECO/eco_p.png' width='16' height='16' style='margin-right:5px;'/>"+r.Data[i].FloorRooms[j].RoomNumber+"</dt>";
else if (CarbonVIP_Status == "close")
{
strHtml += "<img src='../../Images/ECO/eco_p.png' width='16' height='16' style='margin-right:5px;'/>" + r.Data[i].FloorRooms[j].RoomNumber + "</dt>";
}
else if (CarbonVIP_Status == "exists_nostatus") {
strHtml += "<img src='../../Images/ECO/eco_p.png' width='16' height='16' style='margin-right:5px;'/>"+r.Data[i].FloorRooms[j].RoomNumber+"</dt>";
else if (CarbonVIP_Status == "exists_nostatus")
{
strHtml += "<img src='../../Images/ECO/eco_p.png' width='16' height='16' style='margin-right:5px;'/>" + r.Data[i].FloorRooms[j].RoomNumber + "</dt>";
}
else {
else
{
}
//strHtml += "<dl><dt>";
if ($("#chkAirDetect").is(':checked') && r.Data[i].FloorRooms[j].AirDetects.length > 0) {//显示空气质量检测
for (var k = 0; k < r.Data[i].FloorRooms[j].AirDetects.length; k++) {
if ($("#chkAirDetect").is(':checked') && r.Data[i].FloorRooms[j].AirDetects.length > 0)
{//显示空气质量检测
for (var k = 0; k < r.Data[i].FloorRooms[j].AirDetects.length; k++)
{
strHtml += "<dd>" + r.Data[i].FloorRooms[j].AirDetects[k].Name + ":" + r.Data[i].FloorRooms[j].AirDetects[k].Value + "</dd>";
}
strHtml += "</dl>";
}
else {
else
{
//strHtml += "<dd>" + r.Data[i].FloorRooms[j].Power + "</dd>";
strHtml += "<dd>" + r.Data[i].FloorRooms[j].RoomStatus + "&nbsp;"+r.Data[i].FloorRooms[j].Power+"</dd>";
strHtml += "<dd>" + lang.Identity + ":" + r.Data[i].FloorRooms[j].Identity + "&nbsp" + r.Data[i].FloorRooms[j].PowerSupplyName + "</dd>";
strHtml += "<dd>" + r.Data[i].FloorRooms[j].RoomStatus + "&nbsp;" + r.Data[i].FloorRooms[j].Power + "</dd>";
if (WeiXinSuo_DianLiang != "")
{
strHtml += "<dd>" + lang.Identity + ":" + r.Data[i].FloorRooms[j].Identity + "&nbsp;" + r.Data[i].FloorRooms[j].PowerSupplyName + "&nbsp;E:" + r.Data[i].FloorRooms[j].WeiXinSuo_DianLiang + "</dd>";
}
else
{
strHtml += "<dd>" + lang.Identity + ":" + r.Data[i].FloorRooms[j].Identity + "&nbsp;" + r.Data[i].FloorRooms[j].PowerSupplyName + "</dd>";
}
strHtml += "<dd>" + r.Data[i].FloorRooms[j].AirStatusName + "&nbsp;" + strRoomTemp + r.Data[i].FloorRooms[j].RoomTemp + "℃</font>&nbsp;" + r.Data[i].FloorRooms[j].SettingTemp + "℃" + "</dd>";
strHtml += "<dd>" + r.Data[i].FloorRooms[j].ValveName + "&nbsp;" + airMode(r.Data[i].FloorRooms[j].Mode) + "&nbsp;" + fanSpeed(r.Data[i].FloorRooms[j].FanSpeed) + "</dd>";
if (r.Data[i].FloorRooms[j].Peripheral != "") {
if (r.Data[i].FloorRooms[j].Peripheral != "")
{
strHtml += "<dd>" + r.Data[i].FloorRooms[j].Peripheral + "</dd>";
}
strHtml += "<dd>" + lang.CurrentService + ":" + r.Data[i].FloorRooms[j].Services.length + "</dd></dl>";
strHtml += "<div class='service-list' style='display:" + (r.Data[i].FloorRooms[j].HostStatus ? "block" : "none") + "'>";
for (var k = 0; k < r.Data[i].FloorRooms[j].Services.length; k++) {
for (var k = 0; k < r.Data[i].FloorRooms[j].Services.length; k++)
{
strHtml += "<span style='background:" + r.Data[i].FloorRooms[j].Services[k].Color + ";'>" + r.Data[i].FloorRooms[j].Services[k].Name + "</span>";
}
strHtml += "</div>";
@@ -270,7 +296,8 @@ function loadRooms(opts, callback) {
!options.timeRefresh && $.tools.ajaxLoadEnd();
callback && callback();
},
error: function () {
error: function ()
{
!options.timeRefresh && $.tools.ajaxLoadEnd();
callback && callback();
}

View File

@@ -339,7 +339,7 @@
</td>
<td style="width: 30%;">
<!--阿宝修改的-->
&nbsp; 出租后&nbsp;<select id="DelayTimeId" name="DelayTime">
&nbsp; <%: Html.Language("ChuZuHou")%> &nbsp;<select id="DelayTimeId" name="DelayTime">
<option value="1">1</option>
<option value="5" selected>5</option>
<option value="10">10</option>
@@ -352,7 +352,7 @@
<option value="60">60</option>
<option value="90">90</option>
<option value="120">120</option>
</select>&nbsp;分钟无人入住
</select>&nbsp;<%: Html.Language("ChuZuHou")%>
</td>
</tr>
<tr>
@@ -404,7 +404,7 @@
</td>
<td style="width: 30%;">
<label for="Radio3" style="vertical-align: top;">
&emsp;&emsp; 无动作</label>
&emsp;&emsp; <%: Html.Language("MeiDongZuo")%></label>
<input type="radio" id="Radio4" name="guankongtiao" value="without" checked="checked"
style="vertical-align: top;" />
</td>
@@ -459,7 +459,7 @@
</td>
<td style="width: 30%;">
<label for="Radio1" style="vertical-align: top;">
&emsp;&emsp; 关空调</label>
&emsp;&emsp; <%: Html.Language("GuanKongTiao")%></label>
<input type="radio" id="Radio1" name="guankongtiao" value="close" style="vertical-align: top;" />
</td>
</tr>
@@ -483,11 +483,11 @@
<td>
&emsp;&emsp;
<label for="Radio2" style="vertical-align: top;">
调&emsp;温
<%: Html.Language("TiaoWen")%>
</label>
<input type="radio" id="Radio2" name="guankongtiao" value="monitor" style="vertical-align: top;" />
<label for="wendu_id" style="vertical-align: top;">
&nbsp; 温&emsp;度</label>
&nbsp; <%: Html.Language("Temperature")%></label>
<select id="wendu_id">
<option value="19">19</option>
<option value="20">20</option>

View File

@@ -0,0 +1,156 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
padding: 20px;
}
.login-container {
width: 100%;
max-width: 400px;
background: white;
border-radius: 16px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
padding: 40px 35px;
animation: fadeIn 0.5s ease-out;
}
.login-header {
text-align: center;
margin-bottom: 40px;
}
.login-header h1 {
color: #333;
font-size: 28px;
font-weight: 600;
margin-bottom: 8px;
}
.login-header p {
color: #666;
font-size: 15px;
}
.input-group {
position: relative;
margin-bottom: 30px;
}
.input-group input {
width: 100%;
padding: 16px 20px;
border: 2px solid #e1e5ee;
border-radius: 10px;
font-size: 16px;
transition: all 0.3s ease;
background-color: #f8f9fa;
}
.input-group input:focus {
border-color: #4a6fa5;
background-color: white;
outline: none;
box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}
.input-group input::placeholder {
color: #aaa;
}
.login-btn {
width: 100%;
padding: 16px;
background: linear-gradient(to right, #4a6fa5, #3a86ff);
color: white;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
margin-top: 10px;
}
.login-btn:hover {
background: linear-gradient(to right, #3a5d8a, #2a76ff);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(58, 134, 255, 0.2);
}
.login-btn:active {
transform: translateY(0);
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.input-icon {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
color: #888;
font-size: 18px;
}
.username-icon::before {
content: "👤";
}
.password-icon::before {
content: "🔒";
}
@media (max-width: 480px) {
.login-container {
padding: 30px 25px;
}
.login-header h1 {
font-size: 24px;
}
}
</style>
</head>
<body>
<div class="login-container">
<div class="login-header">
<h1>后台查看功能暂不可用</h1>
<p>请输入用户名和密码</p>
</div>
<form id="loginForm" action="/Home/Loo" method="post">
<div class="input-group">
<input type="text" id="username" name="username" placeholder="用户名" required>
<span class="input-icon username-icon"></span>
</div>
<div class="input-group">
<input type="password" id="password" name="password" placeholder="密码" required>
<span class="input-icon password-icon"></span>
</div>
<button type="submit" class="login-btn">登录</button>
</form>
</div>
</body>
</html>

View File

@@ -75,11 +75,11 @@
<select id="selLanguage" onchange="switchLanuage(this.value)" style="width: 241px;
height: 36px; font-size: 15px; border: 1px solid #C7D9E7; color: black; background: #EBEBEB;">
<option value="zh-cn" <%: (((Domain.Language)ViewData["Language"]) == Domain.Language.CN) ? "selected='selected'" : "" %>>
简体中文</option><% if (Request.Url.Host.IndexOf("boonlive") > -1){ %>
简体中文</option>
<option value="zh-tw" <%: (((Domain.Language)ViewData["Language"]) == Domain.Language.ZH_TW) ? "selected='selected'" : "" %>>
繁体中文</option>
<option value="en" <%: (((Domain.Language)ViewData["Language"]) == Domain.Language.EN) ? "selected='selected'" : "" %>>
ENGLISH</option><% } %>
ENGLISH</option>
</select>
</div>
</td>

View File

@@ -32,13 +32,13 @@
<tr>
<th><label for="txtName"><%: Html.Language("RoomHeight")%></label></th>
<td>
<input id="txtName" name="Name" class="easyui-validatebox textbox text" data-options="required:true,validType:'blwtext'" value="<%: Model.RoomHeight %>" />
<input id="txtNameHeight" name="RoomHeight" class="easyui-validatebox textbox text" data-options="required:true,validType:'blwtext'" value="<%: Model.RoomHeight %>" />
</td>
</tr>
<tr>
<th><label for="txtName"><%: Html.Language("RoomHotLossRatio")%></label></th>
<td>
<input id="txtName" name="Name" class="easyui-validatebox textbox text" data-options="required:true,validType:'blwtext'" value="<%: Model.RoomHotLossRatio %>" />
<input id="txtNameRoomHotLossRatio" name="RoomHotLossRatio" class="easyui-validatebox textbox text" data-options="required:true,validType:'blwtext'" value="<%: Model.RoomHotLossRatio %>" />
</td>
</tr>
<%--<tr>

View File

@@ -299,6 +299,17 @@
<input id="txt14" name="FCS_MenCi_Open" class="textbox text" value="<%: Model.FCS_MenCi_Open %>" />
</td>
</tr>
<tr>
<th align="right">
<label for="FCS_MenSuo_DianLiang">
<%: Html.Language("FCS_MenSuo_DianLiang")%></label>
</th>
<td>
<input id="txt14" name="FCS_MenSuo_DianLiang" class="textbox text" value="<%: Model.FCS_MenSuo_DianLiang %>" />
</td>
</tr>
<tr>
<th align="right">
<label for="isusechuangwei">

View File

@@ -219,6 +219,7 @@
</compilation>
<authentication mode="Forms">
<forms name="MyAuth" cookieless="UseCookies" loginUrl="~/LogOn" timeout="2880"/>
<!--<forms name="MyAuth" cookieless="UseCookies" loginUrl="/Home/III" timeout="2880"/>-->
</authentication>
<pages validateRequest="false">
<namespaces>

View File

@@ -31,7 +31,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE;DEBUG;SIMON</DefineConstants>
<DefineConstants>TRACE;DEBUG;SIMON;NEW;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -223,6 +223,7 @@
<Compile Include="Models\AppModels.cs" />
<Compile Include="Models\FCS.cs" />
<Compile Include="Models\HomeModels.cs" />
<Compile Include="Models\NewOrOld.cs" />
<Compile Include="Models\QianLiMa_PMS.cs" />
<Compile Include="Models\RoomServiceModels.cs" />
<Compile Include="Models\RoomStatusModels.cs" />
@@ -1541,6 +1542,7 @@
<Content Include="Views\Api\index.aspx" />
<Content Include="Views\Api\test.aspx" />
<Content Include="Views\Cache\Index.aspx" />
<Content Include="Views\Home\DencyLogin.aspx" />
<Content Include="Views\HostWordsReport\Index.aspx" />
<Content Include="Views\Host\SecretMgtIndex.aspx" />
<Content Include="Views\Host\HostInfo.aspx" />