Browse Source

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

jiangjc 1 month ago
parent
commit
bb3c2b8b6c

+ 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>
         /// 对外收款账单 
         /// 账单详情

+ 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>