Parcourir la source

修复根据行业配置的审核部门才能审核市民红包

qinchaoyue il y a 4 heures
Parent
commit
265bbe939e

+ 1 - 1
src/Hotline.Application/Snapshot/RedPackApplication.cs

@@ -425,7 +425,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
             .LeftJoin<RedPackRecord>((redPackAudit, order, snapshot, record) => redPackAudit.Id == record.OrderId)
             .LeftJoin<Industry>((redPackAudit, order, snapshot, record, industry) => snapshot.IndustryId == industry.Id)
             .LeftJoin<IndustryCase>((redPackAudit, order, snapshot, record, industry, industryCase) => snapshot.IndustryCase == industryCase.Id)
-            .Where((redPackAudit, order, snapshot, record, industry) => order.Status >= EOrderStatus.Filed)
+            .Where((redPackAudit, order, snapshot, record, industry) => order.Status >= EOrderStatus.Filed && industry.ApproveOrgId == _sessionContext.OrgId)
             .WhereIF(dto.No.NotNullOrEmpty(), (redPackAudit, order, snapshot, record, industry) => order.No.Contains(dto.No))
             .WhereIF(dto.Title.NotNullOrEmpty(), (redPackAudit, order, snapshot, record, industry) => order.Title.Contains(dto.Title))
             .WhereIF(dto.FromPhone.NotNullOrEmpty(), (redPackAudit, order, snapshot, record, industry) => order.FromPhone.Contains(dto.FromPhone))

+ 1 - 1
src/Hotline.Repository.SqlSugar/Extensions/SqlSugarStartupExtensions.cs

@@ -30,7 +30,7 @@ namespace Hotline.Repository.SqlSugar.Extensions
     {
         public static void AddSqlSugar(this IServiceCollection services, IConfiguration configuration, string dbName = "Hotline")
         {
-            //services.AddScoped<DatabaseEventDispatcher>();
+            services.AddScoped<DatabaseEventDispatcher>();
             //多租户 new SqlSugarScope(List<ConnectionConfig>,db=>{});
 
             var slaveConnections = new List<SlaveConnectionConfig>();

+ 1 - 1
test/Hotline.Tests/Application/OrderSnapshotApplicationTest.cs

@@ -328,7 +328,7 @@ public class OrderSnapshotApplicationTest : TestBase
 
                 try
                 {
-                    await _redPackApplication.RevocationRedPackSpecialAuditAsync(new List<string> { specialRedAudit.Id });
+                    await _redPackApplication.RevocationRedPackSpecialAuditAsync([specialRedAudit.Id]);
                 }
                 catch (UserFriendlyException e)
                 {

+ 2 - 1
test/Hotline.Tests/Mock/OrderServiceMock.cs

@@ -87,7 +87,8 @@ public class OrderServiceMock
         inDto.Street = "单元测试街道" + DateTime.Now.ToLongDateTimeString();
         inDto.IndustryId = industry.Id;
         inDto.Town = "仙市镇";
-        inDto.County = "大安区";
+        inDto.AreaCode = "510302";
+        inDto.County = "自流井区";
         inDto.Description = "单元测试添加的时间描述";
         inDto.IsSecret = false;
         inDto.PhoneNumber = _sessionContext.Phone;

+ 1 - 1
test/Hotline.Tests/TestBase.cs

@@ -176,7 +176,7 @@ public class TestBase
                 Name = name,
                 OrgId = orgId,
                 PhoneNo = phoneNo,
-                RoleIds = new[] { roleId },
+                RoleIds = [roleId],
                 UserType = userType,
                 UserName = userName
             };