private void TestAttend() { WxNotifyProducerService publisher = WxNotifyProducerService.Instance; PassportService passportService = new PassportService(); WxNotifyInDto wxNotify = new WxNotifyInDto(); wxNotify.Data = new List <WxNotifyItemInDto>() { new WxNotifyItemInDto { DataKey = "first", Value = "杨宏家长,您的孩子已经到校上课。(感谢您对孩子坚持学术艺术的鼓励)" }, new WxNotifyItemInDto { DataKey = "keyword1", Value = $"2018.02.28 14:29" }, new WxNotifyItemInDto { DataKey = "keyword2", Value = "米罗小小班" }, new WxNotifyItemInDto { DataKey = "keyword3", Value = "302" }, new WxNotifyItemInDto { DataKey = "keyword4", Value = "2018-02-28 14:30-15:30" }, new WxNotifyItemInDto { DataKey = "remark", Value = "杨梅红深圳市东海校区 [以上信息如有误,请点击留言]" } }; wxNotify.ToUser = passportService.GetByUserCodes(new List <string> { "18138878080" }).Where(t => !string.IsNullOrEmpty(t.UnionId)).Select(t => t.UnionId).ToList(); wxNotify.TemplateId = 14000000000000003; wxNotify.Url = ""; publisher.Publish(wxNotify); }
/// <summary> /// 获取学生 GetWxOpenId /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-03-15</para> /// </summary> /// <param name="studentId">学生Id</param> /// <returns>微信OPENID</returns> internal static List <string> GetWxOpenId(long studentId) { List <string> phones = GetMobiles(studentId); PassportService passportService = new PassportService(); return(passportService.GetByUserCodes(phones).Select(x => x.UnionId).ToList()); }
private void TestFeedBack() { WxNotifyProducerService publisher = WxNotifyProducerService.Instance; PassportService passportService = new PassportService(); WxNotifyInDto wxNotify = new WxNotifyInDto(); wxNotify.Data = new List <WxNotifyItemInDto>() { new WxNotifyItemInDto() { DataKey = "first", Color = "#173177", Value = "您好!我们会尽快处理您提交的信息。 感谢您的支持!" }, new WxNotifyItemInDto() { DataKey = "keyword1", Color = "#173177", Value = "总部客服" }, new WxNotifyItemInDto() { DataKey = "keyword2", Color = "#173177", Value = "2018.02.01 15:23" }, new WxNotifyItemInDto() { DataKey = "remark", Color = "#173177", Value = "杨梅红国际私立美校深圳校区" } }; wxNotify.ToUser = passportService.GetByUserCodes(new List <string> { "18138878080" }).Where(t => !string.IsNullOrEmpty(t.UnionId)).Select(t => t.UnionId).ToList(); wxNotify.TemplateId = 14000000000000001; wxNotify.Url = "www.ymm.cn"; publisher.Publish(wxNotify); }
/// <summary> /// 获取学生 GetWxOpenId /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-03-15</para> /// </summary> /// <param name="student">学生信息</param> /// <returns>微信OPENID</returns> internal static List <string> GetWxOpenId(TblCstStudent student) { PassportService passportService = new PassportService(); List <string> phones = GetMobileList(student.LinkMobile, student.ContactPersonMobile); return(passportService.GetByUserCodes(phones).Select(x => x.UnionId).ToList()); }