/// <summary> /// 根据学年学期,学生查询学生实发教材 /// </summary> /// <param name="term"></param> /// <param name="studentId"></param> /// <returns></returns> public IEnumerable <StudentReleaseDetailView> GetStudentReleaseDetail(string term, string studentId) { var studentid = studentId.ConvertToGuid(); var yearTerm = new SchoolYearTerm(term); var studentRecord = _recordRepo.Find(t => t.SchoolYearTerm.Year == yearTerm.Year && t.SchoolYearTerm.Term == yearTerm.Term && t.Student_Id == studentid ).Select(p => new StudentReleaseDetailView() { TextbookId = p.Textbook_Id.ToString(), TextbookName = p.Name, RetailPrice = p.Price.ToString(), DiscountPrice = p.DiscountPrice.ToString(), Term = p.SchoolYearTerm.ToString(), SchoolName = p.SchoolName, ClassName = p.ClassName, StudentNum = p.StudentNum, ReleaseCount = p.ReleaseCount.ToString(), Recipient = p.Recipient1Name, Telephone = p.Recipient1Phone, RecipientDate = p.ReleaseDate.ToString() }); return(_adapter.Adapt <StudentReleaseDetailView>(studentRecord)); }
/// <summary> /// 根据班级Id,教材Id,取领用人名单 /// </summary> /// <param name="classId"></param> /// <param name="textbookId"></param> /// <returns></returns> public IEnumerable <StudentForRecipientsView> GetRecipientsByTextbookId(string classId, string textbookId) { var cId = classId.ConvertToGuid(); var tId = textbookId.ConvertToGuid(); var recipients = _studentReleaseRecordRepo.Find(s => s.Class_Id == cId && s.Textbook_Id == tId) .Select(s => new StudentForRecipientsView { StudentId = s.Student_Id.ToString(), StudentNum = s.StudentNum, StudentName = s.StudentName }); return(_typeAdapter.Adapt <StudentForRecipientsView>(recipients)); }
/// <summary> /// 根据学年学期,专业班级取班级教材费用 /// </summary> /// <param name="term"></param> /// <param name="classId"></param> /// <returns></returns> public IEnumerable <TextbookFeeForProfessionalClassView> GetProfessionalClassFee(string term, string classId) { var classid = classId.ConvertToGuid(); var yearTerm = new SchoolYearTerm(term); var classFee = _studentRecordRepo.Find(t => t.SchoolYearTerm.Year == yearTerm.Year && t.SchoolYearTerm.Term == yearTerm.Term && t.Class_Id == classid ).GroupBy(t => new { t.StudentNum, t.StudentName }).Select(d => new TextbookFeeForProfessionalClassView() { StudentNum = d.Key.StudentNum, StudentName = d.Key.StudentName, TotalCount = d.Sum(t => t.ReleaseCount).ToString(), TotalRetailPrice = d.Sum(t => t.Price).ToString(), DiscountTotalPrice = d.Sum(t => t.DiscountPrice).ToString() }); return(classFee); }
/// <summary> /// 根据学生ID,取学生可退还教材 /// </summary> /// <param name="studentId"></param> /// <returns></returns> public IEnumerable <DropBookForStudentQueryView> GetStudentDropBookByStudentId(string studentId) { var sId = studentId.ConvertToGuid(); var currentTerm = new TermAppl().GetCurrentTerm(); var dropStudentBook = _studentReleaseRecordRepo.Find(s => s.Student_Id == sId && s.SchoolYearTerm.Year == currentTerm.SchoolYearTerm.Year && s.SchoolYearTerm.Term == currentTerm.SchoolYearTerm.Term ).Select(s => new { YearTerm = s.SchoolYearTerm, TextbookName = s.Name, TextbookId = s.Textbook_Id, ReleaseCount = s.ReleaseCount, ReleaseDate = s.ReleaseDate, ReleasePerson = s.OutStockRecord.Operator, RecipientName = s.Recipient1Name, RecipientTelephone = s.Recipient1Phone, ReleaseRecordId = s.ID }); return(_typeAdapter.Adapt <DropBookForStudentQueryView>(dropStudentBook)); }