RetakePlanTaskController.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.ViewModel;
  7. using EMIS.Web.Controls;
  8. using Bowin.Web.Controls.Mvc;
  9. using EMIS.CommonLogic.RetakeManage;
  10. using Bowin.Common.Utility;
  11. using Bowin.Common.Data;
  12. using EMIS.CommonLogic.RetakeManage.General;
  13. using EMIS.ViewModel.RetakeManage;
  14. using EMIS.Utility.FormValidate;
  15. using Bowin.Common.Linq.Entity;
  16. using Bowin.Common.JSON;
  17. using EMIS.Utility;
  18. namespace EMIS.Web.Controllers.RetakeManage.General
  19. {
  20. [Authorization]
  21. public class RetakePlanTaskController : Controller
  22. {
  23. public IRetakePlanTaskServices RetakePlanServices { get; set; }
  24. /// <summary>
  25. /// 重修任务页面
  26. /// </summary>
  27. /// <returns></returns>
  28. public ActionResult List()
  29. {
  30. return View();
  31. }
  32. /// <summary>
  33. /// 重修任务列表查询
  34. /// </summary>
  35. /// <param name="pararms"></param>
  36. /// <returns></returns>
  37. [HttpPost]
  38. public ActionResult List(QueryParamsModel pararms)
  39. {
  40. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  41. var schoolyearID = pararms.getExtraGuid("SchoolYearDropdown").ToString() == DropdownList.SELECT_ALL.ToString() ? null : pararms.getExtraGuid("SchoolYearDropdown");
  42. //开课院系所
  43. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  44. //开课教研室
  45. var departmentID = pararms.getExtraGuid("DepartmentComboGrid");
  46. var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
  47. var retakeTypeID = pararms.getExtraInt("DictionaryRetakeType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryRetakeType");
  48. var statusID = pararms.getExtraInt("DictionaryStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryStatus");
  49. return Json(RetakePlanServices.GetRetakePlanTaskView(configuretView, schoolyearID, collegeID, departmentID, coursematerialID,
  50. retakeTypeID, statusID, (int)pararms.page, (int)pararms.rows));
  51. }
  52. /// <summary>
  53. /// 重修任务分班
  54. /// </summary>
  55. /// <param name="RetakePlanID"></param>
  56. /// <returns></returns>
  57. public ActionResult DivideIntoClassesEdit(Guid? retakePlanID)
  58. {
  59. RetakeDivideIntoClassesView divideIntoClassesView = new RetakeDivideIntoClassesView();
  60. if (retakePlanID != Guid.Empty && retakePlanID.HasValue)
  61. {
  62. divideIntoClassesView = RetakePlanServices.GetDivideIntoClassesView(retakePlanID);
  63. ViewBag.StudentTotalNum = divideIntoClassesView.StudentTotalNum;
  64. }
  65. return View(divideIntoClassesView);
  66. }
  67. /// <summary>
  68. /// 重修任务分班
  69. /// </summary>
  70. /// <param name="divideIntoClassesView"></param>
  71. /// <returns></returns>
  72. [HttpPost]
  73. public ActionResult DivideIntoClassesEdit(RetakeDivideIntoClassesView divideIntoClassesView)
  74. {
  75. try
  76. {
  77. divideIntoClassesView.GroupNum = Convert.ToInt32(Request.Form["hid_GroupNum"]);
  78. divideIntoClassesView.StudentNum = Convert.ToInt32(Request.Form["hid_StudentNum"]);
  79. divideIntoClassesView.StudentTotalNum = Convert.ToInt32(Request.Form["hid_StudentTotalNum"]);
  80. RetakePlanServices.DivideIntoClassesSeparate(divideIntoClassesView);
  81. return Json(new ReturnMessage()
  82. {
  83. IsSuccess = true,
  84. Message = "分班成功。"
  85. });
  86. }
  87. catch (Exception ex)
  88. {
  89. return Json(new ReturnMessage()
  90. {
  91. IsSuccess = false,
  92. Message = "分班失败,原因:" + ex.Message
  93. });
  94. }
  95. }
  96. /// <summary>
  97. /// 编辑
  98. /// </summary>
  99. /// <param name="RetakePlanID"></param>
  100. /// <returns></returns>
  101. public ActionResult Edit(Guid? retakePlanID)
  102. {
  103. RetakePlanTaskSettingView retakePlanTaskView = new RetakePlanTaskSettingView();
  104. if (retakePlanID != Guid.Empty && retakePlanID.HasValue)
  105. {
  106. retakePlanTaskView = RetakePlanServices.GetRetakePlanTaskUpdateView(retakePlanID);
  107. //处理方式(暂时无效)
  108. retakePlanTaskView.HandleModeID = retakePlanTaskView.HandleModeID.HasValue ?
  109. retakePlanTaskView.HandleModeID : (int)EMIS.ViewModel.CF_HandleMode.RequiredCourse;
  110. //重修任务状态标识
  111. ViewBag.Status = retakePlanTaskView.RecordStatus;
  112. }
  113. else
  114. {
  115. retakePlanTaskView.ExaminationModeID = (int)CF_ExaminationMode.WrittenExam;
  116. retakePlanTaskView.IsRequired = true;
  117. retakePlanTaskView.PeopleNumlimit = 0;
  118. retakePlanTaskView.PeopleNumlower = 0;
  119. }
  120. return View(retakePlanTaskView);
  121. }
  122. /// <summary>
  123. /// 编辑
  124. /// </summary>
  125. /// <param name="RetakePlanTaskSetting"></param>
  126. /// <returns></returns>
  127. [HttpPost]
  128. public ActionResult Edit(RetakePlanTaskSettingView retakePlanTaskSettingView)
  129. {
  130. int? type = 0;
  131. try
  132. {
  133. //排课明细列表
  134. var schedulingList = DataGrid.GetTableData<RetakePlanSettingSchedulingView>("dgSchedulingList");
  135. //任课教师列表
  136. var teacherList = DataGrid.GetTableData<RetakePlanTeacherListView>("dgTeacherList");
  137. RetakePlanServices.RetakePlanTaskSet(retakePlanTaskSettingView, teacherList, schedulingList, out type);
  138. return Json(new ReturnMessage()
  139. {
  140. IsSuccess = true,
  141. Message = "保存成功。"
  142. });
  143. }
  144. catch (Exception ex)
  145. {
  146. //如果验证到排课冲突type返回1,页面js根据type弹出选择框
  147. //用户可选择继续保存或不保存,如果不返回1,弹出一般的错误提示框
  148. if (type == 1)
  149. {
  150. return Json(new ReturnMessage()
  151. {
  152. Type = 1,
  153. IsSuccess = false,
  154. Message = "保存失败:" + ex.Message
  155. });
  156. }
  157. else
  158. {
  159. return Json(new ReturnMessage()
  160. {
  161. Type = 2,
  162. IsSuccess = false,
  163. Message = "保存失败:" + ex.Message
  164. });
  165. }
  166. }
  167. }
  168. /// <summary>
  169. /// 删除(需要检测是否存在对应的已报名重修计划名单,根据重修计划ID)
  170. /// </summary>
  171. /// <param name="RetakePlanIDs"></param>
  172. /// <returns></returns>
  173. [HttpPost]
  174. public ActionResult Delete(string RetakePlanIDs)
  175. {
  176. try
  177. {
  178. List<Guid?> list = RetakePlanIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
  179. .Select(x => (Guid?)new Guid(x)).ToList();
  180. RetakePlanServices.DeleteRetakePlanTask(list);
  181. return Json(new ReturnMessage()
  182. {
  183. IsSuccess = true,
  184. Message = "删除成功。"
  185. });
  186. }
  187. catch (Exception ex)
  188. {
  189. return Json(new ReturnMessage()
  190. {
  191. IsSuccess = false,
  192. Message = "删除失败,原因:" + ex.Message
  193. });
  194. }
  195. }
  196. /// <summary>
  197. /// 检测是否存在对应的已报名重修计划名单(根据重修计划ID)
  198. /// </summary>
  199. /// <param name="retakePlanIDs"></param>
  200. /// <returns></returns>
  201. [HttpPost]
  202. public ActionResult IsExistsApplyStudentByRetakePlanID(string retakePlanIDs)
  203. {
  204. try
  205. {
  206. var result = RetakePlanServices.IsExistsApplyStudentByRetakePlanID(retakePlanIDs);
  207. return Json(new ReturnMessage<bool>
  208. {
  209. IsSuccess = true,
  210. Data = result
  211. });
  212. }
  213. catch (Exception ex)
  214. {
  215. return Json(new ReturnMessage<bool>
  216. {
  217. IsSuccess = false,
  218. Data = false,
  219. Message = ex.Message
  220. });
  221. }
  222. }
  223. /// <summary>
  224. /// 重修计划取消开放(删除对应的重修计划报名名单)
  225. /// </summary>
  226. /// <param name="RetakePlanIDs"></param>
  227. /// <returns></returns>
  228. [HttpPost]
  229. public ActionResult CancleOpen(string RetakePlanIDs)
  230. {
  231. try
  232. {
  233. List<Guid?> list = RetakePlanIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
  234. .Select(x => (Guid?)new Guid(x)).ToList();
  235. RetakePlanServices.CancleRetakePlanTask(list);
  236. return Json(new ReturnMessage()
  237. {
  238. IsSuccess = true,
  239. Message = "取消开放成功。"
  240. });
  241. }
  242. catch (Exception ex)
  243. {
  244. return Json(new ReturnMessage()
  245. {
  246. IsSuccess = false,
  247. Message = "取消开放失败,原因:" + ex.Message
  248. });
  249. }
  250. }
  251. /// <summary>
  252. /// 重修计划开放
  253. /// </summary>
  254. /// <param name="RetakePlanIDs"></param>
  255. /// <returns></returns>
  256. [HttpPost]
  257. public ActionResult Open(string RetakePlanIDs)
  258. {
  259. try
  260. {
  261. List<Guid?> list = RetakePlanIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
  262. .Select(x => (Guid?)new Guid(x)).ToList();
  263. RetakePlanServices.OpenRetakePlanTask(list);
  264. return Json(new ReturnMessage()
  265. {
  266. IsSuccess = true,
  267. Message = "开放成功。"
  268. });
  269. }
  270. catch (Exception ex)
  271. {
  272. return Json(new ReturnMessage()
  273. {
  274. IsSuccess = false,
  275. Message = "开放失败,原因:" + ex.Message
  276. });
  277. }
  278. }
  279. /// <summary>
  280. /// 排课明细
  281. /// </summary>
  282. /// <param name="RetakePlanID"></param>
  283. /// <returns></returns>
  284. public ActionResult GetSchedulingViewList(Guid? RetakePlanID)
  285. {
  286. var schedulingViewList = RetakePlanServices.GetSchedulingView(RetakePlanID);
  287. return Json(new GridResultSet<RetakePlanSettingSchedulingView> { rows = schedulingViewList, total = schedulingViewList.Count });
  288. }
  289. /// <summary>
  290. /// 任课教师
  291. /// </summary>
  292. /// <param name="pararms"></param>
  293. /// <returns></returns>
  294. public ActionResult TeacherList(Guid? RetakePlanID)
  295. {
  296. var teacherListView = RetakePlanServices.GetTeacherListView(RetakePlanID);
  297. return base.Json(new GridResultSet<RetakePlanTeacherListView>() { rows = teacherListView, total = teacherListView.Count });
  298. }
  299. /// <summary>
  300. /// 授课方式
  301. /// </summary>
  302. /// <param name="RetakePlanID"></param>
  303. /// <returns></returns>
  304. public ActionResult TeachingModeType(Guid? RetakePlanID)
  305. {
  306. List<int> list = new List<int>();
  307. if (RetakePlanID != Guid.Empty && RetakePlanID.HasValue)
  308. {
  309. list = RetakePlanServices.GetTeachingModeType(RetakePlanID);
  310. }
  311. else
  312. {
  313. list.Add(((int)EMIS.ViewModel.CF_TeachingMode.Theory));
  314. }
  315. return base.Json(list.ConvertAll(x => x.ToString()));
  316. }
  317. /// <summary>
  318. /// 授课地点
  319. /// </summary>
  320. /// <param name="RetakePlanID"></param>
  321. /// <returns></returns>
  322. public ActionResult TeachingPlace(Guid? RetakePlanID)
  323. {
  324. List<int> list = new List<int>();
  325. if (RetakePlanID != Guid.Empty && RetakePlanID.HasValue)
  326. {
  327. list = RetakePlanServices.GetTeachingPlace(RetakePlanID);
  328. }
  329. return base.Json(list.ConvertAll(x => x.ToString()));
  330. }
  331. /// <summary>
  332. /// 重修计划名单列表信息
  333. /// </summary>
  334. /// <returns></returns>
  335. public ActionResult StudentDetail()
  336. {
  337. return View();
  338. }
  339. /// <summary>
  340. /// 重修计划名单列表信息
  341. /// </summary>
  342. /// <param name="pararms"></param>
  343. /// <returns></returns>
  344. [HttpPost]
  345. public ActionResult StudentDetail(QueryParamsModel pararms)
  346. {
  347. var retakePlanID = Request["RetakePlanID"].ParseStrTo<Guid>();
  348. return Json(RetakePlanServices.GetRetakePlanTaskStudentView(retakePlanID, (int)pararms.page, (int)pararms.rows));
  349. }
  350. /// <summary>
  351. /// 重修计划名单添加
  352. /// </summary>
  353. /// <returns></returns>
  354. public ActionResult StudentSelect()
  355. {
  356. var RetakePlanID = Request["RetakePlanID"].ParseStrTo<Guid>();
  357. ViewBag.RetakePlanID = RetakePlanID;
  358. return View();
  359. }
  360. /// <summary>
  361. /// 重修计划名单添加
  362. /// </summary>
  363. /// <param name="finallyScoreIDs"></param>
  364. /// <param name="retakePlanTaskView"></param>
  365. /// <returns></returns>
  366. [HttpPost]
  367. public ActionResult StudentSelect(string finallyScoreIDs, RetakePlanTaskView retakePlanTaskView)
  368. {
  369. try
  370. {
  371. //最终成绩信息IDList
  372. var finallyScoreIDList = finallyScoreIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
  373. .Select(x => (Guid?)new Guid(x)).ToList();
  374. RetakePlanServices.AddStudent(retakePlanTaskView.RetakePlanID, finallyScoreIDList);
  375. return Json(new ReturnMessage()
  376. {
  377. IsSuccess = true,
  378. Message = "添加成功。"
  379. });
  380. }
  381. catch (Exception ex)
  382. {
  383. return Json(new ReturnMessage()
  384. {
  385. IsSuccess = false,
  386. Message = "添加失败,原因:" + ex.Message
  387. });
  388. }
  389. }
  390. /// <summary>
  391. /// 查询对应的重修计划名单列表(不需排除已在其它相应的重修计划中存在的名单,不及格成绩,小于60分)
  392. /// </summary>
  393. /// <param name="pararms"></param>
  394. /// <returns></returns>
  395. [HttpPost]
  396. public ActionResult BaseStudentViewList(QueryParamsModel pararms)
  397. {
  398. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  399. var retakePlanID = new Guid(Request["RetakePlanID"]);
  400. var gradeYearID = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
  401. var standardID = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard");
  402. var classmajorID = pararms.getExtraGuid("cbgClassmajor");
  403. //在校状态
  404. var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
  405. return Json(RetakePlanServices.GetStudentView(configuretView, retakePlanID, gradeYearID, standardID,
  406. classmajorID, inSchoolStatus, (int)pararms.page, (int)pararms.rows));
  407. }
  408. /// <summary>
  409. /// 删除(重修计划名单删除,根据重修计划名单ID)
  410. /// </summary>
  411. /// <param name="retakePlanStudentIDs"></param>
  412. /// <returns></returns>
  413. [HttpPost]
  414. public ActionResult DeleteStudent(string retakePlanStudentIDs)
  415. {
  416. try
  417. {
  418. List<Guid?> list = retakePlanStudentIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
  419. .Select(x => (Guid?)new Guid(x)).ToList();
  420. RetakePlanServices.DeleteStudent(list);
  421. return Json(new ReturnMessage()
  422. {
  423. IsSuccess = true,
  424. Message = "删除成功。"
  425. });
  426. }
  427. catch (Exception ex)
  428. {
  429. return Json(new ReturnMessage()
  430. {
  431. IsSuccess = false,
  432. Message = "删除失败,原因:" + ex.Message
  433. });
  434. }
  435. }
  436. /// <summary>
  437. /// 检测是否存在对应的已报名重修计划名单(根据重修计划ID)
  438. /// </summary>
  439. /// <param name="retakePlanIDs"></param>
  440. /// <returns></returns>
  441. [HttpPost]
  442. public ActionResult IsExistsApplyStudentByRetakePlanStudentID(string retakePlanStudentIDs)
  443. {
  444. try
  445. {
  446. var result = RetakePlanServices.IsExistsApplyStudentByRetakePlanStudentID(retakePlanStudentIDs);
  447. return Json(new ReturnMessage<bool>
  448. {
  449. IsSuccess = true,
  450. Data = result
  451. });
  452. }
  453. catch (Exception ex)
  454. {
  455. return Json(new ReturnMessage<bool>
  456. {
  457. IsSuccess = false,
  458. Data = false,
  459. Message = ex.Message
  460. });
  461. }
  462. }
  463. /// <summary>
  464. /// 重修计划名单Excel导出
  465. /// </summary>
  466. /// <param name="pararms"></param>
  467. /// <returns></returns>
  468. [HttpPost]
  469. public ActionResult StudentDetail_Excel(QueryParamsModel pararms)
  470. {
  471. NpoiExcelHelper neh = new NpoiExcelHelper();
  472. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  473. var retakePlanID = Request["RetakePlanID"].ParseStrTo<Guid>();
  474. var dt = RetakePlanServices.GetRetakePlanTaskStudentViewList(configuretView, retakePlanID)
  475. .Select(x => new
  476. {
  477. x.SchoolyearCode,
  478. x.ClassName,
  479. x.RecordStatusName,
  480. x.RetakeTypeName,
  481. x.LoginID,
  482. x.UserName,
  483. x.SexName,
  484. x.InSchoolStatusName,
  485. x.StudentStatusName,
  486. x.ClassmajorCode,
  487. x.ClassmajorName,
  488. x.GrademajorCode,
  489. x.GrademajorName,
  490. x.CourseCode,
  491. x.CourseName,
  492. x.CourseTypeDesc,
  493. x.CourseCredit,
  494. x.Totalhours,
  495. x.SchoolyearNumDesc,
  496. x.StarttermDesc,
  497. x.DepartmentCode,
  498. x.DepartmentName,
  499. x.ApplyStatusName
  500. }).ToTable();
  501. string[] liststring = {
  502. "重修学年学期", "重修班级名称", "重修任务状态", "重修类型", "学号", "姓名", "性别", "在校状态",
  503. "学籍状态", "班级编号", "班级名称", "年级专业编号", "年级专业名称", "课程代码", "课程名称",
  504. "课程类型", "课程学分", "总学时", "开课学年", "开课学期", "开课教研室代码", "开课教研室名称",
  505. "报名状态"
  506. };
  507. neh.Export(dt, liststring, "重修计划名单信息" + DateTime.Now.ToString("yyyyMMddhhmmss"));
  508. return RedirectToAction("MsgShow", "Common", new
  509. {
  510. msg = "导出成功。",
  511. url = Url.Content("~/RetakePlanTask/List").AddMenuParameter()
  512. });
  513. }
  514. /// <summary>
  515. /// 添加节次(排课检查)
  516. /// </summary>
  517. /// <returns></returns>
  518. public ActionResult CoursesTimeList()
  519. {
  520. return View();
  521. }
  522. /// <summary>
  523. /// 添加教室(排课检查)
  524. /// </summary>
  525. /// <returns></returns>
  526. public ActionResult CourseProcessClassroomList()
  527. {
  528. return View();
  529. }
  530. /// <summary>
  531. /// 添加教室(排课冲突检查,列出课程进度中的可选教室)
  532. /// </summary>
  533. /// <param name="pararms"></param>
  534. /// <returns></returns>
  535. [HttpPost]
  536. public ActionResult GetCourseProcessClassroomList(QueryParamsModel pararms)
  537. {
  538. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  539. int? classroomType = pararms.getExtraString("ClassroomType").ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : pararms.getExtraString("ClassroomType").ParseStrTo<int>();
  540. string schedulingWeek = pararms.getExtraString("schedulingWeek");
  541. int? weekday = pararms.getExtraString("weekDay").ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : pararms.getExtraString("weekDay").ParseStrTo<int>();
  542. var coursesTimeID = pararms.getExtraGuid("coursesTimeID") ?? Guid.Empty;
  543. //int? minSeatCount = pararms.getExtraString("MinSeatCount").ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : pararms.getExtraString("MinSeatCount").ParseStrTo<int>();
  544. //var collegeID = pararms.getExtraGuid("CollegeDropdown") ?? Guid.Empty;
  545. var schoolYearID = pararms.getExtraGuid("SchoolYearID") ?? Guid.Empty;
  546. var buildingsID = pararms.getExtraInt("BuildingsDropdown") == DropdownList.SELECT_ALL ? null : pararms.getExtraGuid("BuildingsDropdown");
  547. return base.Json(RetakePlanServices.GetAvailableClassroom(configuretView, buildingsID, schedulingWeek, weekday, coursesTimeID, classroomType, schoolYearID, (int)pararms.page, (int)pararms.rows));
  548. }
  549. /// <summary>
  550. /// Excel导出
  551. /// </summary>
  552. /// <returns></returns>
  553. [HttpPost]
  554. public ActionResult Excel()
  555. {
  556. NpoiExcelHelper neh = new NpoiExcelHelper();
  557. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
  558. var schoolyearID = Request.Form["SchoolYearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>();
  559. //开课院系所
  560. var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
  561. //开课教研室
  562. var departmentID = Request.Form["DepartmentComboGrid"].ParseStrTo<Guid>();
  563. var coursematerialID = Request.Form["CoursematerialComboGrid"].ParseStrTo<Guid>();
  564. var retakeTypeID = Request.Form["DictionaryRetakeType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryRetakeType"].ParseStrTo<int>();
  565. var statusID = Request.Form["DictionaryStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryStatus"].ParseStrTo<int>();
  566. var dt = RetakePlanServices.GetRetakePlanTaskViewList(configuretView, schoolyearID, collegeID, departmentID,
  567. coursematerialID, retakeTypeID, statusID)
  568. .Select(x => new
  569. {
  570. x.SchoolyearCode,
  571. x.ClassName,
  572. x.RetakeTypeName,
  573. x.CourseCode,
  574. x.CourseName,
  575. x.CourseTypeName,
  576. x.Credit,
  577. x.Totalhours,
  578. x.StartEndWeeklyNum,
  579. x.WeekdayTimesSegmentName,
  580. x.ClassroomName,
  581. x.TeacherName,
  582. x.PeopleNumlower,
  583. x.PeopleNumlimit,
  584. x.DepartmentName,
  585. x.CourseCollegeName,
  586. x.PlanNumber,
  587. x.RecordStatusName
  588. }).ToTable();
  589. string[] liststring = {
  590. "重修学年学期", "重修班级名称", "重修类型", "课程代码", "课程名称", "课程类型", "课程学分",
  591. "总学时", "起止周次", "上课时间", "教室", "任课教师", "人数下限", "人数上限","开课教研室",
  592. "开课" + RSL.Get("CollegeName"), "计划人数", "重修任务状态"
  593. };
  594. neh.Export(dt, liststring, "重修任务信息" + DateTime.Now.ToString("yyyyMMddhhmmss"));
  595. return RedirectToAction("MsgShow", "Common", new
  596. {
  597. msg = "导出成功。",
  598. url = Url.Content("~/RetakePlanTask/List").AddMenuParameter()
  599. });
  600. }
  601. }
  602. }