FinancialController.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using Microsoft.AspNetCore.Http;
  2. using Microsoft.AspNetCore.Mvc;
  3. using OASystem.Domain;
  4. using OASystem.Domain.Dtos.Financial;
  5. using OASystem.Domain.Entities.Groups;
  6. using OASystem.Domain.ViewModels.Groups;
  7. using OASystem.Infrastructure.Repositories.Financial;
  8. namespace OASystem.API.Controllers
  9. {
  10. /// <summary>
  11. /// 财务模块
  12. /// </summary>
  13. [Route("api/[controller]/[action]")]
  14. [ApiController]
  15. public class FinancialController : ControllerBase
  16. {
  17. private readonly IMapper _mapper;
  18. private readonly IConfiguration _config;
  19. private readonly DailyFeePaymentRepository _daiRep;
  20. /// <summary>
  21. /// 初始化
  22. /// </summary>
  23. public FinancialController(IMapper mapper, IConfiguration configuration, DailyFeePaymentRepository daiRep)
  24. {
  25. this._mapper = mapper;
  26. this._config = configuration;
  27. this._daiRep = daiRep;
  28. }
  29. #region 日付申请
  30. /// <summary>
  31. /// 获取日付申请 List
  32. /// </summary>
  33. /// <param name="dto"> 日付申请 分页 dto</param>
  34. /// <returns></returns>
  35. [HttpPost]
  36. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  37. public async Task<IActionResult> PostPageDailyPaymentList(PageDailyFeePaymentDto dto)
  38. {
  39. var result = await _daiRep.GetPageSelectAll(dto);
  40. if (result == null || result.Code != 0)
  41. {
  42. return Ok(JsonView(false, result.Msg));
  43. }
  44. var data = result.Data;
  45. if (data == null)
  46. {
  47. return Ok(JsonView(false, result.Msg));
  48. }
  49. return Ok(JsonView(data.Data, Convert.ToInt32(data.Rows)));
  50. }
  51. #endregion
  52. }
  53. }