初始化CRICS
This commit is contained in:
68
WebSite/Models/ActiveUserModels.cs
Normal file
68
WebSite/Models/ActiveUserModels.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 在线用户
|
||||
/// </summary>
|
||||
public class ActiveUserModel
|
||||
{
|
||||
public string ID { get; set; }
|
||||
public string Account { get; set; }
|
||||
public string LoginIP { get; set; }
|
||||
}
|
||||
|
||||
public class ActiveUserCollection : ICollection<ActiveUserModel>
|
||||
{
|
||||
private IList<ActiveUserModel> activeUserList = new List<ActiveUserModel>();
|
||||
|
||||
public void Add(ActiveUserModel item)
|
||||
{
|
||||
activeUserList.Add(item);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
activeUserList.Clear();
|
||||
}
|
||||
|
||||
public bool Contains(ActiveUserModel item)
|
||||
{
|
||||
return item != null && item.ID == item.ID;
|
||||
}
|
||||
|
||||
public void CopyTo(ActiveUserModel[] array, int arrayIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return activeUserList.Count; }
|
||||
}
|
||||
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get { return activeUserList.IsReadOnly; }
|
||||
}
|
||||
|
||||
public bool Remove(ActiveUserModel item)
|
||||
{
|
||||
return activeUserList.Remove(item);
|
||||
}
|
||||
|
||||
public IEnumerator<ActiveUserModel> GetEnumerator()
|
||||
{
|
||||
return activeUserList.GetEnumerator();
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return activeUserList.GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
13
WebSite/Models/ApiModels.cs
Normal file
13
WebSite/Models/ApiModels.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Domain;
|
||||
|
||||
namespace WebSite.Models.ApiModels
|
||||
{
|
||||
public class ApiRoomTypeModal
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
22
WebSite/Models/AppModels.cs
Normal file
22
WebSite/Models/AppModels.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Domain;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
public class CurtainModel
|
||||
{
|
||||
public CurtainOpenCloseModel CurtainOpen { get; set; }
|
||||
public CurtainOpenCloseModel CurtainClose { get; set; }
|
||||
}
|
||||
|
||||
public class CurtainOpenCloseModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Address { get; set; }
|
||||
public DeviceSubtype Subtype { get; set; }
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
27
WebSite/Models/FCS.cs
Normal file
27
WebSite/Models/FCS.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using RestSharp;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
public class FCS
|
||||
{
|
||||
public static string FCSLoginUrl = "https://api.fcs1cloud.com/api/security/authenticate";
|
||||
public void Login()
|
||||
{
|
||||
string str = Newtonsoft.Json.JsonConvert.SerializeObject("");
|
||||
var client1 = new RestClient(FCSLoginUrl);
|
||||
var request1 = new RestRequest("/", Method.POST);
|
||||
|
||||
//注意方法是POST
|
||||
//两个参数名字必须是 topic 和payload ,区分大小写的
|
||||
request1.AddParameter("topic", "");
|
||||
request1.AddParameter("payload", str);
|
||||
|
||||
|
||||
client1.ExecuteAsync(request1, (response) => { });
|
||||
}
|
||||
}
|
||||
}
|
||||
13
WebSite/Models/HomeModels.cs
Normal file
13
WebSite/Models/HomeModels.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
public class SystemConfigModel
|
||||
{
|
||||
public string MessageIP { get; set; }
|
||||
public int MessagePort { get; set; }
|
||||
}
|
||||
}
|
||||
25
WebSite/Models/QianLiMa_PMS.cs
Normal file
25
WebSite/Models/QianLiMa_PMS.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using RestSharp;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
public class QianLiMa_PMS
|
||||
{
|
||||
public static string FCSLoginUrl = "http://blv-rd.tech:19056";
|
||||
public static void QiYong(string hotel_code,string add_or_remove)
|
||||
{
|
||||
var client1 = new RestClient(FCSLoginUrl);
|
||||
var request1 = new RestRequest("/api/Values/PostData", Method.POST);
|
||||
|
||||
//注意方法是POST
|
||||
//两个参数名字必须是 topic 和payload ,区分大小写的
|
||||
request1.AddQueryParameter("hotelcode", hotel_code);
|
||||
request1.AddQueryParameter("add_or_remove", add_or_remove); ;
|
||||
|
||||
client1.ExecuteAsync(request1, (response) => { });
|
||||
}
|
||||
}
|
||||
}
|
||||
25
WebSite/Models/RoomServiceModels.cs
Normal file
25
WebSite/Models/RoomServiceModels.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询统计中查询条件使用
|
||||
/// </summary>
|
||||
public class QueryConditionModel
|
||||
{
|
||||
public string Order { get; set; }
|
||||
|
||||
public string Sort { get; set; }
|
||||
|
||||
public string RoomNumber { get; set; }
|
||||
|
||||
public string StartTime { get; set; }
|
||||
|
||||
public string EndTime { get; set; }
|
||||
|
||||
public string AlarmCodes { get; set; }
|
||||
}
|
||||
}
|
||||
208
WebSite/Models/RoomStatusModels.cs
Normal file
208
WebSite/Models/RoomStatusModels.cs
Normal file
@@ -0,0 +1,208 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
public class FloorModel
|
||||
{
|
||||
private IList<RoomModel> floorRooms = new List<RoomModel>();
|
||||
|
||||
public IList<RoomModel> FloorRooms
|
||||
{
|
||||
get { return this.floorRooms; }
|
||||
set { if (value != null) { this.floorRooms = value; } }
|
||||
}
|
||||
|
||||
public int Sort { get; set; }
|
||||
}
|
||||
|
||||
public class RoomModel
|
||||
{
|
||||
private string roomNumber = "";
|
||||
|
||||
private string roomStatus = "";
|
||||
|
||||
private IList<ServiceModel> services = new List<ServiceModel>();
|
||||
private IList<AirDetectModel> airDetect = new List<AirDetectModel>();
|
||||
private IList<RoomCustomer> customers = new List<RoomCustomer>();
|
||||
|
||||
public int ID { get; set; }
|
||||
/// <summary>
|
||||
/// 主机状态:是否在线
|
||||
/// </summary>
|
||||
public bool HostStatus { get; set; }
|
||||
|
||||
//public ServiceModel CurrentService { get { return new ServiceModel { Code = "B00", Color = "#FFFFFF" }; } }
|
||||
/// <summary>
|
||||
/// 房号
|
||||
/// </summary>
|
||||
public string RoomNumber
|
||||
{
|
||||
get { return this.roomNumber; }
|
||||
set { this.roomNumber = value ?? ""; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 房态名称
|
||||
/// </summary>
|
||||
public string RoomStatus
|
||||
{
|
||||
get { return this.roomStatus; }
|
||||
set { this.roomStatus = value ?? ""; }
|
||||
}
|
||||
|
||||
public int RoomStatusID { get; set; }
|
||||
|
||||
public string Identity { get; set; }
|
||||
|
||||
public int AirID { get; set; }//空调ID
|
||||
|
||||
public string ModalAddress { get; set; }//空调回路地址
|
||||
|
||||
public int AirStatus { get; set; }//空调开关状态,2/关,1/开
|
||||
|
||||
public string AirStatusName { get; set; }//空调开关状态
|
||||
|
||||
public int RoomTemp { get; set; }
|
||||
|
||||
public int SettingTemp { get; set; }
|
||||
|
||||
public int Mode { get; set; }
|
||||
|
||||
public int FanSpeed { get; set; }
|
||||
|
||||
public int Valve { get; set; }
|
||||
|
||||
public string ValveName { get; set; }
|
||||
/// <summary>
|
||||
/// 客房电源
|
||||
/// </summary>
|
||||
public bool PowerSupply { get; set; }
|
||||
public string PowerSupplyName { get; set; }
|
||||
/// <summary>
|
||||
/// 门锁状态
|
||||
/// </summary>
|
||||
public int LockStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 门锁状态名称
|
||||
/// </summary>
|
||||
public string LockStatusName { get; set; }
|
||||
/// <summary>
|
||||
/// 锁电压
|
||||
/// </summary>
|
||||
public float LockVoltage { get; set; }
|
||||
/// <summary>
|
||||
/// 外设离线数量
|
||||
/// </summary>
|
||||
public int PeripheralOfflineCount { get; set; }
|
||||
/// <summary>
|
||||
/// 外设低电数量
|
||||
/// </summary>
|
||||
public int PeripheralLowPowerCount { get; set; }
|
||||
/// <summary>
|
||||
/// 外设描述
|
||||
/// </summary>
|
||||
public string Peripheral { get; set; }
|
||||
/// <summary>
|
||||
/// 是否是连通房
|
||||
/// </summary>
|
||||
public bool IsConnectingRoom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 碳达人
|
||||
/// </summary>
|
||||
public string CarbonVIP { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 功率
|
||||
/// </summary>
|
||||
public string Power { get; set; }
|
||||
|
||||
public ServiceModel SOS { get; set; }
|
||||
|
||||
public ServiceModel DND { get; set; }
|
||||
|
||||
public ServiceModel Clean { get; set; }
|
||||
|
||||
public ServiceModel Checkout { get; set; }
|
||||
|
||||
public IList<ServiceModel> Services
|
||||
{
|
||||
get { return this.services; }
|
||||
set { if (value != null) { this.services = value; } }
|
||||
}
|
||||
|
||||
public IList<AirDetectModel> AirDetects
|
||||
{
|
||||
get { return this.airDetect; }
|
||||
set { if (value != null) { this.airDetect = value; } }
|
||||
}
|
||||
/// <summary>
|
||||
/// 当前入住人信息
|
||||
/// </summary>
|
||||
public IList<RoomCustomer> Customers
|
||||
{
|
||||
get { return this.customers; }
|
||||
set { if (value != null) { this.customers = value; } }
|
||||
}
|
||||
}
|
||||
|
||||
public class ServiceModel
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Status { get; set; }
|
||||
public string Color { get; set; }
|
||||
}
|
||||
|
||||
public class AirDetectModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class RoomInfoModel
|
||||
{
|
||||
public int HostID { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string RoomStatus { get; set; }
|
||||
public string Identity { get; set; }
|
||||
public string HostStatus { get; set; }
|
||||
public string IP { get; set; }
|
||||
public int Port { get; set; }
|
||||
public bool PowerSupply { get; set; }
|
||||
}
|
||||
|
||||
public class RoomCustomer
|
||||
{
|
||||
/// <summary>
|
||||
/// 0 身份证,1 护照,2 军官证,3 其他
|
||||
/// </summary>
|
||||
public string idtype { get; set; }
|
||||
/// <summary>
|
||||
/// 证件号
|
||||
/// </summary>
|
||||
public string idcard { get; set; }
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string customer { get; set; }
|
||||
/// <summary>
|
||||
/// 性别:男、女
|
||||
/// </summary>
|
||||
public string sex { get; set; }
|
||||
/// <summary>
|
||||
/// 0 国内,1 国际
|
||||
/// </summary>
|
||||
public string country { get; set; }
|
||||
/// <summary>
|
||||
/// 入住时间
|
||||
/// </summary>
|
||||
public DateTime checkindate { get; set; }
|
||||
/// <summary>
|
||||
/// 电话号码
|
||||
/// </summary>
|
||||
public string phoneNumber { get; set; }
|
||||
}
|
||||
}
|
||||
113
WebSite/Models/SendMQTTData.cs
Normal file
113
WebSite/Models/SendMQTTData.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using RestSharp;
|
||||
using Common;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
public class SendMQTTData
|
||||
{
|
||||
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(SendMQTTData));
|
||||
public static void Send(IOTMonitorData t)
|
||||
{
|
||||
try
|
||||
{
|
||||
//string debug_log_report_url = RCUHost.TimingHelper.Common.debug_log_report_url;
|
||||
////这个是 定阅的服务器要写的
|
||||
//string debug_log_report_mqtt_topic = "blw/iot/monitor/";
|
||||
|
||||
string str = Newtonsoft.Json.JsonConvert.SerializeObject(t);
|
||||
//var client1 = new RestClient(debug_log_report_url);
|
||||
//var request1 = new RestRequest("/", Method.POST);
|
||||
|
||||
////注意方法是POST
|
||||
////两个参数名字必须是 topic 和payload ,区分大小写的
|
||||
//request1.AddParameter("topic", debug_log_report_mqtt_topic);
|
||||
//request1.AddParameter("payload", str);
|
||||
|
||||
|
||||
//client1.ExecuteAsync(request1, (response) => { });
|
||||
|
||||
CSRedisCacheHelper.redis3.Publish("redis-iotpackage", str);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("SendMQTTData: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void WebAPI_DataSend<T>(T t, string topic)
|
||||
{
|
||||
try
|
||||
{
|
||||
string debug_log_report_url = RCUHost.TimingHelper.Common.debug_log_report_url;
|
||||
//这个是 定阅的服务器要写的
|
||||
//string debug_log_report_mqtt_topic = "blw/webapi/monitor/";
|
||||
|
||||
string str = Newtonsoft.Json.JsonConvert.SerializeObject(t);
|
||||
var client1 = new RestClient(debug_log_report_url);
|
||||
var request1 = new RestRequest("/", Method.POST);
|
||||
|
||||
//注意方法是POST
|
||||
//两个参数名字必须是 topic 和payload ,区分大小写的
|
||||
request1.AddParameter("topic", topic);
|
||||
request1.AddParameter("payload", str);
|
||||
|
||||
|
||||
client1.ExecuteAsync(request1, (response) => { });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("SendMQTTData: " + ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
public class WebAPIMonitorData
|
||||
{
|
||||
public string RemoteIP { get; set; }
|
||||
public string HotelCode { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public string InvokStart_Time { get; set; }
|
||||
public string InvokEnd_Time { get; set; }
|
||||
public List<string> Parameters { get; set; }
|
||||
public string MethodName { get; set; }
|
||||
}
|
||||
public class IotDeviceData
|
||||
{
|
||||
public string DeviceName { get; set; }
|
||||
public string DeviceAddress { get; set; }
|
||||
}
|
||||
public class IOTMonitorData
|
||||
{
|
||||
public IOTMonitorData()
|
||||
{
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
/// <summary>
|
||||
/// /远程调用IP
|
||||
/// </summary>
|
||||
public string RemoteIP { get; set; }
|
||||
public string ControlClass { get; set; }
|
||||
|
||||
public string SceneName { get; set; }
|
||||
public List<IotDeviceData> WhichOneDevice { get; set; }
|
||||
|
||||
public double Step { get; set; }
|
||||
|
||||
public string RequestId { get; set; }
|
||||
public string Platform { get; set; }
|
||||
|
||||
public string TriggerTime { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public string HotelId { get; set; }
|
||||
public int HotelCode { get; set; }
|
||||
public string HotelName { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
|
||||
public string CommandDescription { get; set; }
|
||||
}
|
||||
}
|
||||
25
WebSite/Models/Temp.cs
Normal file
25
WebSite/Models/Temp.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace WebSite.Models
|
||||
{
|
||||
public class Temp
|
||||
{
|
||||
//{"ID":"1","RoomNumber":"1001","RoomTypeID":"2",
|
||||
//"XiaoDuCUID":"f8815d71ff58b0f8b8ab1bbafe57cc61","TianMaoCUID":"",
|
||||
//"TCLCUID":"","HuaWeiCUID":"","RokidWebhookUrl":"",
|
||||
//"WStarttime":"14:45","WEndtime":"14:45"}
|
||||
public int ID { get; set; }
|
||||
public string RoomNumber { get; set; }
|
||||
public int RoomTypeID{ get; set; }
|
||||
public string XiaoDuCUID{ get; set; }
|
||||
public string TianMaoCUID{ get; set; }
|
||||
public string TCLCUID{ get; set; }
|
||||
public string HuaWeiCUID{ get; set; }
|
||||
public string RokidWebhookUrl{ get; set; }
|
||||
public string WStarttime{ get; set; }
|
||||
public string WEndtime{ get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user