You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Sys_ReceiveFileController.cs 10 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Web;
  8. using Learun.Application.Base.SystemModule;
  9. using Learun.Application.Base.AuthorizeModule;
  10. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  11. {
  12. /// <summary>
  13. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  14. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  15. /// 创 建:超级管理员
  16. /// 日 期:2019-04-11 10:08
  17. /// 描 述:公文收发
  18. /// </summary>
  19. public class Sys_ReceiveFileController : MvcControllerBase
  20. {
  21. private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL();
  22. private AnnexesFileIBLL annexesFileIbll = new AnnexesFileBLL();
  23. private UserRelationIBLL userRelationIBLL = new UserRelationBLL();
  24. #region 视图功能
  25. /// <summary>
  26. /// 主页面
  27. /// <summary>
  28. /// <returns></returns>
  29. [HttpGet]
  30. public ActionResult Index()
  31. {
  32. return View();
  33. }
  34. [HttpGet]
  35. public ActionResult FormReadDocument()
  36. {
  37. return View();
  38. }
  39. [HttpGet]
  40. public ActionResult IndexDocument()
  41. {
  42. return View();
  43. }
  44. /// <summary>
  45. /// 指定接收人表单页
  46. /// </summary>
  47. /// <returns></returns>
  48. [HttpGet]
  49. public ActionResult SpecifyReceiverForm()
  50. {
  51. return View();
  52. }
  53. /// <summary>
  54. /// 主页面【党政公文查阅】
  55. /// </summary>
  56. /// <returns></returns>
  57. [HttpGet]
  58. public ActionResult IndexParty()
  59. {
  60. return View();
  61. }
  62. /// <summary>
  63. /// 主页面【党政公文查阅】
  64. /// </summary>
  65. /// <returns></returns>
  66. [HttpGet]
  67. public ActionResult IndexGWJS()
  68. {
  69. return View();
  70. }
  71. /// <summary>
  72. /// 表单页
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. public ActionResult Form()
  77. {
  78. return View();
  79. }
  80. [HttpGet]
  81. public ActionResult FormDocument()
  82. {
  83. return View();
  84. }
  85. /// <summary>
  86. /// 表单页【党政公文查阅】
  87. /// <summary>
  88. /// <returns></returns>
  89. [HttpGet]
  90. public ActionResult FormParty()
  91. {
  92. return View();
  93. }
  94. #endregion
  95. #region 获取数据
  96. /// <summary>
  97. /// 获取页面显示列表数据
  98. /// <summary>
  99. /// <param name="queryJson">查询参数</param>
  100. /// <returns></returns>
  101. [HttpGet]
  102. [AjaxOnly]
  103. public ActionResult GetPageList(string pagination, string queryJson)
  104. {
  105. Pagination paginationobj = pagination.ToObject<Pagination>();
  106. var data = sys_ReceiveFileIBLL.GetPageList(paginationobj, queryJson);
  107. var jsonData = new
  108. {
  109. rows = data,
  110. total = paginationobj.total,
  111. page = paginationobj.page,
  112. records = paginationobj.records
  113. };
  114. return Success(jsonData);
  115. }
  116. /// <summary>
  117. /// 获取批示信息
  118. /// <summary>
  119. /// <param name="queryJson">查询参数</param>
  120. /// <returns></returns>
  121. [HttpGet]
  122. [AjaxOnly]
  123. public ActionResult GetInstructions(string keyValue)
  124. {
  125. var data = sys_ReceiveFileIBLL.GetInstructions(keyValue);
  126. var jsonData = new
  127. {
  128. rows = data,
  129. };
  130. return Success(jsonData);
  131. }
  132. /// <summary>
  133. /// 获取页面显示列表数据
  134. /// <summary>
  135. /// <param name="queryJson">查询参数</param>
  136. /// <returns></returns>
  137. [HttpGet]
  138. [AjaxOnly]
  139. public ActionResult GetPageListByUserId(string pagination, string queryJson)
  140. {
  141. var UserInfoEntity = LoginUserInfo.Get();
  142. Pagination paginationobj = pagination.ToObject<Pagination>();
  143. var data = sys_ReceiveFileIBLL.GetPageListByUserId(paginationobj, queryJson, UserInfoEntity.userId);
  144. var jsonData = new
  145. {
  146. rows = data,
  147. total = paginationobj.total,
  148. page = paginationobj.page,
  149. records = paginationobj.records
  150. };
  151. return Success(jsonData);
  152. }
  153. /// <summary>
  154. /// 获取表单数据
  155. /// <summary>
  156. /// <returns></returns>
  157. [HttpGet]
  158. [AjaxOnly]
  159. public ActionResult GetFormData(string keyValue)
  160. {
  161. var Sys_ReceiveFileData = sys_ReceiveFileIBLL.GetSys_ReceiveFileEntity(keyValue);
  162. Sys_ReceiveFileData.Contents = HttpUtility.HtmlDecode(Sys_ReceiveFileData.Contents);
  163. var jsonData = new
  164. {
  165. Sys_ReceiveFile = Sys_ReceiveFileData,
  166. };
  167. return Success(jsonData);
  168. }
  169. [HttpGet]
  170. [AjaxOnly]
  171. public ActionResult CheckRUrl(string keyValue)
  172. {
  173. var fileEntity = annexesFileIbll.GetList(keyValue);
  174. if (fileEntity != null && fileEntity.Count() > 0)
  175. {
  176. return Json(true, JsonRequestBehavior.AllowGet);
  177. }
  178. return Json(false, JsonRequestBehavior.AllowGet);
  179. }
  180. /// <summary>
  181. /// 根据角色批示
  182. /// </summary>
  183. /// <returns></returns>
  184. [HttpPost]
  185. [AjaxOnly]
  186. public ActionResult RoleReceive(string strEntity)
  187. {
  188. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  189. var data = userRelationIBLL.GetUserIdList(entity.SpecifyReceiver);
  190. string userIds = "";
  191. foreach (var item in data)
  192. {
  193. if (userIds != "")
  194. {
  195. userIds += ",";
  196. }
  197. userIds += item.F_UserId;
  198. }
  199. entity.SpecifyReceiver = userIds;
  200. sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
  201. return Success("发送成功");
  202. }
  203. #endregion
  204. #region 提交数据
  205. /// <summary>
  206. /// 删除实体数据
  207. /// <param name="keyValue">主键</param>
  208. /// <summary>
  209. /// <returns></returns>
  210. [HttpPost]
  211. [AjaxOnly]
  212. public ActionResult DeleteForm(string keyValue)
  213. {
  214. sys_ReceiveFileIBLL.VirtualDeleteEntity(keyValue);
  215. return Success("删除成功!");
  216. }
  217. /// <summary>
  218. /// 设置批示状态为已处理
  219. /// <param name="keyValue">主键</param>
  220. /// <summary>
  221. /// <returns></returns>
  222. [HttpGet]
  223. [AjaxOnly]
  224. public ActionResult DisPose(string keyValue)
  225. {
  226. sys_ReceiveFileIBLL.DisPose(keyValue);
  227. return Success("操作成功!");
  228. }
  229. /// <summary>
  230. /// 重置
  231. /// <param name="keyValue">主键</param>
  232. /// <summary>
  233. /// <returns></returns>
  234. [HttpGet]
  235. [AjaxOnly]
  236. public ActionResult Reset(string keyValue)
  237. {
  238. sys_ReceiveFileIBLL.Reset(keyValue);
  239. return Success("操作成功!");
  240. }
  241. /// <summary>
  242. /// 保存实体数据(新增、修改)
  243. /// <param name="keyValue">主键</param>
  244. /// <summary>
  245. /// <returns></returns>
  246. [HttpPost]
  247. [ValidateAntiForgeryToken]
  248. [AjaxOnly]
  249. public ActionResult SaveForm(string keyValue, string strEntity)
  250. {
  251. Sys_ReceiveFileEntity entity = strEntity.ToObject<Sys_ReceiveFileEntity>();
  252. sys_ReceiveFileIBLL.SaveEntity(keyValue, entity);
  253. return Success("保存成功!");
  254. }
  255. /// <summary>
  256. /// 保存实体数据(新增、修改)
  257. /// <param name="keyValue">主键</param>
  258. /// <summary>
  259. /// <returns></returns>
  260. [HttpPost]
  261. [ValidateAntiForgeryToken]
  262. [AjaxOnly]
  263. public ActionResult Issue(string strEntity)
  264. {
  265. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  266. sys_ReceiveFileIBLL.Issue(entity);
  267. return Success("保存成功!");
  268. }
  269. /// <summary>
  270. /// 公文接收 下发指定接收人
  271. /// <param name="keyValue">主键</param>
  272. /// <summary>
  273. /// <returns></returns>
  274. [HttpPost]
  275. [ValidateAntiForgeryToken]
  276. [AjaxOnly]
  277. public ActionResult ReceiveDocumentIssue(string strEntity)
  278. {
  279. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  280. sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
  281. return Success("保存成功!");
  282. }
  283. /// <summary>
  284. /// 主任批示
  285. /// </summary>
  286. /// <returns></returns>
  287. [HttpPost]
  288. [AjaxOnly]
  289. public ActionResult ZhuRenP(string strEntity)
  290. {
  291. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  292. entity.SpecifyReceiver = sys_ReceiveFileIBLL.ZhuRenP();
  293. //entity.SpecifyReceiver = "System";
  294. sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
  295. return Success("发送成功");
  296. }
  297. /// <summary>
  298. /// 校长批示
  299. /// </summary>
  300. /// <returns></returns>
  301. [HttpPost]
  302. [AjaxOnly]
  303. public ActionResult XiaoZhangP(string strEntity)
  304. {
  305. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  306. entity.SpecifyReceiver = sys_ReceiveFileIBLL.XiaoZhangP();
  307. //entity.SpecifyReceiver = "System";
  308. sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
  309. return Success("发送成功");
  310. }
  311. /// <summary>
  312. /// 查看实体数据
  313. /// <param name="keyValue">主键</param>
  314. /// <summary>
  315. /// <returns></returns>
  316. [HttpPost]
  317. [AjaxOnly]
  318. public ActionResult Read(string keyValue)
  319. {
  320. sys_ReceiveFileIBLL.ReadEntity(keyValue);
  321. return Success("保存成功!");
  322. }
  323. #endregion
  324. }
  325. }