diff --git a/CRICS_V3_1124.suo b/CRICS_V3_1124.suo index c2e1977..4ad139b 100644 Binary files a/CRICS_V3_1124.suo and b/CRICS_V3_1124.suo differ diff --git a/CommonEntity/LMRegisterInfo.cs b/CommonEntity/LMRegisterInfo.cs index 6f082a2..79700e4 100644 --- a/CommonEntity/LMRegisterInfo.cs +++ b/CommonEntity/LMRegisterInfo.cs @@ -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; } /// /// RCU 时间,年月日 那种 /// @@ -68,8 +68,8 @@ namespace CommonEntity /// /// 授权时间 /// - 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; } diff --git a/RCUHost/Implement/HostRegisterReceiver.cs b/RCUHost/Implement/HostRegisterReceiver.cs index 70b21c3..e8ff2dd 100644 --- a/RCUHost/Implement/HostRegisterReceiver.cs +++ b/RCUHost/Implement/HostRegisterReceiver.cs @@ -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,8 +285,12 @@ 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, diff --git a/RCUHost/Implement/HostServer.cs b/RCUHost/Implement/HostServer.cs index 3e0879d..8a3c95a 100644 --- a/RCUHost/Implement/HostServer.cs +++ b/RCUHost/Implement/HostServer.cs @@ -2562,7 +2562,7 @@ namespace RCUHost.Implement { if (fanspeed == 2 || fanspeed == 3) { - string KKKSpec = HostNNN + "_" + address; + string KKKSpec = HostNNN + "_" + address+"_"+HostID; if (status == 1) { string ReportTime111 = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); @@ -2593,6 +2593,18 @@ namespace RCUHost.Implement { string KKey = CacheKey.HostModalStatus_Prefix + "_" + HostID + "_" + address; var HHostModalData = CSRedisCacheHelper.Get_Partition(KKey); + + if (HHostModalData==null) + { + HHostModalData = new HostModal_Cache(); + HHostModalData.HostID = int.Parse(HostID); + HHostModalData.ModalType = DeviceType.AirConditioner; + HHostModalData.AirConditionData = new AirConditionData(); + HHostModalData.Modal = new RoomTypeModalCache() + { + ModalAddress = address + }; + } if (HHostModalData != null) { HHostModalData.AirConditionData.AirStatus = status; @@ -2629,11 +2641,8 @@ namespace RCUHost.Implement } CSRedisCacheHelper.Set_Partition(KKey, HHostModalData); } - - } } - } #endregion } diff --git a/Service/Implement/HostModalManager.cs b/Service/Implement/HostModalManager.cs index af2f21b..07d86aa 100644 --- a/Service/Implement/HostModalManager.cs +++ b/Service/Implement/HostModalManager.cs @@ -126,14 +126,15 @@ namespace Service.Implement device.MusicExecMode = status + (brightness << 12) + (mode << 8);//背景音乐执行方式和内容 //device.ColorTempExecMode = status + (brightness << 12) + (temperature << 8);//色温执行方式和内容 - var t = new Tuple(host, device); - System.Threading.Tasks.Task.Factory.StartNew((state) => - { - var t1 = state as Tuple; - var host1 = t1.Item1; - var device1 = t1.Item2; - DeviceControlReceiver.Send(host1, device1);//发送命令 - }, t, System.Threading.CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); + DeviceControlReceiver.Send(host, device);//发送命令 + //var t = new Tuple(host, device); + //System.Threading.Tasks.Task.Factory.StartNew((state) => + //{ + // var t1 = state as Tuple; + // var host1 = t1.Item1; + // var device1 = t1.Item2; + // DeviceControlReceiver.Send(host1, device1);//发送命令 + //}, t, System.Threading.CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); } diff --git a/WebSite/Controllers/ApiController.cs b/WebSite/Controllers/ApiController.cs index e018b46..390c89a 100644 --- a/WebSite/Controllers/ApiController.cs +++ b/WebSite/Controllers/ApiController.cs @@ -6385,6 +6385,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 +6401,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(KKey); + + var temp = HHostModalData.AirConditionData.SettingTemp; + var mode = HHostModalData.AirConditionData.Mode; + HostModalManager.SetDevice(host, hostModal, 0, 0, temp, 0, mode, 0); } } } @@ -6408,6 +6422,7 @@ namespace WebSite.Controllers } catch (Exception ex) { + logger.Error("同派出错:"+ex.Message); return Json(new { IsSuccess = false, Message = HttpContext.InnerLanguage("SaveFailedBecause") + ex.Message }); } } diff --git a/WebSite/Controllers/IoTController.cs b/WebSite/Controllers/IoTController.cs index 3c4a29f..a12f134 100644 --- a/WebSite/Controllers/IoTController.cs +++ b/WebSite/Controllers/IoTController.cs @@ -1576,6 +1576,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 +1633,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); }