示例#1
0
        /// <summary>
        /// P1新版极光推送
        /// </summary>
        /// <param name="UserModel">用户基础信息</param>
        /// <param name="TitleID">消息ID</param>
        /// <param name="NewType">消息类型 1 燃起烟感报警 6电气报警</param>
        /// <param name="DevName"></param>
        public static void APPPush(People UserModel, string TitleID, string NewType, string DevName, string DevID)
        {//目前推送智慧给自己推送
         //添加推送记录
            var content = $"紧急通知!您的{DevName}设备发生报警,地址{UserModel.Province + UserModel.City + UserModel.Area + UserModel.VillageName},请尽快处理";
            FireControl_PushRecordBLL pushReBLL = new FireControl_PushRecordBLL();
            FireControl_PushRecord    pushRe    = new FireControl_PushRecord();

            pushRe.DevID    = DevID;
            pushRe.Message  = content;
            pushRe.Phone    = UserModel.Phone;
            pushRe.PRID     = CommHelper.CreatePKID("fr");
            pushRe.SendType = 1;
            pushRe.TitleID  = TitleID;
            pushRe.UserID   = UserModel.UserID;
            pushReBLL.AddObj(pushRe);
            Dictionary <string, string> dic1 = new Dictionary <string, string>();

            dic1.Add("content", content);
            dic1.Add("title", "设备报警");
            dic1.Add("type", NewType); //1为烟感燃气 6为电气
            dic1.Add("msgid", TitleID);
            dic1.Add("cucode", UserModel.UserID);
            dic1.Add("application", "8");
            dic1.Add("platformType", "3");
            dic1.Add("isCustomMsg", "0");
            Utility.WriteLog("极光--1推----" + UserModel.UserID + UserModel.Phone);
            new Task(() =>
            {
                HttpSend.GetByRequest(JGApi, dic1, null, true);
            }).Start();
            //添加极光推送记录
            if (NewType == "6")
            {
                FireControl_WarninsHandleBLL WHandBLL = new FireControl_WarninsHandleBLL();
                //报警推送记录
                List <FireControl_WarninsHandle> InsertModle = new List <FireControl_WarninsHandle>();
                FireControl_WarninsHandle        SecondModel = new FireControl_WarninsHandle();
                SecondModel.Content    = $"报警已推送给{(string.IsNullOrWhiteSpace(UserModel.Name) ? UserModel.Phone : UserModel.Name)}";
                SecondModel.CreateTime = DateTime.Now;
                SecondModel.Deleted    = 0;
                SecondModel.CreatedBy  = "0";
                SecondModel.HandlD     = CommHelper.CreatePKID("hd");
                SecondModel.Hand_Date  = DateTime.Now.AddSeconds(1);
                SecondModel.Title      = $"报警推送";;
                SecondModel.TitleID    = TitleID;
                SecondModel.UserID     = "0"; //初次报警 0代表系统
                SecondModel.Hand_Mode  = 0;
                SecondModel.Hand_Type  = 0;
                InsertModle.Add(SecondModel);
                var ss = WHandBLL.AddAllObj(InsertModle);
                Utility.WriteLog("消息处理:" + ss.ResultContent);
            }
        }
