Browse Source

财务提成相关表

leiy 1 year ago
parent
commit
4a22925ce8
20 changed files with 529 additions and 55 deletions
  1. 6 6
      OASystem/EntitySync/Program.cs
  2. 3 3
      OASystem/OASystem.Api/Controllers/FinancialController.cs
  3. 61 5
      OASystem/OASystem.Api/OAMethodLib/GroupCommission.cs
  4. 2 2
      OASystem/OASystem.Domain/Dtos/Financial/CommissionDto.cs
  5. 7 0
      OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs
  6. 1 0
      OASystem/OASystem.Domain/Entities/Financial/Fin_OtherPrice.cs
  7. 7 3
      OASystem/OASystem.Domain/Entities/Groups/Grp_CreditCardPayment.cs
  8. 14 5
      OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs
  9. 16 0
      OASystem/OASystem.Domain/ViewModels/Financial/Fin_ForeignReceivablesView.cs
  10. 16 0
      OASystem/OASystem.Domain/ViewModels/Financial/Fin_OtherPriceView.cs
  11. 42 0
      OASystem/OASystem.Domain/ViewModels/Financial/Fin_ProceedsReceivedView.cs
  12. 40 8
      OASystem/OASystem.Domain/ViewModels/Groups/DelegationInfoView.cs
  13. 4 1
      OASystem/OASystem.Domain/ViewModels/Groups/Grp_CreditCardPaymentView.cs
  14. 13 13
      OASystem/OASystem.Domain/ViewModels/JuHeExchangeRate/JuHeAPIResult.cs
  15. 77 0
      OASystem/OASystem.Infrastructure/Repositories/Financial/CreditCardPaymentRepository.cs
  16. 0 1
      OASystem/OASystem.Infrastructure/Repositories/Financial/DailyFeePaymentRepository.cs
  17. 49 0
      OASystem/OASystem.Infrastructure/Repositories/Financial/ForeignReceivablesRepository.cs
  18. 47 0
      OASystem/OASystem.Infrastructure/Repositories/Financial/OtherPriceRepository.cs
  19. 53 0
      OASystem/OASystem.Infrastructure/Repositories/Financial/ProceedsReceivedRepository.cs
  20. 71 8
      OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

+ 6 - 6
OASystem/EntitySync/Program.cs

@@ -90,14 +90,14 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Bus_ConfItemListInfo)
     //typeof(Res_CountryFeeCost)
     //typeof(Res_MemoInfo),
-    //typeof(Fin_DailyFeePayment), // 财务 - 日付申请
-    //typeof(Fin_DailyFeePaymentContent),  // 财务 - 日付申请详细类
+    //typeof(Fin_DailyFeePayment),       // 财务 - 日付申请
+    //typeof(Fin_DailyFeePaymentContent),// 财务 - 日付申请详细类
     //typeof(Grp_GroupsTaskAssignment),
     //typeof(Grp_AirTicketReservations),
     //typeof(Grp_GroupCostParameter),
-    //typeof(Grp_TeamRate), // 团组汇率
-    //typeof(Fin_ForeignReceivables),  //对外收款账单
-    //typeof(Fin_ProceedsReceived),    //已收款项
-    //typeof( Fin_OtherPrice), //其他款项
+    //typeof(Grp_TeamRate),              // 团组汇率
+    //typeof(Fin_ForeignReceivables),    // 对外收款账单
+    //typeof(Fin_ProceedsReceived),      // 已收款项
+    //typeof(Fin_OtherPrice),            // 其他款项
 });
 Console.WriteLine("数据库结构同步完成!");

+ 3 - 3
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -256,11 +256,11 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostPageSearchCommissionList(PageDailyFeePaymentDto dto)
+        public async Task<IActionResult> PostPageSearchCommissionList(GroupCommissionDto dto)
         {
-            GroupCommission.GetCommissionPageList();
+             var data = await GroupCommission.GetCommissionPageList(dto);
 
-            return Ok(JsonView(new object()));
+            return Ok(JsonView(data.Data));
         }
         #endregion
     }

+ 61 - 5
OASystem/OASystem.Api/OAMethodLib/GroupCommission.cs

