|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- using Learun.Util;
- using System.Data;
- using Learun.Application.TwoDevelopment.PersonnelManagement;
- using System.Web.Mvc;
- using System.Collections.Generic;
- using System.Linq;
- using Learun.Application.Base.SystemModule;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
-
- namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创 建:超级管理员
- /// 日 期:2020-02-03 14:37
- /// 描 述:疫情记录
- /// </summary>
- public class EpidemicSituationCopyController : MvcControllerBase
- {
- private EpidemicSituationIBLL epidemicSituationIBLL = new EpidemicSituationBLL();
- private DataItemIBLL dataItemIbll = new DataItemBLL();
- private CdDeptIBLL cdDeptIbll = new CdDeptBLL();
- private CdMajorIBLL cdMajorIbll = new CdMajorBLL();
- private ClassInfoIBLL classInfoIbll = new ClassInfoBLL();
- private StuInfoBasicIBLL stuInfoBasicIbll = new StuInfoBasicBLL();
- private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL();
-
- #region 视图功能
-
- /// <summary>
- /// 主页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
-
- /// <summary>
- /// 统计
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexReport()
- {
- return View();
- }
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- /// <summary>
- /// 外出原因统计
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult OutReasonReport()
- {
- return View();
- }
-
- /// <summary>
- /// 人员类别统计
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult PersonnelCategoryReport()
- {
- return View();
- }
-
- /// <summary>
- /// 各省份人数统计
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ProviceReport()
- {
- return View();
- }
-
- /// <summary>
- /// 交通工具人数统计
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult VehicleReport()
- {
- return View();
- }
-
- #endregion
-
- #region 获取数据
-
- public ActionResult GetStudentSource(string studentId)
- {
- var res = "";
- var stuEntity = stuInfoBasicIbll.GetStuInfoBasicEntityByStuNo(studentId);
- if (stuEntity != null)
- {
- var detptName = cdDeptIbll.GetCdDeptEntityByNo(stuEntity.DeptNo)?.DeptName;
- var majorName = cdMajorIbll.GetCdMajorEntityByMajorNo(stuEntity.MajorNo)?.MajorName;
- var className = classInfoIbll.GetClassInfoEntityByClassNo(stuEntity.ClassNo)?.ClassName;
- res = $"{detptName} {majorName} {className}";
- }
-
- return Success(new { res, Address = stuEntity?.MailAddress });
-
- }
-
-
- public ActionResult GetEmpSource(string empId)
- {
- var stuEntity = empInfoIBLL.GetEmpInfoEntity(empId);
- return Success(new { Address = stuEntity?.Homeaddress });
- }
-
- public ActionResult OutReasonReportList()
- {
- var dataItemList = dataItemIbll.GetDetailList("OutReason");
- var data = epidemicSituationIBLL.GetList("{}");
- var list = data.GroupBy(a => a.OutReason).Select(a => new
- {
- name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
- value = a.Count()
- });
- return Success(list);
- }
- public ActionResult OutReasonReportData()
- {
- var dataItemList = dataItemIbll.GetDetailList("OutReason");
- var data = epidemicSituationIBLL.GetList("{}");
- var list = data.GroupBy(a => a.OutReason).Select(a => new
- {
- name = dataItemList.FirstOrDefault(b => b.F_ItemValue == a.Key.ToString()).F_ItemName,
- value = a.Count()
- });
- var rdata = new
- {
- name = list.Select(a => a.name),
- value = list.Select(a => a.value)
- };
- return Success(new { list, data });
-
-
- }
-
- /// <summary>
- /// 获取页面显示列表分页数据
- /// <summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = epidemicSituationIBLL.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
-
- /// <summary>
- /// 获取页面显示列表分页数据
- /// <summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetReportPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = epidemicSituationIBLL.GetReportPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
- /// <summary>
- /// 获取页面显示列表数据
- /// <summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetList(string queryJson)
- {
- var data = epidemicSituationIBLL.GetList(queryJson);
- return Success(data);
- }
- /// <summary>
- /// 获取表单数据
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var EpidemicSituationData = epidemicSituationIBLL.GetEpidemicSituationEntity(keyValue);
- var ContactsDetailsData = epidemicSituationIBLL.GetContactsDetailsList(EpidemicSituationData.ID);
- var PassPlaceData = epidemicSituationIBLL.GetPassPlaceList(EpidemicSituationData.ID);
- var PeopleDetailData = epidemicSituationIBLL.GetPeopleDetailslist(EpidemicSituationData.ID);
- var jsonData = new
- {
- EpidemicSituation = EpidemicSituationData,
- ContactsDetails = ContactsDetailsData,
- PassPlaces = PassPlaceData,
- PeopleDetails = PeopleDetailData
- };
- return Success(jsonData);
- }
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- epidemicSituationIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, string strEntity, string strcontactsDetailsList, string passPlaceDetailsList, string strpeopleDetailsList)
- {
- UserInfo userInfo = LoginUserInfo.Get();
- EpidemicSituationEntity entity = strEntity.ToObject<EpidemicSituationEntity>();
-
- if (string.IsNullOrEmpty(keyValue))
- {
- var userId = entity.Creater;
- if (epidemicSituationIBLL.HasTodayValue(userId))
- {
- return Success("不能重复提交");
- }
- }
-
- List<PassPlaceEntity> passDetailsList = passPlaceDetailsList.ToObject<List<PassPlaceEntity>>();
- List<ContactsDetailsEntity> contactsDetailsList = strcontactsDetailsList.ToObject<List<ContactsDetailsEntity>>();
- List<PeopleDetailsEntity> peopleDetailsList = strpeopleDetailsList.ToObject<List<PeopleDetailsEntity>>();
- epidemicSituationIBLL.SaveEntity(userInfo, keyValue, entity, contactsDetailsList, passDetailsList, peopleDetailsList);
- return Success("保存成功!");
- }
- #endregion
-
- }
- }
|