using HL_FristAidPlatform_Bussiness; using HL_FristAidPlatform_Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace HL_FristAidPlatform_Service.Controllers { /// /// /// [Route("api/base/[controller]")] [ApiController] [ApiExplorerSettings(GroupName = "JC")] [HiddenApiFilter.HiddenApi] public class T_Base_AccidentInfoController : Controller { T_Base_AccidentInfoBLL bll = new T_Base_AccidentInfoBLL(); /// /// /// /// [HttpGet] [Route("GetListAccidentInfo")] [Authorize(Roles = "GET")] public JsonResult GetListAccidentInfo() { return Json(bll.GetListAccidentInfo()); } //[HttpGet] //[Route("GetListAccidentInfoeDataTable")] //public JsonResult GetListAccidentInfoeDataTable() //{ // return Json(bll.GetListAccidentInfoeDataTable()); //} /// /// /// /// [HttpGet] [Route("GetListAccident")] [Authorize(Roles = "GET")] public JsonResult GetListAccident() { return Json(bll.GetListAccident()); } /// /// 重大事故/群伤事件数据集合 /// /// [HttpGet] [Route("GetAccidentInfoClass")] [Authorize(Roles = "GET")] public JsonResult GetAccidentInfoClass() { return Json(bll.GetAccidentInfoClass()); } /// /// 获取所有事件 /// /// /// /// [HttpGet] [Route("GetList")] [Authorize(Roles = "GET")] public JsonResult GetList(string name="", int AccidentLevel=0) { return Json(bll.GetList(name, AccidentLevel)); } /// /// 保存住院科室 /// /// [HttpPost] [Route("SaveAccidentInfo")] [Authorize(Roles = "ADD")] public JsonResult SaveAccidentInfo(T_Base_AccidentInfo department) { if (department == null) return Json("参数不能为空"); if (string.IsNullOrEmpty(department.ParentName)) return Json("事件名称不能为空"); if (department.AccidentLevel <= 0) return Json("事件等级不能为空"); return Json(bll.SaveAccidentInfo(department)); } /// /// 修改住院科室 /// /// /// [HttpPost] [Route("UpdateAccidentInfo")] [Authorize(Roles = "UPDATE")] public JsonResult UpdateAccidentInfo(T_Base_AccidentInfo model) { if (model == null) return Json("参数不能为空"); if (model.ID <= 0) return Json("事件ID不能为空"); if (string.IsNullOrEmpty(model.ParentName)) return Json("事件名称不能为空"); if (model.AccidentLevel <= 0) return Json("事件等级不能为空"); return Json(bll.UpdateAccidentInfo(model)); } /// /// 获取所有事故等级 /// /// /// /// [HttpGet] [Route("GetAccidentLevelList")] [Authorize(Roles = "GET")] public JsonResult GetAccidentLevelList(string name = "", int AccidentLevel = 0) { return Json(bll.GetAccidentLevelList(name, AccidentLevel)); } /// /// 保存事故等级 /// /// [HttpPost] [Route("SaveAccidentLevel")] [Authorize(Roles = "ADD")] public JsonResult SaveAccidentLevel(T_Base_AccidentLevel department) { if (department == null) return Json("参数不能为空"); if (string.IsNullOrEmpty(department.LevelName)) return Json("事件名称不能为空"); if (department.AccidentLevel <= 0) return Json("事件等级不能为空"); return Json(bll.SaveAccidentLevel(department)); } /// /// 修改事故等级 /// /// /// [HttpPost] [Route("UpdateAccidentLevel")] [Authorize(Roles = "UPDATE")] public JsonResult UpdateAccidentLevel(T_Base_AccidentLevel model) { if (model == null) return Json("参数不能为空"); if (model.ID <= 0) return Json("事件ID不能为空"); if (string.IsNullOrEmpty(model.LevelName)) return Json("事件名称不能为空"); if (model.AccidentLevel <= 0) return Json("事件等级不能为空"); return Json(bll.UpdateAccidentLevel(model)); } } }