From 75463592b40199fbafb6930060ef679a05b5b714 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期四, 07 八月 2025 16:26:14 +0800 Subject: [PATCH] feat:任务开发 --- FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs b/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs index ac2f0cf..6e121f5 100644 --- a/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs +++ b/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs @@ -83,6 +83,12 @@ return request.SetIsDisabled<DictionaryData>(cancellationToken: cancellationToken); } + /// <summary> + /// 鍚屾浜哄姏璧勬簮鍦板尯瀛楀吀鏁版嵁 + /// </summary> + /// <param name="request"></param> + /// <param name="cancellationToken"></param> + /// <returns></returns> public async Task<int> Handle(SyncHumanResourcesAreaDictionaryDataCommand request, CancellationToken cancellationToken) { var repHumanResourcesBaseArea = Db.GetRepository<BaseArea, HumanResourcesDbContextLocator>(); @@ -96,12 +102,19 @@ CategoryId = categoryId }); var parentAreas = areas.Where(it => it.ParentId == 0).ToList(); - LoopAdd(categoryId, entities, areas, parentAreas); + LoopSyncHumanResourcesAreaDictionaryData(categoryId, entities, areas, parentAreas); await rep.Context.BulkInsertAsync(entities); return entities.Count; } - public void LoopAdd(Guid categoryId, List<DictionaryData> entities, List<BaseArea> all, List<BaseArea> areas) + /// <summary> + /// 閫掑綊鍚屾浜哄姏璧勬簮鍦板尯瀛楀吀鏁版嵁 + /// </summary> + /// <param name="categoryId"></param> + /// <param name="entities"></param> + /// <param name="all"></param> + /// <param name="areas"></param> + private void LoopSyncHumanResourcesAreaDictionaryData(Guid categoryId, List<DictionaryData> entities, List<BaseArea> all, List<BaseArea> areas) { if (areas.IsNotNull()) { @@ -140,7 +153,7 @@ entities.Add(entity); var children = all.Where(it => it.ParentId == area.AreaCode).ToList(); - LoopAdd(categoryId, entities, all, children); + LoopSyncHumanResourcesAreaDictionaryData(categoryId, entities, all, children); } } } -- Gitblit v1.9.1