@@ -1,4 +1,10 @@
-using OASystem.Infrastructure.Repositories.Groups;
+using Microsoft.AspNetCore.Components.Web;
+using OASystem.Domain.Dtos.Financial;
+using OASystem.Domain.Dtos.Groups;
+using OASystem.Domain.ViewModels.Financial;
+using OASystem.Domain.ViewModels.Groups;
+using OASystem.Infrastructure.Repositories.Financial;
+using OASystem.Infrastructure.Repositories.Groups;
 
 namespace OASystem.API.OAMethodLib
 {
@@ -8,25 +14,75 @@ namespace OASystem.API.OAMethodLib
     /// </summary>
     public static class GroupCommission
     {
-        private readonly static DelegationInfoRepository _grpDelInfoRep = AutofacIocManager.Instance.GetService<DelegationInfoRepository>(); //团组信息
+        //团组信息
+        private readonly static DelegationInfoRepository _dirRep = AutofacIocManager.Instance.GetService<DelegationInfoRepository>(); 
+        //团组实付金额
+        private readonly static CreditCardPaymentRepository ccpRep = AutofacIocManager.Instance.GetService<CreditCardPaymentRepository>();
+        //团组应收款项
+        private readonly static ForeignReceivablesRepository _frRep = AutofacIocManager.Instance.GetService<ForeignReceivablesRepository>();
+        //团组已收款项
+        private readonly static ProceedsReceivedRepository _prRep = AutofacIocManager.Instance.GetService<ProceedsReceivedRepository>();
+        //团组其他款项
+        private readonly static OtherPriceRepository _opRep = AutofacIocManager.Instance.GetService<OtherPriceRepository>(); 
 
         /// <summary>
         /// 获取团组提成 Page List
         /// </summary>
-        public static async void GetCommissionPageList()
+        public static async Task<Result> GetCommissionPageList(GroupCommissionDto dto)
         {
+            Result result = new Result() { Code = -1 };
+
+            GroupListPageDto groupPageDto = new GroupListPageDto() { PortType = dto.PortType, PageIndex = dto.PageIndex, PageSize = dto.PageSize };
+            var groupResult = await _dirRep.GetGroupPageList(groupPageDto);
+            if (groupResult.Code != 0)
+            {
+                result.Code = groupResult.Code;
+                result.Msg = groupResult.Msg;
+                return result;
+            }
+            if (groupResult.Data == null) { }
+            //List<DelegationListView> groupData = groupResult.Data;
+            result.Data = groupResult.Data;
+
+            return result;
 
         }
 
 
 
         /// <summary>
-        /// 获取团组提成
+        /// 根据团组Id计算 团组利润
         /// </summary>
         /// <param name="DiId">团组Id</param>
         public static async void GetCommission(int DiId)
-        { 
+        {
+            decimal sumFr = 0.00M,  //团组 应收款项
+                    sumPr = 0.00M,  //团组 已收款项
+                    refund = 0.00M, //团组 退款和其他费用
+                    cost = 0.00M;   //团组成本费用
+            if (DiId == 0) return;
             
+            //应收款项
+            Result frData = await _frRep.GetGroupReceivablesByDiid(DiId);
+            if (frData.Code == 0 && frData.Data != null)
+            {
+                foreach (var item in frData.Data)
+                {
+                    sumFr += item.Price;
+                }
+            }
+
+            //已收款项
+            Result prData = await _prRep.GetGroupReceivedByDiid(DiId);
+            if (frData.Code == 0 && frData.Data != null)
+            {
+                foreach (var item in prData.Data)
+                {
+                    sumPr += item.Price;
+                }
+            }
+
+            //收款退还费用
         }
     }
 }

+ 2 - 2
OASystem/OASystem.Domain/Dtos/Financial/CommissionDto.cs

@@ -9,14 +9,14 @@ namespace OASystem.Domain.Dtos.Financial
     /// <summary>
     /// 团组提成Dto
     /// </summary>
-    public class CommissionDto
+    public class GroupCommissionDto : DtoBase
     {
     }
 
     /// <summary>
     /// 团组提成 分页 Dto
     /// </summary>
-    public class CommissionPageDto:DtoBase
+    public class CommissionPageDto
     {
         
     }

+ 7 - 0
OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs

@@ -15,6 +15,13 @@ namespace OASystem.Domain.Dtos.Groups
     {
     }
 
+    /// <summary>
+    /// 获取团组列表 Page 请求实体类
+    /// </summary>
+    public class GroupListPageDto : DtoBase
+    {
+    }
+
     /// <summary>
     /// 获取团组singe 请求实体类
     /// </summary>

+ 1 - 0
OASystem/OASystem.Domain/Entities/Financial/Fin_OtherPrice.cs

@@ -8,6 +8,7 @@ namespace OASystem.Domain.Entities.Financial
 {
     /// <summary>
     /// 财务 - 其他款项
+    /// 雷怡 2023-08-15 15:13
     /// </summary>
     [SugarTable("Fin_OtherPrice")]
     public class Fin_OtherPrice:EntityBase

+ 7 - 3
OASystem/OASystem.Domain/Entities/Groups/Grp_CreditCardPayment.cs

@@ -117,11 +117,13 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
         public DateTime AuditMFDate { get; set; }
+
         /// <summary>
-        /// 总经理是否审核  0否1是
+        /// 总经理是否审核  0 未审核 1已通过 2未通过
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int IsAuditGM { get; set; }
+
         /// <summary>
         /// 总经理审核人
         /// </summary>
@@ -133,7 +135,7 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
         public DateTime AuditGMDate { get; set; }
         /// <summary> 
-        /// 是否付款  0否1是
+        /// 是否付款  0  1 
         /// </summary> 
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int IsPay { get; set; }
@@ -187,11 +189,13 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10, 2)")]
         public decimal RMBPrice { get; set; }
+
         /// <summary>
         /// 费用标识
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
-        public string OrbitalPrivateTransfer { get; set; }
+        public string? OrbitalPrivateTransfer { get; set; }
+
         /// <summary>
         /// 超出预算比例
         /// </summary>

+ 14 - 5
OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs

@@ -47,12 +47,12 @@ namespace OASystem.Domain.ViewModels.Financial
         /// <summary>
         /// 公司名称
         /// </summary>
-        public string CompanyName { get; set; }
+        public string? CompanyName { get; set; }
 
         /// <summary>
         /// 费用描述
         /// </summary>
-        public string Instructions { get; set; }
+        public string? Instructions { get; set; }
 
         /// <summary>
         /// 费用总计
@@ -67,7 +67,7 @@ namespace OASystem.Domain.ViewModels.Financial
         /// <summary>
         /// 申请人姓名
         /// </summary>
-        public string CreateUser { get; set; }
+        public string? CreateUser { get; set; }
 
         /// <summary>
         /// 申请时间
@@ -79,7 +79,10 @@ namespace OASystem.Domain.ViewModels.Financial
         /// </summary>
         public int FAudit { get; set; }
 
-        public string FAuditDesc
+        /// <summary>
+        /// 财务 审核状态
+        /// </summary>
+        public string? FAuditDesc
         {
             get
             {
@@ -96,7 +99,10 @@ namespace OASystem.Domain.ViewModels.Financial
         /// </summary>
         public int MAudit { get; set; }
 
-        public string MAuditDesc
+        /// <summary>
+        /// 总经理 审核状态
+        /// </summary>
+        public string? MAuditDesc
         {
             get
             {
@@ -114,6 +120,9 @@ namespace OASystem.Domain.ViewModels.Financial
         public int PriceTypeId { get; set; }
     }
 
+    /// <summary>
+    /// 日服申请 分页
+    /// </summary>
     public class Fin_DailyFeePaymentPage
     {
         /// <summary>

+ 16 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_ForeignReceivablesView.cs

@@ -0,0 +1,16 @@
+using OASystem.Domain.Entities.Financial;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Financial
+{
+    /// <summary>
+    /// 团组应收款项 View
+    /// </summary>
+    public class Fin_ForeignReceivablesView:Fin_ForeignReceivables
+    {
+    }
+}

+ 16 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_OtherPriceView.cs

@@ -0,0 +1,16 @@
+using OASystem.Domain.Entities.Financial;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Financial
+{
+    /// <summary>
+    /// 其他款项
+    /// </summary>
+    public class Fin_OtherPriceView:Fin_OtherPrice
+    {
+    }
+}

+ 42 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_ProceedsReceivedView.cs

@@ -0,0 +1,42 @@
+using OASystem.Domain.Entities.Financial;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Financial
+{
+    /// <summary>
+    /// 团组已收款项 View
+    /// </summary>
+    public class Fin_ProceedsReceivedView:Fin_ProceedsReceived
+    {
+    }
+
+    /// <summary>
+    /// 团组退款/其他款项 View
+    /// </summary>
+    public class GroupRefundView
+    {
+        /// <summary>
+        /// 创建用户Id 
+        /// </summary>
+        public int CreateUserId { get; set; }
+
+        /// <summary>
+        /// 总经理审核时间
+        /// </summary>
+        public string? AuditGMDate { get; set; }
+
+        /// <summary>
+        /// 支付方式
+        /// </summary>
+        public string? PayType { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public int OrbitalPrivateTransfer { get; set; }
+    }
+}

+ 40 - 8
OASystem/OASystem.Domain/ViewModels/Groups/DelegationInfoView.cs

@@ -148,48 +148,59 @@ namespace OASystem.Domain.ViewModels.Groups
     {
         /// <summary>
         /// 主键Id
+        /// 团组Id
         /// </summary>
         public int Id { get; set; }
 
         /// <summary>
         /// 销售报价号
         /// </summary>
-        public string SalesQuoteNo { get; set; }
+        public string? SalesQuoteNo { get; set; }
 
         /// <summary>
         /// 团号
         /// </summary>
-        public string TourCode { get; set; }
+        public string? TourCode { get; set; }
 
         /// <summary>
         /// 接团操作人
         /// </summary>
-        public string JietuanOperator { get; set; }
+        public string? JietuanOperator { get; set; }
+
+        /// <summary>
+        /// 团组等级Id
+        /// </summary>
+        public int TeamLevId { get; set; }
 
         /// <summary>
         /// 团组等级 
         /// </summary>
-        public string TeamLev { get; set; }
+        public string? TeamLev { get; set; }
+
+        /// <summary>
+        /// 团组类型Id
+        /// </summary>
+        public int TeamTypeId { get; set; }
 
         /// <summary>
         /// 团组类型
         /// </summary>
-        public string TeamType { get; set; }
+        public string? TeamType { get; set; }
 
         /// <summary>
         /// 团组名称
         /// </summary>
-        public string TeamName { get; set; }
+        public string? TeamName { get; set; }
 
         /// <summary>
         /// 客户名称
         /// </summary>
-        public string ClientName { get; set; }
+        public string? ClientName { get; set; }
 
         /// <summary>
         /// 客户所属公司
         /// </summary>
-        public string ClientUnit { get; set; }
+        public string? ClientUnit { get; set; }
 
         /// <summary>
         /// 出团日期
@@ -214,6 +225,27 @@ namespace OASystem.Domain.ViewModels.Groups
         public int IsSure { get; set; }
     }
 
+    /// <summary>
+    /// 团组信息 Page List
+    /// </summary>
+    public class DelegationPageListView : DelegationListView
+    {
+        /// <summary>
+        /// 行号
+        /// </summary>
+        public int RowNumber { get; set; }
+    }
+
+    /// <summary>
+    /// 团组信息 Page List
+    /// </summary>
+    public class DelegationPageCountView
+    {
+        /// <summary>
+        /// 行号
+        /// </summary>
+        public int Count { get; set; }
+    }
 
     /// <summary>
     /// 团组编号

+ 4 - 1
OASystem/OASystem.Domain/ViewModels/Groups/Grp_CreditCardPaymentView.cs

@@ -1,4 +1,5 @@
-using System;
+using OASystem.Domain.Entities.Groups;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -6,6 +7,8 @@ using System.Threading.Tasks;
 
 namespace OASystem.Domain.ViewModels.Groups
 {
+    public class Grp_Fin_CreditCardPaymentView:Grp_CreditCardPayment
+    { }
     public class Grp_CreditCardPaymentView
     {
         /// <summary>

+ 13 - 13
OASystem/OASystem.Domain/ViewModels/JuHeExchangeRate/JuHeAPIResult.cs

@@ -20,21 +20,21 @@ namespace OASystem.Domain.ViewModels.JuHeExchangeRate
 
         /// <summary>
         /// 系统级错误码
-        /// 错误码  说明            旧版本(resultcode)
-        /// 10001	错误的请求KEY	101
- 	    /// 10002	该KEY无请求权限	102
- 	    /// 10003	KEY过期	        103
- 	    /// 10004	错误的OPENID	104
+        /// 错误码  说明                 旧版本(resultcode)
+        /// 10001	错误的请求KEY	     101
+ 	    /// 10002	该KEY无请求权限	     102
+ 	    /// 10003	KEY过期	             103
+ 	    /// 10004	错误的OPENID	     104
  	    /// 10005	应用未审核超时,请提交认证	105
- 	    /// 10007	未知的请求源	107
- 	    /// 10008	被禁止的IP	    108
- 	    /// 10009	被禁止的KEY	    109
- 	    /// 10011	当前IP请求超过限制	111
- 	    /// 10012	请求超过次数限制	112
- 	    /// 10013	测试KEY超过请求限制	113
+ 	    /// 10007	未知的请求源	     107
+ 	    /// 10008	被禁止的IP	         108
+ 	    /// 10009	被禁止的KEY	         109
+ 	    /// 10011	当前IP请求超过限制	 111
+ 	    /// 10012	请求超过次数限制	 112
+ 	    /// 10013	测试KEY超过请求限制	 113
  	    /// 10014	系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失)    114
- 	    /// 10020	接口维护	    120
- 	    /// 10021	接口停用	    121
+ 	    /// 10020	接口维护	         120
+ 	    /// 10021	接口停用	         121
         /// </summary>
         public string? Resultcode { get; set; }
 

+ 77 - 0
OASystem/OASystem.Infrastructure/Repositories/Financial/CreditCardPaymentRepository.cs

@@ -0,0 +1,77 @@
+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>
+        /// 团组 其他款项/退款
+        /// </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 * 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;
+        }
+    }
+}

+ 0 - 1
OASystem/OASystem.Infrastructure/Repositories/Financial/DailyFeePaymentRepository.cs

@@ -171,7 +171,6 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
                 int totalCount = dailyFeePaymentCount.Count;
                 
-
                 dailyFeePaymentPageList = new ListViewBase<Fin_DailyFeePaymentPageListView>
                 {
                     CurrPageIndex = dto.PageIndex,

+ 49 - 0
OASystem/OASystem.Infrastructure/Repositories/Financial/ForeignReceivablesRepository.cs

@@ -0,0 +1,49 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Entities.Financial;
+using OASystem.Domain.ViewModels.Financial;
+using SqlSugar;
+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 15:03
+    /// </summary>
+    public class ForeignReceivablesRepository:BaseRepository<Fin_ForeignReceivables,Fin_ForeignReceivablesView>
+    {
+        private readonly IMapper _mapper;
+
+        public ForeignReceivablesRepository(SqlSugarClient sqlSugar, IMapper mapper)
+            :base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+
+        /// <summary>
+        /// 根据diid查询团组已收收款项
+        /// </summary>
+        /// <param name="diid"></param>
+        /// <returns></returns>
+        public async Task<Result> GetGroupReceivablesByDiid(int diid)
+        {
+            Result result = new() { Code = -2 };
+
+            string sql = string.Format(@"Select * From Fin_ProceedsReceived Where IsDel=0 And Diid={0}", diid);
+
+            var groupReceivedList = await _sqlSugar.SqlQueryable<Fin_ProceedsReceivedView>(sql).ToListAsync();
+
+            result.Code = 0;
+            result.Msg = "查询成功!";
+            result.Data = groupReceivedList;
+
+            return result;
+
+        }
+    }
+}

+ 47 - 0
OASystem/OASystem.Infrastructure/Repositories/Financial/OtherPriceRepository.cs

@@ -0,0 +1,47 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Entities.Financial;
+using OASystem.Domain.ViewModels.Financial;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Financial
+{
+    /// <summary>
+    /// 财务 - 其他款项
+    /// </summary>
+    public class OtherPriceRepository:BaseRepository<Fin_OtherPrice,Fin_OtherPriceView>
+    {
+        private readonly IMapper _mapper;
+
+        public OtherPriceRepository(SqlSugarClient sqlSugar, IMapper mapper)
+            : base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+
+        /// <summary>
+        /// 根据diid查询团组其他款项
+        /// </summary>
+        /// <param name="diid"></param>
+        /// <returns></returns>
+        public async Task<Result> GetGroupOtherPriceByDiid(int diid)
+        {
+            Result result = new() { Code = -2 };
+
+            string sql = string.Format(@"Select * From Fin_OtherPrice Where IsDel=0 And Diid={0}", diid);
+
+            var groupReceivablesList = await _sqlSugar.SqlQueryable<Fin_ProceedsReceivedView>(sql).ToListAsync();
+
+            result.Code = 0;
+            result.Msg = "查询成功!";
+            result.Data = groupReceivablesList;
+
+            return result;
+
+        }
+    }
+}

+ 53 - 0
OASystem/OASystem.Infrastructure/Repositories/Financial/ProceedsReceivedRepository.cs

@@ -0,0 +1,53 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Entities.Financial;
+using OASystem.Domain.ViewModels.Financial;
+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 15:24
+    /// </summary>
+    public class ProceedsReceivedRepository:BaseRepository<Fin_ProceedsReceived,Fin_ProceedsReceivedView>
+    {
+        private readonly IMapper _mapper;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="sqlSugar"></param>
+        /// <param name="mapper"></param>
+        public ProceedsReceivedRepository(SqlSugarClient sqlSugar, IMapper mapper)
+            : base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+
+        /// <summary>
+        /// 根据diid查询团组应收款项
+        /// </summary>
+        /// <param name="diid"></param>
+        /// <returns></returns>
+        public async Task<Result> GetGroupReceivedByDiid(int diid)
+        {
+            Result result = new() { Code = -2 };
+
+            string sql = string.Format(@"Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0}", diid);
+
+            var groupReceivablesList = await _sqlSugar.SqlQueryable<Fin_ProceedsReceivedView>(sql).ToListAsync();
+
+            result.Code = 0;
+            result.Msg = "查询成功!";
+            result.Data = groupReceivablesList;
+
+            return result;
+
+        }
+    }
+}

+ 71 - 8
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -1,10 +1,12 @@
 using Newtonsoft.Json;
 using OASystem.Domain;
 using OASystem.Domain.Dtos;
+using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Dtos.UserDto;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.CRM;
+using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Repositories.System;
 using Org.BouncyCastle.Asn1.Cms;
@@ -36,6 +38,68 @@ namespace OASystem.Infrastructure.Repositories.Groups
         }
 
         #region 团组
+
+        /// <summary>
+        /// 获取接团信息 Page List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> GetGroupPageList(GroupListPageDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+
+            ListViewBase<DelegationPageListView> groupsInfoPageList = new ListViewBase<DelegationPageListView>()
+            {
+                ReceiveDt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
+            };
+
+            if (dto.PortType == 1 || dto.PortType == 2) //web
+            {
+                int startIndex = (dto.PageIndex - 1) * dto.PageSize + 1;
+                int endIndex = startIndex + dto.PageSize - 1;
+
+                string sql = string.Format(@"Select * From(Select row_number() over (order by gdi.Id Desc) as RowNumber,
+		                                        gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,
+		                                        ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,
+		                                        su.CnName JietuanOperator,IsSure
+	                                        From  Grp_DelegationInfo gdi
+	                                        Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id 
+	                                        Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
+	                                        Left Join Sys_Users su On gdi.JietuanOperator = su.Id
+	                                        Where gdi.IsDel = 0 
+                                        )temp Where RowNumber Between {0} and {1}", startIndex, endIndex);
+
+                string sqlCount = string.Format(@"Select Count(1) as Count From  Grp_DelegationInfo gdi
+	                                        Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id 
+	                                        Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
+	                                        Left Join Sys_Users su On gdi.JietuanOperator = su.Id
+	                                        Where gdi.IsDel = 0  ");
+
+                List<DelegationPageListView> _DeleInfoList = await _sqlSugar.SqlQueryable<DelegationPageListView>(sql).ToListAsync();
+
+                DelegationPageCountView _DeleCount = await _sqlSugar.SqlQueryable<DelegationPageCountView>(sql).FirstAsync();
+
+                int count = _DeleCount.Count;
+
+                groupsInfoPageList = new ListViewBase<DelegationPageListView>
+                {
+                    CurrPageIndex = dto.PageIndex,
+                    CurrPageSize = dto.PageSize,
+                    DataCount = count,
+                    DataList = _DeleInfoList
+                };
+
+                result.Code = 0;
+                result.Msg = "成功!";
+                result.Data = groupsInfoPageList;
+            }
+
+
+            return result;
+
+        }
+
+
         /// <summary>
         /// 获取接团信息List
         /// </summary>
@@ -47,14 +111,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             if (dto.PortType == 1 || dto.PortType == 2) //web
             {
-                string sql = string.Format(@"Select gdi.Id,SalesQuoteNo,TourCode,ssd.Name TeamType,ssd1.Name TeamLev,TeamName,ClientName,
-                                                    ClientUnit,VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure
-                                             From  Grp_DelegationInfo gdi
-                                             Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id 
-                                             Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
-                                             Left Join Sys_Users su On gdi.JietuanOperator = su.Id
-                                             Where gdi.IsDel = 0 
-                                             Order By gdi.CreateTime Desc");
+                string sql = string.Format(@"Select gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure
+                  From  Grp_DelegationInfo gdi
+                  Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id 
+                  Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
+                  Left Join Sys_Users su On gdi.JietuanOperator = su.Id
+                  Where gdi.IsDel = 0 
+                  Order By gdi.CreateTime Desc");
 
                 var _DelegationList = await _sqlSugar.SqlQueryable<DelegationListView>(sql).ToListAsync();
                 if (_DelegationList.Count > 0)