using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.ViewModel; namespace EMIS.ExtensionLogic.ServiceLogic.GraduationManage { public class GraduationListServices : EMIS.CommonLogic.GraduationManage.GraduationManage.GraduationListServices { /// /// 流程结束跳转函数(工作流平台中配置) /// 注:毕业审核通过需对毕业证书编号进行生成(广东松山职业技术学院) /// 生成规则:学校代码+办学类型Value(1位)+毕业年份+培养层次Value(2位)+6位流水号(学号的后6位) /// 例如:学校代码+普通高等教育+毕业年份+专科+6位流水号(学号的后6位),12060+1+2017+06+101116 /// /// /// public override void OnApproveEnd(List graduationApplyIDList, Guid? userID) { ////更新对应的学生信息(如:在校状态、学籍状态、毕业日期) //base.OnApproveEnd(graduationApplyIDList, userID); //查询对应的毕业申请信息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(); //查询毕业学期对应的毕业学期信息List var graduatingSemesterIDList = graduationApplyList.Select(x => x.GraduatingSemesterID).ToList(); var graduateSchoolyearList = GraduationApplyDAL.GraduateSchoolyearRepository .GetList(x => graduatingSemesterIDList.Contains(x.SchoolyearID)).ToList(); //更新对应的学生信息(如:在校状态、学籍状态、毕业日期、毕业证书编号) foreach (var graduationApply in graduationApplyList) { graduationApply.CF_Student.InSchoolStatusID = (int)CF_InschoolStatus.Graduation; graduationApply.CF_Student.StudentStatus = (int)CF_StudentStatus.Graduation; //查询对应的毕业申请信息View var graduationApplyView = graduationApplyViewList .Where(x => x.GraduationApplyID == graduationApply.GraduationApplyID).SingleOrDefault(); //毕业证书编号生成(学校代码+办学类型Value(1位)+毕业年份+培养层次Value(2位)+6位流水号(学号的后6位)) var graduateCardNo = string.Format("{0}{1}{2}{3}{4}", graduationApplyView.UniversityCode, graduationApplyView.SchoolTypeID ?? null, graduationApplyView.GraduationYear ?? null, graduationApplyView.EducationCode ?? null, graduationApplyView.StudentNo.Substring(graduationApplyView.StudentNo.Length - 6, 6)); graduationApply.CF_Student.GraduateCardNo = graduateCardNo; //毕业日期 foreach (var graduateSchoolyear in graduateSchoolyearList) { if (graduationApply.GraduatingSemesterID == graduateSchoolyear.SchoolyearID) { graduationApply.CF_Student.GraduateDate = graduateSchoolyear.GraduateDate; } } this.SetModifyStatus(graduationApply.CF_Student); } var updateStudentList = graduationApplyList.Select(x => x.CF_Student).ToList(); this.UnitOfWork.BatchUpdate(updateStudentList); } } }