浏览代码

返回线索分类字段

qinchaoyue 1 月之前
父节点
当前提交
5823b7d045

+ 5 - 2
src/Hotline.Application/Snapshot/RedPackApplication.cs

@@ -362,6 +362,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
             .LeftJoin<OrderSnapshot>((redPackAudit, order, snapshot) => redPackAudit.OrderId == snapshot.Id)
             .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)
             .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))
@@ -380,7 +381,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
             .WhereIF(dto.IsDanger.HasValue, (redPackAudit, order, snapshot, record, industry) => snapshot.IsDanger == dto.IsDanger)
             .WhereIF(status.HasValue, (redPackAudit, order, snapshot, record, industry) => redPackAudit.Status == status)
             .OrderByDescending((redPackAudit, order, snapshot, record, industry) => redPackAudit.CreationTime)
-            .Select((redPackAudit, order, snapshot, record, industry) => new SnapshotOrderAuditItemsOutDto
+            .Select((redPackAudit, order, snapshot, record, industry, industryCase) => new SnapshotOrderAuditItemsOutDto
             {
                 Id = redPackAudit.Id,
                 RedPackAuditId = redPackAudit.Id,
@@ -388,6 +389,8 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
                 No = order.No,
                 Title = order.Title,
                 IndustryName = industry.Name,
+                IndustryCaseId = snapshot.IndustryCase,
+                IndustryCase = industryCase.Name,
                 IndustryId = industry.Id,
                 SourceChannel = order.SourceChannel,
                 SourceChannelCode = order.SourceChannelCode,
@@ -419,7 +422,7 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
                 OpenBank = record.OpenBank,
                 AwardName = record.Name,
                 AuditStatus = redPackAudit.Status,
-            });
+            }, true);
         return query;
     }
 

+ 5 - 0
test/Hotline.Tests/Application/OrderSnapshotApplicationTest.cs

@@ -147,6 +147,11 @@ public class OrderSnapshotApplicationTest : TestBase
             {
                 data.IsDangerDepartment = true;
                 data.IndustryCase = industryCase.Id;
+                data.IsRectifyDepartment = true;
+            })
+            .StepHandle(async order => {
+                var snapshot = await _orderSnapshotRepository.GetAsync(order.Id);
+                snapshot.IndustryCase.ShouldBe(industryCase.Id);
             })
             .发布工单(SetZuoXi, inputLable.Select(m => new Kv(m.DicDataName, m.DicDataName)).ToList())
             .StepHandle(async order =>