123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.Entities;
- using EMIS.CommonLogic.SystemServices;
- namespace EMIS.ExtensionLogic.ServiceLogic.DegreeManage
- {
- public class DegreeListServices : EMIS.CommonLogic.DegreeManage.DegreeManage.DegreeListServices
- {
- /// <summary>
- /// 流水号生成Services
- /// </summary>
- public Lazy<ISerialNumberServices> SerialNumberServices { get; set; }
- /// <summary>
- /// 流程结束跳转函数(工作流平台中配置)
- /// 注:学位审核通过需对学位证书编号进行生成(东莞理工学院)
- /// 生成规则:学校代码+学位级别(1位,博士为2,硕士为3,学士为4)+毕业年份+6位流水号(9+5位流水号)
- /// 例如:学校代码+学位级别(学士)+毕业年份+6位流水号(9+5位流水号),11819+4+2016+900001
- /// </summary>
- /// <param name="degreeApplyIDList"></param>
- /// <param name="userID"></param>
- public override void OnApproveEnd(List<Guid> degreeApplyIDList, Guid? userID)
- {
- ////更新对应的学生信息(如:学位状态)
- //base.OnApproveEnd(degreeApplyIDList, userID);
- //查询对应的学位申请信息List
- var degreeApplyList = DegreeApplyDAL.DegreeApplyRepository
- .GetList(x => degreeApplyIDList.Contains(x.DegreeApplyID), (x => x.ER_GraduationApply.CF_Student)).ToList();
- //查询对应的学位申请信息ViewList
- var degreeApplyViewList = DegreeApplyDAL
- .GetDegreeApplyViewQueryable(x => degreeApplyIDList.Contains(x.DegreeApplyID)).ToList();
- //更新对应的学生信息(如:学位状态、学位证书编号)
- List<CF_Student> studentUpList = new List<CF_Student>();
- List<ER_DegreeApply> degreeApplyUpList = new List<ER_DegreeApply>();
- foreach (var degreeApply in degreeApplyList)
- {
- degreeApply.ER_GraduationApply.CF_Student.DegreeStatus = true;
- this.SetModifyStatus(degreeApply.ER_GraduationApply.CF_Student);
- studentUpList.Add(degreeApply.ER_GraduationApply.CF_Student);
- //查询对应的学位申请信息View
- var degreeApplyView = degreeApplyViewList
- .Where(x => x.DegreeApplyID == degreeApply.DegreeApplyID).SingleOrDefault();
- //学位证书编号生成(学校代码+学位级别(学士)+毕业年份+6位流水号(9+5位流水号))
- var degreeNoPrefix = string.Format("{0}{1}{2}{3}", degreeApplyView.UniversityCode, 4,
- degreeApplyView.GraduationYear ?? null, 9);
- degreeApply.DegreeNo = SerialNumberServices.Value.SetSN(degreeNoPrefix, 5);
- degreeApplyUpList.Add(degreeApply);
- }
- this.UnitOfWork.BatchUpdate(studentUpList);
- this.UnitOfWork.BatchUpdate(degreeApplyUpList);
- }
- }
- }
|