Bläddra i källkod

Merge branch 'feature/snapshot' into dev

qinchaoyue 1 månad sedan
förälder
incheckning
556080bcb3

+ 5 - 2
src/Hotline.Api/Controllers/OrderController.cs

@@ -4197,11 +4197,14 @@ public class OrderController : BaseController
         {
             await _orderSnapshotRepository.Queryable()
                 .Where(m => m.Id == order.Id)
-                .Select(m => new { m.IndustryId, m.IndustryName })
+                .Select(m => new { m.IndustryId, m.IndustryName , m.IndustryCase})
                 .FirstAsync(HttpContext.RequestAborted)
                 .Then(async snapshot =>
                 {
-                    dto.IndustryName = snapshot.IndustryName;
+                    if (snapshot.IndustryCase.IsNullOrEmpty())
+                        dto.IndustryName = snapshot.IndustryName;
+                    else
+                        dto.IndustryName = snapshot.IndustryName + " " + snapshot.IndustryCase;
                     dto.IndustryId = snapshot.IndustryId;
                 });
         }

+ 2 - 1
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -104,11 +104,12 @@ public class SnapshotController : BaseController
         order.AcceptType = industry.AcceptType;
         order.FromGender = EGender.Unknown;
         order.Title = dto.GetTitle(industry.IndustryType, industry.TitleSuffix);
-        order.Content = dto.GetContent(industry.IndustryType);
+        order.Content = dto.GetContent(industry.IndustryType, _systemDicDataCacheManager.JobType);
         order.FromPhone = _sessionContext.Phone;
         order.Contact = _sessionContext.Phone;
         order.SourceChannel = ssp.DicDataName;
         order.SourceChannelCode = ssp.DicDataValue;
+        order.FullAddress = dto.Address + dto.FullAddress;
         order.InitId();
         await _orderDomainService.AddAsync(order);
         if (dto.Files.NotNullOrEmpty())

+ 6 - 5
src/Hotline.Share/Dtos/Snapshot/OrderDto.cs

@@ -183,17 +183,18 @@ public class AddSnapshotOrderInDto : Position
     /// </summary>
     public string? Attach { get; set; }
 
-    public string GetContent(EIndustryType industryType)
+    public string GetContent(EIndustryType industryType, IReadOnlyList<SystemDicDataOutDto> dic)
     {
+        var name = (dic.FirstOrDefault(m => m.DicDataValue == JobType.ToString()) ?? new SystemDicDataOutDto()).DicDataName;
         if (industryType == EIndustryType.Declare)
         {
             return $"经营单位类别: {this.BusinessUnitType}\r\n" + // 个人
                     $"作业场所:{this.Workplace}\r\n" + // 化工、民爆物品生产经营企业
                     $"场所名称:{this.WorkplaceName}\r\n" + // 多业态混合经营场所 - 存储多种功能的劳动密集型企业
-                    $"作业区域: {this.County + this.Town}\r\n" + // 自流井区舒坪街道
-                    $"作业类型: {this.JobType}\r\n" + // 电焊
+                    $"作业区域: {this.WorkArea}\r\n" + // 自流井区舒坪街道
+                    $"作业类型: {name}\r\n" + // 电焊
                     $"作业时间:{this.StartWorkTime}~{this.EndWorkTime}\r\n" +
-                    $"作业地点: {this.Town}({this.County})({this.Street})"; // 舒平(自流井区)(油库)"
+                    $"作业地点: {Address}{FullAddress}"; // 舒平(自流井区)(油库)"
         }
         return $"{Description}";
     }
@@ -1438,7 +1439,7 @@ public class GetOrderSnapshotPublishItemsOutDto
     /// <summary>
     /// 公开状态
     /// </summary>
-    public string? PublishStatusTxt => PublishStatus?.GetDescription() ?? "";
+    public string? PublishStatusTxt =>  PublishStatus.HasValue && PublishStatus.Value == EOrderSnapshotPublishStatus.Agree ? "公开" : PublishStatus?.GetDescription() ?? "";
 
     /// <summary>
     /// 信件状态