GraduationApplyServices.cs 2.8 KB

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