GraduationListServices.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel;
  6. namespace EMIS.ExtensionLogic.ServiceLogic.GraduationManage
  7. {
  8. public class GraduationListServices : EMIS.CommonLogic.GraduationManage.GraduationManage.GraduationListServices
  9. {
  10. /// <summary>
  11. /// 流程结束跳转函数(工作流平台中配置)
  12. /// 注:毕业审核通过需对毕业证书编号进行生成(广东松山职业技术学院)
  13. /// 生成规则:学校代码+办学类型Value(1位)+毕业年份+培养层次Value(2位)+6位流水号(学号的后6位)
  14. /// 例如:学校代码+普通高等教育+毕业年份+专科+6位流水号(学号的后6位),12060+1+2017+06+101116
  15. /// </summary>
  16. /// <param name="graduationApplyIDList"></param>
  17. /// <param name="userID"></param>
  18. public override void OnApproveEnd(List<Guid> graduationApplyIDList, Guid? userID)
  19. {
  20. ////更新对应的学生信息(如:在校状态、学籍状态、毕业日期)
  21. //base.OnApproveEnd(graduationApplyIDList, userID);
  22. //查询对应的毕业申请信息List
  23. var graduationApplyList = GraduationApplyDAL.GraduationApplyRepository
  24. .GetList(x => graduationApplyIDList.Contains(x.GraduationApplyID), (x => x.CF_Student)).ToList();
  25. //查询对应的毕业申请信息ViewList
  26. var graduationApplyViewList = GraduationApplyDAL
  27. .GetGraduationApplyViewQueryable(x => graduationApplyIDList.Contains(x.GraduationApplyID)).ToList();
  28. //查询毕业学期对应的毕业学期信息List
  29. var graduatingSemesterIDList = graduationApplyList.Select(x => x.GraduatingSemesterID).ToList();
  30. var graduateSchoolyearList = GraduationApplyDAL.GraduateSchoolyearRepository
  31. .GetList(x => graduatingSemesterIDList.Contains(x.SchoolyearID)).ToList();
  32. //更新对应的学生信息(如:在校状态、学籍状态、毕业日期、毕业证书编号)
  33. foreach (var graduationApply in graduationApplyList)
  34. {
  35. graduationApply.CF_Student.InSchoolStatusID = (int)CF_InschoolStatus.Graduation;
  36. graduationApply.CF_Student.StudentStatus = (int)CF_StudentStatus.Graduation;
  37. //查询对应的毕业申请信息View
  38. var graduationApplyView = graduationApplyViewList
  39. .Where(x => x.GraduationApplyID == graduationApply.GraduationApplyID).SingleOrDefault();
  40. //毕业证书编号生成(学校代码+办学类型Value(1位)+毕业年份+培养层次Value(2位)+6位流水号(学号的后6位))
  41. var graduateCardNo = string.Format("{0}{1}{2}{3}{4}", graduationApplyView.UniversityCode,
  42. graduationApplyView.SchoolTypeID ?? null,
  43. graduationApplyView.GraduationYear ?? null,
  44. graduationApplyView.EducationCode ?? null,
  45. graduationApplyView.StudentNo.Substring(graduationApplyView.StudentNo.Length - 6, 6));
  46. graduationApply.CF_Student.GraduateCardNo = graduateCardNo;
  47. //毕业日期
  48. foreach (var graduateSchoolyear in graduateSchoolyearList)
  49. {
  50. if (graduationApply.GraduatingSemesterID == graduateSchoolyear.SchoolyearID)
  51. {
  52. graduationApply.CF_Student.GraduateDate = graduateSchoolyear.GraduateDate;
  53. }
  54. }
  55. this.SetModifyStatus(graduationApply.CF_Student);
  56. }
  57. var updateStudentList = graduationApplyList.Select(x => x.CF_Student).ToList();
  58. this.UnitOfWork.BatchUpdate(updateStudentList);
  59. }
  60. }
  61. }