增加一些功能,比如 修正重启后,队列消费会报错的问题

This commit is contained in:
2026-04-02 15:16:13 +08:00
parent 182186e1fb
commit c13ab0cb56
25 changed files with 589 additions and 176 deletions

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
@@ -5327,7 +5330,7 @@ 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);
@@ -6421,7 +6424,7 @@ namespace WebSite.Controllers
}
catch (Exception ex)
{
logger.Error("同派出错:"+ex.Message);
logger.Error("同派出错:" + ex.Message);
return Json(new { IsSuccess = false, Message = HttpContext.InnerLanguage("SaveFailedBecause") + ex.Message });
}
}
@@ -6480,13 +6483,14 @@ 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();
return true;
}
#endregion
@@ -6642,7 +6646,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)
@@ -6653,7 +6657,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);
}
}
}
@@ -6815,7 +6819,7 @@ namespace WebSite.Controllers
{
try
{
HostServer.StopConsumerTasks();
//HostServer.StopConsumerTasks();
if (key.Equals("blw^_^wlb"))
{
var hostServer = (IHostServer)MvcApplication.cxt.GetObject("RCUHost.HostServer");

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

@@ -1081,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

@@ -47,9 +47,10 @@ 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; }
//private IGroupManager GroupManager;
//private IHostRoomCardManager HostRoomCardManager;
private syncstatus.syncstatusSoapClient _client = null;//房态同步接口
@@ -95,6 +96,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 +125,9 @@ namespace WebSite
}
catch { }
};
SetInitAccount();
StartHostServer();
//StartHostServerNew();
BLWMQTT.StartMqtt();
//if ("1" == send_to_debugger)
//{
// UDPLogServer.Init();
@@ -137,6 +139,10 @@ namespace WebSite
}
//HeartBeat();
QuanJuVar.BaoJingUpLoad = RoomTypeModalManager.LoadAllBaoJingUpload();
StartHostServer();
BLWMQTT.StartMqtt();
long ll1 = CSRedisCacheHelper.ForeverGet<long>(UDPLostKey);
@@ -519,6 +525,7 @@ 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");
_client = new syncstatus.syncstatusSoapClient();
Timer timer2 = new Timer(20000);//每20秒扫描一次
@@ -739,7 +746,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

@@ -1312,6 +1312,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 CheckIn 的本地化字符串。
/// </summary>
internal static string ChuZuHou {
get {
return ResourceManager.GetString("ChuZuHou", resourceCulture);
}
}
/// <summary>
/// 查找类似 Circuit 的本地化字符串。
/// </summary>
@@ -3022,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>
@@ -4462,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>
@@ -7486,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

@@ -2914,4 +2914,19 @@ Single circuit status</value>
<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>
@@ -3021,6 +3030,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 关空调 的本地化字符串。
/// </summary>
internal static string GuanKongTiao {
get {
return ResourceManager.GetString("GuanKongTiao", resourceCulture);
}
}
/// <summary>
/// 查找类似 客房 的本地化字符串。
/// </summary>
@@ -4461,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>
@@ -7494,6 +7530,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 调温 的本地化字符串。
/// </summary>
internal static string TiaoWen {
get {
return ResourceManager.GetString("TiaoWen", resourceCulture);
}
}
/// <summary>
/// 查找类似 收拾餐盘 的本地化字符串。
/// </summary>

View File

@@ -2916,4 +2916,19 @@
<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>
@@ -3021,6 +3030,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 关空调 的本地化字符串。
/// </summary>
internal static string GuanKongTiao {
get {
return ResourceManager.GetString("GuanKongTiao", resourceCulture);
}
}
/// <summary>
/// 查找类似 客房 的本地化字符串。
/// </summary>
@@ -4461,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>
@@ -7496,6 +7532,15 @@ namespace WebSite.Resource {
}
}
/// <summary>
/// 查找类似 调温 的本地化字符串。
/// </summary>
internal static string TiaoWen {
get {
return ResourceManager.GetString("TiaoWen", resourceCulture);
}
}
/// <summary>
/// 查找类似 收拾餐盤 的本地化字符串。
/// </summary>

View File

@@ -2918,4 +2918,19 @@
<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

@@ -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

@@ -218,7 +218,8 @@
</assemblies>
</compilation>
<authentication mode="Forms">
<forms name="MyAuth" cookieless="UseCookies" loginUrl="~/LogOn" timeout="2880"/>
<!--<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

@@ -1541,6 +1541,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" />