GraduationApplyServices.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace EMIS.ExtensionLogic.ServiceLogic.GraduationManage
  6. {
  7. public class GraduationApplyServices : EMIS.CommonLogic.GraduationManage.GraduationManage.GraduationApplyServices
  8. {
  9. /// <summary>
  10. /// 结业
  11. /// 注:结业通过需对结业证书编号进行生成(广东松山职业技术学院)
  12. /// 生成规则:学校代码+办学类型Value(1位)+毕业年份+培养层次Value(2位)+6位流水号(学号的后6位)
  13. /// 例如:学校代码+普通高等教育+毕业年份+专科+6位流水号(学号的后6位),12060+1+2017+06+101116
  14. /// </summary>
  15. /// <param name="graduationApplyIDList"></param>
  16. public override void GraduationApplyCompletion(List<Guid?> graduationApplyIDList)
  17. {
  18. //更新毕业申请信息、学生信息
  19. base.GraduationApplyCompletion(graduationApplyIDList);
  20. //查询对应的毕业申请信息List
  21. var graduationApplyList = GraduationApplyDAL.GraduationApplyRepository
  22. .GetList(x => graduationApplyIDList.Contains(x.GraduationApplyID), (x => x.CF_Student)).ToList();
  23. //查询对应的毕业申请信息ViewList
  24. var graduationApplyViewList = GraduationApplyDAL
  25. .GetGraduationApplyViewQueryable(x => graduationApplyIDList.Contains(x.GraduationApplyID)).ToList();
  26. //更新对应的学生信息(结业证书编号)
  27. foreach (var graduationApply in graduationApplyList)
  28. {
  29. //查询对应的毕业申请信息View
  30. var graduationApplyView = graduationApplyViewList
  31. .Where(x => x.GraduationApplyID == graduationApply.GraduationApplyID).SingleOrDefault();
  32. //结业证书编号生成(学校代码+办学类型Value(1位)+毕业年份+培养层次Value(2位)+6位流水号(学号的后6位))
  33. var graduateCardNo = string.Format("{0}{1}{2}{3}{4}", graduationApplyView.UniversityCode,
  34. graduationApplyView.SchoolTypeID ?? null,
  35. graduationApplyView.GraduationYear ?? null,
  36. graduationApplyView.EducationCode ?? null,
  37. graduationApplyView.StudentNo.Substring(graduationApplyView.StudentNo.Length - 6, 6));
  38. graduationApply.CF_Student.GraduateCardNo = graduateCardNo;
  39. this.SetModifyStatus(graduationApply.CF_Student);
  40. }
  41. var updateStudentList = graduationApplyList.Select(x => x.CF_Student).ToList();
  42. this.UnitOfWork.BatchUpdate(updateStudentList);
  43. }
  44. }
  45. }