CreditCardPaymentRepository.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using AutoMapper;
  2. using OASystem.Domain;
  3. using OASystem.Domain.Entities.Groups;
  4. using OASystem.Domain.ViewModels.Financial;
  5. using OASystem.Domain.ViewModels.Groups;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace OASystem.Infrastructure.Repositories.Financial
  12. {
  13. /// <summary>
  14. /// 财务 - 付款信息类
  15. /// 雷怡 2023.08.16 16:19
  16. /// </summary>
  17. public class CreditCardPaymentRepository : BaseRepository<Grp_CreditCardPayment, Grp_Fin_CreditCardPaymentView>
  18. {
  19. private readonly IMapper _mapper;
  20. public CreditCardPaymentRepository(SqlSugarClient sqlSugar, IMapper mapper)
  21. : base(sqlSugar)
  22. {
  23. _mapper = mapper;
  24. }
  25. /// <summary>
  26. /// 根据diid查询团组付款信息
  27. /// </summary>
  28. /// <param name="diid"></param>
  29. /// <param name="isPay">false 未支付 true 已支付</param>
  30. /// <returns></returns>
  31. public async Task<Result> GetGroupPaymentInfoByDiid(int diid,bool isPay)
  32. {
  33. Result result = new() { Code = -2 };
  34. int _isPay = 0;
  35. if (isPay) { _isPay = 1; }
  36. string sql = string.Format(@"Select * From Grp_CreditCardPayment Where IsDel=0 And Diid={0} And IsPay={1}", diid, _isPay);
  37. var groupReceivablesList = await _sqlSugar.SqlQueryable<Fin_ProceedsReceivedView>(sql).ToListAsync();
  38. result.Code = 0;
  39. result.Msg = "查询成功!";
  40. result.Data = groupReceivablesList;
  41. return result;
  42. }
  43. /// <summary>
  44. /// 团组 其他款项/退款
  45. /// </summary>
  46. /// <param name="diid">团组Id</param>
  47. /// <param name="isPay"></param>
  48. /// <returns></returns>
  49. public async Task<Result> GetGroupRefundByDiid(int diid, bool isPay)
  50. {
  51. Result result = new() { Code = -2 };
  52. int _isPay = 0;
  53. if (isPay) { _isPay = 1; }
  54. string sql = string.Format(@"Select * From Grp_CreditCardPayment Where IsDel=0 And Diid={0} And IsPay={1}", diid, _isPay);
  55. var groupReceivablesList = await _sqlSugar.SqlQueryable<Fin_ProceedsReceivedView>(sql).ToListAsync();
  56. result.Code = 0;
  57. result.Msg = "查询成功!";
  58. result.Data = groupReceivablesList;
  59. return result;
  60. }
  61. }
  62. }