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.
 
 
 
 
 
 

346 lines
10 KiB

  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. #endregion
  181. #region 提交数据
  182. /// <summary>
  183. /// 删除实体数据
  184. /// <param name="keyValue">主键</param>
  185. /// <summary>
  186. /// <returns></returns>
  187. [HttpPost]
  188. [AjaxOnly]
  189. public ActionResult DeleteForm(string keyValue)
  190. {
  191. sys_ReceiveFileIBLL.VirtualDeleteEntity(keyValue);
  192. return Success("删除成功!");
  193. }
  194. /// <summary>
  195. /// 设置批示状态为已处理
  196. /// <param name="keyValue">主键</param>
  197. /// <summary>
  198. /// <returns></returns>
  199. [HttpGet]
  200. [AjaxOnly]
  201. public ActionResult DisPose(string keyValue)
  202. {
  203. sys_ReceiveFileIBLL.DisPose(keyValue);
  204. return Success("操作成功!");
  205. }
  206. /// <summary>
  207. /// 重置
  208. /// <param name="keyValue">主键</param>
  209. /// <summary>
  210. /// <returns></returns>
  211. [HttpGet]
  212. [AjaxOnly]
  213. public ActionResult Reset(string keyValue)
  214. {
  215. sys_ReceiveFileIBLL.Reset(keyValue);
  216. return Success("操作成功!");
  217. }
  218. /// <summary>
  219. /// 保存实体数据(新增、修改)
  220. /// <param name="keyValue">主键</param>
  221. /// <summary>
  222. /// <returns></returns>
  223. [HttpPost]
  224. [ValidateAntiForgeryToken]
  225. [AjaxOnly]
  226. public ActionResult SaveForm(string keyValue, string strEntity)
  227. {
  228. Sys_ReceiveFileEntity entity = strEntity.ToObject<Sys_ReceiveFileEntity>();
  229. sys_ReceiveFileIBLL.SaveEntity(keyValue, entity);
  230. return Success("保存成功!");
  231. }
  232. /// <summary>
  233. /// 保存实体数据(新增、修改)
  234. /// <param name="keyValue">主键</param>
  235. /// <summary>
  236. /// <returns></returns>
  237. [HttpPost]
  238. [ValidateAntiForgeryToken]
  239. [AjaxOnly]
  240. public ActionResult Issue(string strEntity)
  241. {
  242. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  243. sys_ReceiveFileIBLL.Issue(entity);
  244. return Success("保存成功!");
  245. }
  246. /// <summary>
  247. /// 公文接收 下发指定接收人
  248. /// <param name="keyValue">主键</param>
  249. /// <summary>
  250. /// <returns></returns>
  251. [HttpPost]
  252. [ValidateAntiForgeryToken]
  253. [AjaxOnly]
  254. public ActionResult ReceiveDocumentIssue(string strEntity)
  255. {
  256. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  257. sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
  258. return Success("保存成功!");
  259. }
  260. /// <summary>
  261. /// 主任批示
  262. /// </summary>
  263. /// <returns></returns>
  264. [HttpPost]
  265. [AjaxOnly]
  266. public ActionResult ZhuRenP(string strEntity)
  267. {
  268. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  269. entity.SpecifyReceiver = sys_ReceiveFileIBLL.ZhuRenP();
  270. //entity.SpecifyReceiver = "System";
  271. sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
  272. return Success("发送成功");
  273. }
  274. /// <summary>
  275. /// 校长批示
  276. /// </summary>
  277. /// <returns></returns>
  278. [HttpPost]
  279. [AjaxOnly]
  280. public ActionResult XiaoZhangP(string strEntity)
  281. {
  282. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  283. entity.SpecifyReceiver = sys_ReceiveFileIBLL.XiaoZhangP();
  284. //entity.SpecifyReceiver = "System";
  285. sys_ReceiveFileIBLL.ReceiveDocumentIssue(entity);
  286. return Success("发送成功");
  287. }
  288. /// <summary>
  289. /// 根据角色批示
  290. /// </summary>
  291. /// <returns></returns>
  292. [HttpPost]
  293. [AjaxOnly]
  294. public ActionResult RoleReceive(string strEntity)
  295. {
  296. Sys_IssueEntity entity = strEntity.ToObject<Sys_IssueEntity>();
  297. var data = userRelationIBLL.GetUserIdList(entity.SpecifyReceiver);
  298. string userIds = "";
  299. foreach (var item in data)
  300. {
  301. if (userIds != "")
  302. {
  303. userIds += ",";
  304. }
  305. userIds += item.F_UserId;
  306. }
  307. entity.SpecifyReceiver = userIds;
  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. }