|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- using System;
- using Learun.Util;
- using System.Data;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using System.Web.Mvc;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using Learun.Application.Web.Controllers;
-
- namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创 建:超级管理员
- /// 日 期:2019-04-11 10:31
- /// 描 述:公文发送
- /// </summary>
- public class Sys_SendFileController : MvcControllerBase
- {
- private Sys_SendFileIBLL sys_SendFileIBLL = new Sys_SendFileBLL();
-
- #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 IndexPartyFile()
- {
- return View();
- }
- [HttpGet]
- public ActionResult IndexDocument()
- {
- return View();
- }
-
- /// <summary>
- /// 公文下发表单页
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IssueForm()
- {
- return View();
- }
-
- /// <summary>
- /// 主页面【党政公文下发】
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexParty()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult FormDocument()
- {
- return View();
- }
-
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- /// <summary>
- /// 表单页【党政公文下发】
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormParty()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult FormView()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult FormDocumentView()
- {
- return View();
- }
-
- /// <summary>
- /// 【党政公文下发】
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormPartyView()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult ReadList()
- {
- return View();
- }
-
- [HttpGet]
- public ActionResult ReadListDocument()
- {
- return View();
- }
-
- /// <summary>
- /// 【党政公文下发】
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ReadListParty()
- {
- 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_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 1);
-
- foreach (var item in data)
- {
- var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.SFileId}'";
- var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.SFileId}'";
- var readdt = sys_SendFileIBLL.Execute(sql);
- var senddt = sys_SendFileIBLL.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);
- }
-
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageListDocument(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 2);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
-
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageListParty(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 3);
-
- foreach (var item in data)
- {
- var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.SFileId}'";
- var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.SFileId}'";
- var readdt = sys_SendFileIBLL.Execute(sql);
- var senddt = sys_SendFileIBLL.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_SendFileData = sys_SendFileIBLL.GetSys_SendFileEntity(keyValue);
- Sys_SendFileData.Contents = HttpUtility.HtmlDecode(Sys_SendFileData.Contents);
- var jsonData = new
- {
- Sys_SendFile = Sys_SendFileData,
- };
- return Success(jsonData);
- }
-
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormDataView(string keyValue)
- {
- var Sys_SendFileData = sys_SendFileIBLL.GetSys_SendFileEntity(keyValue);
- Sys_SendFileData.Contents = HttpUtility.HtmlDecode(Sys_SendFileData.Contents);
- var jsonData = new
- {
- Sys_SendFile = Sys_SendFileData,
- };
- return Success(jsonData);
- }
-
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormDataByProcessId(string processId)
- {
- var Sys_SendFileData = sys_SendFileIBLL.GetEntityByProcessId(processId);
- var jsonData = new
- {
- Sys_SendFile = Sys_SendFileData,
- };
- return Success(jsonData);
- }
-
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- sys_SendFileIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
-
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- [ValidateInput(false)]
- public ActionResult SaveForm(string keyValue, string strEntity)
- {
- Sys_SendFileEntity entity = strEntity.ToObject<Sys_SendFileEntity>();
- if (string.IsNullOrEmpty(keyValue))
- {
- entity.STypeId = 1;
- }
-
- sys_SendFileIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
-
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- [ValidateInput(false)]
- public ActionResult SaveFormDocument(string keyValue, string strEntity)
- {
- Sys_SendFileEntity entity = strEntity.ToObject<Sys_SendFileEntity>();
- if (string.IsNullOrEmpty(keyValue))
- {
- entity.STypeId = 2;
- }
-
- sys_SendFileIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
-
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- [ValidateInput(false)]
- public ActionResult SaveFormParty(string keyValue, string strEntity)
- {
- Sys_SendFileEntity entity = strEntity.ToObject<Sys_SendFileEntity>();
- if (string.IsNullOrEmpty(keyValue))
- {
- entity.STypeId = 3;
- }
-
- sys_SendFileIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
-
- /// <summary>
- /// 提交
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult ChangeStatusById(string keyValue, string processId)
- {
- sys_SendFileIBLL.ChangeStatusById(keyValue, 1, processId);
- return Success("操作成功!");
- }
-
- [HttpPost]
- [AjaxOnly]
- public ActionResult ChangeStatusByIdDocument(string keyValue)
- {
- string guid = Guid.NewGuid().ToString();
- sys_SendFileIBLL.ChangeStatusById(keyValue, 2, guid);
- sys_SendFileIBLL.ChangeStatusByProcessId(guid, 2);
- return Success("操作成功!");
- }
- /// <summary>
- /// 结束下发
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult OverIssue(string keyValue)
- {
- string guid = Guid.NewGuid().ToString();
- sys_SendFileIBLL.OverIssue(keyValue);
- return Success("下发成功!");
- }
-
- /// <summary>
- /// 提交
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult IssueList(string keyValue, string CreateUser)
- {
-
- sys_SendFileIBLL.IssueList(keyValue, CreateUser);
- return Success("操作成功!");
- }
-
- /// <summary>
- /// 作废
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult CancelList(string keyValue)
- {
- sys_SendFileIBLL.CancelList(keyValue);
- return Success("操作成功!");
- }
-
- #endregion
-
- }
- }
|