GraduationListServices.cs 3.9 KB

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