using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using System.Text.RegularExpressions; using Bowin.Common.Utility; using Bowin.Common.Linq; using Bowin.Common.Linq.Entity; using EMIS.Entities; using EMIS.ViewModel; using EMIS.ViewModel.GraduationManage.GraduationManage; using EMIS.DataLogic.GraduationManage.GraduationManage; using EMIS.CommonLogic.CalendarManage; using EMIS.CommonLogic.SystemServices; using EMIS.CommonLogic.StudentManage.StudentStatistics; namespace EMIS.CommonLogic.GraduationManage.CompletionManage { public class CompletionListServices : BaseWorkflowServices, ICompletionListServices { public GraduationApplyDAL GraduationApplyDAL { get; set; } public Lazy InSchoolSettingServices { get; set; } public Lazy SchoolYearServices { get; set; } /// /// 查询结业名单信息View /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// public IGridResultSet GetCompletionListViewGrid(ConfiguretView configuretView, Guid? gradSchoolyearID, Guid? campusID, Guid? collegeID, int? yearID, int? standardID, int? educationID, int? learningformID, string learnSystem, int? graduationTypeID, int? educationTypeID, int? inSchoolStatus, int pageIndex, int pageSize) { var approveStatusList = this.GetStatusViewList(); var endApproveStatusID = this.GetCorrectEndStatus(); //毕业申请 Expression> expGraduationApply = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE); expGraduationApply = expGraduationApply.And(x => x.ApprovalStatus == endApproveStatusID); //毕业结论 expGraduationApply = expGraduationApply.And(x => x.GraduationResult == (int)ER_GraduationResult.Completion); if (gradSchoolyearID.HasValue) { //毕业学期(实际的毕业学期) expGraduationApply = expGraduationApply.And(x => x.GraduatingSemesterID == gradSchoolyearID); } if (graduationTypeID.HasValue) { //毕业类型 expGraduationApply = expGraduationApply.And(x => x.GraduationTypeID == graduationTypeID); } //学生信息 Expression> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE); if (inSchoolStatus != null && inSchoolStatus > -1) { var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true); if (inSchoolStatus == 1) { //表示在校 expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID)); } if (inSchoolStatus == 0) { //不在校 expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID)); } } ////在校状态(结业) //expStudent = expStudent.And(x => x.InSchoolStatusID == (int)CF_InschoolStatus.Complete); var query = GraduationApplyDAL.GetGraduationApplyViewQueryable(expGraduationApply, expStudent); if (campusID.HasValue) { query = query.Where(x => x.CampusID == campusID); } if (collegeID.HasValue) { query = query.Where(x => x.CollegeID == collegeID); } if (yearID.HasValue) { query = query.Where(x => x.SchoolyearID == yearID); } if (standardID.HasValue) { query = query.Where(x => x.StandardID == standardID); } if (educationID.HasValue) { query = query.Where(x => x.EducationID == educationID); } if (learningformID.HasValue) { query = query.Where(x => x.LearningformID == learningformID); } if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1") { var LearnSystems = Convert.ToDecimal(learnSystem); query = query.Where(x => x.LearnSystem == LearnSystems); } if (educationTypeID.HasValue) { //培养类型 query = query.Where(x => x.EducationTypeID == educationTypeID); } //查询条件 if (!string.IsNullOrEmpty(configuretView.ConditionValue)) { query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim()); } var result = this.GetQueryByDataRangeByCollege(query) .OrderBy(x => x.ClassNo.Length) .ThenBy(x => x.ClassNo).ThenBy(x => x.StudentNo.Length) .ThenBy(x => x.StudentNo).ThenBy(x => x.GraduatingSemesterValue) .ToGridResultSet(pageIndex, pageSize); result.rows.ForEach(x => x.ApprovalStatusName = approveStatusList.FirstOrDefault(w => w.ID == x.ApprovalStatus).Name); return result; } /// /// 查询结业名单信息List /// /// /// /// /// /// /// /// /// /// /// /// /// /// public List GetCompletionListViewList(ConfiguretView configuretView, Guid? gradSchoolyearID, Guid? campusID, Guid? collegeID, int? yearID, int? standardID, int? educationID, int? learningformID, string learnSystem, int? graduationTypeID, int? educationTypeID, int? inSchoolStatus) { var approveStatusList = this.GetStatusViewList(); var endApproveStatusID = this.GetCorrectEndStatus(); //毕业申请 Expression> expGraduationApply = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE); expGraduationApply = expGraduationApply.And(x => x.ApprovalStatus == endApproveStatusID); //毕业结论 expGraduationApply = expGraduationApply.And(x => x.GraduationResult == (int)ER_GraduationResult.Completion); if (gradSchoolyearID.HasValue) { //毕业学期(实际的毕业学期) expGraduationApply = expGraduationApply.And(x => x.GraduatingSemesterID == gradSchoolyearID); } if (graduationTypeID.HasValue) { //毕业类型 expGraduationApply = expGraduationApply.And(x => x.GraduationTypeID == graduationTypeID); } //学生信息 Expression> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE); if (inSchoolStatus != null && inSchoolStatus > -1) { var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true); if (inSchoolStatus == 1) { //表示在校 expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID)); } if (inSchoolStatus == 0) { //不在校 expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID)); } } ////在校状态(结业) //expStudent = expStudent.And(x => x.InSchoolStatusID == (int)CF_InschoolStatus.Complete); var query = GraduationApplyDAL.GetGraduationApplyViewQueryable(expGraduationApply, expStudent); if (campusID.HasValue) { query = query.Where(x => x.CampusID == campusID); } if (collegeID.HasValue) { query = query.Where(x => x.CollegeID == collegeID); } if (yearID.HasValue) { query = query.Where(x => x.SchoolyearID == yearID); } if (standardID.HasValue) { query = query.Where(x => x.StandardID == standardID); } if (educationID.HasValue) { query = query.Where(x => x.EducationID == educationID); } if (learningformID.HasValue) { query = query.Where(x => x.LearningformID == learningformID); } if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1") { var LearnSystems = Convert.ToDecimal(learnSystem); query = query.Where(x => x.LearnSystem == LearnSystems); } if (educationTypeID.HasValue) { //培养类型 query = query.Where(x => x.EducationTypeID == educationTypeID); } //查询条件 if (!string.IsNullOrEmpty(configuretView.ConditionValue)) { query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim()); } var result = this.GetQueryByDataRangeByCollege(query) .OrderBy(x => x.ClassNo.Length) .ThenBy(x => x.ClassNo).ThenBy(x => x.StudentNo.Length) .ThenBy(x => x.StudentNo).ThenBy(x => x.GraduatingSemesterValue) .ToList(); result.ForEach(x => x.ApprovalStatusName = approveStatusList.FirstOrDefault(w => w.ID == x.ApprovalStatus).Name); return result; } /// /// 查询对应的结业名单信息GraduationApplyView /// /// /// public GraduationApplyView GetCompletionListView(Guid? graduationApplyID) { try { var graduationListView = GraduationApplyDAL.GetGraduationApplyViewQueryable(x => x.GraduationApplyID == graduationApplyID) .SingleOrDefault(); return graduationListView; } catch (Exception ex) { throw new Exception(ex.Message); } } /// /// 编辑(新增、修改,业务主键:学生信息ID、流程结束状态(已通过)) /// /// public void CompletionListEdit(GraduationApplyView graduationApplyView) { try { //查询对应的工作流程环节状态信息View var approveStatusList = this.GetStatusViewList(); if (approveStatusList == null || approveStatusList.Count() <= 0) { throw new Exception("工作流平台中,毕业处理流程未配置,请核查。"); } //查询工作流程开始环节状态 var approveStartStatusID = this.GetStartStatus(); if (approveStartStatusID == null) { throw new Exception("工作流平台中,毕业处理流程开始环节未配置,请核查。"); } //查询工作流程结束环节状态 var approveEndStatusID = this.GetCorrectEndStatus(); if (approveEndStatusID == null) { throw new Exception("工作流平台中,毕业处理流程结束环节未配置,请核查。"); } //查询当前启用的学年学期View var currentSchoolYearView = SchoolYearServices.Value.GetCurrentSchoolYear(); if (currentSchoolYearView == null) { throw new Exception("未设置启用的学年学期,请设置。"); } //查询数据库进行验证 var graduationApplyVerify = GraduationApplyDAL.GraduationApplyRepository .GetList(x => x.GraduationApplyID != graduationApplyView.GraduationApplyID && x.UserID == graduationApplyView.UserID && x.ApprovalStatus == approveEndStatusID) .SingleOrDefault(); if (graduationApplyVerify == null) { if (!string.IsNullOrEmpty(graduationApplyView.GraduateCardNo)) { //查询数据库进行验证(结业证书编号唯一) var graduateCardNoVerify = GraduationApplyDAL.StudentRepository .GetList(x => x.UserID != graduationApplyView.UserID && x.GraduateCardNo == graduationApplyView.GraduateCardNo).SingleOrDefault(); if (graduateCardNoVerify != null) { throw new Exception("已存在此结业证书编号(重复),请检查。"); } } //查询毕业学期对应的毕业学期信息 var graduateSchoolyear = GraduationApplyDAL.GraduateSchoolyearRepository .GetList(x => x.SchoolyearID == graduationApplyView.GraduatingSemesterID).SingleOrDefault(); //数据有误验证 if (graduationApplyView.GraduationApplyID != Guid.Empty) { var graduationApply = GraduationApplyDAL.GraduationApplyRepository .GetList(x => x.GraduationApplyID == graduationApplyView.GraduationApplyID, (x => x.CF_Student)) .SingleOrDefault(); if (graduationApply == null) { throw new Exception("数据有误,请核查。"); } else { //表示修改 if (graduationApply.ApprovalStatus == approveEndStatusID) { //毕业名单信息 graduationApply.Remark = graduationApplyView.Remark; SetModifyStatus(graduationApply); //更新对应的学生信息 graduationApply.CF_Student.GraduateCardNo = graduationApplyView.GraduateCardNo; //毕业日期 if (graduateSchoolyear != null) { if (graduationApply.CF_Student.GraduateDate == null) { graduationApply.CF_Student.GraduateDate = graduateSchoolyear.GraduateDate; } } this.SetModifyStatus(graduationApply.CF_Student); } else { throw new Exception("数据有误,请核查(只能修改已通过状态的信息)。"); } } } else { //查询对应的学生信息 var student = GraduationApplyDAL.StudentRepository .GetList(x => x.UserID == graduationApplyView.UserID).SingleOrDefault(); //表示新增 ER_GraduationApply graduationApply = new ER_GraduationApply(); graduationApply.GraduationApplyID = Guid.NewGuid(); graduationApply.UserID = graduationApplyView.UserID; graduationApply.GraduationTypeID = graduationApplyView.GraduationTypeID; graduationApply.GraduatingSemesterID = graduationApplyView.GraduatingSemesterID; graduationApply.ApplySchoolyearID = currentSchoolYearView.SchoolYearID; graduationApply.GraduationConditionPackageID = graduationApplyView.GraduationConditionPackageID; graduationApply.BeforeInSchoolStatusID = student.InSchoolStatusID; graduationApply.BeforeStudentStatusID = student.StudentStatus; graduationApply.ApprovalStatus = approveEndStatusID; graduationApply.GraduationResult = (int)ER_GraduationResult.Completion; graduationApply.ApprovalResult = graduationApplyView.ApprovalResult; graduationApply.Remark = graduationApplyView.Remark; SetNewStatus(graduationApply); UnitOfWork.Add(graduationApply); //更新对应的学生信息 student.InSchoolStatusID = (int)CF_InschoolStatus.Complete; student.StudentStatus = (int)CF_StudentStatus.Complete; student.GraduateCardNo = graduationApplyView.GraduateCardNo; //毕业日期 if (graduateSchoolyear != null) { if (student.GraduateDate == null) { student.GraduateDate = graduateSchoolyear.GraduateDate; } } this.SetModifyStatus(student); } } else { if (graduationApplyVerify.GraduationResult == (int)ER_GraduationResult.Completion) { throw new Exception("此名单在结业名单中已存在,请核查。"); } else if (graduationApplyVerify.GraduationResult == (int)ER_GraduationResult.Graduation) { throw new Exception("此名单在毕业名单中已存在,请核查。"); } else { throw new Exception("数据异常(毕业结论为空),请核查。"); } } //事务提交 UnitOfWork.Commit(); } catch (Exception ex) { throw new Exception(ex.Message); } } /// /// 删除(事务处理) /// 注:需考虑对应的在校状态、毕结业证书编号等信息的处理 /// /// /// public bool CompletionListDelete(List graduationApplyIDs) { try { //查询对应的学位申请信息List var degreeApplyList = GraduationApplyDAL.DegreeApplyRepository .GetList(x => graduationApplyIDs.Contains(x.GraduationApplyID)).ToList(); if (degreeApplyList != null && degreeApplyList.Count() > 0) { throw new Exception("请先删除与其关联的数据,如:学位申请、学位审核、学位名单等"); } //查询对应的毕业申请信息List var graduationApplyList = GraduationApplyDAL.GraduationApplyRepository .GetList(x => graduationApplyIDs.Contains(x.GraduationApplyID), (x => x.CF_Student)) .ToList(); //更新对应的学生信息(如:在校状态、学籍状态、毕结业证书编号、毕业日期),同时删除对应的结业名单信息 graduationApplyList.ForEach(x => { x.CF_Student.InSchoolStatusID = x.BeforeInSchoolStatusID; x.CF_Student.StudentStatus = x.BeforeStudentStatusID; x.CF_Student.GraduateCardNo = null; x.CF_Student.GraduateDate = null; this.SetModifyStatus(x.CF_Student); UnitOfWork.Remove(x); }); UnitOfWork.Commit(); return true; } catch (Exception ex) { throw new Exception(ex.Message); } } /// /// 结业证书编号Excel导入 /// /// /// /// /// /// /// public void CompletionNoImport(Dictionary cellheader, out int? inCount, out int? upCount, out List errdataList, out int? errCount, string sourcePhysicalPath) { try { //查询工作流程结束环节状态 var approveEndStatusID = this.GetCorrectEndStatus(); if (approveEndStatusID == null) { throw new Exception("工作流平台中,毕业处理流程结束环节未配置,请核查。"); } //查询培养类型设置信息List var educationTypeSettingList = GraduationApplyDAL.EducationTypeSettingRepository .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList(); if (educationTypeSettingList == null || educationTypeSettingList.Count() <= 0) { throw new Exception("培养类型设置未设置,请设置。"); } StringBuilder errorMsg = new StringBuilder(); // 错误信息 List errList = new List(); // 1.1解析文件,存放到一个List集合里 cellheader.Remove("ErrorMessage");//移除“未导入原因”列(ErrorMessage) List enlist = NpoiExcelHelper .ExcelToEntityList(cellheader, sourcePhysicalPath, out errorMsg, out errList); cellheader.Add("ErrorMessage", "未导入原因"); //对List集合进行有效性校验 if (enlist.Count() <= 0) { throw new Exception("Excel文件数据为空,请检查。"); } Regex reg = null; //正则表达式 //DateTime result; //用于返回判断日期字段格式 inCount = 0; //导入个数 upCount = 0; //更新个数 errCount = 0; //失败个数 string errorMsgStr = ""; //错误信息 List newGraduationApplyInList = new List(); List newStudentUpList = new List(); //移除StuUpList List removeStuUpList = new List(); //将循环中相关数据库查询统一查询出来进行匹配(尽量避免在循环中进行数据库查询) //毕业申请 Expression> expGraduationApply = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE); expGraduationApply = expGraduationApply.And(x => x.ApprovalStatus == approveEndStatusID); //毕业结论(结业) expGraduationApply = expGraduationApply.And(x => x.GraduationResult == (int)ER_GraduationResult.Completion); //查询对应的结业名单信息ViewList var completionListViewList = GraduationApplyDAL.GetGraduationApplyViewQueryable(expGraduationApply).ToList(); //查询对应的学生信息IDList var userIDList = completionListViewList.Select(x => x.UserID).ToList(); //学号List var studentNoList = enlist.Where(x => !string.IsNullOrEmpty(x.StudentNo)).Select(x => x.StudentNo).ToList(); //对比后的studentNoCompletionListViewList var studentNoCompletionListViewList = completionListViewList.Where(x => studentNoList.Contains(x.StudentNo)).ToList(); //查询对应的学生信息List var studentList = GraduationApplyDAL.StudentRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList(); //结业名单中的学生信息List var completionStudentList = studentList.Where(x => userIDList.Contains(x.UserID)).ToList(); //结业证书编号List var completionNoList = enlist.Where(x => !string.IsNullOrEmpty(x.GraduateCardNo)).Select(x => x.GraduateCardNo).ToList(); //对比后的completionNoStudentList var completionNoStudentList = studentList.Where(x => completionNoList.Contains(x.GraduateCardNo)).ToList(); //查询对应的毕业学期信息List var graduateSchoolyearList = GraduationApplyDAL.GraduateSchoolyearRepository .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList(); //循环检测数据列,对各数据列进行验证(必填、字典项验证、数据格式等) for (int i = 0; i < enlist.Count; i++) { GraduationApplyView en = enlist[i]; //Excel表数据视图 ER_GraduationApply newGraduationApply = new ER_GraduationApply(); CF_Student newStudent = new CF_Student(); //学号 if (string.IsNullOrEmpty(en.StudentNo)) { errCount++; errorMsgStr = "学号不能为空"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } else { var studentNoGraduationApplyViewList = studentNoCompletionListViewList .Where(x => x.StudentNo == en.StudentNo).ToList(); if (studentNoGraduationApplyViewList.Count() > 1) { errCount++; errorMsgStr = "对应的学号存在多个结业名单信息,请检查"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } else { var studentNoGraduationApplyView = studentNoGraduationApplyViewList .Where(x => x.StudentNo == en.StudentNo).SingleOrDefault(); if (studentNoGraduationApplyView == null) { errCount++; errorMsgStr = "对应的学号中不存在相应的结业名单信息,请检查"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } else { //学生信息ID newStudent.UserID = studentNoGraduationApplyView.UserID.Value; newGraduationApply.UserID = studentNoGraduationApplyView.UserID; newGraduationApply.GraduatingSemesterID = studentNoGraduationApplyView.GraduatingSemesterID; } } } //结业证书编号 if (string.IsNullOrEmpty(en.GraduateCardNo)) { errCount++; errorMsgStr = "结业证书编号不能为空"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } else { reg = new Regex(@"^[0-9a-zA-Z\s?]+$"); //正则表达式(请输入数字或英文字母) if (!reg.IsMatch(en.GraduateCardNo)) { errCount++; errorMsgStr = "结业证书编号格式不正确,请检查(数字或英文字母)"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } else { var completionNoStudentViewList = completionNoStudentList .Where(x => x.UserID != newStudent.UserID && x.GraduateCardNo == en.GraduateCardNo.Trim()).ToList(); if (completionNoStudentViewList.Count() > 1) { errCount++; errorMsgStr = "对应的结业证书编号存在多个学生信息中(重复),请检查"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } else { var completionNoStudentView = completionNoStudentViewList .Where(x => x.GraduateCardNo == en.GraduateCardNo.Trim()).SingleOrDefault(); if (completionNoStudentView == null) { newStudent.GraduateCardNo = en.GraduateCardNo.Trim(); } else { errCount++; errorMsgStr = "对应的结业证书编号已存在学生信息中(重复),请检查"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } } } } ////Excel表重复性验证(注:当数据表中没有此记录,但是Excel中有重复数据时的去掉) //for (int j = i + 1; j < enlist.Count; j++) //{ // GraduationApplyView enA = enlist[j]; // //根据Excel表中的业务主键进行去重(学号或学生信息ID唯一) // if (en.StudentNo == enA.StudentNo || en.UserID == enA.UserID) // { // //用于标识Excel表中的重复记录(由于是批量进行插入数据表) // } //} //数据表重复性验证(学号或学生信息ID唯一) var completionStudentVerification = completionStudentList .Where(x => x.UserID == newStudent.UserID).SingleOrDefault(); //查询毕业学期对应的毕业学期信息 var graduateSchoolyear = graduateSchoolyearList .Where(x => x.SchoolyearID == newGraduationApply.GraduatingSemesterID).SingleOrDefault(); if (completionStudentVerification == null) { //由于前面已做相应判断,此处代码暂时无效 //新增 if (!newGraduationApplyInList.Any(x => x.UserID == newStudent.UserID)) { //ER_GraduationApply表 inCount++; } else { //Excel表重复性验证 //(注:当数据表中没有此记录,但是Excel中有重复数据,可在此处进行抛出到失败数据文件中,目前暂不考虑) inCount++; } } else { //注:结业证书编号唯一 //更新(Excel中有重复时,以数据重复抛出到失败数据文件中进行处理,不进行更新) if (!removeStuUpList.Any(x => x.GraduateCardNo == en.GraduateCardNo.Trim())) { if (!newStudentUpList.Any(x => x.GraduateCardNo == en.GraduateCardNo.Trim())) { completionStudentVerification.GraduateCardNo = newStudent.GraduateCardNo; //毕业日期 if (graduateSchoolyear != null) { if (completionStudentVerification.GraduateDate == null) { completionStudentVerification.GraduateDate = graduateSchoolyear.GraduateDate; } } SetModifyStatus(completionStudentVerification); newStudentUpList.Add(completionStudentVerification); upCount++; } else { var stuUpList = newStudentUpList.Where(x => x.GraduateCardNo == en.GraduateCardNo.Trim()).ToList(); foreach (var stuUp in stuUpList) { errCount++; errorMsgStr = "结业证书编号重复,请检查"; en.ErrorMessage = errorMsgStr; errList.Add(new GraduationApplyView() { StudentNo = en.StudentNo, GraduateCardNo = en.GraduateCardNo, ErrorMessage = en.ErrorMessage }); errorMsg.AppendLine(errorMsgStr); newStudentUpList.Remove(stuUp); removeStuUpList.Add(stuUp); upCount--; } errCount++; errorMsgStr = "结业证书编号重复,请检查"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } } else { errCount++; errorMsgStr = "结业证书编号重复,请检查"; en.ErrorMessage = errorMsgStr; errList.Add(en); errorMsg.AppendLine(errorMsgStr); continue; } } } //移除Up if (removeStuUpList != null && removeStuUpList.Count() > 0) { foreach (var removeStuUp in removeStuUpList) { newStudentUpList.Remove(removeStuUp); } } //批量统一提交更新 if (newStudentUpList != null && newStudentUpList.Count() > 0) { ////事务提交 //UnitOfWork.Commit(); UnitOfWork.BatchUpdate(newStudentUpList); } errdataList = errList.Distinct().ToList(); //错误列表List } catch (Exception ex) { //目前会出现,由于错误信息字符太长,无法抛出弹出框的问题 throw new Exception(ex.Message); } } } }