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.
 
 
 
 
 
 

293 lines
9.5 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.PersonnelManagement;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using Learun.Application.Base.SystemModule;
  8. using Learun.Application.TwoDevelopment.EducationalAdministration;
  9. namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
  10. {
  11. /// <summary>
  12. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  13. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  14. /// 创 建:超级管理员
  15. /// 日 期:2020-02-03 14:37
  16. /// 描 述:疫情记录
  17. /// </summary>
  18. public class EpidemicSituationCopyController : MvcControllerBase
  19. {
  20. private EpidemicSituationIBLL epidemicSituationIBLL = new EpidemicSituationBLL();
  21. private DataItemIBLL dataItemIbll = new DataItemBLL();
  22. private CdDeptIBLL cdDeptIbll = new CdDeptBLL();
  23. private CdMajorIBLL cdMajorIbll = new CdMajorBLL();
  24. private ClassInfoIBLL classInfoIbll = new ClassInfoBLL();
  25. private StuInfoBasicIBLL stuInfoBasicIbll = new StuInfoBasicBLL();
  26. private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL();
  27. #region 视图功能
  28. /// <summary>
  29. /// 主页面
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult Index()
  34. {
  35. return View();
  36. }
  37. [HttpGet]
  38. public ActionResult IndexAll()
  39. {
  40. return View();
  41. }
  42. /// <summary>
  43. /// 统计
  44. /// <summary>
  45. /// <returns></returns>
  46. [HttpGet]
  47. public ActionResult IndexReport()
  48. {
  49. return View();
  50. }
  51. /// <summary>
  52. /// 表单页
  53. /// <summary>
  54. /// <returns></returns>
  55. [HttpGet]
  56. public ActionResult Form()
  57. {
  58. return View();
  59. }
  60. [HttpGet]
  61. public ActionResult FormView()
  62. {
  63. return View();
  64. }
  65. /// <summary>
  66. /// 外出原因统计
  67. /// </summary>
  68. /// <returns></returns>
  69. [HttpGet]
  70. public ActionResult OutReasonReport()
  71. {
  72. return View();
  73. }
  74. /// <summary>
  75. /// 人员类别统计
  76. /// </summary>
  77. /// <returns></returns>
  78. [HttpGet]
  79. public ActionResult PersonnelCategoryReport()
  80. {
  81. return View();
  82. }
  83. /// <summary>
  84. /// 各省份人数统计
  85. /// </summary>
  86. /// <returns></returns>
  87. [HttpGet]
  88. public ActionResult ProviceReport()
  89. {
  90. return View();
  91. }
  92. /// <summary>
  93. /// 交通工具人数统计
  94. /// </summary>
  95. /// <returns></returns>
  96. [HttpGet]
  97. public ActionResult VehicleReport()
  98. {
  99. return View();
  100. }
  101. #endregion
  102. #region 获取数据
  103. public ActionResult GetStudentSource(string studentId)
  104. {
  105. var res = "";
  106. var stuEntity = stuInfoBasicIbll.GetStuInfoBasicEntityByStuNo(studentId);
  107. if (stuEntity != null)
  108. {
  109. var detptName = cdDeptIbll.GetCdDeptEntityByNo(stuEntity.DeptNo)?.DeptName;
  110. var majorName = cdMajorIbll.GetCdMajorEntityByMajorNo(stuEntity.MajorNo)?.MajorName;
  111. var className = classInfoIbll.GetClassInfoEntityByClassNo(stuEntity.ClassNo)?.ClassName;
  112. res = $"{detptName} {majorName} {className}";
  113. }
  114. return Success(new { res, Address = stuEntity?.MailAddress });
  115. }
  116. public ActionResult GetEmpSource(string empId)
  117. {
  118. var stuEntity = empInfoIBLL.GetEmpInfoEntity(empId);
  119. return Success(new { Address = stuEntity?.Homeaddress });
  120. }
  121. public ActionResult OutReasonReportList()
  122. {
  123. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  124. var data = epidemicSituationIBLL.GetList("{}");
  125. var list = data.GroupBy(a => a.OutReason).Select(a => new
  126. {
  127. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
  128. value = a.Count()
  129. });
  130. return Success(list);
  131. }
  132. public ActionResult OutReasonReportData()
  133. {
  134. var dataItemList = dataItemIbll.GetDetailList("OutReason");
  135. var data = epidemicSituationIBLL.GetList("{}");
  136. var list = data.GroupBy(a => a.OutReason).Select(a => new
  137. {
  138. name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
  139. value = a.Count()
  140. });
  141. var rdata = new
  142. {
  143. name = list.Select(a => a.name),
  144. value = list.Select(a => a.value)
  145. };
  146. return Success(new { list, data });
  147. }
  148. /// <summary>
  149. /// 获取页面显示列表分页数据
  150. /// <summary>
  151. /// <param name="pagination">分页参数</param>
  152. /// <param name="queryJson">查询参数</param>
  153. /// <returns></returns>
  154. [HttpGet]
  155. [AjaxOnly]
  156. public ActionResult GetPageList(string pagination, string queryJson)
  157. {
  158. Pagination paginationobj = pagination.ToObject<Pagination>();
  159. var data = epidemicSituationIBLL.GetPageList(paginationobj, queryJson);
  160. var jsonData = new
  161. {
  162. rows = data,
  163. total = paginationobj.total,
  164. page = paginationobj.page,
  165. records = paginationobj.records
  166. };
  167. return Success(jsonData);
  168. }
  169. /// <summary>
  170. /// 获取页面显示列表分页数据
  171. /// <summary>
  172. /// <param name="pagination">分页参数</param>
  173. /// <param name="queryJson">查询参数</param>
  174. /// <returns></returns>
  175. [HttpGet]
  176. [AjaxOnly]
  177. public ActionResult GetReportPageList(string pagination, string queryJson)
  178. {
  179. Pagination paginationobj = pagination.ToObject<Pagination>();
  180. var data = epidemicSituationIBLL.GetReportPageList(paginationobj, queryJson);
  181. var jsonData = new
  182. {
  183. rows = data,
  184. total = paginationobj.total,
  185. page = paginationobj.page,
  186. records = paginationobj.records
  187. };
  188. return Success(jsonData);
  189. }
  190. /// <summary>
  191. /// 获取页面显示列表数据
  192. /// <summary>
  193. /// <param name="queryJson">查询参数</param>
  194. /// <returns></returns>
  195. [HttpGet]
  196. [AjaxOnly]
  197. public ActionResult GetList(string queryJson)
  198. {
  199. var data = epidemicSituationIBLL.GetList(queryJson);
  200. return Success(data);
  201. }
  202. /// <summary>
  203. /// 获取表单数据
  204. /// <summary>
  205. /// <returns></returns>
  206. [HttpGet]
  207. [AjaxOnly]
  208. public ActionResult GetFormData(string keyValue)
  209. {
  210. var EpidemicSituationData = epidemicSituationIBLL.GetEpidemicSituationEntity(keyValue);
  211. var ContactsDetailsData = epidemicSituationIBLL.GetContactsDetailsList(EpidemicSituationData.ID);
  212. var PassPlaceData = epidemicSituationIBLL.GetPassPlaceList(EpidemicSituationData.ID);
  213. var PeopleDetailData = epidemicSituationIBLL.GetPeopleDetailslist(EpidemicSituationData.ID);
  214. var jsonData = new
  215. {
  216. EpidemicSituation = EpidemicSituationData,
  217. ContactsDetails = ContactsDetailsData,
  218. PassPlaces = PassPlaceData,
  219. PeopleDetails = PeopleDetailData
  220. };
  221. return Success(jsonData);
  222. }
  223. #endregion
  224. #region 提交数据
  225. /// <summary>
  226. /// 删除实体数据
  227. /// <param name="keyValue">主键</param>
  228. /// <summary>
  229. /// <returns></returns>
  230. [HttpPost]
  231. [AjaxOnly]
  232. public ActionResult DeleteForm(string keyValue)
  233. {
  234. epidemicSituationIBLL.DeleteEntity(keyValue);
  235. return Success("删除成功!");
  236. }
  237. /// <summary>
  238. /// 保存实体数据(新增、修改)
  239. /// <param name="keyValue">主键</param>
  240. /// <summary>
  241. /// <returns></returns>
  242. [HttpPost]
  243. [ValidateAntiForgeryToken]
  244. [AjaxOnly]
  245. public ActionResult SaveForm(string keyValue, string strEntity, string strcontactsDetailsList, string passPlaceDetailsList, string strpeopleDetailsList)
  246. {
  247. UserInfo userInfo = LoginUserInfo.Get();
  248. EpidemicSituationEntity entity = strEntity.ToObject<EpidemicSituationEntity>();
  249. if (string.IsNullOrEmpty(keyValue))
  250. {
  251. var userId = entity.Creater;
  252. if (epidemicSituationIBLL.HasTodayValue(userId))
  253. {
  254. return Success("不能重复提交");
  255. }
  256. }
  257. List<PassPlaceEntity> passDetailsList = passPlaceDetailsList.ToObject<List<PassPlaceEntity>>();
  258. List<ContactsDetailsEntity> contactsDetailsList = strcontactsDetailsList.ToObject<List<ContactsDetailsEntity>>();
  259. List<PeopleDetailsEntity> peopleDetailsList = strpeopleDetailsList.ToObject<List<PeopleDetailsEntity>>();
  260. epidemicSituationIBLL.SaveEntity(userInfo, keyValue, entity, contactsDetailsList, passDetailsList, peopleDetailsList);
  261. return Success("保存成功!");
  262. }
  263. #endregion
  264. }
  265. }