DegreeListServices.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.Entities;
  6. using EMIS.CommonLogic.SystemServices;
  7. namespace EMIS.ExtensionLogic.ServiceLogic.DegreeManage
  8. {
  9. public class DegreeListServices : EMIS.CommonLogic.DegreeManage.DegreeManage.DegreeListServices
  10. {
  11. /// <summary>
  12. /// 流水号生成Services
  13. /// </summary>
  14. public Lazy<ISerialNumberServices> SerialNumberServices { get; set; }
  15. /// <summary>
  16. /// 流程结束跳转函数(工作流平台中配置)
  17. /// 注:学位审核通过需对学位证书编号进行生成(东莞理工学院)
  18. /// 生成规则:学校代码+学位级别(1位,博士为2,硕士为3,学士为4)+毕业年份+6位流水号(9+5位流水号)
  19. /// 例如:学校代码+学位级别(学士)+毕业年份+6位流水号(9+5位流水号),11819+4+2016+900001
  20. /// </summary>
  21. /// <param name="degreeApplyIDList"></param>
  22. /// <param name="userID"></param>
  23. public override void OnApproveEnd(List<Guid> degreeApplyIDList, Guid? userID)
  24. {
  25. ////更新对应的学生信息(如:学位状态)
  26. //base.OnApproveEnd(degreeApplyIDList, userID);
  27. //查询对应的学位申请信息List
  28. var degreeApplyList = DegreeApplyDAL.DegreeApplyRepository
  29. .GetList(x => degreeApplyIDList.Contains(x.DegreeApplyID), (x => x.ER_GraduationApply.CF_Student)).ToList();
  30. //查询对应的学位申请信息ViewList
  31. var degreeApplyViewList = DegreeApplyDAL
  32. .GetDegreeApplyViewQueryable(x => degreeApplyIDList.Contains(x.DegreeApplyID)).ToList();
  33. //更新对应的学生信息(如:学位状态、学位证书编号)
  34. List<CF_Student> studentUpList = new List<CF_Student>();
  35. List<ER_DegreeApply> degreeApplyUpList = new List<ER_DegreeApply>();
  36. foreach (var degreeApply in degreeApplyList)
  37. {
  38. degreeApply.ER_GraduationApply.CF_Student.DegreeStatus = true;
  39. this.SetModifyStatus(degreeApply.ER_GraduationApply.CF_Student);
  40. studentUpList.Add(degreeApply.ER_GraduationApply.CF_Student);
  41. //查询对应的学位申请信息View
  42. var degreeApplyView = degreeApplyViewList
  43. .Where(x => x.DegreeApplyID == degreeApply.DegreeApplyID).SingleOrDefault();
  44. //学位证书编号生成(学校代码+学位级别(学士)+毕业年份+6位流水号(9+5位流水号))
  45. var degreeNoPrefix = string.Format("{0}{1}{2}{3}", degreeApplyView.UniversityCode, 4,
  46. degreeApplyView.GraduationYear ?? null, 9);
  47. degreeApply.DegreeNo = SerialNumberServices.Value.SetSN(degreeNoPrefix, 5);
  48. degreeApplyUpList.Add(degreeApply);
  49. }
  50. this.UnitOfWork.BatchUpdate(studentUpList);
  51. this.UnitOfWork.BatchUpdate(degreeApplyUpList);
  52. }
  53. }
  54. }