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_SendFileController.cs 12 KiB

4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. using System;
  2. using Learun.Util;
  3. using System.Data;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using System.Web.Mvc;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Web;
  9. using Learun.Application.Web.Controllers;
  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:31
  17. /// 描 述:公文发送
  18. /// </summary>
  19. public class Sys_SendFileController : MvcControllerBase
  20. {
  21. private Sys_SendFileIBLL sys_SendFileIBLL = new Sys_SendFileBLL();
  22. #region 视图功能
  23. /// <summary>
  24. /// 主页面
  25. /// <summary>
  26. /// <returns></returns>
  27. [HttpGet]
  28. public ActionResult Index()
  29. {
  30. return View();
  31. }
  32. /// <summary>
  33. /// 行政公文归档
  34. /// <summary>
  35. /// <returns></returns>
  36. [HttpGet]
  37. public ActionResult IndexFile()
  38. {
  39. return View();
  40. }
  41. /// <summary>
  42. /// 党政公文归档
  43. /// <summary>
  44. /// <returns></returns>
  45. [HttpGet]
  46. public ActionResult IndexPartyFile()
  47. {
  48. return View();
  49. }
  50. [HttpGet]
  51. public ActionResult IndexDocument()
  52. {
  53. return View();
  54. }
  55. /// <summary>
  56. /// 公文下发表单页
  57. /// </summary>
  58. /// <returns></returns>
  59. [HttpGet]
  60. public ActionResult IssueForm()
  61. {
  62. return View();
  63. }
  64. /// <summary>
  65. /// 主页面【党政公文下发】
  66. /// <summary>
  67. /// <returns></returns>
  68. [HttpGet]
  69. public ActionResult IndexParty()
  70. {
  71. return View();
  72. }
  73. [HttpGet]
  74. public ActionResult FormDocument()
  75. {
  76. return View();
  77. }
  78. /// <summary>
  79. /// 表单页
  80. /// <summary>
  81. /// <returns></returns>
  82. [HttpGet]
  83. public ActionResult Form()
  84. {
  85. return View();
  86. }
  87. /// <summary>
  88. /// 表单页【党政公文下发】
  89. /// <summary>
  90. /// <returns></returns>
  91. [HttpGet]
  92. public ActionResult FormParty()
  93. {
  94. return View();
  95. }
  96. [HttpGet]
  97. public ActionResult FormView()
  98. {
  99. return View();
  100. }
  101. [HttpGet]
  102. public ActionResult FormDocumentView()
  103. {
  104. return View();
  105. }
  106. /// <summary>
  107. /// 【党政公文下发】
  108. /// </summary>
  109. /// <returns></returns>
  110. [HttpGet]
  111. public ActionResult FormPartyView()
  112. {
  113. return View();
  114. }
  115. [HttpGet]
  116. public ActionResult ReadList()
  117. {
  118. return View();
  119. }
  120. [HttpGet]
  121. public ActionResult ReadListDocument()
  122. {
  123. return View();
  124. }
  125. /// <summary>
  126. /// 【党政公文下发】
  127. /// </summary>
  128. /// <returns></returns>
  129. [HttpGet]
  130. public ActionResult ReadListParty()
  131. {
  132. return View();
  133. }
  134. #endregion
  135. #region 获取数据
  136. /// <summary>
  137. /// 获取页面显示列表数据
  138. /// <summary>
  139. /// <param name="queryJson">查询参数</param>
  140. /// <returns></returns>
  141. [HttpGet]
  142. [AjaxOnly]
  143. public ActionResult GetPageList(string pagination, string queryJson)
  144. {
  145. Pagination paginationobj = pagination.ToObject<Pagination>();
  146. var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 1);
  147. foreach (var item in data)
  148. {
  149. var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.SFileId}'";
  150. var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.SFileId}'";
  151. var readdt = sys_SendFileIBLL.Execute(sql);
  152. var senddt = sys_SendFileIBLL.Execute(sendSql);
  153. var readcount = readdt.Rows[0][0];
  154. var sendcount = senddt.Rows[0][0];
  155. item.NumberPeople = $"{readcount}/{sendcount}";
  156. }
  157. var jsonData = new
  158. {
  159. rows = data,
  160. total = paginationobj.total,
  161. page = paginationobj.page,
  162. records = paginationobj.records
  163. };
  164. return Success(jsonData);
  165. }
  166. [HttpGet]
  167. [AjaxOnly]
  168. public ActionResult GetPageListDocument(string pagination, string queryJson)
  169. {
  170. Pagination paginationobj = pagination.ToObject<Pagination>();
  171. var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 2);
  172. var jsonData = new
  173. {
  174. rows = data,
  175. total = paginationobj.total,
  176. page = paginationobj.page,
  177. records = paginationobj.records
  178. };
  179. return Success(jsonData);
  180. }
  181. [HttpGet]
  182. [AjaxOnly]
  183. public ActionResult GetPageListParty(string pagination, string queryJson)
  184. {
  185. Pagination paginationobj = pagination.ToObject<Pagination>();
  186. var data = sys_SendFileIBLL.GetPageList(paginationobj, queryJson).Where(m => m.STypeId == 3);
  187. foreach (var item in data)
  188. {
  189. var sql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where ReadFlag=1 AND SFileId='{item.SFileId}'";
  190. var sendSql = $"SELECT COUNT(*) FROM dbo.Sys_ReceiveFile where SFileId='{item.SFileId}'";
  191. var readdt = sys_SendFileIBLL.Execute(sql);
  192. var senddt = sys_SendFileIBLL.Execute(sendSql);
  193. var readcount = readdt.Rows[0][0];
  194. var sendcount = senddt.Rows[0][0];
  195. item.NumberPeople = $"{readcount}/{sendcount}";
  196. }
  197. var jsonData = new
  198. {
  199. rows = data,
  200. total = paginationobj.total,
  201. page = paginationobj.page,
  202. records = paginationobj.records
  203. };
  204. return Success(jsonData);
  205. }
  206. /// <summary>
  207. /// 获取表单数据
  208. /// <summary>
  209. /// <returns></returns>
  210. [HttpGet]
  211. [AjaxOnly]
  212. public ActionResult GetFormData(string keyValue)
  213. {
  214. var Sys_SendFileData = sys_SendFileIBLL.GetSys_SendFileEntity(keyValue);
  215. Sys_SendFileData.Contents = HttpUtility.HtmlDecode(Sys_SendFileData.Contents);
  216. var jsonData = new
  217. {
  218. Sys_SendFile = Sys_SendFileData,
  219. };
  220. return Success(jsonData);
  221. }
  222. [HttpGet]
  223. [AjaxOnly]
  224. public ActionResult GetFormDataView(string keyValue)
  225. {
  226. var Sys_SendFileData = sys_SendFileIBLL.GetSys_SendFileEntity(keyValue);
  227. Sys_SendFileData.Contents = HttpUtility.HtmlDecode(Sys_SendFileData.Contents);
  228. var jsonData = new
  229. {
  230. Sys_SendFile = Sys_SendFileData,
  231. };
  232. return Success(jsonData);
  233. }
  234. /// <summary>
  235. /// 获取表单数据
  236. /// <summary>
  237. /// <returns></returns>
  238. [HttpGet]
  239. [AjaxOnly]
  240. public ActionResult GetFormDataByProcessId(string processId)
  241. {
  242. var Sys_SendFileData = sys_SendFileIBLL.GetEntityByProcessId(processId);
  243. var jsonData = new
  244. {
  245. Sys_SendFile = Sys_SendFileData,
  246. };
  247. return Success(jsonData);
  248. }
  249. #endregion
  250. #region 提交数据
  251. /// <summary>
  252. /// 删除实体数据
  253. /// <param name="keyValue">主键</param>
  254. /// <summary>
  255. /// <returns></returns>
  256. [HttpPost]
  257. [AjaxOnly]
  258. public ActionResult DeleteForm(string keyValue)
  259. {
  260. sys_SendFileIBLL.DeleteEntity(keyValue);
  261. return Success("删除成功!");
  262. }
  263. /// <summary>
  264. /// 保存实体数据(新增、修改)
  265. /// <param name="keyValue">主键</param>
  266. /// <summary>
  267. /// <returns></returns>
  268. [HttpPost]
  269. [ValidateAntiForgeryToken]
  270. [AjaxOnly]
  271. [ValidateInput(false)]
  272. public ActionResult SaveForm(string keyValue, string strEntity)
  273. {
  274. Sys_SendFileEntity entity = strEntity.ToObject<Sys_SendFileEntity>();
  275. if (string.IsNullOrEmpty(keyValue))
  276. {
  277. entity.STypeId = 1;
  278. }
  279. sys_SendFileIBLL.SaveEntity(keyValue, entity);
  280. return Success("保存成功!");
  281. }
  282. [HttpPost]
  283. [ValidateAntiForgeryToken]
  284. [AjaxOnly]
  285. [ValidateInput(false)]
  286. public ActionResult SaveFormDocument(string keyValue, string strEntity)
  287. {
  288. Sys_SendFileEntity entity = strEntity.ToObject<Sys_SendFileEntity>();
  289. if (string.IsNullOrEmpty(keyValue))
  290. {
  291. entity.STypeId = 2;
  292. }
  293. sys_SendFileIBLL.SaveEntity(keyValue, entity);
  294. return Success("保存成功!");
  295. }
  296. [HttpPost]
  297. [ValidateAntiForgeryToken]
  298. [AjaxOnly]
  299. [ValidateInput(false)]
  300. public ActionResult SaveFormParty(string keyValue, string strEntity)
  301. {
  302. Sys_SendFileEntity entity = strEntity.ToObject<Sys_SendFileEntity>();
  303. if (string.IsNullOrEmpty(keyValue))
  304. {
  305. entity.STypeId = 3;
  306. }
  307. sys_SendFileIBLL.SaveEntity(keyValue, entity);
  308. return Success("保存成功!");
  309. }
  310. /// <summary>
  311. /// 提交
  312. /// </summary>
  313. /// <param name="keyValue"></param>
  314. /// <returns></returns>
  315. [HttpPost]
  316. [AjaxOnly]
  317. public ActionResult ChangeStatusById(string keyValue, string processId)
  318. {
  319. sys_SendFileIBLL.ChangeStatusById(keyValue, 1, processId);
  320. return Success("操作成功!");
  321. }
  322. [HttpPost]
  323. [AjaxOnly]
  324. public ActionResult ChangeStatusByIdDocument(string keyValue)
  325. {
  326. string guid = Guid.NewGuid().ToString();
  327. sys_SendFileIBLL.ChangeStatusById(keyValue, 2, guid);
  328. sys_SendFileIBLL.ChangeStatusByProcessId(guid, 2);
  329. return Success("操作成功!");
  330. }
  331. /// <summary>
  332. /// 结束下发
  333. /// </summary>
  334. /// <param name="keyValue"></param>
  335. /// <returns></returns>
  336. [HttpPost]
  337. [AjaxOnly]
  338. public ActionResult OverIssue(string keyValue)
  339. {
  340. string guid = Guid.NewGuid().ToString();
  341. sys_SendFileIBLL.OverIssue(keyValue);
  342. return Success("下发成功!");
  343. }
  344. /// <summary>
  345. /// 提交
  346. /// </summary>
  347. /// <param name="keyValue"></param>
  348. /// <returns></returns>
  349. [HttpPost]
  350. [AjaxOnly]
  351. public ActionResult IssueList(string keyValue, string CreateUser)
  352. {
  353. sys_SendFileIBLL.IssueList(keyValue, CreateUser);
  354. return Success("操作成功!");
  355. }
  356. /// <summary>
  357. /// 作废
  358. /// </summary>
  359. /// <param name="keyValue"></param>
  360. /// <returns></returns>
  361. [HttpPost]
  362. [AjaxOnly]
  363. public ActionResult CancelList(string keyValue)
  364. {
  365. sys_SendFileIBLL.CancelList(keyValue);
  366. return Success("操作成功!");
  367. }
  368. #endregion
  369. }
  370. }