增加下位机下位机测试升级的功能

This commit is contained in:
2026-01-19 15:49:06 +08:00
parent 7a43c97047
commit f038ca3260
8 changed files with 91 additions and 29 deletions

Binary file not shown.

View File

@@ -84,6 +84,18 @@ namespace CommonEntity
public int Time { get; set; }
public DateTime? UpdateTime { get; set; }
public AirConditionData()
{
this.AirStatus=2;
this.FanSpeed=0;
this.Mode=0;
this.Valve=0;
this.CurrentTemp = 25;
this.SettingTemp = 25;
this.Valve = 0;
this.Time = 0;
this.UpdateTime=DateTime.Now;
}
}
public class RoomTypeModalCache

View File

@@ -1250,11 +1250,11 @@ namespace RCUHost.Implement
o.EndPoint = EndPointStr;
//新来的数据
var n = Newtonsoft.Json.JsonConvert.SerializeObject(o);
CSRedisCacheHelper.Set_PartitionWithTime(EndPointStr, n, 5, 4);
//上线
string EEE = CSRedisCacheHelper.Get<string>(EndPointStr);
//string EEE = CSRedisCacheHelper.Get<string>(EndPointStr);
var EEE = CSRedisCacheHelper.Get_Partition<string>(EndPointStr, 4);
var dtstart = CSRedisCacheHelper.ForeverGet<string>(CacheKey.ServerStartTime);
DateTime SSS = DateTime.Now;
DateTime.TryParse(dtstart, out SSS);
@@ -1263,6 +1263,7 @@ namespace RCUHost.Implement
{
CSRedisCacheHelper.Publish("redis-on_off_line", n);
}
CSRedisCacheHelper.Set_PartitionWithTime(EndPointStr, n, 5, 4);
@@ -1963,6 +1964,10 @@ namespace RCUHost.Implement
= false;
}
}
else
{
}
}
}
@@ -1982,10 +1987,10 @@ namespace RCUHost.Implement
//0x07短暂人离事件
//0x08长时间人离事件
var NOCardInfo = reader.ReadByte();
var NOCardInfo_NoFilter = NOCardInfo;
if (!nocard_enum.Contains(NOCardInfo))
{
NOCardInfo = 0x00;
NOCardInfo = 0x00;
}
#region BUG处理
//只有同派酒店做这个处理
@@ -2004,13 +2009,15 @@ namespace RCUHost.Implement
BitArray bitlist = new BitArray(N);
#region
int iii = 0;
for (int i = 0; i < bitlist.Length; i++)
{
if (i == 1)
{
continue;
}
string SerNo = i.ToString("000");
iii = i + 1;
//if (i == 1)
//{
// continue;
//}
string SerNo = iii.ToString("000");
//界面上显示,为了 兼容老版的 界面 显示逻辑,所以这样写
if (!string.IsNullOrEmpty(HostID))
@@ -2028,6 +2035,24 @@ namespace RCUHost.Implement
OldHostModal.Status = 2;
}
}
else
{
HostModal_Cache ccc = new HostModal_Cache();
ccc.HostID = int.Parse(HostID);
ccc.ModalType = DeviceType.ServiceInfo;
if (bitlist[i])
{
ccc.Status = 1;
}
else
{
ccc.Status = 2;
}
ccc.UpdateTime = DateTime.Now;
ccc.Modal = new RoomTypeModalCache() { };
ccc.AirConditionData = new AirConditionData();
CSRedisCacheHelper.Set_Partition<HostModal_Cache>(KKey,ccc);
}
}
//var hostModal1 = CSRedisCacheHelper.HMGet<NewVersionDeviceStatus>(1, QUDIANKey, "004000" + SerNo);
@@ -2095,6 +2120,7 @@ namespace RCUHost.Implement
//碳达人
var CarbonVIP = reader.ReadByte();
var CarbonVIP_NoFilter = CarbonVIP;
byte[] carbon_enum = new byte[] { 0x01, 0x02 };
if (!carbon_enum.Contains(CarbonVIP))
{
@@ -2291,6 +2317,7 @@ namespace RCUHost.Implement
#endregion
}
#region
long tf0 = Tools.GetUnixTime();
NengHao4BaoJing ns2 = new NengHao4BaoJing()
{
@@ -2320,6 +2347,7 @@ namespace RCUHost.Implement
string mns = Newtonsoft.Json.JsonConvert.SerializeObject(ns2);
CSRedisCacheHelper.Publish("redis-power", mns);
#endregion
#region TSlog
@@ -2330,15 +2358,15 @@ namespace RCUHost.Implement
device_id = HostNNN,
ip = EndPoint,
power_state = _Int,
cardless_state = Convert.ToUInt16(NOCardInfo),
cardless_state = Convert.ToUInt16(NOCardInfo_NoFilter),
guest_type = Convert.ToUInt16(IdentityInfo),
service_mask = BitConverter.ToUInt64(N, 0),
pms_state = Convert.ToUInt16(PMS),
carbon_state = Convert.ToUInt16(CarbonVIP),
carbon_state = Convert.ToUInt16(CarbonVIP_NoFilter),
device_count = DeviceCount_I,
comm_seq = MyFrameNO,
electricity=nenghaoList1,
air_conditioner=kongtiaoList,
electricity = nenghaoList1,
air_conditioner = kongtiaoList,
extra = new extra_data()
{
original_byte = OriginalByte

View File

@@ -399,7 +399,14 @@ namespace RCUHost.Implement
var hostModal = CSRedisCacheHelper.Get_Partition<HostModal_Cache>(KKey);
if (hostModal != null)
{
if (hostModal.AirConditionData==null)
{
hostModal.AirConditionData = new AirConditionData();
}
if (hostModal.Modal==null)
{
hostModal.Modal = new RoomTypeModalCache() { ModalAddress=device.Value.Address};
}
}
else
{

View File

@@ -3833,29 +3833,31 @@ namespace WebSite.Controllers
{
try
{
string b = Request.Form["roomTypeID"].ToString();
if (string.IsNullOrEmpty(b))
{
return Json(new { IsSuccess = false, Data = "roomTypeID不能为空" });
}
//1412
//固件:BLV-V9 || Launcher_C1F_V04 || C1F_A_L4_31_240723_NM.bin
//100331-YHF_T
//YHF_T
string host_list_str = Request.Form["hostid_lists"].ToString();
string fileName = Request.Form["upgradefileName"].ToString();
//2438
//研发测试房型_1
//固件:BLV-C5 || Launcher_C1F_V04 || C1F_A_L4_41_250605_NM.bin
string roomTypeID = "1412";
string host_list_str = "[24540]";
//string fileName = "C1F_A_L4_41_250704_NM.bin";
string fileName = "C1F_A_L4_31_240723_NM.bin";
if (string.IsNullOrEmpty(host_list_str))
{
return Json(new { IsSuccess = false, Data = "hostid_lists不能为空" });
}
ReallyUpgrade(b, host_list_str, fileName);
ReallyUpgrade(roomTypeID, host_list_str, fileName);
return Json(new { IsSuccess = true, Data = "正在升级,请等待……" });
}
catch (Exception ex)
{
logger.Error("定时升级出错:"+ex.Message);
return Json(new { IsSuccess = false, Data = ex.Message });
}
}
private void ReallyUpgrade(string ID, string host_list_str, string fileName)
{
int roomTypeID = 0;
@@ -3871,7 +3873,7 @@ namespace WebSite.Controllers
HostUpdateController hh = new HostUpdateController();
logger.Error("开始升级: " + fileName + " host_list: " + lll);
//升级
hh.ShengJI_NEW(host_list, fileName, HostManager);
hh.ShengJI_NEW(host_list, fileName, HostManager,roomTypeID);
}
[HttpPost()]

View File

@@ -384,7 +384,7 @@ namespace WebSite.Controllers
}
public ActionResult ShengJI_NEW(IList<int> idList, string fileName, IHostManager HostManager1)
public ActionResult ShengJI_NEW(IList<int> idList, string fileName, IHostManager HostManager1,int RoomTypeID)
{
try
{
@@ -410,7 +410,8 @@ namespace WebSite.Controllers
default:
return Json(new { IsSuccess = false, Message = "升级文件不合法!" });
}
string fileHref = "Uploads/room_type/" + hosts[hosts.Count - 1].RoomType.ID + "/" + fileName;//升级文件相对路径
//string fileHref = "Uploads/room_type/" + hosts[hosts.Count - 1].RoomType.ID + "/" + fileName;//升级文件相对路径
string fileHref = "Uploads/room_type/" + RoomTypeID + "/" + fileName;//升级文件相对路径
string fileMd5 = "";
using (Stream stream = System.IO.File.Open(Tools.GetApplicationPath() + fileHref, FileMode.Open))
{

11
WebSite/HTMLPage1.htm Normal file
View File

@@ -0,0 +1,11 @@
<!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>
<title></title>
<script src="Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>

View File

@@ -841,6 +841,7 @@
<Content Include="easyui-1.4.2\themes\metro\window.css" />
<Content Include="easyui-1.4.2\themes\mobile.css" />
<Content Include="Global.asax" />
<Content Include="HTMLPage1.htm" />
<Content Include="Images\app\Call.png" />
<Content Include="Images\app\loading.gif" />
<Content Include="Images\app\bottom.png" />