|
- using Learun.Util;
- using System.Data;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using System.Web.Mvc;
- using System.Collections.Generic;
- using System.Linq;
-
- namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创 建:超级管理员
- /// 日 期:2019-10-22 16:58
- /// 描 述:文件接收
- /// </summary>
- public class SYS_ReceiveDocumentController : MvcControllerBase
- {
- private SYS_ReceiveDocumentIBLL sYS_ReceiveDocumentIBLL = new SYS_ReceiveDocumentBLL();
- private Sys_ReceiveFileIBLL receiveFileIbll = new Sys_ReceiveFileBLL();
-
- #region 视图功能
-
- /// <summary>
- /// 主页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
-
- /// <summary>
- /// 公文接收归档
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexFile()
- {
- return View();
- }
-
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormView()
- {
- return View();
- }
- /// <summary>
- /// 指派人列表
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IssueForm()
- {
- return View();
- }
-
- /// <summary>
- /// 阅读详情
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ReadList()
- {
- return View();
- }
- /// <summary>
- /// 打印页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult PrintView()
- {
- return View();
- }
- #endregion
-
- #region 获取数据
-
- /// <summary>
- /// 获取页面显示列表数据
- /// <summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = sYS_ReceiveDocumentIBLL.GetPageList(paginationobj, queryJson);
-
- foreach (var item in data)
- {
- var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.RID}'";
- var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.RID}'";
- var readdt = sYS_ReceiveDocumentIBLL.Execute(sql);
- var senddt = sYS_ReceiveDocumentIBLL.Execute(sendSql);
- var readcount = readdt.Rows[0][0];
- var sendcount = senddt.Rows[0][0];
- item.NumberPeople = $"{readcount}/{sendcount}";
- }
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
-
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var Sys_ReceiveDocumentData = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
- var jsonData = new
- {
- Sys_ReceiveDocument = Sys_ReceiveDocumentData,
- };
- return Success(jsonData);
- }
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormDataByProcessId(string processId)
- {
- var Sys_ReceiveDocumentData = sYS_ReceiveDocumentIBLL.GetEntityByProcessId(processId);
- var jsonData = new
- {
- Sys_ReceiveDocument = Sys_ReceiveDocumentData,
- };
- return Success(jsonData);
- }
-
-
-
- public ActionResult PrintInfo(string keyValue)
- {
- var entity = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
- var entityItem = receiveFileIbll.GetPageListBySendId(keyValue).ToList().Where(a => a.ReadTime != null).OrderBy(a => a.ReadTime);
- object data = new
- {
- entity,
- entityItem
- };
-
- return Success(data);
- }
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- sYS_ReceiveDocumentIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 结束下发
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult OverIssue(string keyValue)
- {
- var entity = sYS_ReceiveDocumentIBLL.GetSys_ReceiveDocumentEntity(keyValue);
- if (null != entity)
- {
- entity.RSendFlag = "4";
- sYS_ReceiveDocumentIBLL.SaveEntity(keyValue, entity);
- }
- return Success("操作成功!");
- }
-
-
-
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- [ValidateInput(false)]
- public ActionResult SaveForm(string keyValue, string strEntity)
- {
- Sys_ReceiveDocumentEntity entity = strEntity.ToObject<Sys_ReceiveDocumentEntity>();
- sYS_ReceiveDocumentIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
-
- /// <summary>
- /// 提交申请
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult ChangeStatusById(string keyValue, string processId)
- {
- sYS_ReceiveDocumentIBLL.ChangeStatusById(keyValue, 1, processId);
- return Success("操作成功!");
- }
-
- #endregion
-
- }
- }
|