/// <summary> /// 发送投诉与建议的微信通知 /// <para>作 者:郭伟佳</para> /// <para>创建时间:2019-03-08</para> /// </summary> /// <param name="feedbackInfo">投诉与建议信息</param> public void SendWxMessage(TblDatFeedback feedbackInfo) { //获取学生信息 var studentInfo = StudentService.GetStudentInfo(feedbackInfo.StudentId); //请假信息 WxNotifyInDto wxNotify = new WxNotifyInDto { Data = new List <WxNotifyItemInDto> { new WxNotifyItemInDto { DataKey = "first", Value = ClientConfigManager.HssConfig.WeChatTemplateTitle.FeedbackNotice }, new WxNotifyItemInDto { DataKey = "keyword1", Value = WeChatTemplateContentConstants.FeedbackReceiver }, new WxNotifyItemInDto { DataKey = "keyword2", Value = feedbackInfo.CreateTime.ToString("yyyy.MM.dd HH:mm") }, new WxNotifyItemInDto { DataKey = "remark", Value = feedbackInfo.SchoolName } }, ToUser = StudentService.GetWxOpenId(studentInfo), TemplateId = WeChatTemplateConstants.FeedbackTemplateId, Url = string.Empty }; WxNotifyProducerService.Instance.Publish(wxNotify); }
/// <summary> /// 补签-微信通知 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-03-15</para> /// </summary> /// <param name="className">班级名称</param> /// <param name="classRoom">教室</param> /// <param name="classTime">上课时间</param> /// <param name="replenishCode">补签码</param> /// <param name="studentId">学生Id</param> /// private void PushWeChatNotice(long studentId, string className, string classRoom, string classTime, string replenishCode) { //获取学生信息 var stuInfo = StudentService.GetStudentInfo(studentId); //微信推送标题 string title = string.Format(ClientConfigManager.HssConfig.WeChatTemplateTitle.SignReplenishNotice, stuInfo.StudentName); //家长确认补签地址 string signUrl = ClientConfigManager.HssConfig.ParentsConfirmSignUrl + "?replenishCode=" + replenishCode; WxNotifyProducerService wxNotifyProducerService = WxNotifyProducerService.Instance; WxNotifyInDto wxNotify = new WxNotifyInDto { Data = new List <WxNotifyItemInDto> { new WxNotifyItemInDto { DataKey = "first", Value = title }, new WxNotifyItemInDto { DataKey = "keyword1", Value = className }, new WxNotifyItemInDto { DataKey = "keyword2", Value = classRoom }, new WxNotifyItemInDto { DataKey = "keyword3", Value = classTime }, new WxNotifyItemInDto { DataKey = "remark", Value = ScanCodeAttendConstants.Msg, Color = "#FF2500" } }, ToUser = StudentService.GetWxOpenId(stuInfo), TemplateId = WeChatTemplateConstants.SignReplenishNotice, Url = signUrl }; wxNotifyProducerService.Publish(wxNotify); }
/// <summary> /// 微信通知 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-03-15</para> /// </summary> private void PushWeChatNotice() { var stuInfo = StudentService.GetStudentInfo(_request.StudentId); var inLesson = this._inLessonList.FirstOrDefault(); string pushClassTime = this._outLessonList .Select(x => DateTime.Parse(x.ClassDate.ToString("yyyy-MM-dd") + " " + x.ClassBeginTime)) .Min().ToString("yyyy.MM.dd HH:mm"); //first={0}家长,您好!因{1}于{2}请假,为了保证孩子的学习效果,我们特别为孩子安排了补课,具体时间如下: string title = string.Format( ClientConfigManager.HssConfig.WeChatTemplateTitle.MakeupNotice, stuInfo.StudentName, stuInfo.StudentName, pushClassTime); //keyword1=上课时间 var classTimeList = this._inLessonList.Select(x => x.ClassBeginTime + "-" + x.ClassEndTime); string classTime = $"{inLesson.ClassDate.ToString("yyyy.MM.dd")} {string.Join("、", classTimeList)}"; //keyword2=班级名称 string className = CourseService.GetByCourseId(inLesson.CourseId)?.ClassCnName ?? string.Empty; //keyword3=教室 string classRoom = new ClassRoomService(inLesson.ClassRoomId)?.ClassRoomInfo?.RoomNo ?? string.Empty; //keyword4=老师名称 string teacherName = TeachService.GetTeacher(inLesson.TeacherId)?.TeacherName ?? string.Empty; //remark=校区名称 string schoolName = OrgService.GetSchoolBySchoolId(_schoolId)?.SchoolName ?? string.Empty; WxNotifyProducerService wxNotifyProducerService = WxNotifyProducerService.Instance; WxNotifyInDto wxNotify = new WxNotifyInDto { Data = new List <WxNotifyItemInDto> { new WxNotifyItemInDto { DataKey = "first", Value = title }, new WxNotifyItemInDto { DataKey = "keyword1", Value = classTime }, new WxNotifyItemInDto { DataKey = "keyword2", Value = className }, new WxNotifyItemInDto { DataKey = "keyword3", Value = classRoom }, new WxNotifyItemInDto { DataKey = "keyword4", Value = teacherName }, new WxNotifyItemInDto { DataKey = "remark", Value = schoolName } }, ToUser = StudentService.GetWxOpenId(stuInfo), TemplateId = WeChatTemplateConstants.MakeupNotice, Url = string.Empty }; wxNotifyProducerService.Publish(wxNotify); }