示例#2
0
 /// <summary>
 /// 推送
 /// </summary>
 /// <param name="Phone"></param>
 /// <param name="userName"></param>
 /// <param name="type">类型 1业主打电话 2给互助联系人 </param>
 /// <param name="address"></param>
 /// NewType 消息类型 1 燃起烟感报警 6电气报警
 public static void PublicPush(string Phone, string userName, string type, string address, string DivName, string title, string content, string cucode, string BeUserID = "", string titleID = "", string NewType = "1")
 {//目前推送智慧给自己推送
     if (type == "1")
     {
         FireControl_WarninsHandleBLL WHandBLL = new FireControl_WarninsHandleBLL();
         Utility.WriteLog("极光--1----");
         Dictionary <string, string> dic1 = new Dictionary <string, string>();
         dic1.Add("content", content);
         dic1.Add("title", title);
         dic1.Add("type", NewType);
         dic1.Add("msgid", titleID);
         dic1.Add("cucode", BeUserID);
         dic1.Add("application", "8");
         dic1.Add("platformType", "3");
         dic1.Add("isCustomMsg", "0");
         Utility.WriteLog("极光--1推----" + BeUserID);
         new Task(() =>
         {
             HttpSend.GetByRequest(JGApi, dic1, null, true);
         }).Start();
         if (NewType == "6")
         {
             //报警推送记录
             List <FireControl_WarninsHandle> InsertModle = new List <FireControl_WarninsHandle>();
             FireControl_WarninsHandle        SecondModel = new FireControl_WarninsHandle();
             SecondModel.Content    = $"报警已推送给{(string.IsNullOrWhiteSpace(userName) ? Phone : userName)}";
             SecondModel.CreateTime = DateTime.Now;
             SecondModel.Deleted    = 0;
             SecondModel.CreatedBy  = "0";
             SecondModel.HandlD     = CommHelper.CreatePKID("hd");
             SecondModel.Hand_Date  = DateTime.Now.AddSeconds(1);
             SecondModel.Title      = $"报警推送";;
             SecondModel.TitleID    = titleID;
             SecondModel.UserID     = "0"; //初次报警 0代表系统
             SecondModel.Hand_Mode  = 0;
             SecondModel.Hand_Type  = 0;
             InsertModle.Add(SecondModel);
             var ss = WHandBLL.AddAllObj(InsertModle);
             Utility.WriteLog("消息处理:" + ss.ResultContent);
         }
     }
 }
示例#3
0
        /// <summary>
        /// 报警消息处理记录
        /// </summary>
        /// <param name="TitleID">消息id</param>
        /// <param name="deviceType">设备类型</param>
        /// <param name="address">报警地址</param>
        /// <param name="FriendNames">关联好友</param>
        private static void AddPusUserFirst(string TitleID, int deviceType, string address, string FriendNames, string UserName)
        {
            List <FireControl_WarninsHandle> InsertModle = new List <FireControl_WarninsHandle>();
            FireControl_WarninsHandleBLL     WHandBLL    = new FireControl_WarninsHandleBLL();
            //初次报警记录
            FireControl_WarninsHandle Model = new FireControl_WarninsHandle();

            Model.Content    = address + $"的{ConvertControlType.ConvertNameString(deviceType)}发生报警";
            Model.CreateTime = DateTime.Now;
            Model.Deleted    = 0;
            Model.CreatedBy  = "0";
            Model.HandlD     = CommHelper.CreatePKID("hd");;
            Model.Hand_Date  = DateTime.Now;
            Model.Title      = $"{ConvertControlType.ConvertNameString(deviceType)}发生报警";;
            Model.TitleID    = TitleID;
            Model.UserID     = "0"; //初次报警 0代表系统
            Model.Hand_Mode  = 0;
            Model.Hand_Type  = 0;
            InsertModle.Add(Model);
            //报警推送记录
            FireControl_WarninsHandle SecondModel = new FireControl_WarninsHandle();

            SecondModel.Content    = $"报警已推送给{UserName},{(FriendNames != "" ? "和" + FriendNames : "")}";
            SecondModel.CreateTime = Model.Hand_Date.AddSeconds(1);
            SecondModel.Deleted    = 0;
            SecondModel.CreatedBy  = "0";
            SecondModel.HandlD     = CommHelper.CreatePKID("hd");;
            SecondModel.Hand_Date  = Model.Hand_Date.AddSeconds(1);
            SecondModel.Title      = $"报警推送";;
            SecondModel.TitleID    = TitleID;
            SecondModel.UserID     = "0"; //初次报警 0代表系统
            SecondModel.Hand_Mode  = 0;
            SecondModel.Hand_Type  = 2;
            InsertModle.Add(SecondModel);
            var ss = WHandBLL.AddAllObj(InsertModle);

            Utility.WriteLog("消息处理:" + ss.ResultContent);
        }