| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 | 
							- using AutoMapper;
 
- using OASystem.Domain;
 
- using OASystem.Domain.Entities.Groups;
 
- using OASystem.Domain.ViewModels.Financial;
 
- using OASystem.Domain.ViewModels.Groups;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- namespace OASystem.Infrastructure.Repositories.Financial
 
- {
 
-     /// <summary>
 
-     /// 财务 - 付款信息类
 
-     /// 雷怡 2023.08.16 16:19
 
-     /// </summary>
 
-     public class CreditCardPaymentRepository : BaseRepository<Grp_CreditCardPayment, Grp_Fin_CreditCardPaymentView>
 
-     {
 
-         private readonly IMapper _mapper;
 
-         public CreditCardPaymentRepository(SqlSugarClient sqlSugar, IMapper mapper)
 
-             : base(sqlSugar)
 
-         {
 
-             _mapper = mapper;
 
-         }
 
-         /// <summary>
 
-         /// 根据diid查询团组付款信息
 
-         /// </summary>
 
-         /// <param name="diid"></param>
 
-         /// <param name="isPay">false 未支付 true 已支付</param>
 
-         /// <returns></returns>
 
-         public async Task<Result> GetGroupPaymentInfoByDiid(int diid,bool isPay)
 
-         {
 
-             Result result = new() { Code = -2 };
 
-             int _isPay = 0;
 
-             if (isPay) { _isPay = 1; }
 
-             string sql = string.Format(@"Select * From Grp_CreditCardPayment Where IsDel=0 And Diid={0} And IsPay={1}", diid, _isPay);
 
-             var groupReceivablesList = await _sqlSugar.SqlQueryable<Fin_ProceedsReceivedView>(sql).ToListAsync();
 
-             result.Code = 0;
 
-             result.Msg = "查询成功!";
 
-             result.Data = groupReceivablesList;
 
-             return result;
 
-         }
 
-         /// <summary>
 
-         /// 根据diid 数组 查询团组付款信息
 
-         /// </summary>
 
-         /// <param name="diid"></param>
 
-         /// <param name="isPay">false 未支付 true 已支付</param>
 
-         /// <returns></returns>
 
-         public async Task<Result> GetGroupPaymentInfoByDiids(int[] diids, bool isPay)
 
-         {
 
-             Result result = new() { Code = -2 };
 
-             int _isPay = 0;
 
-             if (isPay) { _isPay = 1; }
 
-             var groupReceivablesList = await _sqlSugar.Queryable<Grp_CreditCardPayment>()
 
-                 .Where(ccp => ccp.IsDel == 0 && diids.Contains(ccp.DIId) && ccp.IsPay == _isPay) .ToListAsync();
 
-             result.Code = 0;
 
-             result.Msg = "查询成功!";
 
-             result.Data = groupReceivablesList;
 
-             return result;
 
-         }
 
-         /// <summary>
 
-         /// 团组 其他款项/退款
 
-         /// </summary>
 
-         /// <param name="diid">团组Id</param>
 
-         /// <param name="isPay"></param>
 
-         /// <returns></returns>
 
-         public async Task<Result> GetGroupRefundByDiid(int diid, bool isPay)
 
-         {
 
-             Result result = new() { Code = -2 };
 
-             int _isPay = 0;
 
-             if (isPay) { _isPay = 1; }
 
-             string sql = string.Format(@"Select ccp.DIId,ccp.CreateUserId,ccp.AuditGMDate,sd1.name As PayType,ccp.OrbitalPrivateTransfer,ccp.PayDid,
 
-                                                             ccp.payee,ccp.IsPay,gdp.CreateTime,gdp.PriceName,gdp.Price,sd.[Name] Currency,
 
-                                                             ccp.PayMoney As Spread,ccp.DayRate,gdp.Remark From Fin_OtherPrice gdp 
 
-                                         join Grp_CreditCardPayment ccp On ccp.Diid = gdp.Diid and ccp.Cid = gdp.Id 
 
-                                         join Sys_SetData sd On sd.Id =gdp.CurrencyId 
 
-                                         join Sys_SetData sd1 On sd1.id=ccp.PayDid 
 
-                                         Where ccp.DIId={0} And gdp.IsDel = 0 and ccp.isDel=0 and ccp.CTable=285 and ccp.IsPay = {1} ", diid, _isPay);
 
-             var groupRefundList = await _sqlSugar.SqlQueryable<GroupRefundView>(sql).ToListAsync();
 
-             result.Code = 0;
 
-             result.Msg = "查询成功!";
 
-             result.Data = groupRefundList;
 
-             return result;
 
-         }
 
-         /// <summary>
 
-         /// 团组 根据diid 数组 查询 其他款项/退款
 
-         /// </summary>
 
-         /// <param name="diid">团组Id</param>
 
-         /// <param name="isPay"></param>
 
-         /// <returns></returns>
 
-         public async Task<Result> GetGroupRefundByDiids(int[] diids, bool isPay)
 
-         {
 
-             Result result = new() { Code = -2 };
 
-             int _isPay = 0;
 
-             if (isPay) { _isPay = 1; }
 
-             string _diidsStr = string.Empty;
 
-             #region 处理Diid
 
-             StringBuilder diidSb = new StringBuilder();
 
-             for (int i = 0; i < diids.Length; i++)
 
-             {
 
-                 if (i == diids.Length - 1)
 
-                 {
 
-                     diidSb.Append(diids[i]);
 
-                 }
 
-                 else
 
-                 {
 
-                     diidSb.Append(diids[i]).Append(",");
 
-                 }
 
-             }
 
-             _diidsStr = diidSb.ToString().Trim();
 
-             #endregion
 
-             string sql = string.Format(@"Select ccp.DIId,ccp.CreateUserId,ccp.AuditGMDate,sd1.name As PayType,ccp.OrbitalPrivateTransfer,ccp.PayDid,
 
-                                                             ccp.payee,ccp.IsPay,gdp.CreateTime,gdp.PriceName,gdp.Price,sd.[Name] Currency,
 
-                                                             ccp.PayMoney As Spread,ccp.DayRate,gdp.Remark From Fin_OtherPrice gdp 
 
-                                         join Grp_CreditCardPayment ccp On ccp.Diid = gdp.Diid and ccp.Cid = gdp.Id 
 
-                                         join Sys_SetData sd On sd.Id =gdp.CurrencyId 
 
-                                         join Sys_SetData sd1 On sd1.id=ccp.PayDid 
 
-                                         Where ccp.isDel=0 And gdp.IsDel = 0 And ccp.DIId In ({0}) And ccp.CTable=285 and ccp.IsPay = {1} ", _diidsStr, _isPay);
 
-             var groupRefundList = await _sqlSugar.SqlQueryable<GroupRefundView>(sql).ToListAsync();
 
-             result.Code = 0;
 
-             result.Msg = "查询成功!";
 
-             result.Data = groupRefundList;
 
-             return result;
 
-         }
 
-     }
 
- }
 
 
  |