Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

LEIYI 1 month ago
parent
commit
c9c5cfc5bb

+ 13 - 0
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -788,6 +788,19 @@ namespace OASystem.API.Controllers
             return Ok(await _ForForeignReceivablesRep.PostDataSource(dto));
         }
 
+        /// <summary>
+        /// 对外收款账单,团组列表分页
+        /// 数据源
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> ForeignReceivablesDataSourcesOffSet(ForeignReceivablesDataSourcesOffSetDto dto)
+        {
+            return Ok(await _ForForeignReceivablesRep.PostDataSourceOffSet(dto));
+        }
+
         /// <summary>
         /// 对外收款账单 
         /// 账单详情

+ 1 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -7520,6 +7520,7 @@ FROM
                 }
                 catch (Exception ex)
                 {
+
                 }
                 #endregion
 

+ 6 - 2
OASystem/OASystem.Api/OAMethodLib/APNs/APNsService.cs

@@ -6,6 +6,7 @@ using static System.Net.Mime.MediaTypeNames;
 using Microsoft.Net.Http.Headers;
 using Microsoft.Extensions.Configuration;
 using NPOI.SS.Formula.Functions;
+using Serilog;
 
 namespace OASystem.API.OAMethodLib.APNs
 {
@@ -27,10 +28,12 @@ namespace OASystem.API.OAMethodLib.APNs
 
         private readonly IConfiguration _configuration;
         private readonly IHttpClientFactory _httpClientFactory;
-        public APNsService(IConfiguration configuration, IHttpClientFactory httpClientFactory)
+        private readonly Serilog.ILogger _logger;
+        public APNsService(IConfiguration configuration, Serilog.ILogger logger, IHttpClientFactory httpClientFactory)
         {
             this._configuration = configuration;
             this._httpClientFactory = httpClientFactory;
+            this._logger = logger;
 
             //APNsService.baseUrl = this._configuration["apple:pushNotificationServer"];
             APNsService.baseUrl = this._configuration["apple:pushNotificationServer_Production"];
@@ -173,6 +176,7 @@ namespace OASystem.API.OAMethodLib.APNs
                 result.Code = -3;
                 result.Msg = "";
                 result.Data = responseData;
+                _logger.Information(string.Format(@" APNs : {0}", e.Message));
                 return result;
             }
         }
@@ -191,5 +195,5 @@ namespace OASystem.API.OAMethodLib.APNs
 
     }
 
-   
+
 }

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

@@ -12,6 +12,14 @@ namespace OASystem.Domain.Dtos.Financial
         public int CurrUserId { get; set; }
     }
 
+    public class ForeignReceivablesDataSourcesOffSetDto
+    {
+        public int CurrUserId { get; set; }
+
+        public int PageSize { get; set; }
+        public int PageIndex { get; set; }
+    }
+
     /// <summary>
     /// 财务模块
     /// 对外收款

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

@@ -326,6 +326,59 @@ namespace OASystem.Infrastructure.Repositories.Financial
             return result;
         }
 
+        /// <summary>
+        /// 收款账单数据源团组分页
+        /// </summary>
+        /// <returns></returns>
+        public async Task<JsonView> PostDataSourceOffSet(ForeignReceivablesDataSourcesOffSetDto dto)
+        {
+            JsonView result = new() { Code = StatusCodes.Status204NoContent };
+            if (dto.PageIndex < 1) dto.PageIndex = 1;
+            if (dto.PageSize < 1) dto.PageSize = 10;
+
+            //已收款项 判断如果是市场部的人员进来的话 只显示自己的 其他的都显示全部的
+            var userInfos = await _sqlSugar.Queryable<Sys_Users>()
+                                           .InnerJoin<Sys_Department>((u, d) => u.DepId == d.Id)
+                                           .Where((u, d) => u.IsDel == 0 && d.DepName.Contains("市场部") && u.Id == dto.CurrUserId)
+                                           .ToListAsync();
+
+            var expressionWhere = Expressionable.Create<Grp_DelegationInfo>()
+                                                .And(x => x.IsDel == 0 && x.TeamName != "")
+                                                .AndIF(userInfos.Count > 0, x => x.JietuanOperator == dto.CurrUserId)
+                                                .ToExpression();
+
+            var totalNumber = 0;
+
+            var _groupNameList =  _sqlSugar.Queryable<Grp_DelegationInfo>()
+                                            .Where(expressionWhere)
+                                            .ToPageList(dto.PageIndex, dto.PageSize, ref  totalNumber)
+                                            .Select(x=> new GroupNameView
+                                            {
+                                                 GroupName = x.TeamName,
+                                                 Id = x.Id,
+                                            });
+
+            if (totalNumber > 0)
+            {
+                totalNumber = totalNumber / dto.PageSize + 1;
+            }
+
+            var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种
+            var remittanceMethodData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //汇款方式
+
+            result.Code = StatusCodes.Status200OK;
+            result.Msg = "成功!";
+            result.Data = new
+            {
+                GroupNameData = _groupNameList,
+                CurrencyData = currencyData.Data,
+                RemittanceMethodData = remittanceMethodData.Data,
+                GroupTotalPage = totalNumber
+            };
+
+            return result;
+        }
+
         /// <summary>
         /// 根据diid查询团组应收款项
         /// </summary>