123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using System.IO;
- using System.Text;
- using System.Data;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Data;
- using Bowin.Common.Utility;
- using Bowin.Common.Exceptions;
- using EMIS.Utility;
- using EMIS.Web.Controls;
- using EMIS.ViewModel;
- using EMIS.ViewModel.StudentManage.OnlineChecking;
- using EMIS.CommonLogic.StudentWeb.InfoCenter;
- namespace EMIS.Web.Controllers.StudentWeb.InfoCenter
- {
- [Authorization]
- public class CheckingResultController : Controller
- {
- public Lazy<ICheckingResultServices> CheckingResultServices { get; set; }
- /// <summary>
- /// 校对结果(学生)页面
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 校对结果(学生)页面列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var checkingTypeID = pararms.getExtraInt("DictionaryCheckingType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCheckingType");
- var approvalStatus = pararms.getExtraInt("DictionaryApprovalStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryApprovalStatus");
- return base.Json(CheckingResultServices.Value.GetStudentCheckingResultViewGrid(configuretView, user.UserID, checkingTypeID, approvalStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <param name="studentRecordChangeHistoryID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Edit(Guid? studentRecordChangeHistoryID)
- {
- CheckingHistoryView checkingHistoryView = new CheckingHistoryView();
- if (studentRecordChangeHistoryID.HasValue && studentRecordChangeHistoryID != Guid.Empty)
- {
- checkingHistoryView = CheckingResultServices.Value.GetStudentCheckingResultView(studentRecordChangeHistoryID);
- }
- return View(checkingHistoryView);
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <param name="checkingHistoryView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(CheckingHistoryView checkingHistoryView)
- {
- try
- {
- //CheckingResultServices.Value.CheckingResultEdit(checkingHistoryView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 撤消
- /// </summary>
- /// <param name="studentRecordChangeHistoryIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Cancel(string studentRecordChangeHistoryIDs)
- {
- try
- {
- var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- List<Guid?> list = studentRecordChangeHistoryIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- CheckingResultServices.Value.StudentCheckingResultCancel(list, user.UserID);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "撤消成功。" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "撤消失败,原因:" + ex.Message });
- }
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var user = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var checkingTypeID = Request.Form["DictionaryCheckingType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryCheckingType"].ParseStrTo<int>();
- var approvalStatus = Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryApprovalStatus"].ParseStrTo<int>();
- var dt = CheckingResultServices.Value.GetStudentCheckingResultViewList(configuretView, user.UserID, checkingTypeID, approvalStatus)
- .Select(x => new
- {
- x.StudentNo,
- x.Name,
- x.SexName,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyyMMdd") : ""),
- x.NationName,
- x.PoliticsName,
- x.ClassmajorName,
- x.Description,
- x.CheckingTypeName,
- x.CheckingBeforeContent,
- x.CheckingAfterContent,
- x.IP,
- x.ApprovalStatusName,
- x.Comment,
- ApprovalTime = (x.ApprovalTime.HasValue ? x.ApprovalTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")
- }).ToTable();
- string[] liststring = {
- "学号", "姓名", "性别", "出生日期", "民族", "政治面貌", "班级名称", "校对名称",
- "校对类型", "校对前内容", "校对后内容", "IP地址", "状态", "处理意见", "审核时间"
- };
- neh.Export(dt, liststring, "校对结果信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- }
- }
|