Bladeren bron

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test

田爽 3 maanden geleden
bovenliggende
commit
781fa10592

+ 13 - 3
src/Hotline.Api/Controllers/Snapshot/RedPackController.cs

@@ -125,6 +125,18 @@ public class RedPackController : BaseController
     public async Task UpdateRedPackRecordAsync([FromBody] UpdateRedPackRecordInDto dto)
         => await _redPackApplication.UpdateRedPackRecordAsync(dto);
 
+    /// <summary>
+    /// 补充发放集合基础信息
+    /// </summary>
+    [HttpGet("record/supplement/basedata")]
+    public async Task<Dictionary<string, object>> GetRedPackRecordSupplementBaseDataAsync()
+    {
+        return new Dictionary<string, object>()
+        {
+            { "industry", await _industryRepository.GetDataBaseAsync() }
+        };
+    }
+
     /// <summary>
     /// 补充发放集合
     /// </summary>
@@ -156,9 +168,7 @@ public class RedPackController : BaseController
     [HttpGet("audit/basedata")]
     public async Task<Dictionary<string, object>> GetAuditBaseDataAsync()
     {
-        var industry = await _industryRepository.Queryable()
-            .Select(m => new { m.Id, m.Name })
-            .ToListAsync();
+        var industry = await _industryRepository.GetDataBaseAsync();
 
         var configAmount = await _industryRepository.Queryable()
             .Select(m => m.CitizenReadPackAmount)

+ 9 - 0
src/Hotline.Repository.SqlSugar/Snapshot/IndustryRepository.cs

@@ -17,6 +17,15 @@ public class IndustryRepository : BaseRepository<Industry>, IIndustryRepository,
     {
     }
 
+    public async Task<IList<dynamic>> GetDataBaseAsync()
+    {
+        var result = await Queryable()
+            .Select(m => new { m.Id, m.Name })
+            .ToListAsync();
+
+        return result.Cast<dynamic>().ToList();
+    }
+
     public async Task<double> GetIntervalTimeAsync(string industryId, double defaultValue,  CancellationToken cancellationToken)
     {
         var time = await Queryable().Where(m => m.Id == industryId).Select(m => m.IntervalTime).FirstAsync(cancellationToken);

+ 1 - 0
src/Hotline/Snapshot/Interfaces/IIndustryRepository.cs

@@ -9,5 +9,6 @@ using XF.Domain.Repository;
 namespace Hotline.Snapshot.Interfaces;
 public interface IIndustryRepository : IRepository<Industry>
 {
+    Task<IList<dynamic>> GetDataBaseAsync();
     Task<double> GetIntervalTimeAsync(string industryId, double defaultValue, CancellationToken cancellationToken);
 }