GroupsController.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Microsoft.AspNetCore.Mvc;
  2. using Newtonsoft.Json.Serialization;
  3. using OASystem.Domain.Dtos.Groups;
  4. using OASystem.Domain.ViewModels.Groups;
  5. using OASystem.Infrastructure.Repositories.Groups;
  6. namespace OASystem.API.Controllers
  7. {
  8. /// <summary>
  9. /// 团组
  10. /// </summary>
  11. //[Authorize]
  12. [Route("api/[controller]/[action]")]
  13. public class GroupsController : ControllerBase
  14. {
  15. private readonly GrpScheduleRepository _grpScheduleRep;
  16. private readonly IMapper _mapper;
  17. public GroupsController(IMapper mapper, GrpScheduleRepository grpScheduleRep)
  18. {
  19. _mapper = mapper;
  20. _grpScheduleRep = grpScheduleRep;
  21. }
  22. #region 流程管控
  23. /// <summary>
  24. /// 获取团组流程管控信息
  25. /// </summary>
  26. /// <param name="paras">参数Json字符串</param>
  27. /// <returns></returns>
  28. [HttpPost]
  29. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  30. public async Task<IActionResult> PostGrpSchedule(string paras)
  31. {
  32. if (string.IsNullOrEmpty(paras))
  33. {
  34. return Ok(JsonView(false, "参数为空"));
  35. }
  36. Grp_ScheduleDto _ScheduleDto = JsonConvert.DeserializeObject<Grp_ScheduleDto>(paras);
  37. if (_ScheduleDto != null)
  38. {
  39. if (_ScheduleDto.SearchType == 2)//获取列表
  40. {
  41. }
  42. else//获取对象
  43. {
  44. Grp_ScheduleView _grpScheduleView = await _grpScheduleRep.GetView_GrpSchedule(_ScheduleDto);
  45. if (_grpScheduleView != null)
  46. {
  47. return Ok(JsonView(0, "获取成功", _grpScheduleView));
  48. }
  49. }
  50. }
  51. else
  52. {
  53. return Ok(JsonView(false, "参数反序列化失败"));
  54. }
  55. return Ok(JsonView(false, "暂无数据!"));
  56. }
  57. #endregion
  58. }
  59. }