FacultymajorServices.cs 51 KB

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