Exemple #1
0
        /// <summary>
        /// 获取学生卡打印信息
        /// <para>作    者: Huan GaoLiang </para>
        /// <para>创建时间: 2019-03-06 </para>
        /// </summary>
        /// <param name="studentId">学生编号</param>
        /// <param name="schoolId">校区编号</param>
        /// <returns>返回学生证信息</returns>
        /// <returns>修改结果数</returns>
        /// <exception>
        /// 异常ID:1,系统不存在该学生
        /// </exception>
        public StudentCardResponse GetStudentCard(long studentId, string schoolId)
        {
            StudentCardResponse studentCar = new StudentCardResponse();

            // 1、根据学生编号查询学生信息
            TblCstStudent student = _studentRepository.Value.GetCstStudentId(studentId);

            if (student == null)
            {
                throw new BussinessException((byte)ModelType.Customer, 1);
            }

            studentCar.StudentId   = student.StudentId;
            studentCar.HeadFaceUrl = student.HeadFaceUrl;
            studentCar.StudentNo   = student.StudentNo;
            studentCar.StudentName = student.StudentName;

            // 2、获取基础配置中的公司log和学生证反面信息
            var companyId     = SdkClient.CreateDimCommonService().GetAllSchool().FirstOrDefault(m => m.SchoolId == schoolId)?.CompanyId;
            var schoolSetting = new HomeSchoolSettingService().GetSettingList(companyId);

            studentCar.CompanyImage  = schoolSetting.FirstOrDefault(m => m.FuntionId == (int)HomeSchoolBusinessType.StudentCradUp)?.DataValue;
            studentCar.NegativeImage = schoolSetting.FirstOrDefault(m => m.FuntionId == (int)HomeSchoolBusinessType.StudentCradDown)?.DataValue;

            return(studentCar);
        }
Exemple #2
0
        /// <summary>
        /// 发送投诉与建议的邮件
        /// <para>作    者: 郭伟佳</para>
        /// <para>创建时间: 2019-03-07</para>
        /// </summary>
        /// <param name="feedbackRequest">回馈添加请求对象</param>
        /// <param name="feedbackInfo">投诉与建议信息</param>
        private void SendEmail(FeedbackAddRequest feedbackRequest, TblDatFeedback feedbackInfo)
        {
            //1、获取校区的公司信息
            var schoolInfo = new JDWService().GetSchoolInfo(feedbackInfo.SchoolId);

            //2、获取公司家校互联相关的配置
            var schoolSettingInfo = new HomeSchoolSettingService().GetSettingList(schoolInfo.CompanyId)
                                    .Where(a => a.FuntionId == (int)HomeSchoolBusinessType.Feedback).FirstOrDefault();

            if (schoolSettingInfo != null)
            {
                //邮件内容
                StringBuilder contentMsg = new StringBuilder();
                contentMsg.Append("<div>");
                contentMsg.Append($"<span>{DatumConstants.Content}:{feedbackInfo.Content}</span><br /><br />");
                contentMsg.Append($"<span>{DatumConstants.School}: {feedbackInfo.SchoolName}</span><br />");
                contentMsg.Append($"<span>{DatumConstants.ContactPhone}:{feedbackInfo.LinkMobile}</span><br />");
                contentMsg.Append($"<span>{DatumConstants.StudentName}: {feedbackInfo.CreatorName}</span><br />");
                contentMsg.Append($"<span>{DatumConstants.SubmitTime}:{feedbackInfo.CreateTime.ToString("yyyy-MM-dd HH:mm")}</span><br /><br /><br /></div>");
                //3、发送邮件
                new MailSdk(ClientConfigManager.HssConfig.EmailSender.UserId, ClientConfigManager.HssConfig.EmailSender.UserName).SendMail(new MailSendDto()
                {
                    IsSaveDrafts = false,
                    Title        = DatumConstants.FeedbackTitle,
                    Contents     = contentMsg.ToString(),
                    FileList     = feedbackRequest.AttachmentUrlList.Select(a =>
                    {
                        //获取url文件扩展名
                        var fileSuffix = Regex.Match(a.Url, @"(\.\w+)+(?!.*(\w+)(\.\w+)+)").ToString();
                        return(new FileInfoDto()
                        {
                            Url = a.Url,
                            Name = a.Name,
                            Suffix = fileSuffix.Remove(0, 1),//去掉扩展名前的点
                            Size = 0
                        });
                    }).ToList(),
                    ReceiverList = new List <MailUserInfoDto> {
                        new MailUserInfoDto {
                            UserId = schoolSettingInfo.DataId, UserName = schoolSettingInfo.DataValue
                        }
                    }
                });
            }
        }