From 59e73ad4283491cd407854874879e0ddc8dafaba Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 07 八月 2025 14:08:20 +0800
Subject: [PATCH] feat:地区字典

---
 FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs b/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs
index 0dce231..7df5b54 100644
--- a/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs
+++ b/FlexJobApi.Application/Dictionaries/Commands/DictionaryDataCommandHandler.cs
@@ -21,7 +21,8 @@
             IRepository<DictionaryCategory> repDictionaryCategory
         ) :
         IRequestHandler<SaveDictionaryDataCommand, Guid>,
-        IRequestHandler<SetDictionaryDataIsDisabledCommand, int>
+        IRequestHandler<SetDictionaryDataIsDisabledCommand, int>,
+        IRequestHandler<SyncHumanResourcesAreaDictionaryDataCommand, int>
 
     {
         private readonly IRepository<DictionaryData> rep = rep;
@@ -45,7 +46,7 @@
                 .FirstOrDefaultAsync();
             if (category == null) throw Oops.Oh(EnumErrorCodeType.s404, "鏁版嵁瀛楀吀绫诲埆");
             request.CategoryId = category.Id;
-            if (!request.Code.StartsWith($"{request.CategoryCode}-")) throw Oops.Oh(EnumErrorCodeType.s400, "缂栧彿寮�澶撮渶瑕佸寘鍚被鍒紪鍙�-");
+            if (!request.Code.StartsWith($"{category.Code}-")) throw Oops.Oh(EnumErrorCodeType.s400, "缂栧彿寮�澶撮渶瑕佸寘鍚被鍒紪鍙�-");
             return await request.SaveData<DictionaryData, SaveDictionaryDataCommand>(
                 null,
                 it =>
@@ -78,5 +79,15 @@
         {
             return request.SetIsDisabled<DictionaryData>(cancellationToken: cancellationToken);
         }
+
+        public async Task<int> Handle(SyncHumanResourcesAreaDictionaryDataCommand request, CancellationToken cancellationToken)
+        {
+            var rep = Db.GetRepository<BaseArea, HumanResourcesDbContextLocator>();
+            var areas = await rep.AsQueryable().AsNoTracking()
+                .Take(10)
+                .ToListAsync();
+            Console.WriteLine();
+            return 1;
+        }
     }
 }

--
Gitblit v1.9.1