Przeglądaj źródła

财务模块 对外收款账单
基础数据源接口

leiy 1 rok temu
rodzic
commit
20089319bd

+ 33 - 2
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -25,12 +25,13 @@ namespace OASystem.API.Controllers
         private readonly SqlSugarClient _sqlSugar;
         private readonly SetDataTypeRepository _setDataTypeRep;
         private readonly DailyFeePaymentRepository _daiRep;    //日付申请仓库
-        private readonly TeamRateRepository _teamRateRep;    //团组汇率仓库
+        private readonly TeamRateRepository _teamRateRep;      //团组汇率仓库
+        private readonly ForeignReceivablesRepository _ForForeignReceivablesRep;  //对外收款账单仓库
 
         /// <summary>
         /// 初始化
         /// </summary>
-        public FinancialController(IMapper mapper, IConfiguration configuration, DailyFeePaymentRepository daiRep, SqlSugarClient sqlSugar, SetDataTypeRepository setDataTypeRep, TeamRateRepository teamRateRep) 
+        public FinancialController(IMapper mapper, IConfiguration configuration, DailyFeePaymentRepository daiRep, SqlSugarClient sqlSugar, SetDataTypeRepository setDataTypeRep, TeamRateRepository teamRateRep, ForeignReceivablesRepository ForForeignReceivablesRep) 
         {
             _mapper = mapper;
             _config = configuration;
@@ -38,6 +39,7 @@ namespace OASystem.API.Controllers
             _sqlSugar = sqlSugar;
             _setDataTypeRep = setDataTypeRep;
             _teamRateRep = teamRateRep;
+            _ForForeignReceivablesRep = ForForeignReceivablesRep;
         }
 
         #region 日付申请
@@ -371,5 +373,34 @@ namespace OASystem.API.Controllers
         }
 
         #endregion
+
+        #region 对外收款账单
+
+        /// <summary>
+        /// 对外收款账单 Select数据源(团组名,币种,汇款方式)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> GetForeignReceivablesDataSources()
+        {
+            try
+            {
+                Result ffrData = await _ForForeignReceivablesRep.GetDataSource();
+                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
     }
 }

+ 2 - 2
OASystem/OASystem.Domain/ViewModels/Financial/Fin_DailyFeePaymentView.cs

@@ -105,7 +105,7 @@ namespace OASystem.Domain.ViewModels.Financial
         /// <summary>
         /// 财务审核人姓名
         /// </summary>
-        public string? FAuditName { get; set; }
+        public string? FAuditName { get; set; } = "无";
 
         /// <summary>
         /// 总经理审核
@@ -130,7 +130,7 @@ namespace OASystem.Domain.ViewModels.Financial
         /// <summary>
         /// 总经理审核姓名
         /// </summary>
-        public string? MAuditName { get; set; }
+        public string? MAuditName { get; set; } = "无";
 
         /// <summary>
         /// 费用类型

+ 33 - 3
OASystem/OASystem.Infrastructure/Repositories/Financial/ForeignReceivablesRepository.cs

@@ -1,7 +1,10 @@
 using AutoMapper;
 using OASystem.Domain;
+using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.ViewModels.Financial;
+using OASystem.Infrastructure.Repositories.Groups;
+using OASystem.Infrastructure.Repositories.System;
 using SqlSugar;
 using System;
 using System.Collections.Generic;
@@ -15,14 +18,41 @@ namespace OASystem.Infrastructure.Repositories.Financial
     /// 财务 - 团组应收款项 仓库
     /// 雷怡 2023.08.16 15:03
     /// </summary>
-    public class ForeignReceivablesRepository:BaseRepository<Fin_ForeignReceivables,Fin_ForeignReceivablesView>
+    public class ForeignReceivablesRepository : BaseRepository<Fin_ForeignReceivables, Fin_ForeignReceivablesView>
     {
         private readonly IMapper _mapper;
+        private readonly DelegationInfoRepository _delegationRep;
+        private readonly SetDataRepository _setDataRep;
 
-        public ForeignReceivablesRepository(SqlSugarClient sqlSugar, IMapper mapper)
-            :base(sqlSugar)
+        public ForeignReceivablesRepository(SqlSugarClient sqlSugar, IMapper mapper, DelegationInfoRepository delegationRep, SetDataRepository setDataRep)
+            : base(sqlSugar)
         {
             _mapper = mapper;
+            _delegationRep = delegationRep;
+            _setDataRep = setDataRep;
+        }
+
+        /// <summary>
+        /// 收款账单 数据源
+        /// </summary>
+        /// <returns></returns>
+        public async Task<Result> GetDataSource()
+        {
+            Result result = new() { Code = -2 };
+
+            var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
+            var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep,66); //币种
+            var remittanceMethodData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //汇款方式
+
+            result.Code = 0;
+            result.Msg = "成功!";
+            result.Data = new {
+                GroupNameData= groupNameData.Data,
+                CurrencyData = currencyData.Data,
+                RemittanceMethodData = remittanceMethodData.Data
+            };
+
+            return result;
         }
 
         /// <summary>