12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.CommonLogic.SystemServices;
- namespace EMIS.ExtensionLogic.ServiceLogic.GraduationManage
- {
- public class GraduationApplyServices : EMIS.CommonLogic.GraduationManage.GraduationManage.GraduationApplyServices
- {
- /// <summary>
- /// 流水号生成Services
- /// </summary>
- public Lazy<ISerialNumberServices> SerialNumberServices { get; set; }
- /// <summary>
- /// 结业
- /// 注:结业通过需对结业证书编号进行生成(东莞理工学院)
- /// 生成规则:学校代码+办学类型Value(1位)+毕业年份+培养层次类型Code(2位)+6位流水号
- /// 例如:学校代码+成人高等继续教育+毕业年份+专科或本科+6位流水号,11819+2+2016+05或06+000001
- /// </summary>
- /// <param name="graduationApplyIDList"></param>
- public override void GraduationApplyCompletion(List<Guid?> graduationApplyIDList)
- {
- //更新毕业申请信息、学生信息
- base.GraduationApplyCompletion(graduationApplyIDList);
- //查询对应的毕业申请信息List
- var graduationApplyList = GraduationApplyDAL.GraduationApplyRepository
- .GetList(x => graduationApplyIDList.Contains(x.GraduationApplyID), (x => x.CF_Student)).ToList();
- //查询对应的毕业申请信息ViewList
- var graduationApplyViewList = GraduationApplyDAL
- .GetGraduationApplyViewQueryable(x => graduationApplyIDList.Contains(x.GraduationApplyID)).ToList();
- //更新对应的学生信息(结业证书编号)
- foreach (var graduationApply in graduationApplyList)
- {
- //查询对应的毕业申请信息View
- var graduationApplyView = graduationApplyViewList
- .Where(x => x.GraduationApplyID == graduationApply.GraduationApplyID).SingleOrDefault();
- //结业证书编号生成(学校代码+办学类型Value(1位)+毕业年份+培养层次类型Code(2位)+6位流水号)
- var graduateCardNoPrefix = string.Format("{0}{1}{2}{3}", graduationApplyView.UniversityCode,
- graduationApplyView.SchoolTypeID ?? null,
- graduationApplyView.GraduationYear ?? null,
- graduationApplyView.EducationCode ?? null);
- graduationApply.CF_Student.GraduateCardNo = SerialNumberServices.Value.SetSN(graduateCardNoPrefix, 6);
- this.SetModifyStatus(graduationApply.CF_Student);
- }
- var updateStudentList = graduationApplyList.Select(x => x.CF_Student).ToList();
- this.UnitOfWork.BatchUpdate(updateStudentList);
- }
- }
- }
|