LEIYI 7 maanden geleden
bovenliggende
commit
9b04580302

+ 18 - 5
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -5,6 +5,7 @@ using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
+using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
 using Org.BouncyCastle.Utilities.Encoders;
 using static OASystem.API.OAMethodLib.JWTHelper;
@@ -2821,15 +2822,27 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 })
                 .ToListAsync();
             var officialDutyData = await _sqlSugar.Queryable<Res_OfficialActivities>()
-                .Where(x => x.IsDel == 0)
-                .Select(x => new {
-                    x.Id,
-                    x.Client,
+                .LeftJoin<Grp_DelegationInfo>((oa, di) => oa.DiId == di.Id)
+                .Where((oa, di) => oa.IsDel == 0)
+                .Select((oa, di) => new
+                {
+                    oa.Id,
+                    oa.Client,
+                    oa.DiId,
+                    di.TeamName
                 })
                 .ToListAsync();
+
+            var officialDutyData1 = officialDutyData.GroupBy(x => x.DiId)
+                .Select(g => new {
+                    diId = g.Key,
+                    groupName = g.FirstOrDefault()?.TeamName ?? "-",
+                    children = g.Select(g1 => new { oaId = g1.Id,client = g1.Client }).ToList()
+                })
+                .ToList();
             var view = new { 
                 currencyData = currencyData,
-                officialDutyData = officialDutyData
+                officialDutyData = officialDutyData1
             };
 
             return Ok(JsonView(view));

+ 24 - 4
OASystem/OASystem.Infrastructure/Repositories/Financial/DailyFeePaymentRepository.cs

@@ -51,8 +51,16 @@ namespace OASystem.Infrastructure.Repositories.Financial
             var setData = _setDataTypeRep.QueryDto<Sys_SetData, Fin_DailyFeePaymentPagePriceSubTypeView>().ToList();
 
             //48人员费用  49办公费用 50 销售费用 51 其他费用 55 大运会
-            var priceTypeData = setTypeData.Where(s => s.Id == 48 || s.Id == 49 || s.Id == 50 || s.Id == 51 || s.Id == 55).ToList();
-            var priceSubTypeData = setData.Where(s => s.STid == 48 || s.STid == 49 || s.STid == 50 || s.STid == 51 || s.STid == 55).ToList();
+            var typeIds = new List<int>() {
+                48, //人员费用
+                49, //办公费用
+                50, //销售费用
+                51, //其他费用
+                55, //大运会
+                90, //各部门基础固定费用明细
+            };
+            var priceTypeData = setTypeData.Where(s => typeIds.Contains(s.Id)).ToList();
+            var priceSubTypeData = setData.Where(s => typeIds.Contains(s.STid)).ToList();
 
             var isEnable = false;
             //员工姓名列表
@@ -275,7 +283,6 @@ namespace OASystem.Infrastructure.Repositories.Financial
                                                 ) temp ", sqlWhere);
             #endregion
 
-
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
             {
                 //Fin_DailyFeePaymentPageCount
@@ -361,6 +368,20 @@ namespace OASystem.Infrastructure.Repositories.Financial
             {
                 Fin_DailyFeePayment _fee = _mapper.Map<Fin_DailyFeePayment>(dto);
                 _fee.CreateUserId = dto.UserId;
+
+                /*
+                 * 2024-10-29
+                 * 各部门基础固定费用明细”里的费用数据新增后,财务和总经理审核都默认直接通过isAudit=1),并且可编辑,如果ispay=1的话将不可编辑
+                 */
+                var priceTypeInfo = await _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.Id == dto.PriceTypeId).FirstAsync();
+                if (priceTypeInfo != null && priceTypeInfo.STid == 90)
+                {
+                    _fee.FAudit = 1;
+                    _fee.FAuditDate = DateTime.Now;
+                    _fee.MAudit = 1;
+                    _fee.MAuditDate = DateTime.Now;
+                }
+
                 int? feeId = await _sqlSugar.Insertable(_fee).ExecuteReturnIdentityAsync();
 
                 if (dto.FeeContents.Count > 0)
@@ -426,7 +447,6 @@ namespace OASystem.Infrastructure.Repositories.Financial
                     result.Msg = "审核已通过,不可修改!";
                     return result;
                 }
-
             }
 
             #endregion