public static void SendSms(object sender, ApproveEventArgs args) { ISMS sms = ctx["SMS"] as ISMS; IWorker worker = ctx["Worker"] as IWorker; //string title = string.Format("{0}(表单号:{1})被否决", args.FlowName, args.FlowNo); string content = string.Format("您于{0}申请的{1}(表单号:{2})已经被否决。", args.BeginDate.ToString("yyyy/MM/dd HH:mm"), args.FlowName, args.FlowNo); B_WORKER w = worker.GetWorkerById(args.ApplyerId); if (w != null && !string.IsNullOrEmpty(w.Mobile)) { sms.SendSMG(new List <string> { w.Mobile }, content, "99999"); //if (!innerCommBLL.SendSMG(new List<string> { w.Mobile }, content, "99999")) //{ // throw new Exception(string.Format("短信发送失败,flowId{0},flowNo{1},AppValue{2}", args.FlowId, args.FlowNo, args.AppValue)); //} } }
public bool SendMsg(List <string> TelList, string Content) { IApplicationContext ctx = ContextRegistry.GetContext(); ISMS sms = ctx["SMS"] as ISMS; sms.SendSMG(TelList, Content, "99999"); return(true); }
/// <summary> /// 分配工作(关卡参与人) /// </summary> /// <param name="listWorker"></param> /// <returns></returns> public void AssignWork() { //解析参与人 IList <int> listWorkerId = this.Activity.ParseParticipant(this.FlowInstance.FlowDefine.ID, this.FlowInstance.FlowNo); if (listWorkerId.Count > 0) { //分配工作 foreach (int workerId in listWorkerId) { WorkItemInstance item = new WorkItemInstance(); item.Create(m_ActivityInstanceId, workerId); m_ListWorkItemInstance.Add(item); } //发送提醒短信 if (this.Activity.IsSms == "Y") { List <string> listMobile = new List <string>(); foreach (int workerId in listWorkerId) { IWorker worker = ctx["Worker"] as IWorker; string mobile = worker.GetWorkerById(workerId).Mobile; if (!string.IsNullOrEmpty(mobile)) { listMobile.Add(mobile); } } if (listMobile.Count > 0) { ISMS sms = ctx["SMS"] as ISMS; string content = string.Format("您有一笔{0}需要审核", FlowInstance.FlowDefine.Name); Log4Net.LogInfo(content); sms.SendSMG(listMobile, content, "99999"); } } } else { throw new Exception(string.Format("关卡({0})无签核人", this.Activity.Name)); } }
public ActionResult MessageSave() { BLL.Notice.NoticeList notice = new BLL.Notice.NoticeList(); ISMS sms = ctx["SMS"] as ISMS; string content = Request.Form["content"]; string Tel = Request.Form["telList"]; List <string> TelList = Tel.Split(',').Distinct().ToList(); int WorkerID = int.Parse(User.Identity.Name.Split('|')[0]); string empNo = notice.GetEmpNoByWorkerID(WorkerID); //获取发送人的工号 if (sms.SendSMG(TelList, content, empNo)) { return(Json(new { IsSuccess = true, Message = "发送成功" }, "text/html", JsonRequestBehavior.AllowGet)); } else { return(Json(new { IsSuccess = false, Message = "发送失败" }, "text/html", JsonRequestBehavior.AllowGet)); } }