diff --git a/CRICS_V3_1124.suo b/CRICS_V3_1124.suo index 5d3a9c6..1dd2740 100644 Binary files a/CRICS_V3_1124.suo and b/CRICS_V3_1124.suo differ diff --git a/Common/OnOffLineData.cs b/Common/OnOffLineData.cs index 8e96055..a4f6cb6 100644 --- a/Common/OnOffLineData.cs +++ b/Common/OnOffLineData.cs @@ -14,6 +14,7 @@ namespace Common public string EndPoint { get; set; } public string CurrentStatus { get; set; } public DateTime CurrentTime { get; set; } + public long UnixTime { get; set; } } } diff --git a/Common/StructConverter.cs b/Common/StructConverter.cs index 393b2a3..de024ea 100644 --- a/Common/StructConverter.cs +++ b/Common/StructConverter.cs @@ -77,7 +77,7 @@ namespace Common Marshal.Copy(bytes, startIndex, structPtr, size); structObj = Marshal.PtrToStructure(structPtr, type); } - catch (Exception) + catch (Exception ex) { } finally diff --git a/CommonEntity/DataTongJi.cs b/CommonEntity/DataTongJi.cs index edaa65c..15d2a24 100644 --- a/CommonEntity/DataTongJi.cs +++ b/CommonEntity/DataTongJi.cs @@ -339,7 +339,7 @@ namespace CommonEntity public string cmd_word { get; set; } public int frame_id { get; set; } - public string udp_raw { get; set; } + public byte[] udp_raw { get; set; } public int sys_lock_status { get; set; } public int report_count { get; set; } diff --git a/ConsoleApplication2/ConsoleApplication2.csproj b/ConsoleApplication2/ConsoleApplication2.csproj index 7b21eb6..14396ee 100644 --- a/ConsoleApplication2/ConsoleApplication2.csproj +++ b/ConsoleApplication2/ConsoleApplication2.csproj @@ -36,7 +36,7 @@ full false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;AAA;BBB;CCC; prompt 4 diff --git a/ConsoleApplication2/Program.cs b/ConsoleApplication2/Program.cs index 7526bcc..d3ad2b9 100644 --- a/ConsoleApplication2/Program.cs +++ b/ConsoleApplication2/Program.cs @@ -275,7 +275,8 @@ namespace ConsoleApplication2 d1.device_id = hostNumber; d1.frame_id = zhenhao; d1.cmd_word = "0F"; - d1.udp_raw = Tools.ByteToString(data); + //d1.udp_raw = Tools.ByteToString(data); + d1.udp_raw = data; d1.direction = "下发"; List lll1 = new List(); @@ -300,6 +301,11 @@ namespace ConsoleApplication2 } static void Main(string[] args) { +#if AAA + Console.WriteLine("aaaaaaaaaaaaa"); +#endif + + AAA(); string aaa111 = "233003"; var bj1 = aaa111.Substring(0, 3); diff --git a/Domain/SysHotel.cs b/Domain/SysHotel.cs index 3cebbf4..9e863a0 100644 --- a/Domain/SysHotel.cs +++ b/Domain/SysHotel.cs @@ -440,5 +440,9 @@ namespace Domain ///// //public virtual string TCLAppSecret { get; set; } public virtual string ETV_HotelID { get; set; } + public virtual int SwitchRoomStatus_PowerOff2 { get; set; } + public virtual int SwitchRoomStatus_PowerOff4 { get; set; } + public virtual int SwitchRoomStatus_PowerOff8 { get; set; } + public virtual int SwitchRoomStatus_PowerOff16 { get; set; } } } diff --git a/Domain/SysHotel.hbm.xml b/Domain/SysHotel.hbm.xml index 8cacd5b..b5d0a4f 100644 --- a/Domain/SysHotel.hbm.xml +++ b/Domain/SysHotel.hbm.xml @@ -74,6 +74,10 @@ + + + + diff --git a/RCUHost/Implement/GenericReceiverBase.cs b/RCUHost/Implement/GenericReceiverBase.cs index b2380f2..294346e 100644 --- a/RCUHost/Implement/GenericReceiverBase.cs +++ b/RCUHost/Implement/GenericReceiverBase.cs @@ -246,7 +246,7 @@ namespace RCUHost.Implement 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 lll3 = new List(); diff --git a/RCUHost/Implement/HostServer.cs b/RCUHost/Implement/HostServer.cs index b211629..8a0233d 100644 --- a/RCUHost/Implement/HostServer.cs +++ b/RCUHost/Implement/HostServer.cs @@ -406,6 +406,7 @@ namespace RCUHost.Implement DataTongJi.TotalCount.TryAdd(TotalKey, u); } + //logger.Error("升级拉取指令:" + Tools.ByteToString(data)); udpClient.Send(data, data.Length, endPoint); // 使用同一个 Socket 发送回复 //udpClient.SendTo(data, endPoint); @@ -1247,6 +1248,10 @@ namespace RCUHost.Implement byte cmdType = context111.SystemHeader.Value.CmdType; + if (cmdType == 0x68) + { + logger.Error("收到升级返回:" + Tools.ByteToString(gga.Data)); + } ushort MyFrameNO = context111.SystemHeader.Value.FrameNo; byte[] framenolist = BitConverter.GetBytes(MyFrameNO); @@ -1274,6 +1279,7 @@ namespace RCUHost.Implement o.CurrentStatus = "on"; o.CurrentTime = DateTime.Now; o.EndPoint = EndPointStr; + o.UnixTime = Tools.GetUnixTime(); //新来的数据 var n = Newtonsoft.Json.JsonConvert.SerializeObject(o); @@ -1358,7 +1364,7 @@ namespace RCUHost.Implement d1.device_id = HostNNN; d1.frame_id = MyFrameNO; d1.cmd_word = "0F"; - d1.udp_raw = Tools.ByteToString(OriginalByte); + d1.udp_raw = OriginalByte; d1.direction = "上报"; string sss = Newtonsoft.Json.JsonConvert.SerializeObject(d1); CSRedisCacheHelper.Publish("redis-0X36-0X0F", sss); @@ -1857,7 +1863,7 @@ namespace RCUHost.Implement d1.device_id = HostNNN; d1.frame_id = MyFrameNO; d1.cmd_word = "36"; - d1.udp_raw = Tools.ByteToString(OriginalByte); + d1.udp_raw = OriginalByte; d1.direction = "上报"; List lll1 = new List(); diff --git a/RCUHost/Implement/New_RoomStatusReceiver.cs b/RCUHost/Implement/New_RoomStatusReceiver.cs index e543701..826bb12 100644 --- a/RCUHost/Implement/New_RoomStatusReceiver.cs +++ b/RCUHost/Implement/New_RoomStatusReceiver.cs @@ -827,21 +827,21 @@ namespace RCUHost.Implement #endregion case DeviceType.AirConditioner://空调 #region 空调 - //status = device.Value.StatusReceiver >> 15;//开关 - //int mode = (device.Value.StatusReceiver >> 13) & 0x03;//模式 - //int fanSpeed = (device.Value.StatusReceiver >> 11) & 0x03;//风速 - //int valve = (device.Value.StatusReceiver >> 10) & 0x01;//阀门 - //int temperature = (device.Value.StatusReceiver >> 5) & 0x1F;//设定温度 - //int currentTemp = device.Value.StatusReceiver & 0x01F;//当前温度(室内温度) - - int StatusReceiver = device.Value.StatusReceiver; - status = StatusReceiver >> 15;//开关 - int mode = (StatusReceiver >> 12) & 0x03;//模式 - int fanSpeed = (StatusReceiver >> 11) & 0x03;//风速 - int valve = (StatusReceiver >> 10) & 0x01;//阀门 - int temperature = (StatusReceiver >> 5) & 0x1F;//设定温度 - int currentTemp = StatusReceiver & 0x01F;//当前温度(室内温度) + status = device.Value.StatusReceiver >> 15;//开关 + int mode = (device.Value.StatusReceiver >> 13) & 0x03;//模式 + int fanSpeed = (device.Value.StatusReceiver >> 11) & 0x03;//风速 + int valve = (device.Value.StatusReceiver >> 10) & 0x01;//阀门 + int temperature = (device.Value.StatusReceiver >> 5) & 0x1F;//设定温度 + int currentTemp = device.Value.StatusReceiver & 0x01F;//当前温度(室内温度) + + + //status = StatusReceiver >> 15;//开关 + //int mode = (StatusReceiver >> 12) & 0x03;//模式 + //int fanSpeed = (StatusReceiver >> 11) & 0x03;//风速 + //int valve = (StatusReceiver >> 10) & 0x01;//阀门 + //int temperature = (StatusReceiver >> 5) & 0x1F;//设定温度 + //int currentTemp = StatusReceiver & 0x01F;//当前温度(室内温度) #region 任务 if (status == 1)//设备开 { diff --git a/RCUHost/Implement/UpdateHostReceiver.cs b/RCUHost/Implement/UpdateHostReceiver.cs index e13c7c3..76d1715 100644 --- a/RCUHost/Implement/UpdateHostReceiver.cs +++ b/RCUHost/Implement/UpdateHostReceiver.cs @@ -85,6 +85,8 @@ namespace RCUHost.Implement public override void Process(ReceiverContext context1) { int startIndex = StructConverter.SizeOf(context1.SystemHeader); + //var mydata = Tools.ByteToString(context1.Data); + //logger.Error(string.Format("升级返回:{0}", mydata)); UpdateHostPacketReply? reply1 = DecodeUpdateHostPacketReply(context1.Data, startIndex); var TTT = new Tuple(context1, reply1); //logger.Error(string.Format("收到tftp升级回复命令({0}:{1}):{2},解析结果:{3}", context.RemoteEndPoint.Address.ToString(), context.RemoteEndPoint.Port, Tools.ByteToString(context.Data), reply.HasValue)); @@ -96,8 +98,8 @@ namespace RCUHost.Implement var context = NNN.Item1; var reply = NNN.Item2; var updateHostWorker = this.updateHostList.FirstOrDefault(r => r.Host.HostNumber == context.SystemHeader.Value.HostNumber.ToString()); - var data= Tools.ByteToString( context1.Data); - logger.Error(string.Format("主机{0}升级返回:{1}", context.SystemHeader.Value.HostNumber.ToString(),data)); + var data = Tools.ByteToString(context1.Data); + logger.Error(string.Format("主机{0}升级返回:{1}", context.SystemHeader.Value.HostNumber.ToString(), data)); if (updateHostWorker == null) { return; @@ -215,10 +217,10 @@ namespace RCUHost.Implement /// 升级文件MD5值 private void SendUpdateRequest(Host host, string updateFileMd5, ushort blockNum, byte fileType, string fileName) { - logger.Error("主机升级:"+host.SysHotel.Code+":"+host.RoomNumber+" FileMd5:"+updateFileMd5+" FileName:"+fileName); + logger.Error("主机升级:" + host.SysHotel.Code + ":" + host.RoomNumber + " FileMd5:" + updateFileMd5 + " FileName:" + fileName); byte[] data = CreateUpdateRequestPacket(updateFileMd5, blockNum, fileType, fileName); - logger.Error("升级HostNumber为:"+host.HostNumber); - logger.Error("升级指令为:"+Tools.ByteToString(data)); + logger.Error("升级HostNumber为:" + host.HostNumber); + logger.Error("升级指令为:" + Tools.ByteToString(data)); Send(data, host.HostNumber, host.MAC);// host.IP, host.Port); } /// diff --git a/WebSite/Controllers/SysHotelController.cs b/WebSite/Controllers/SysHotelController.cs index 4384b60..2a36927 100644 --- a/WebSite/Controllers/SysHotelController.cs +++ b/WebSite/Controllers/SysHotelController.cs @@ -306,6 +306,10 @@ namespace WebSite.Controllers sysHotel.IsPushPMSData = entity.IsPushPMSData; sysHotel.HeTongNumber = entity.HeTongNumber; sysHotel.ETV_HotelID = entity.ETV_HotelID; + sysHotel.SwitchRoomStatus_PowerOff2 = entity.SwitchRoomStatus_PowerOff2; + sysHotel.SwitchRoomStatus_PowerOff4 = entity.SwitchRoomStatus_PowerOff4; + sysHotel.SwitchRoomStatus_PowerOff8 = entity.SwitchRoomStatus_PowerOff8; + sysHotel.SwitchRoomStatus_PowerOff16 = entity.SwitchRoomStatus_PowerOff16; //sysHotel.TCLAppId = entity.TCLAppId; //sysHotel.TCLAppSecret = entity.TCLAppSecret; SysHotelManager.Update(sysHotel); @@ -390,6 +394,12 @@ namespace WebSite.Controllers TakeOut.SysHotel.IsPushPMSData = entity.IsPushPMSData; TakeOut.SysHotel.HeTongNumber = entity.HeTongNumber; TakeOut.SysHotel.ETV_HotelID = entity.ETV_HotelID; + + + TakeOut.SysHotel.SwitchRoomStatus_PowerOff2 = entity.SwitchRoomStatus_PowerOff2; + TakeOut.SysHotel.SwitchRoomStatus_PowerOff4 = entity.SwitchRoomStatus_PowerOff4; + TakeOut.SysHotel.SwitchRoomStatus_PowerOff8 = entity.SwitchRoomStatus_PowerOff8; + TakeOut.SysHotel.SwitchRoomStatus_PowerOff16 = entity.SwitchRoomStatus_PowerOff16; //TakeOut.SysHotel.TCLAppId = entity.TCLAppId; //TakeOut.SysHotel.TCLAppSecret = entity.TCLAppSecret; diff --git a/WebSite/Global.asax.cs b/WebSite/Global.asax.cs index 2b9a109..7aecf97 100644 --- a/WebSite/Global.asax.cs +++ b/WebSite/Global.asax.cs @@ -47,6 +47,7 @@ namespace WebSite private IRoomStatusManager RoomStatusManager; private IDeviceControlReceiver DeviceControlReceiver; private IOverviewManager OverviewManager { get; set; } + public IHostModalManager HostModalManager { get; set; } public static IHostServer hostServer { get; set; } //private IGroupManager GroupManager; @@ -521,6 +522,7 @@ namespace WebSite RoomStatusManager = (IRoomStatusManager)cxt.GetObject("Manager.RoomStatus"); DeviceControlReceiver = (IDeviceControlReceiver)cxt.GetObject("RCUHost.DeviceControlReceiver"); OverviewManager = (IOverviewManager)cxt.GetObject("Manager.Overview"); + HostModalManager = (IHostModalManager)cxt.GetObject("Manager.HostModal"); _client = new syncstatus.syncstatusSoapClient(); Timer timer2 = new Timer(20000);//每20秒扫描一次 @@ -735,6 +737,19 @@ namespace WebSite Host host = HostManager.GetByRoomNumber(T1.Item2, T1.Item1); if (host != null) { + int status_id2 = host.SysHotel.SwitchRoomStatus_PowerOff2; + int status_id4 = host.SysHotel.SwitchRoomStatus_PowerOff4; + int status_id8 = host.SysHotel.SwitchRoomStatus_PowerOff8; + 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) + { + HostModal h1 = new HostModal(); + h1.Modal = new RoomTypeModal() { ModalAddress = "004000001", Type = DeviceType.ServiceInfo }; + HostModalManager.SetDevice(host, h1, 2, 0, 25, 0, 0, 0); + } + } HostManager.ChangeRoomStatus(host, T1.Item3); string Key = CacheKey.SyncRoomStatus + "_" + host.HostNumber; RoomStatusRequest ddd = new RoomStatusRequest(); diff --git a/WebSite/Resource/en-US.Designer.cs b/WebSite/Resource/en-US.Designer.cs index 0d42286..49ac721 100644 --- a/WebSite/Resource/en-US.Designer.cs +++ b/WebSite/Resource/en-US.Designer.cs @@ -1303,6 +1303,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 Apartment for Rent 的本地化字符串。 + /// + internal static string ChuZu { + get { + return ResourceManager.GetString("ChuZu", resourceCulture); + } + } + /// /// 查找类似 Circuit 的本地化字符串。 /// @@ -1663,6 +1672,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 For Rent 的本地化字符串。 + /// + internal static string DaiZu { + get { + return ResourceManager.GetString("DaiZu", resourceCulture); + } + } + /// /// 查找类似 Data 的本地化字符串。 /// @@ -6028,6 +6046,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 Switch RoomStatus To Power Off 的本地化字符串。 + /// + internal static string RoomStatusSwitch { + get { + return ResourceManager.GetString("RoomStatusSwitch", resourceCulture); + } + } + /// /// 查找类似 Temp 的本地化字符串。 /// @@ -7657,6 +7684,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 CheckOut 的本地化字符串。 + /// + internal static string TuiFang { + get { + return ResourceManager.GetString("TuiFang", resourceCulture); + } + } + /// /// 查找类似 TV 的本地化字符串。 /// diff --git a/WebSite/Resource/en-US.resx b/WebSite/Resource/en-US.resx index 97a47ad..2867527 100644 --- a/WebSite/Resource/en-US.resx +++ b/WebSite/Resource/en-US.resx @@ -2899,4 +2899,16 @@ Single circuit status WelcomeBGM + + Apartment for Rent + + + For Rent + + + CheckOut + + + Switch RoomStatus To Power Off + \ No newline at end of file diff --git a/WebSite/Resource/zh-CN.Designer.cs b/WebSite/Resource/zh-CN.Designer.cs index 75e96e9..f774087 100644 --- a/WebSite/Resource/zh-CN.Designer.cs +++ b/WebSite/Resource/zh-CN.Designer.cs @@ -1302,6 +1302,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 出租 的本地化字符串。 + /// + internal static string ChuZu { + get { + return ResourceManager.GetString("ChuZu", resourceCulture); + } + } + /// /// 查找类似 回路 的本地化字符串。 /// @@ -1662,6 +1671,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 待租 的本地化字符串。 + /// + internal static string DaiZu { + get { + return ResourceManager.GetString("DaiZu", resourceCulture); + } + } + /// /// 查找类似 数据 的本地化字符串。 /// @@ -6045,6 +6063,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 状态更新断电 的本地化字符串。 + /// + internal static string RoomStatusSwitch { + get { + return ResourceManager.GetString("RoomStatusSwitch", resourceCulture); + } + } + /// /// 查找类似 客房温度 的本地化字符串。 /// @@ -7665,6 +7692,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 退房 的本地化字符串。 + /// + internal static string TuiFang { + get { + return ResourceManager.GetString("TuiFang", resourceCulture); + } + } + /// /// 查找类似 电视 的本地化字符串。 /// diff --git a/WebSite/Resource/zh-CN.resx b/WebSite/Resource/zh-CN.resx index c19a4b0..e3a4562 100644 --- a/WebSite/Resource/zh-CN.resx +++ b/WebSite/Resource/zh-CN.resx @@ -2901,4 +2901,16 @@ 欢迎背景乐 + + 出租 + + + 待租 + + + 状态更新断电 + + + 退房 + \ No newline at end of file diff --git a/WebSite/Resource/zh-TW.Designer.cs b/WebSite/Resource/zh-TW.Designer.cs index 91a72cd..ef792db 100644 --- a/WebSite/Resource/zh-TW.Designer.cs +++ b/WebSite/Resource/zh-TW.Designer.cs @@ -1302,6 +1302,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 出租 的本地化字符串。 + /// + internal static string ChuZu { + get { + return ResourceManager.GetString("ChuZu", resourceCulture); + } + } + /// /// 查找类似 回路 的本地化字符串。 /// @@ -1662,6 +1671,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 待租 的本地化字符串。 + /// + internal static string DaiZu { + get { + return ResourceManager.GetString("DaiZu", resourceCulture); + } + } + /// /// 查找类似 數據 的本地化字符串。 /// @@ -6045,6 +6063,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 切換狀態即斷電 的本地化字符串。 + /// + internal static string RoomStatusSwitch { + get { + return ResourceManager.GetString("RoomStatusSwitch", resourceCulture); + } + } + /// /// 查找类似 客房溫度 的本地化字符串。 /// @@ -7667,6 +7694,15 @@ namespace WebSite.Resource { } } + /// + /// 查找类似 退房 的本地化字符串。 + /// + internal static string TuiFang { + get { + return ResourceManager.GetString("TuiFang", resourceCulture); + } + } + /// /// 查找类似 電視 的本地化字符串。 /// diff --git a/WebSite/Resource/zh-TW.resx b/WebSite/Resource/zh-TW.resx index e7748c0..a20781a 100644 --- a/WebSite/Resource/zh-TW.resx +++ b/WebSite/Resource/zh-TW.resx @@ -2903,4 +2903,16 @@ 歡迎詞背景樂 + + 出租 + + + 待租 + + + 切換狀態即斷電 + + + 退房 + \ No newline at end of file diff --git a/WebSite/Views/SysHotel/EditDockingInfo.ascx b/WebSite/Views/SysHotel/EditDockingInfo.ascx index e7f86e6..d3dc814 100644 --- a/WebSite/Views/SysHotel/EditDockingInfo.ascx +++ b/WebSite/Views/SysHotel/EditDockingInfo.ascx @@ -388,6 +388,17 @@ + + + + <%: Html.Language("RoomStatusSwitch")%>: + + + /> <%: Html.Language("ChuZu")%> + /> <%: Html.Language("DaiZu")%> + /> <%: Html.Language("TuiFang")%> + + <%-- TCL 功能--%> <%--