Exemplo n.º 1
0
        /// <summary>
        /// 自定义消息推送
        /// </summary>
        public static void  AddAlarmWindow(FireControl_AlarmWindow model)
        {
            //添加弹窗window
            FireControl_AlarmWindowBLL alarmWinBLL = new FireControl_AlarmWindowBLL();

            model.AWID = CommHelper.CreatePKID("aw");
            var stateResult = alarmWinBLL.AddObj(model);

            if (stateResult.ResultCode == ResultCode.Succ)
            {
                Dictionary <string, string> dic1 = new Dictionary <string, string>();
                dic1.Add("type", "9");
                dic1.Add("cucode", model.UserID);
                dic1.Add("content", "消息");
                dic1.Add("title", "消息");
                dic1.Add("msgid", model.RecordID);
                dic1.Add("application", "8");
                dic1.Add("platformType", "0");
                dic1.Add("isCustomMsg", "1");
                new Task(() =>
                {
                    HttpSend.GetByRequest(JGApi, dic1, null, true);
                }).Start();
            }
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
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);
         }
     }
 }