/// <summary> /// 多案件、單一技師推播(指派) /// </summary> /// <param name="data"></param> /// <param name="Sn"></param> /// <param name="Account"></param> /// <returns></returns> public Boolean Exucte(JPushRequest data, List <string> Sn, List <string> Account) { _logger.Info($"---------準備執行多案件、多技師推播,公司:{data.CompCd},廠商:{data.VendorCd}----------"); _logger.Info($"送出推播,技師帳號:{Account[0].ToString()}"); if (string.IsNullOrEmpty(Account[1]) || Account[1] == string.Empty) { _logger.Info($"技師帳號:{Account[0].ToString()},沒有RegID。"); Sn.ForEach(sn => { this.Record(data.CompCd, sn, Account[0].ToString(), $"案件編號:{sn},因為沒有推播ID,無法推播。"); }); } else { bool bo = _notifyRepo.Push(data.Content, data.Extras, Account[1].ToString()); if (bo) { Sn.ForEach(sn => { this.Record(data.CompCd, sn, Account[0].ToString(), data.Content); }); } } return(true); }
/// <summary> /// 多案件、多技師推撥 /// </summary> /// <returns>從Web進行通知</returns> public Boolean Exucte(JPushRequest data, List <string> Sn, Dictionary <string, string> Account) { _logger.Info($"---------準備執行多案件、多技師推播,公司:{data.CompCd},廠商:{data.VendorCd}----------"); Account.ForEach(account => { _logger.Info($"送出推播,技師帳號:{account.Key}"); if (account.Value == string.Empty) { _logger.Info($"技師帳號:{account.Key},沒有RegID。"); Sn.ForEach(sn => { this.Record(data.CompCd, sn, account.Key, $"案件編號:{sn},因為沒有推播ID,無法推播。"); }); } else { bool bo = _notifyRepo.Push(data.Content, data.Extras, account.Value); if (bo) { Sn.ForEach(sn => { this.Record(data.CompCd, sn, account.Key, data.Content); }); } } } ); return(true); }
/// <summary> /// 單一推播 /// </summary> /// <param name="data"></param> /// <returns></returns> public Boolean Exucte(JPushRequest data) { _logger.Info($"---------準備執行單一推播,公司:{data.CompCd},廠商:{data.VendorCd}----------"); #region 找到技師資訊 var con = new Conditions <DataBase.TVenderTechnician>(); con.And(x => x.Comp_Cd == data.CompCd && x.Vender_Cd == data.VendorCd); con.And(x => data.Accounts.Contains(x.Account)); var technicians = _technicianRepo.GetList(con); if (technicians == null || technicians.Count == 0) { _logger.Info($"[INFO]=>單一推播時,找不到技師群資訊"); return(false); } #endregion #region 推播 bool bo = _notifyRepo.Push(data.Content, data.Extras, RegIds(technicians)); if (bo) { //推播給誰,需要紀錄 technicians.ForEach(x => { if (x.RegistrationID == string.Empty) { this.Record(data.CompCd, data.Sn, x.Account, $"案件編號:{data.Sn},因為沒有推播ID,無法推播。"); } else { this.Record(data.CompCd, data.Sn, x.Account, data.Content); } }); } #endregion return(true); }
/// <summary> /// 案件立案-自動推播 /// </summary> /// <param name="data"></param> /// <param name="account"></param> /// <param name="RegId"></param> /// <returns></returns> public Boolean Exucte(JPushRequest data, string account, string RegId) { _logger.Info($"---------準備執行自動推播,公司:{data.CompCd},廠商:{data.VendorCd}----------"); _logger.Info($"送出推播,技師帳號:{account}"); if (RegId == string.Empty) { _logger.Info($"技師帳號:{account},沒有RegID。"); this.Record(data.CompCd, data.Sn, account, $"案件編號:{data.Sn},因為沒有推播ID,無法推播。"); } else { bool bo = _notifyRepo.Push(data.Content, data.Extras, RegId); if (bo) { this.Record(data.CompCd, data.Sn, account, data.Content); } } return(true); }