StudentDAL.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using System.Linq.Expressions;
  7. using EMIS.Entities;
  8. using EMIS.DataLogic.Repositories;
  9. using EMIS.ViewModel;
  10. using EMIS.ViewModel.StudentManage.StudentProfile;
  11. namespace EMIS.DataLogic.StudentManage.StudentProfile
  12. {
  13. public class StudentDAL
  14. {
  15. public StudentRepository StudentRepository { get; set; }
  16. public StudentProfileRepository StudentProfileRepository { get; set; }
  17. public StudentContactRepository StudentContactRepository { get; set; }
  18. public StudentAccountRepository StudentAccountRepository { get; set; }
  19. public RecruitstudentsRepository RecruitstudentsRepository { get; set; }
  20. public ClassmajorRepository ClassmajorRepository { get; set; }
  21. public GrademajorRepository GrademajorRepository { get; set; }
  22. public FacultymajorRepository FacultymajorRepository { get; set; }
  23. public CollegeRepository CollegeRepository { get; set; }
  24. public CampusRepository CampusRepository { get; set; }
  25. public UniversityRepository UniversityRepository { get; set; }
  26. public UserRepository UserRepository { get; set; }
  27. public SchoolyearRepository SchoolyearRepository { get; set; }
  28. public DifferentDynamicRepository DifferentDynamicRepository { get; set; }
  29. public StudentReportRepository StudentReportRepository { get; set; }
  30. public StudentConductRepository StudentConductRepository { get; set; }
  31. public StudentPostPracticeRepository StudentPostPracticeRepository { get; set; }
  32. public StaffRepository StaffRepository { get; set; }
  33. public NewStudentRepository NewStudentRepository { get; set; }
  34. public ParameterRepository ParameterRepository { get; set; }
  35. public RoleRepository RoleRepository { get; set; }
  36. public GraduateSchoolyearRepository GraduateSchoolyearRepository { get; set; }
  37. /// <summary>
  38. /// 查询对应的学生信息StudentBaseView(根据对应的学生信息)
  39. /// </summary>
  40. /// <param name="expStudent"></param>
  41. /// <returns></returns>
  42. public IQueryable<StudentBaseView> GetStudentBaseViewQueryable(Expression<Func<CF_Student, bool>> expStudent)
  43. {
  44. var query = from stu in StudentRepository.GetList(expStudent)
  45. join cl in ClassmajorRepository.Entities
  46. on stu.ClassmajorID equals cl.ClassmajorID
  47. join gr in GrademajorRepository.Entities
  48. on cl.GrademajorID equals gr.GrademajorID
  49. join fa in FacultymajorRepository.Entities
  50. on gr.FacultymajorID equals fa.FacultymajorID
  51. join col in CollegeRepository.Entities
  52. on fa.CollegeID equals col.CollegeID
  53. join cam in CampusRepository.Entities
  54. on col.CampusID equals cam.CampusID
  55. join us in UserRepository.Entities
  56. on stu.UserID equals us.UserID
  57. join stsy in SchoolyearRepository.Entities
  58. on new { SchoolyearID = gr.GradeID.Value, SchoolcodeID = gr.SemesterID.Value }
  59. equals new { SchoolyearID = stsy.Years, SchoolcodeID = stsy.SchoolcodeID } into tempstsy
  60. from startsy in tempstsy.DefaultIfEmpty()
  61. join grsy in SchoolyearRepository.Entities
  62. on gr.GraduateSchoolyearID equals grsy.SchoolyearID into tempgrsy
  63. from grasy in tempgrsy.DefaultIfEmpty()
  64. select new StudentBaseView
  65. {
  66. UserID = stu.UserID,
  67. StudentNo = us.LoginID,
  68. LoginID = us.LoginID,
  69. Name = us.Name,
  70. UserName = us.Name,
  71. ClassmajorID = stu.ClassmajorID,
  72. ClassmajorNo = cl.No,
  73. ClassmajorName = cl.Name,
  74. ClassNum = cl.ClassNum,
  75. StandardID = fa.StandardID,
  76. EducationID = fa.EducationID,
  77. LearningformID = fa.LearningformID,
  78. LearnSystem = fa.LearnSystem,
  79. FacultymajorID = gr.FacultymajorID,
  80. FacultymajorCode = fa.Code,
  81. FacultymajorName = fa.Name,
  82. GradeID = gr.GradeID,
  83. SemesterID = gr.SemesterID,
  84. StartSchoolyearID = startsy.SchoolyearID,
  85. StartSchoolyearValue = startsy.Value,
  86. StartSchoolyearCode = startsy.Code,
  87. GrademajorID = cl.GrademajorID,
  88. GrademajorCode = gr.Code,
  89. GrademajorName = gr.Name,
  90. GraduateSchoolyearID = gr.GraduateSchoolyearID,
  91. GraduateSchoolyearValue = grasy.Value,
  92. GraduateSchoolyearCode = grasy.Code,
  93. CollegeID = fa.CollegeID,
  94. CollegeNo = col.No,
  95. CollegeName = col.Name,
  96. CampusID = col.CampusID,
  97. CampusCode = cam.No,
  98. CampusName = cam.Name,
  99. SexID = stu.SexID,
  100. BirthDate = stu.BirthDate,
  101. NationID = stu.NationID,
  102. PoliticsID = stu.PoliticsID,
  103. CertificatesType = stu.CertificatesType,
  104. IDNumber = stu.IDNumber,
  105. StudentType = stu.StudentType,
  106. InSchoolStatusID = stu.InSchoolStatusID,
  107. StudentStatus = stu.StudentStatus,
  108. PlanningGraduateDate = stu.PlanningGraduateDate,
  109. GraduateDate = stu.GraduateDate
  110. };
  111. return query;
  112. }
  113. /// <summary>
  114. /// 查询对应的学生信息View(根据对应的学生信息)
  115. /// </summary>
  116. /// <param name="expStudent"></param>
  117. /// <returns></returns>
  118. public IQueryable<StudentView> GetStudentViewQueryable(Expression<Func<CF_Student, bool>> expStudent)
  119. {
  120. var query = from stu in StudentRepository.GetList(expStudent)
  121. join pf in StudentProfileRepository.Entities
  122. on stu.UserID equals pf.UserID into temppf
  123. from stupf in temppf.DefaultIfEmpty()
  124. join ct in StudentContactRepository.Entities
  125. on stu.UserID equals ct.UserID into tempct
  126. from stuct in tempct.DefaultIfEmpty()
  127. join ac in StudentAccountRepository.Entities
  128. on stu.UserID equals ac.UserID into tempac
  129. from stuac in tempac.DefaultIfEmpty()
  130. join rt in RecruitstudentsRepository.Entities
  131. on stu.UserID equals rt.UserID into temprt
  132. from sturt in temprt.DefaultIfEmpty()
  133. join cl in ClassmajorRepository.Entities
  134. on stu.ClassmajorID equals cl.ClassmajorID
  135. join gr in GrademajorRepository.Entities
  136. on cl.GrademajorID equals gr.GrademajorID
  137. join fa in FacultymajorRepository.Entities
  138. on gr.FacultymajorID equals fa.FacultymajorID
  139. join col in CollegeRepository.Entities
  140. on fa.CollegeID equals col.CollegeID
  141. join cam in CampusRepository.Entities
  142. on col.CampusID equals cam.CampusID
  143. join un in UniversityRepository.Entities
  144. on cam.UniversityID equals un.UniversityID
  145. join us in UserRepository.Entities
  146. on stu.UserID equals us.UserID
  147. join stsy in SchoolyearRepository.Entities
  148. on new { SchoolyearID = gr.GradeID.Value, SchoolcodeID = gr.SemesterID.Value }
  149. equals new { SchoolyearID = stsy.Years, SchoolcodeID = stsy.SchoolcodeID } into tempstsy
  150. from startsy in tempstsy.DefaultIfEmpty()
  151. join grsy in SchoolyearRepository.Entities
  152. on gr.GraduateSchoolyearID equals grsy.SchoolyearID into tempgrsy
  153. from grasy in tempgrsy.DefaultIfEmpty()
  154. from stureport in stu.EM_StudentReport.AsQueryable().Where(x => x.CF_Schoolyear.IsCurrent).DefaultIfEmpty()
  155. select new StudentView
  156. {
  157. UserID = stu.UserID,
  158. StudentNo = us.LoginID,
  159. LoginID = us.LoginID,
  160. ExamineeNum = sturt.ExamineeNum,
  161. AdmissionTicketNo = sturt.AdmissionTicketNo,
  162. Name = us.Name,
  163. UserName = us.Name,
  164. UsedName = stupf.UsedName,
  165. ClassmajorID = stu.ClassmajorID,
  166. ClassmajorNo = cl.No,
  167. ClassmajorName = cl.Name,
  168. ClassNum = cl.ClassNum,
  169. StandardID = fa.StandardID,
  170. EducationID = fa.EducationID,
  171. LearningformID = fa.LearningformID,
  172. LearnSystem = fa.LearnSystem,
  173. FacultymajorID = gr.FacultymajorID,
  174. FacultymajorCode = fa.Code,
  175. FacultymajorName = fa.Name,
  176. YearID = gr.GradeID,
  177. GradeID = gr.GradeID,
  178. SemesterID = gr.SemesterID,
  179. StartSchoolyearID = startsy.SchoolyearID,
  180. StartSchoolyearValue = startsy.Value,
  181. StartSchoolyearCode = startsy.Code,
  182. GrademajorID = cl.GrademajorID,
  183. GrademajorCode = gr.Code,
  184. GrademajorName = gr.Name,
  185. GraduateSchoolyearID = gr.GraduateSchoolyearID,
  186. GraduateSchoolyearValue = grasy.Value,
  187. GraduateSchoolyearCode = grasy.Code,
  188. CollegeID = fa.CollegeID,
  189. CollegeNo = col.No,
  190. CollegeName = col.Name,
  191. CampusID = col.CampusID,
  192. CampusCode = cam.No,
  193. CampusName = cam.Name,
  194. UniversityID = cam.UniversityID,
  195. UniversityCode = un.Code,
  196. UniversityName = un.Name,
  197. HeadMasterName = un.CF_UniversityProfile.HeadMasterName,
  198. Country = stupf.Country,
  199. Place = stupf.Place,
  200. BornPlace = stupf.BornPlace,
  201. SexID = stu.SexID,
  202. BirthDate = stu.BirthDate,
  203. NationID = stu.NationID,
  204. PoliticsID = stu.PoliticsID,
  205. CertificatesType = stu.CertificatesType,
  206. IDNumber = stu.IDNumber,
  207. StudentType = stu.StudentType,
  208. InSchoolStatusID = stu.InSchoolStatusID,
  209. StudentStatus = stu.StudentStatus,
  210. ExamineeType = sturt.ExamineeType,
  211. EntranceDate = sturt.EntranceDate,
  212. LiteracyLevelID = stupf.LiteracyLevelID,
  213. SchoolTypeID = un.CF_UniversityProfile.SchoolTypeID,
  214. CultureModelID = stupf.CultureModelID,
  215. IsDreamProject = stupf.IsDreamProject ?? false,
  216. Email = stuct.Email,
  217. Telephone = stuct.Telephone,
  218. Mobile = stuct.Mobile,
  219. ZIPCode = stuct.ZIPCode,
  220. WeChatNum = stuct.WeChatNum,
  221. QQ = stuct.QQ,
  222. HealthStateID = stupf.HealthStateID,
  223. BloodGroup = stupf.BloodGroup,
  224. Specialty = stupf.Specialty,
  225. Height = stupf.Height,
  226. Weight = stupf.Weight,
  227. DirectorName = stupf.DirectorName,
  228. Score = sturt.Score,
  229. EntranceWayID = sturt.EntranceWayID,
  230. FeaturesID = sturt.FeaturesID,
  231. TerritorialID = sturt.TerritorialID,
  232. Area = sturt.Area,
  233. HomeAddress = stuct.HomeAddress,
  234. WorkUnit = stuct.WorkUnit,
  235. Address = stuct.Address,
  236. Recipient = stuct.Recipient,
  237. Dormitory = stuct.Dormitory,
  238. BankName = stuac.BankName,
  239. CardNo = stuac.CardNo,
  240. RecruitPictureUrl = sturt.RecruitPictureUrl,
  241. RecruitPictureHasValue = (sturt.RecruitPictureUrl == null || sturt.RecruitPictureUrl == "") ? false : true,
  242. StudentCardNo = stu.StudentCardNo,
  243. PhotoUrl = stu.PhotoUrl,
  244. PhotoHasValue = (stu.PhotoUrl == null || stu.PhotoUrl == "") ? false : true,
  245. PlanningGraduateDate = stu.PlanningGraduateDate,
  246. GraduateDate = stu.GraduateDate,
  247. GraduationResult = stu.InSchoolStatusID == (int)EMIS.ViewModel.CF_InschoolStatus.Graduation ?
  248. (int)EMIS.ViewModel.ER_GraduationResult.Graduation : (int)EMIS.ViewModel.ER_GraduationResult.Completion,
  249. GraduateCardNo = stu.GraduateCardNo,
  250. ReplaceGraduateNo = stu.ReplaceGraduateNo,
  251. DegreeStatus = stu.DegreeStatus ?? false,
  252. GraduationPictureUrl = stu.GraduationPictureUrl,
  253. GraduationPictureHasValue = (stu.GraduationPictureUrl == null || stu.GraduationPictureUrl == "") ? false : true,
  254. Career = stu.Career,
  255. IsPhotoComparison = stu.IsPhotoComparison ?? false,
  256. IsProofread = stu.IsProofread ?? false,
  257. ReportStatus = stureport.ReportStatus == null ?
  258. (stu.InSchoolStatusID == (int)EMIS.ViewModel.CF_InschoolStatus.Graduation ?
  259. (int)EMIS.ViewModel.CF_ReportStatus.Graduation : (int)EMIS.ViewModel.CF_ReportStatus.WaitReport) :
  260. stureport.ReportStatus,
  261. AccountStatus = us.RecordStatus,
  262. Remark = stu.Remark,
  263. RecordStatus = stu.RecordStatus,
  264. CreateUserID = stu.CreateUserID,
  265. CreateTime = stu.CreateTime,
  266. ModifyUserID = stu.ModifyUserID,
  267. ModifyTime = stu.ModifyTime
  268. };
  269. return query;
  270. }
  271. /// <summary>
  272. /// 查询对应的学生信息View(根据对应的学生信息、异动申请信息,统计相应的异动数)
  273. /// </summary>
  274. /// <param name="expStudent"></param>
  275. /// <param name="expChange"></param>
  276. /// <returns></returns>
  277. public IQueryable<StudentView> GetStudentViewQueryable(Expression<Func<CF_Student, bool>> expStudent, Expression<Func<CF_DifferentDynamic, bool>> expChange)
  278. {
  279. var query = from stu in StudentRepository.GetList(expStudent)
  280. join pf in StudentProfileRepository.Entities
  281. on stu.UserID equals pf.UserID into temppf
  282. from stupf in temppf.DefaultIfEmpty()
  283. join ct in StudentContactRepository.Entities
  284. on stu.UserID equals ct.UserID into tempct
  285. from stuct in tempct.DefaultIfEmpty()
  286. join ac in StudentAccountRepository.Entities
  287. on stu.UserID equals ac.UserID into tempac
  288. from stuac in tempac.DefaultIfEmpty()
  289. join rt in RecruitstudentsRepository.Entities
  290. on stu.UserID equals rt.UserID into temprt
  291. from sturt in temprt.DefaultIfEmpty()
  292. join cl in ClassmajorRepository.Entities
  293. on stu.ClassmajorID equals cl.ClassmajorID
  294. join gr in GrademajorRepository.Entities
  295. on cl.GrademajorID equals gr.GrademajorID
  296. join fa in FacultymajorRepository.Entities
  297. on gr.FacultymajorID equals fa.FacultymajorID
  298. join col in CollegeRepository.Entities
  299. on fa.CollegeID equals col.CollegeID
  300. join cam in CampusRepository.Entities
  301. on col.CampusID equals cam.CampusID
  302. join un in UniversityRepository.Entities
  303. on cam.UniversityID equals un.UniversityID
  304. join us in UserRepository.Entities
  305. on stu.UserID equals us.UserID
  306. join stsy in SchoolyearRepository.Entities
  307. on new { SchoolyearID = gr.GradeID.Value, SchoolcodeID = gr.SemesterID.Value }
  308. equals new { SchoolyearID = stsy.Years, SchoolcodeID = stsy.SchoolcodeID } into tempstsy
  309. from startsy in tempstsy.DefaultIfEmpty()
  310. join grsy in SchoolyearRepository.Entities
  311. on gr.GraduateSchoolyearID equals grsy.SchoolyearID into tempgrsy
  312. from grasy in tempgrsy.DefaultIfEmpty()
  313. join cegr in
  314. (
  315. from ce in DifferentDynamicRepository.GetList(expChange)
  316. group ce by ce.UserID into g
  317. select new
  318. {
  319. UserID = g.Key,
  320. ChangeCount = g.Count()
  321. }
  322. ) on stu.UserID equals cegr.UserID into tempce
  323. from stuce in tempce.DefaultIfEmpty()
  324. from stureport in stu.EM_StudentReport.AsQueryable()
  325. .Where(x => x.CF_Schoolyear.IsCurrent).DefaultIfEmpty()
  326. select new StudentView
  327. {
  328. UserID = stu.UserID,
  329. StudentNo = us.LoginID,
  330. LoginID = us.LoginID,
  331. ExamineeNum = sturt.ExamineeNum,
  332. AdmissionTicketNo = sturt.AdmissionTicketNo,
  333. Name = us.Name,
  334. UserName = us.Name,
  335. UsedName = stupf.UsedName,
  336. ClassmajorID = stu.ClassmajorID,
  337. ClassmajorNo = cl.No,
  338. ClassmajorName = cl.Name,
  339. ClassNum = cl.ClassNum,
  340. StandardID = fa.StandardID,
  341. EducationID = fa.EducationID,
  342. LearningformID = fa.LearningformID,
  343. LearnSystem = fa.LearnSystem,
  344. FacultymajorID = gr.FacultymajorID,
  345. FacultymajorCode = fa.Code,
  346. FacultymajorName = fa.Name,
  347. YearID = gr.GradeID,
  348. GradeID = gr.GradeID,
  349. SemesterID = gr.SemesterID,
  350. StartSchoolyearID = startsy.SchoolyearID,
  351. StartSchoolyearValue = startsy.Value,
  352. StartSchoolyearCode = startsy.Code,
  353. GrademajorID = cl.GrademajorID,
  354. GrademajorCode = gr.Code,
  355. GrademajorName = gr.Name,
  356. GraduateSchoolyearID = gr.GraduateSchoolyearID,
  357. GraduateSchoolyearValue = grasy.Value,
  358. GraduateSchoolyearCode = grasy.Code,
  359. CollegeID = fa.CollegeID,
  360. CollegeNo = col.No,
  361. CollegeName = col.Name,
  362. CampusID = col.CampusID,
  363. CampusCode = cam.No,
  364. CampusName = cam.Name,
  365. UniversityID = cam.UniversityID,
  366. UniversityCode = un.Code,
  367. UniversityName = un.Name,
  368. HeadMasterName = un.CF_UniversityProfile.HeadMasterName,
  369. Country = stupf.Country,
  370. Place = stupf.Place,
  371. BornPlace = stupf.BornPlace,
  372. SexID = stu.SexID,
  373. BirthDate = stu.BirthDate,
  374. NationID = stu.NationID,
  375. PoliticsID = stu.PoliticsID,
  376. CertificatesType = stu.CertificatesType,
  377. IDNumber = stu.IDNumber,
  378. StudentType = stu.StudentType,
  379. InSchoolStatusID = stu.InSchoolStatusID,
  380. StudentStatus = stu.StudentStatus,
  381. ExamineeType = sturt.ExamineeType,
  382. EntranceDate = sturt.EntranceDate,
  383. LiteracyLevelID = stupf.LiteracyLevelID,
  384. SchoolTypeID = un.CF_UniversityProfile.SchoolTypeID,
  385. CultureModelID = stupf.CultureModelID,
  386. IsDreamProject = stupf.IsDreamProject ?? false,
  387. Email = stuct.Email,
  388. Telephone = stuct.Telephone,
  389. Mobile = stuct.Mobile,
  390. ZIPCode = stuct.ZIPCode,
  391. WeChatNum = stuct.WeChatNum,
  392. QQ = stuct.QQ,
  393. HealthStateID = stupf.HealthStateID,
  394. BloodGroup = stupf.BloodGroup,
  395. Specialty = stupf.Specialty,
  396. Height = stupf.Height,
  397. Weight = stupf.Weight,
  398. DirectorName = stupf.DirectorName,
  399. Score = sturt.Score,
  400. EntranceWayID = sturt.EntranceWayID,
  401. FeaturesID = sturt.FeaturesID,
  402. TerritorialID = sturt.TerritorialID,
  403. Area = sturt.Area,
  404. HomeAddress = stuct.HomeAddress,
  405. WorkUnit = stuct.WorkUnit,
  406. Address = stuct.Address,
  407. Recipient = stuct.Recipient,
  408. Dormitory = stuct.Dormitory,
  409. BankName = stuac.BankName,
  410. CardNo = stuac.CardNo,
  411. RecruitPictureUrl = sturt.RecruitPictureUrl,
  412. RecruitPictureHasValue = (sturt.RecruitPictureUrl == null || sturt.RecruitPictureUrl == "") ? false : true,
  413. StudentCardNo = stu.StudentCardNo,
  414. PhotoUrl = stu.PhotoUrl,
  415. PhotoHasValue = (stu.PhotoUrl == null || stu.PhotoUrl == "") ? false : true,
  416. PlanningGraduateDate = stu.PlanningGraduateDate,
  417. GraduateDate = stu.GraduateDate,
  418. GraduationResult = stu.InSchoolStatusID == (int)EMIS.ViewModel.CF_InschoolStatus.Graduation ?
  419. (int)EMIS.ViewModel.ER_GraduationResult.Graduation : (int)EMIS.ViewModel.ER_GraduationResult.Completion,
  420. GraduateCardNo = stu.GraduateCardNo,
  421. ReplaceGraduateNo = stu.ReplaceGraduateNo,
  422. DegreeStatus = stu.DegreeStatus ?? false,
  423. GraduationPictureUrl = stu.GraduationPictureUrl,
  424. GraduationPictureHasValue = (stu.GraduationPictureUrl == null || stu.GraduationPictureUrl == "") ? false : true,
  425. Career = stu.Career,
  426. IsPhotoComparison = stu.IsPhotoComparison ?? false,
  427. IsProofread = stu.IsProofread ?? false,
  428. ChangeCount = stuce.ChangeCount == null ? 0 : stuce.ChangeCount,
  429. ReportStatus = stureport.ReportStatus == null ?
  430. (stu.InSchoolStatusID == (int)EMIS.ViewModel.CF_InschoolStatus.Graduation ?
  431. (int)EMIS.ViewModel.CF_ReportStatus.Graduation : (int)EMIS.ViewModel.CF_ReportStatus.WaitReport) :
  432. stureport.ReportStatus,
  433. AccountStatus = us.RecordStatus,
  434. Remark = stu.Remark,
  435. RecordStatus = stu.RecordStatus,
  436. CreateUserID = stu.CreateUserID,
  437. CreateTime = stu.CreateTime,
  438. ModifyUserID = stu.ModifyUserID,
  439. ModifyTime = stu.ModifyTime
  440. };
  441. return query;
  442. }
  443. /// <summary>
  444. /// 查询对应的学生预计毕业时间(根据对应的学生信息)
  445. /// </summary>
  446. /// <param name="exp"></param>
  447. /// <returns></returns>
  448. public IQueryable<StudentView> GetStudentPlanningGraduateDateQueryable(Expression<Func<CF_Student, bool>> exp)
  449. {
  450. var query = from stu in StudentRepository.GetList(exp)
  451. group stu by stu.PlanningGraduateDate into g
  452. select new StudentView
  453. {
  454. PlanningGraduateDate = g.Key
  455. };
  456. return query;
  457. }
  458. /// <summary>
  459. /// 查询必填字段为空的记录行
  460. /// </summary>
  461. /// <param name="dataSource"></param>
  462. /// <param name="dic"></param>
  463. /// <returns></returns>
  464. public List<ImportErrorRowView> GetExceptEmptyDataRow(DataTable dataSource, Dictionary<string, string> dic)
  465. {
  466. var query = (from ds in dataSource.AsEnumerable()
  467. from pair in dic
  468. where string.IsNullOrEmpty(ds.Field<string>(pair.Key))
  469. group pair by ds into g
  470. select new ImportErrorRowView { Row = g.Key, Error = string.Join(",", g.Select(x => x.Value)) }).ToList();
  471. return query;
  472. }
  473. }
  474. }