Browse Source

财务模块 对外首款账单
应收款项 info

leiy 1 year ago
parent
commit
2c3b9a73d0

+ 26 - 1
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -400,7 +400,32 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
-
+        
+        /// <summary>
+        /// 对外收款账单 
+        /// 账单详情
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetGroupReceivablesInfoByDiId(ForForeignReceivablesInfoDto dto)
+        {
+            try
+            {
+                Result ffrData = await _ForForeignReceivablesRep.GetGroupReceivablesInfoByDiId(dto);
+                if (ffrData.Code != 0)
+                {
+                    return Ok(JsonView(false, ffrData.Msg));
+                }
+                return Ok(JsonView(true, ffrData.Msg, ffrData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+                throw;
+            }
+        }
         #endregion
     }
 }

+ 12 - 4
OASystem/OASystem.Domain/Dtos/DtoBase.cs

@@ -10,16 +10,24 @@ namespace OASystem.Domain.Dtos
     /// <summary>
     /// 请求实体类 基类
     /// </summary>
-    public class DtoBase
+    public class DtoBase: PortDtoBase
+    {
+        public int PageIndex { get; set; } = 1;
+        public int PageSize { get; set; } = 10;
+    }
+
+    /// <summary>
+    /// 请求实体类
+    /// 端口
+    /// 基类
+    /// </summary>
+    public class PortDtoBase
     {
         /// <summary>
         /// 请求端口分类
         /// 1 Web 2 Android 3 IOS
         /// </summary>
         public int PortType { get; set; } = 1;
-
-        public int PageIndex { get; set; } = 1;
-        public int PageSize { get; set; } = 10;
     }
 
     public class JsonDtoBase

+ 20 - 0
OASystem/OASystem.Domain/Dtos/Financial/ForForeignReceivablesDto.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Financial
+{
+    /// <summary>
+    /// 财务模块
+    /// 对外收款
+    /// </summary>
+    public class ForForeignReceivablesInfoDto: PortDtoBase
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+    }
+}

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

@@ -1,5 +1,6 @@
 using AutoMapper;
 using OASystem.Domain;
+using OASystem.Domain.Dtos.Financial;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.ViewModels.Financial;
@@ -55,6 +56,36 @@ namespace OASystem.Infrastructure.Repositories.Financial
             return result;
         }
 
+        /// <summary>
+        /// 根据diid查询团组应收款项
+        /// </summary>
+        /// <param name="diid"></param>
+        /// <returns></returns>
+        public async Task<Result> GetGroupReceivablesInfoByDiId(ForForeignReceivablesInfoDto dto)
+        {
+            Result result = new() { Code = -2 };
+
+            var groupInfoData = await _delegationRep.GetGroupInfo(new GroupInfoDto() { Id = dto.DiId });
+            string sql = string.Format(@"Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0}", dto.DiId);
+            var groupReceivedList = await _sqlSugar.SqlQueryable<Fin_ForeignReceivables>(sql).ToListAsync();
+
+            if (dto.PortType == 1 )
+            {
+
+            }
+
+            result.Code = 0;
+            result.Msg = "查询成功!";
+            result.Data = new {
+                GroupInfo = groupInfoData.Data,
+                GroupReceivedData=groupReceivedList
+            };
+
+            return result;
+
+        }
+
+
         /// <summary>
         /// 根据diid查询团组应收款项
         /// </summary>