CollegeServices.cs 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7. using System.Transactions;
  8. using Bowin.Common.Linq;
  9. using Bowin.Common.Linq.Entity;
  10. using Bowin.Common.Utility;
  11. using EMIS.Entities;
  12. using EMIS.Utility;
  13. using EMIS.ViewModel;
  14. using EMIS.ViewModel.CacheManage;
  15. using EMIS.ViewModel.UniversityManage.AdministrativeOrgan;
  16. using EMIS.ViewModel.UniversityManage.SpecialtyClassManage;
  17. using EMIS.ViewModel.UniversityManage.TeacherManage;
  18. using EMIS.DataLogic.UniversityManage.AdministrativeOrgan;
  19. using EMIS.CommonLogic.UniversityManage.TeacherManage;
  20. using EMIS.CommonLogic.StudentManage.StudentStatistics;
  21. namespace EMIS.CommonLogic.UniversityManage.AdministrativeOrgan
  22. {
  23. public class CollegeServices : BaseServices, ICollegeServices
  24. {
  25. public CollegeDAL CollegeDAL { get; set; }
  26. public Lazy<IStaffServices> StaffServices { get; set; }
  27. public Lazy<IInSchoolSettingServices> InSchoolSettingServices { get; set; }
  28. /// <summary>
  29. /// 查询院系所信息View
  30. /// </summary>
  31. /// <param name="configuretView"></param>
  32. /// <param name="campusID"></param>
  33. /// <param name="unitCategoryID"></param>
  34. /// <param name="pageIndex"></param>
  35. /// <param name="pageSize"></param>
  36. /// <returns></returns>
  37. public IGridResultSet<CollegeView> GetCollegeViewGrid(ConfiguretView configuretView, Guid? campusID, int? unitCategoryID, int pageIndex, int pageSize)
  38. {
  39. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  40. var query = CollegeDAL.GetCollegeViewQueryable(expCollege);
  41. if (campusID.HasValue)
  42. {
  43. query = query.Where(x => x.CampusID == campusID);
  44. }
  45. if (unitCategoryID.HasValue)
  46. {
  47. query = query.Where(x => x.UnitCategoryID == unitCategoryID);
  48. }
  49. //查询条件
  50. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  51. {
  52. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  53. }
  54. return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.No.Length).ThenBy(x => x.No).ToGridResultSet<CollegeView>(pageIndex, pageSize);
  55. }
  56. /// <summary>
  57. /// 查询院系所信息List
  58. /// </summary>
  59. /// <param name="configuretView"></param>
  60. /// <param name="campusID"></param>
  61. /// <param name="unitCategoryID"></param>
  62. /// <returns></returns>
  63. public IList<CollegeView> GetCollegeViewList(ConfiguretView configuretView, Guid? campusID, int? unitCategoryID)
  64. {
  65. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  66. var query = CollegeDAL.GetCollegeViewQueryable(expCollege);
  67. if (campusID.HasValue)
  68. {
  69. query = query.Where(x => x.CampusID == campusID);
  70. }
  71. if (unitCategoryID.HasValue)
  72. {
  73. query = query.Where(x => x.UnitCategoryID == unitCategoryID);
  74. }
  75. //查询条件
  76. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  77. {
  78. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  79. }
  80. return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.No.Length).ThenBy(x => x.No).ToList();
  81. }
  82. /// <summary>
  83. /// 查询院系所信息View(只显示院、系、部类别的院系所)
  84. /// </summary>
  85. /// <param name="configuretView"></param>
  86. /// <param name="campusID"></param>
  87. /// <param name="pageIndex"></param>
  88. /// <param name="pageSize"></param>
  89. /// <returns></returns>
  90. public IGridResultSet<CollegeView> GetOnlyCollegeViewList(ConfiguretView configuretView, Guid? campusID, int pageIndex, int pageSize)
  91. {
  92. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  93. var query = CollegeDAL.GetOnlyCollegeViewQueryable(expCollege);
  94. if (campusID.HasValue)
  95. {
  96. query = query.Where(x => x.CampusID == campusID);
  97. }
  98. //查询条件
  99. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  100. {
  101. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  102. }
  103. return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.No.Length).ThenBy(x => x.No).ToGridResultSet<CollegeView>(pageIndex, pageSize);
  104. }
  105. /// <summary>
  106. /// 查询院系所信息View(无数据范围)
  107. /// </summary>
  108. /// <param name="configuretView"></param>
  109. /// <param name="campusID"></param>
  110. /// <param name="pageIndex"></param>
  111. /// <param name="pageSize"></param>
  112. /// <returns></returns>
  113. public IGridResultSet<CollegeView> GetCollegeViewWithoutRange(ConfiguretView configuretView, Guid? campusID, int pageIndex, int pageSize)
  114. {
  115. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  116. var query = CollegeDAL.GetCollegeViewQueryable(expCollege);
  117. if (campusID.HasValue)
  118. {
  119. query = query.Where(x => x.CampusID == campusID);
  120. }
  121. //查询条件
  122. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  123. {
  124. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  125. }
  126. return query.OrderBy(x => x.No.Length).ThenBy(x => x.No).ToGridResultSet<CollegeView>(pageIndex, pageSize);
  127. }
  128. /// <summary>
  129. /// 根据校区信息ID查询对应的院系所信息CF_College(带数据范围)
  130. /// </summary>
  131. /// <param name="campusID"></param>
  132. /// <returns></returns>
  133. public List<CF_College> GetCollegeList(Guid? campusID)
  134. {
  135. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  136. var query = CollegeDAL.CollegeRepository.GetList(expCollege);
  137. if (campusID.HasValue)
  138. {
  139. query = query.Where(x => x.CampusID == campusID);
  140. }
  141. return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.No.Length).ThenBy(x => x.No).ToList();
  142. }
  143. /// <summary>
  144. /// 根据校区信息ID查询对应的院系所信息CF_College(无数据范围)
  145. /// </summary>
  146. /// <param name="campusID"></param>
  147. /// <returns></returns>
  148. public List<CF_College> GetAllCollegeList(Guid? campusID)
  149. {
  150. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  151. var query = CollegeDAL.CollegeRepository.GetList(expCollege);
  152. if (campusID.HasValue)
  153. {
  154. query = query.Where(x => x.CampusID == campusID);
  155. }
  156. return query.OrderBy(x => x.No.Length).ThenBy(x => x.No).ToList();
  157. }
  158. /// <summary>
  159. /// 查询全部院系所信息CollegeView(带数据范围)
  160. /// </summary>
  161. /// <returns></returns>
  162. public List<CollegeView> GetCollegeList()
  163. {
  164. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  165. var query = CollegeDAL.GetCollegeViewQueryable(expCollege);
  166. return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.No.Length).ThenBy(x => x.No).ToList();
  167. }
  168. /// <summary>
  169. /// 查询全部院系所信息CollegeView(只显示院、系、部类别的院系所,带数据范围)
  170. /// </summary>
  171. /// <returns></returns>
  172. public List<CollegeView> GetOnlyCollegeList()
  173. {
  174. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  175. var query = CollegeDAL.GetOnlyCollegeViewQueryable(expCollege);
  176. return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.No.Length).ThenBy(x => x.No).ToList();
  177. }
  178. /// <summary>
  179. /// 查询全部院系所信息CollegeView(无数据范围)
  180. /// </summary>
  181. /// <returns></returns>
  182. public List<CollegeView> GetCollegeViewListWithoutDataRange()
  183. {
  184. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  185. var query = CollegeDAL.GetCollegeViewQueryable(expCollege);
  186. return query.OrderBy(x => x.No.Length).ThenBy(x => x.No).ToList();
  187. }
  188. /// <summary>
  189. /// 查询对应的院系所信息CF_College
  190. /// </summary>
  191. /// <param name="collegeID"></param>
  192. /// <returns></returns>
  193. public CF_College GetCollegeInfo(Guid? collegeID)
  194. {
  195. try
  196. {
  197. var query = CollegeDAL.CollegeRepository.GetList(x => x.CollegeID == collegeID).SingleOrDefault();
  198. return query;
  199. }
  200. catch (Exception ex)
  201. {
  202. throw new Exception(ex.Message);
  203. }
  204. }
  205. /// <summary>
  206. /// 查询对应的院系所信息CollegeView
  207. /// </summary>
  208. /// <param name="collegeID"></param>
  209. /// <returns></returns>
  210. public CollegeView GetCollegeView(Guid? collegeID)
  211. {
  212. try
  213. {
  214. var query = CollegeDAL.GetCollegeViewQueryable(x => x.CollegeID == collegeID).SingleOrDefault();
  215. return query;
  216. }
  217. catch (Exception ex)
  218. {
  219. throw new Exception(ex.Message);
  220. }
  221. }
  222. /// <summary>
  223. /// 编辑(新增、修改,业务主键:院系所代码或院系所名称)
  224. /// </summary>
  225. /// <param name="collegeView"></param>
  226. public void CollegeEdit(CollegeView collegeView)
  227. {
  228. try
  229. {
  230. //查询数据库进行验证
  231. var collegeVerify = CollegeDAL.CollegeRepository.GetList(x => x.CollegeID != collegeView.CollegeID && (x.No == collegeView.No || x.Name == collegeView.Name)).FirstOrDefault();
  232. if (collegeVerify == null)
  233. {
  234. //数据有误验证
  235. if (collegeView.CollegeID != Guid.Empty)
  236. {
  237. var college = CollegeDAL.CollegeRepository.GetList(x => x.CollegeID == collegeView.CollegeID, x => x.CF_CollegeProfile).SingleOrDefault();
  238. if (college == null)
  239. {
  240. throw new Exception("数据有误,请核查。");
  241. }
  242. else
  243. {
  244. //表示修改
  245. college.CampusID = collegeView.CampusID;
  246. college.No = collegeView.No;
  247. college.Name = collegeView.Name;
  248. college.SimpleName = collegeView.SimpleName;
  249. college.EnglishName = collegeView.EnglishName;
  250. college.Remark = collegeView.Remark;
  251. SetModifyStatus(college);
  252. //院系所信息扩展表
  253. if (college.CF_CollegeProfile == null)
  254. {
  255. //新增
  256. var newCollegeProfile = new CF_CollegeProfile();
  257. newCollegeProfile.CollegeID = college.CollegeID;
  258. newCollegeProfile.PoliticalManager = collegeView.PoliticalManager;
  259. newCollegeProfile.AdministrativeManager = collegeView.AdministrativeManager;
  260. newCollegeProfile.UnitCategoryID = collegeView.UnitCategoryID;
  261. newCollegeProfile.CollegeTypeID = collegeView.CollegeTypeID;
  262. newCollegeProfile.CollegeCategoryID = collegeView.CollegeCategoryID;
  263. newCollegeProfile.RunByCategoryID = collegeView.RunByCategoryID;
  264. newCollegeProfile.FoundDate = collegeView.FoundDate;
  265. newCollegeProfile.Officephone = collegeView.Officephone;
  266. SetNewStatus(newCollegeProfile);
  267. UnitOfWork.Add(newCollegeProfile);
  268. }
  269. else
  270. {
  271. //修改
  272. college.CF_CollegeProfile.PoliticalManager = collegeView.PoliticalManager;
  273. college.CF_CollegeProfile.AdministrativeManager = collegeView.AdministrativeManager;
  274. college.CF_CollegeProfile.UnitCategoryID = collegeView.UnitCategoryID;
  275. college.CF_CollegeProfile.CollegeTypeID = collegeView.CollegeTypeID;
  276. college.CF_CollegeProfile.CollegeCategoryID = collegeView.CollegeCategoryID;
  277. college.CF_CollegeProfile.RunByCategoryID = collegeView.RunByCategoryID;
  278. college.CF_CollegeProfile.FoundDate = collegeView.FoundDate;
  279. college.CF_CollegeProfile.Officephone = collegeView.Officephone;
  280. SetModifyStatus(college.CF_CollegeProfile);
  281. }
  282. }
  283. }
  284. else
  285. {
  286. //表示新增(CF_College主表)
  287. CF_College college = new CF_College();
  288. college.CollegeID = Guid.NewGuid();
  289. college.CampusID = collegeView.CampusID;
  290. college.No = collegeView.No;
  291. college.Name = collegeView.Name;
  292. college.SimpleName = collegeView.SimpleName;
  293. college.EnglishName = collegeView.EnglishName;
  294. college.Remark = collegeView.Remark;
  295. SetNewStatus(college);
  296. UnitOfWork.Add(college);
  297. //表示新增(CF_CollegeProfile扩展表)
  298. CF_CollegeProfile collegeProfile = new CF_CollegeProfile();
  299. collegeProfile.CollegeID = college.CollegeID;
  300. collegeProfile.PoliticalManager = collegeView.PoliticalManager;
  301. collegeProfile.AdministrativeManager = collegeView.AdministrativeManager;
  302. collegeProfile.UnitCategoryID = collegeView.UnitCategoryID;
  303. collegeProfile.CollegeTypeID = collegeView.CollegeTypeID;
  304. collegeProfile.CollegeCategoryID = collegeView.CollegeCategoryID;
  305. collegeProfile.RunByCategoryID = collegeView.RunByCategoryID;
  306. collegeProfile.FoundDate = collegeView.FoundDate;
  307. collegeProfile.Officephone = collegeView.Officephone;
  308. SetNewStatus(collegeProfile);
  309. UnitOfWork.Add(collegeProfile);
  310. }
  311. }
  312. else
  313. {
  314. throw new Exception("已存在相同的" + RSL.Get("CollegeCode") + "或" + RSL.Get("CollegeName") + ",请核查。");
  315. }
  316. //事务提交
  317. UnitOfWork.Commit();
  318. }
  319. catch (Exception ex)
  320. {
  321. throw new Exception(ex.Message);
  322. }
  323. }
  324. /// <summary>
  325. /// 删除
  326. /// </summary>
  327. /// <param name="collegeIDList"></param>
  328. /// <returns></returns>
  329. public bool CollegeDelete(List<Guid?> collegeIDList)
  330. {
  331. try
  332. {
  333. UnitOfWork.Remove<CF_CollegeProfile>(x => collegeIDList.Contains(x.CollegeID));
  334. UnitOfWork.Remove<CF_College>(x => collegeIDList.Contains(x.CollegeID));
  335. UnitOfWork.Commit();
  336. return true;
  337. }
  338. catch (Exception)
  339. {
  340. throw;
  341. }
  342. }
  343. /// <summary>
  344. /// 查询院系所对应的教研室信息DepartmentView
  345. /// </summary>
  346. /// <param name="configuretView"></param>
  347. /// <param name="collegeID"></param>
  348. /// <param name="pageIndex"></param>
  349. /// <param name="pageSize"></param>
  350. /// <returns></returns>
  351. public IGridResultSet<DepartmentView> GetDepartmentListViewGrid(ConfiguretView configuretView, Guid? collegeID, int pageIndex, int pageSize)
  352. {
  353. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  354. expCollege = expCollege.And(x => x.CollegeID == collegeID);
  355. var query = CollegeDAL.GetDepartmentViewQueryable(expCollege);
  356. //查询条件
  357. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  358. {
  359. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  360. }
  361. return query.OrderBy(x => x.No.Length).ThenBy(x => x.No).ToGridResultSet<DepartmentView>(pageIndex, pageSize);
  362. }
  363. /// <summary>
  364. /// 查询院系所对应的教研室信息List
  365. /// </summary>
  366. /// <param name="configuretView"></param>
  367. /// <param name="collegeID"></param>
  368. /// <returns></returns>
  369. public IList<DepartmentView> GetDepartmentListViewList(ConfiguretView configuretView, Guid? collegeID)
  370. {
  371. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  372. expCollege = expCollege.And(x => x.CollegeID == collegeID);
  373. var query = CollegeDAL.GetDepartmentViewQueryable(expCollege);
  374. //查询条件
  375. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  376. {
  377. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  378. }
  379. return query.OrderBy(x => x.No.Length).ThenBy(x => x.No).ToList();
  380. }
  381. /// <summary>
  382. /// 查询院系所对应的教师信息StaffView
  383. /// </summary>
  384. /// <param name="configuretView"></param>
  385. /// <param name="collegeID"></param>
  386. /// <param name="departmentID"></param>
  387. /// <param name="isPhoto"></param>
  388. /// <param name="teacherTypeID"></param>
  389. /// <param name="incumbencyState"></param>
  390. /// <param name="titleID"></param>
  391. /// <param name="isDualTeacher"></param>
  392. /// <param name="pageIndex"></param>
  393. /// <param name="pageSize"></param>
  394. /// <returns></returns>
  395. public IGridResultSet<StaffView> GetStaffListViewGrid(ConfiguretView configuretView, Guid? collegeID, Guid? departmentID, int? isPhoto, int? teacherTypeID,
  396. int? incumbencyState, int? titleID, int? isDualTeacher, int pageIndex, int pageSize)
  397. {
  398. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  399. expCollege = expCollege.And(x => x.CollegeID == collegeID);
  400. var query = CollegeDAL.GetStaffViewQueryable(expCollege);
  401. if (departmentID.HasValue)
  402. {
  403. query = query.Where(x => x.DepartmentID == departmentID);
  404. }
  405. if (isPhoto.HasValue)
  406. {
  407. if (isPhoto.Value == (int)CF_GeneralExist.Have)
  408. {
  409. query = query.Where(x => x.PhotoUrl != null && x.PhotoUrl != "");
  410. }
  411. if (isPhoto.Value == (int)CF_GeneralExist.No)
  412. {
  413. query = query.Where(x => x.PhotoUrl == null || x.PhotoUrl == "");
  414. }
  415. }
  416. if (teacherTypeID.HasValue)
  417. {
  418. query = query.Where(x => x.TeacherTypeID == teacherTypeID);
  419. }
  420. if (incumbencyState.HasValue)
  421. {
  422. query = query.Where(x => x.IncumbencyState == incumbencyState);
  423. }
  424. if (titleID.HasValue)
  425. {
  426. query = query.Where(x => x.TitleID == titleID);
  427. }
  428. if (isDualTeacher.HasValue)
  429. {
  430. if (isDualTeacher.Value == (int)CF_GeneralPurpose.IsYes)
  431. {
  432. query = query.Where(x => x.IsDualTeacher == true);
  433. }
  434. if (isDualTeacher.Value == (int)CF_GeneralPurpose.IsNo)
  435. {
  436. query = query.Where(x => x.IsDualTeacher != true);
  437. }
  438. }
  439. //查询条件
  440. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  441. {
  442. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  443. }
  444. return query.OrderBy(x => x.StaffCode.Length).ThenBy(x => x.StaffCode).ThenBy(x => x.CollegeNo.Length).ThenBy(x => x.CollegeNo).ToGridResultSet<StaffView>(pageIndex, pageSize);
  445. }
  446. /// <summary>
  447. /// 查询院系所对应的教师信息List
  448. /// </summary>
  449. /// <param name="configuretView"></param>
  450. /// <param name="collegeID"></param>
  451. /// <param name="departmentID"></param>
  452. /// <param name="isPhoto"></param>
  453. /// <param name="teacherTypeID"></param>
  454. /// <param name="incumbencyState"></param>
  455. /// <param name="titleID"></param>
  456. /// <param name="isDualTeacher"></param>
  457. /// <returns></returns>
  458. public IList<StaffView> GetStaffListViewList(ConfiguretView configuretView, Guid? collegeID, Guid? departmentID, int? isPhoto, int? teacherTypeID,
  459. int? incumbencyState, int? titleID, int? isDualTeacher)
  460. {
  461. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  462. expCollege = expCollege.And(x => x.CollegeID == collegeID);
  463. var query = CollegeDAL.GetStaffViewQueryable(expCollege);
  464. if (departmentID.HasValue)
  465. {
  466. query = query.Where(x => x.DepartmentID == departmentID);
  467. }
  468. if (isPhoto.HasValue)
  469. {
  470. if (isPhoto.Value == (int)CF_GeneralExist.Have)
  471. {
  472. query = query.Where(x => x.PhotoUrl != null && x.PhotoUrl != "");
  473. }
  474. if (isPhoto.Value == (int)CF_GeneralExist.No)
  475. {
  476. query = query.Where(x => x.PhotoUrl == null || x.PhotoUrl == "");
  477. }
  478. }
  479. if (teacherTypeID.HasValue)
  480. {
  481. query = query.Where(x => x.TeacherTypeID == teacherTypeID);
  482. }
  483. if (incumbencyState.HasValue)
  484. {
  485. query = query.Where(x => x.IncumbencyState == incumbencyState);
  486. }
  487. if (titleID.HasValue)
  488. {
  489. query = query.Where(x => x.TitleID == titleID);
  490. }
  491. if (isDualTeacher.HasValue)
  492. {
  493. if (isDualTeacher.Value == (int)CF_GeneralPurpose.IsYes)
  494. {
  495. query = query.Where(x => x.IsDualTeacher == true);
  496. }
  497. if (isDualTeacher.Value == (int)CF_GeneralPurpose.IsNo)
  498. {
  499. query = query.Where(x => x.IsDualTeacher != true);
  500. }
  501. }
  502. //查询条件
  503. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  504. {
  505. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  506. }
  507. return query.OrderBy(x => x.StaffCode.Length).ThenBy(x => x.StaffCode).ThenBy(x => x.CollegeNo.Length).ThenBy(x => x.CollegeNo).ToList();
  508. }
  509. /// <summary>
  510. /// 查询院系所对应的院系专业信息FacultymajorView
  511. /// </summary>
  512. /// <param name="configuretView"></param>
  513. /// <param name="collegeID"></param>
  514. /// <param name="standardID"></param>
  515. /// <param name="educationID"></param>
  516. /// <param name="learningformID"></param>
  517. /// <param name="learnSystem"></param>
  518. /// <param name="scienceclassID"></param>
  519. /// <param name="inSchoolStatus"></param>
  520. /// <param name="pageIndex"></param>
  521. /// <param name="pageSize"></param>
  522. /// <returns></returns>
  523. public IGridResultSet<FacultymajorView> GetFacultymajorListViewGrid(ConfiguretView configuretView, Guid? collegeID, int? standardID, int? educationID, int? learningformID,
  524. string learnSystem, int? scienceclassID, int? inSchoolStatus, int pageIndex, int pageSize)
  525. {
  526. //院系所信息
  527. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  528. expCollege = expCollege.And(x => x.CollegeID == collegeID);
  529. //学生信息
  530. Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  531. if (inSchoolStatus != null && inSchoolStatus > -1)
  532. {
  533. var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
  534. if (inSchoolStatus == 1)
  535. {
  536. //表示在校
  537. expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
  538. }
  539. if (inSchoolStatus == 0)
  540. {
  541. //不在校
  542. expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
  543. }
  544. }
  545. var query = CollegeDAL.GetFacultymajorViewQueryable(expCollege, expStudent);
  546. if (standardID.HasValue)
  547. {
  548. //专业ID(Value)
  549. query = query.Where(x => x.StandardID == standardID);
  550. }
  551. if (educationID.HasValue)
  552. {
  553. //培养层次
  554. query = query.Where(x => x.EducationID == educationID);
  555. }
  556. if (learningformID.HasValue)
  557. {
  558. //学习形式
  559. query = query.Where(x => x.LearningformID == learningformID);
  560. }
  561. if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
  562. {
  563. //学制
  564. var LearnSystems = Convert.ToDecimal(learnSystem);
  565. query = query.Where(x => x.LearnSystem == LearnSystems);
  566. }
  567. if (scienceclassID.HasValue)
  568. {
  569. //专业科类
  570. query = query.Where(x => x.ScienceclassID == scienceclassID);
  571. }
  572. //if (inSchoolStatus != null && inSchoolStatus > -1)
  573. //{
  574. // //排除人数为0的信息
  575. // query = query.Where(x => x.StudentCount > 0);
  576. //}
  577. //查询条件
  578. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  579. {
  580. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  581. }
  582. return query.OrderBy(x => x.CollegeCode.Length).ThenBy(x => x.CollegeCode).ThenBy(x => x.StandardID).ThenBy(x => x.Code.Length).ThenBy(x => x.Code).ToGridResultSet<FacultymajorView>(pageIndex, pageSize);
  583. }
  584. /// <summary>
  585. /// 查询院系所对应的院系专业信息List
  586. /// </summary>
  587. /// <param name="configuretView"></param>
  588. /// <param name="collegeID"></param>
  589. /// <param name="standardID"></param>
  590. /// <param name="educationID"></param>
  591. /// <param name="learningformID"></param>
  592. /// <param name="learnSystem"></param>
  593. /// <param name="scienceclassID"></param>
  594. /// <param name="inSchoolStatus"></param>
  595. /// <returns></returns>
  596. public IList<FacultymajorView> GetFacultymajorListViewList(ConfiguretView configuretView, Guid? collegeID, int? standardID, int? educationID, int? learningformID,
  597. string learnSystem, int? scienceclassID, int? inSchoolStatus)
  598. {
  599. //院系所信息
  600. Expression<Func<CF_College, bool>> expCollege = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  601. expCollege = expCollege.And(x => x.CollegeID == collegeID);
  602. //学生信息
  603. Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  604. if (inSchoolStatus != null && inSchoolStatus > -1)
  605. {
  606. var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
  607. if (inSchoolStatus == 1)
  608. {
  609. //表示在校
  610. expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
  611. }
  612. if (inSchoolStatus == 0)
  613. {
  614. //不在校
  615. expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
  616. }
  617. }
  618. var query = CollegeDAL.GetFacultymajorViewQueryable(expCollege, expStudent);
  619. if (standardID.HasValue)
  620. {
  621. //专业ID(Value)
  622. query = query.Where(x => x.StandardID == standardID);
  623. }
  624. if (educationID.HasValue)
  625. {
  626. //培养层次
  627. query = query.Where(x => x.EducationID == educationID);
  628. }
  629. if (learningformID.HasValue)
  630. {
  631. //学习形式
  632. query = query.Where(x => x.LearningformID == learningformID);
  633. }
  634. if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
  635. {
  636. //学制
  637. var LearnSystems = Convert.ToDecimal(learnSystem);
  638. query = query.Where(x => x.LearnSystem == LearnSystems);
  639. }
  640. if (scienceclassID.HasValue)
  641. {
  642. //专业科类
  643. query = query.Where(x => x.ScienceclassID == scienceclassID);
  644. }
  645. //if (inSchoolStatus != null && inSchoolStatus > -1)
  646. //{
  647. // //排除人数为0的信息
  648. // query = query.Where(x => x.StudentCount > 0);
  649. //}
  650. //查询条件
  651. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  652. {
  653. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  654. }
  655. return query.OrderBy(x => x.CollegeCode.Length).ThenBy(x => x.CollegeCode).ThenBy(x => x.StandardID).ThenBy(x => x.Code.Length).ThenBy(x => x.Code).ToList();
  656. }
  657. /// <summary>
  658. /// Excel院系所信息导入
  659. /// </summary>
  660. /// <param name="cellheader"></param>
  661. /// <param name="inCount"></param>
  662. /// <param name="upCount"></param>
  663. /// <param name="errdataList"></param>
  664. /// <param name="errCount"></param>
  665. /// <param name="sourcePhysicalPath"></param>
  666. public void CollegeImport(Dictionary<string, string> cellheader, out int? inCount, out int? upCount, out List<CollegeView> errdataList, out int? errCount, string sourcePhysicalPath)
  667. {
  668. try
  669. {
  670. StringBuilder errorMsg = new StringBuilder(); // 错误信息
  671. List<CollegeView> errList = new List<CollegeView>();
  672. cellheader.Remove("ErrorMessage");
  673. List<CollegeView> enlist = NpoiExcelHelper.ExcelToEntityList<CollegeView>(cellheader, sourcePhysicalPath, out errorMsg, out errList);
  674. cellheader.Add("ErrorMessage", "未导入原因");
  675. //对List集合进行有效性校验
  676. if (enlist.Count() <= 0)
  677. {
  678. throw new Exception("Excel文件数据为空,请检查。");
  679. }
  680. Regex reg = null; //正则表达式
  681. DateTime result; //用于返回判断日期字段格式
  682. inCount = 0; //导入个数
  683. upCount = 0; //更新个数
  684. errCount = 0; //失败个数
  685. string errorMsgStr = ""; //错误信息
  686. List<CF_College> newCollegeInList = new List<CF_College>();
  687. List<CF_CollegeProfile> newCollegeProfileInList = new List<CF_CollegeProfile>();
  688. List<CF_College> newCollegeUpList = new List<CF_College>();
  689. List<CF_CollegeProfile> newCollegeProfileUpList = new List<CF_CollegeProfile>();
  690. //将循环中相关数据库查询统一查询出来进行匹配(尽量避免在循环中进行数据库查询)
  691. //单位类别
  692. var unitCategoryList = IdNameExt.GetDictionaryItem(DictionaryItem.CF_UnitCategory).ToList();
  693. //院系所信息
  694. var collegeList = CollegeDAL.CollegeRepository.GetList(x => true, x => x.CF_CollegeProfile).ToList();
  695. //院系所代码
  696. var collegeNoList = enlist.Where(x => !string.IsNullOrEmpty(x.No)).Select(x => x.No).ToList();
  697. //院系所名称
  698. var collegeNameList = enlist.Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name).ToList();
  699. //对比后的newCollegeList
  700. var newCollegeList = collegeList.Where(x => collegeNoList.Contains(x.No) || collegeNameList.Contains(x.Name)).ToList();
  701. //校区信息
  702. var campusList = CollegeDAL.CampusRepository.GetList(x => true).ToList();
  703. //校区代码
  704. var campusNoList = enlist.Where(x => !string.IsNullOrEmpty(x.CampusNo)).Select(x => x.CampusNo).ToList();
  705. //对比后的newCampusList
  706. var newCampusList = campusList.Where(x => campusNoList.Contains(x.No)).ToList();
  707. //教职工信息
  708. var staffViewList = StaffServices.Value.GetListStaffView();
  709. //教职工姓名(暂时不考虑,教职工号不同,姓名相同的情况)
  710. var staffNamePList = enlist.Where(x => !string.IsNullOrEmpty(x.PoliticalManagerName)).Select(x => x.PoliticalManagerName).ToList();
  711. var staffNameAList = enlist.Where(x => !string.IsNullOrEmpty(x.AdministrativeManagerName)).Select(x => x.AdministrativeManagerName).ToList();
  712. //对比后的newStaffViewList
  713. var newStaffViewList = staffViewList.Where(x => staffNamePList.Contains(x.Name) || staffNameAList.Contains(x.Name)).ToList();
  714. //循环检测数据列,对各数据列进行验证(必填、字典项验证、数据格式等)
  715. for (int i = 0; i < enlist.Count; i++)
  716. {
  717. CollegeView en = enlist[i]; //Excel表数据视图
  718. CF_College newCollege = new CF_College();
  719. CF_CollegeProfile newCollegeProfile = new CF_CollegeProfile();
  720. //院系所代码
  721. if (string.IsNullOrEmpty(en.No))
  722. {
  723. errCount++;
  724. errorMsgStr = RSL.Get("CollegeCode") + "不能为空";
  725. en.ErrorMessage = errorMsgStr;
  726. errList.Add(en);
  727. errorMsg.AppendLine(errorMsgStr);
  728. continue;
  729. }
  730. else
  731. {
  732. reg = new Regex(@"^[0-9a-zA-Z\s?]+$"); //正则表达式(请输入数字或英文字母)
  733. if (!reg.IsMatch(en.No))
  734. {
  735. errCount++;
  736. errorMsgStr = RSL.Get("CollegeCode") + "格式不正确,请检查(数字或英文字母)";
  737. en.ErrorMessage = errorMsgStr;
  738. errList.Add(en);
  739. errorMsg.AppendLine(errorMsgStr);
  740. continue;
  741. }
  742. else
  743. {
  744. //院系所代码
  745. newCollege.No = en.No.Trim();
  746. }
  747. }
  748. //院系所名称
  749. if (string.IsNullOrEmpty(en.Name))
  750. {
  751. errCount++;
  752. errorMsgStr = RSL.Get("CollegeName") + "不能为空";
  753. en.ErrorMessage = errorMsgStr;
  754. errList.Add(en);
  755. errorMsg.AppendLine(errorMsgStr);
  756. continue;
  757. }
  758. else
  759. {
  760. //院系所名称
  761. newCollege.Name = en.Name.Trim();
  762. }
  763. //简称
  764. if (string.IsNullOrEmpty(en.SimpleName))
  765. {
  766. //不考虑
  767. }
  768. else
  769. {
  770. newCollege.SimpleName = en.SimpleName;
  771. }
  772. //英文名称
  773. if (string.IsNullOrEmpty(en.EnglishName))
  774. {
  775. //不考虑
  776. }
  777. else
  778. {
  779. newCollege.EnglishName = en.EnglishName;
  780. }
  781. //校区代码
  782. if (string.IsNullOrEmpty(en.CampusNo))
  783. {
  784. errCount++;
  785. errorMsgStr = RSL.Get("CampusCode") + "不能为空";
  786. en.ErrorMessage = errorMsgStr;
  787. errList.Add(en);
  788. errorMsg.AppendLine(errorMsgStr);
  789. continue;
  790. }
  791. else
  792. {
  793. reg = new Regex(@"^[0-9a-zA-Z\s?]+$"); //正则表达式(请输入数字或英文字母)
  794. if (!reg.IsMatch(en.CampusNo))
  795. {
  796. errCount++;
  797. errorMsgStr = RSL.Get("CampusCode") + "格式不正确,请检查(数字或英文字母)";
  798. en.ErrorMessage = errorMsgStr;
  799. errList.Add(en);
  800. errorMsg.AppendLine(errorMsgStr);
  801. continue;
  802. }
  803. else
  804. {
  805. var campus = newCampusList.Where(x => x.No == en.CampusNo.Trim()).SingleOrDefault();
  806. if (campus == null)
  807. {
  808. errCount++;
  809. errorMsgStr = RSL.Get("CampusCode") + "不存在,请检查";
  810. en.ErrorMessage = errorMsgStr;
  811. errList.Add(en);
  812. errorMsg.AppendLine(errorMsgStr);
  813. continue;
  814. }
  815. else
  816. {
  817. //校区信息ID
  818. newCollege.CampusID = campus.CampusID;
  819. }
  820. }
  821. }
  822. //党务负责人
  823. if (string.IsNullOrEmpty(en.PoliticalManagerName))
  824. {
  825. //不考虑
  826. }
  827. else
  828. {
  829. var staffViewByP = newStaffViewList.Where(x => x.Name == en.PoliticalManagerName.Trim()).FirstOrDefault();
  830. if (staffViewByP == null)
  831. {
  832. ////暂不考虑
  833. //errCount++;
  834. //errorMsgStr = "党务负责人不存在,请检查";
  835. //en.ErrorMessage = errorMsgStr;
  836. //errList.Add(en);
  837. //errorMsg.AppendLine(errorMsgStr);
  838. //continue;
  839. }
  840. else
  841. {
  842. //党务负责人
  843. newCollegeProfile.PoliticalManager = staffViewByP.UserID;
  844. }
  845. }
  846. //行政负责人
  847. if (string.IsNullOrEmpty(en.AdministrativeManagerName))
  848. {
  849. //不考虑
  850. }
  851. else
  852. {
  853. var staffViewByA = newStaffViewList.Where(x => x.Name == en.AdministrativeManagerName.Trim()).FirstOrDefault();
  854. if (staffViewByA == null)
  855. {
  856. ////暂不考虑
  857. //errCount++;
  858. //errorMsgStr = "行政负责人不存在,请检查";
  859. //en.ErrorMessage = errorMsgStr;
  860. //errList.Add(en);
  861. //errorMsg.AppendLine(errorMsgStr);
  862. //continue;
  863. }
  864. else
  865. {
  866. //行政负责人
  867. newCollegeProfile.AdministrativeManager = staffViewByA.UserID;
  868. }
  869. }
  870. //单位类别
  871. if (string.IsNullOrEmpty(en.UnitCategoryStr))
  872. {
  873. errCount++;
  874. errorMsgStr = "单位类别不能为空";
  875. en.ErrorMessage = errorMsgStr;
  876. errList.Add(en);
  877. errorMsg.AppendLine(errorMsgStr);
  878. continue;
  879. }
  880. else
  881. {
  882. var unitCategory = unitCategoryList.Where(x => x.Name == en.UnitCategoryStr.Trim()).SingleOrDefault();
  883. if (unitCategory == null)
  884. {
  885. errCount++;
  886. errorMsgStr = "单位类别不存在,请检查";
  887. en.ErrorMessage = errorMsgStr;
  888. errList.Add(en);
  889. errorMsg.AppendLine(errorMsgStr);
  890. continue;
  891. }
  892. else
  893. {
  894. //单位类别
  895. newCollegeProfile.UnitCategoryID = unitCategory.Value;
  896. }
  897. }
  898. //建立年月
  899. if (string.IsNullOrEmpty(en.FoundDateStr))
  900. {
  901. //不考虑
  902. }
  903. else
  904. {
  905. //reg = new Regex(@"(\d{4})-(\d{1,2})-(\d{1,2})"); //日期正则表达式,2017-12-28
  906. if (!DateTime.TryParse(en.FoundDateStr, out result))
  907. {
  908. errCount++;
  909. errorMsgStr = "建立年月格式不正确,请检查";
  910. en.ErrorMessage = errorMsgStr;
  911. errList.Add(en);
  912. errorMsg.AppendLine(errorMsgStr);
  913. continue;
  914. }
  915. else
  916. {
  917. //建立年月
  918. newCollegeProfile.FoundDate = Convert.ToDateTime(en.FoundDateStr);
  919. }
  920. }
  921. //办公电话
  922. if (string.IsNullOrEmpty(en.Officephone))
  923. {
  924. //不考虑
  925. }
  926. else
  927. {
  928. newCollegeProfile.Officephone = en.Officephone;
  929. }
  930. //备注
  931. if (string.IsNullOrEmpty(en.Remark))
  932. {
  933. //不考虑
  934. }
  935. else
  936. {
  937. newCollege.Remark = en.Remark;
  938. }
  939. ////Excel表重复性验证(注:当数据表中没有此记录,但是Excel中有重复数据时的去掉)
  940. //for (int j = i + 1; j < enlist.Count; j++)
  941. //{
  942. // NewCollegeView enA = enlist[j];
  943. // //根据Excel表中的业务主键进行去重(院系所代码或院系所名称唯一)
  944. // if (en.No == enA.No && en.Name == enA.Name)
  945. // {
  946. // //用于标识Excel表中的重复记录(由于是批量进行插入数据表)
  947. // }
  948. //}
  949. //数据表重复性验证(院系所代码或院系所名称唯一)
  950. var collegeVerification = newCollegeList.Where(x => x.No == newCollege.No || x.Name == newCollege.Name).FirstOrDefault();
  951. if (collegeVerification == null)
  952. {
  953. //新增
  954. if (!newCollegeInList.Any(x => x.No == newCollege.No || x.Name == newCollege.Name))
  955. {
  956. //CF_College主表
  957. newCollege.CollegeID = Guid.NewGuid();
  958. SetNewStatus(newCollege);
  959. newCollegeInList.Add(newCollege);
  960. //CF_CollegeProfile扩展表
  961. newCollegeProfile.CollegeID = newCollege.CollegeID;
  962. SetNewStatus(newCollegeProfile);
  963. newCollegeProfileInList.Add(newCollegeProfile);
  964. inCount++;
  965. }
  966. else
  967. {
  968. //Excel表重复性验证
  969. //(注:当数据表中没有此记录,但是Excel中有重复数据,可在此处进行抛出到失败数据文件中,目前暂不考虑)
  970. inCount++;
  971. }
  972. }
  973. else
  974. {
  975. //更新(Excel有重复时,以最后一条记录的更新为准)
  976. //更新CF_College主表
  977. collegeVerification.SimpleName = newCollege.SimpleName;
  978. collegeVerification.EnglishName = newCollege.EnglishName;
  979. collegeVerification.Remark = newCollege.Remark;
  980. SetModifyStatus(collegeVerification);
  981. newCollegeUpList.Add(collegeVerification);
  982. //CF_CollegeProfile扩展表
  983. if (collegeVerification.CF_CollegeProfile == null)
  984. {
  985. newCollegeProfile.CollegeID = collegeVerification.CollegeID;
  986. SetNewStatus(newCollegeProfile);
  987. newCollegeProfileInList.Add(newCollegeProfile);
  988. }
  989. else
  990. {
  991. //更新CF_CollegeProfile扩展表
  992. collegeVerification.CF_CollegeProfile.PoliticalManager = newCollegeProfile.PoliticalManager;
  993. collegeVerification.CF_CollegeProfile.AdministrativeManager = newCollegeProfile.AdministrativeManager;
  994. collegeVerification.CF_CollegeProfile.UnitCategoryID = newCollegeProfile.UnitCategoryID;
  995. collegeVerification.CF_CollegeProfile.FoundDate = newCollegeProfile.FoundDate;
  996. collegeVerification.CF_CollegeProfile.Officephone = newCollegeProfile.Officephone;
  997. SetModifyStatus(collegeVerification.CF_CollegeProfile);
  998. newCollegeProfileUpList.Add(collegeVerification.CF_CollegeProfile);
  999. }
  1000. upCount++;
  1001. }
  1002. }
  1003. using (TransactionScope ts = new TransactionScope())
  1004. {
  1005. UnitOfWork.BulkInsert(newCollegeInList);
  1006. UnitOfWork.BulkInsert(newCollegeProfileInList);
  1007. //批量统一提交更新
  1008. if (newCollegeUpList != null && newCollegeUpList.Count() > 0)
  1009. {
  1010. UnitOfWork.BatchUpdate(newCollegeUpList);
  1011. }
  1012. //批量统一提交更新
  1013. if (newCollegeProfileUpList != null && newCollegeProfileUpList.Count() > 0)
  1014. {
  1015. UnitOfWork.BatchUpdate(newCollegeProfileUpList);
  1016. }
  1017. ts.Complete();
  1018. }
  1019. errdataList = errList.Distinct().ToList(); //错误列表List
  1020. }
  1021. catch (Exception)
  1022. {
  1023. throw;
  1024. }
  1025. }
  1026. }
  1027. }