Sfoglia il codice sorgente

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

田爽 3 mesi fa
parent
commit
6f5d75d4f2

+ 14 - 3
src/Hotline.Api/Controllers/OrderController.cs

@@ -4201,7 +4201,7 @@ public class OrderController : BaseController
                 continue;
             }
 
-            var snapshot = await _orderSnapshotRepository.UpdateSafetyAsync(orderId, dto.IsSafetyDepartment, dto.Remark);
+            var snapshot = await _orderSnapshotApplication.UpdateSafetyAsync(orderId, dto.IsSafetyDepartment, dto.Remark);
             if (snapshot is null)
             {
                 stringBuilder.Append($"随手拍: {orderId} 不存在");
@@ -4209,8 +4209,19 @@ public class OrderController : BaseController
             var workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withDefine: true, withSteps: true, withTraces: true,
     cancellationToken: HttpContext.RequestAborted);
 
-            var nextSteps = await _workflowApplication.GetNextStepsAsync(order.WorkflowId, HttpContext.RequestAborted);
-            var stepInfo = nextSteps.Steps.FirstOrDefault(m => m.BusinessType == EBusinessType.Send);
+            NextStepsWithOpinionDto<NextStepOption> nextSteps;
+            try
+            {
+                nextSteps = await _workflowApplication.GetNextStepsAsync(order.WorkflowId, HttpContext.RequestAborted);
+            }
+            catch (UserFriendlyException e)
+            {
+                if (e.Message.Contains("未找到对应节点"))
+                {
+                    continue;
+                }
+                throw;
+            }            var stepInfo = nextSteps.Steps.FirstOrDefault(m => m.BusinessType == EBusinessType.Send);
             if (stepInfo == null)
             {
                 stringBuilder.Append($"下一步节点: [派单组] 未找到");

+ 10 - 0
src/Hotline.Application/Snapshot/IOrderSnapshotApplication.cs

@@ -2,6 +2,7 @@
 using Hotline.Share.Dtos.FlowEngine;
 using Hotline.Share.Dtos.Order;
 using Hotline.Share.Dtos.Snapshot;
+using Hotline.Snapshot;
 using SqlSugar;
 using System;
 using System.Collections.Generic;
@@ -117,4 +118,13 @@ public interface IOrderSnapshotApplication
     /// <param name="dto"></param>
     /// <returns></returns>
     ISugarQueryable<LabeledOrderSnapshotItemsOutDto> GetLabeledOrderSnapshotItemsAsync(LabeledOrderSnapshotItemsInDto dto);
+
+    /// <summary>
+    /// 工单标记
+    /// </summary>
+    /// <param name="orderId"></param>
+    /// <param name="isSafetyDepartment"></param>
+    /// <param name="remark"></param>
+    /// <returns></returns>
+    Task<OrderSnapshot> UpdateSafetyAsync(string orderId, bool isSafetyDepartment, string remark);
 }

+ 12 - 1
src/Hotline.Application/Snapshot/OrderSnapshotApplication.cs

@@ -42,8 +42,9 @@ public class OrderSnapshotApplication : IOrderSnapshotApplication, IScopeDepende
     private readonly IIndustryRepository _industryRepository;
     private readonly IFileRepository _fileRepository;
     private readonly ISnapshotLabelLogRepository _snapshotLabelLogRepository;
+    private readonly IRedPackAuditRepository _redPackAuditRepository;
 
-    public OrderSnapshotApplication(IOrderSnapshotRepository orderSnapshotRepository, IOrderRepository orderRepository, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, ISessionContext sessionContext, ISystemSettingCacheManager systemSettingCacheManager, IIndustryCaseRepository industryCaseRepository, ISystemDicDataCacheManager systemDicDataCacheManager, IIndustryRepository industryRepository, IFileRepository fileRepository, ISnapshotLabelLogRepository snapshotLabelLogRepository)
+    public OrderSnapshotApplication(IOrderSnapshotRepository orderSnapshotRepository, IOrderRepository orderRepository, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, ISessionContext sessionContext, ISystemSettingCacheManager systemSettingCacheManager, IIndustryCaseRepository industryCaseRepository, ISystemDicDataCacheManager systemDicDataCacheManager, IIndustryRepository industryRepository, IFileRepository fileRepository, ISnapshotLabelLogRepository snapshotLabelLogRepository, IRedPackAuditRepository redPackAuditRepository)
     {
         _orderSnapshotRepository = orderSnapshotRepository;
         _orderRepository = orderRepository;
@@ -55,6 +56,7 @@ public class OrderSnapshotApplication : IOrderSnapshotApplication, IScopeDepende
         _industryRepository = industryRepository;
         _fileRepository = fileRepository;
         _snapshotLabelLogRepository = snapshotLabelLogRepository;
+        _redPackAuditRepository = redPackAuditRepository;
     }
 
     /// <summary>
@@ -466,4 +468,13 @@ public class OrderSnapshotApplication : IOrderSnapshotApplication, IScopeDepende
         return query;
     }
 
+    public async Task<OrderSnapshot> UpdateSafetyAsync(string orderId, bool isSafetyDepartment, string remark)
+    {
+        // 红包已经审核通过的工单不允许修改
+        if (await _redPackAuditRepository.Queryable().AnyAsync(m => m.OrderId == orderId && m.Status == ERedPackAuditStatus.Agree))
+        {
+            return await _orderSnapshotRepository.GetAsync(orderId);
+        }
+        return await _orderSnapshotRepository.UpdateSafetyAsync(orderId, isSafetyDepartment, remark);
+    }
 }

+ 2 - 1
src/Hotline.Share/Dtos/Snapshot/RedPackDto.cs

@@ -3,6 +3,7 @@ using Hotline.Share.Enums.Snapshot;
 using Hotline.Share.Requests;
 using Hotline.Share.Tools;
 using System.ComponentModel.DataAnnotations;
+using XF.Utility.EnumExtensions;
 
 namespace Hotline.Share.Dtos.Snapshot;
 public class RedPackOutDto 
@@ -171,7 +172,7 @@ public class SnapshotRedPackRecordSupplementItemsOutDto
     /// <summary>
     /// 信件状态
     /// </summary>
-    public string StatusTxt { get; set; }
+    public string StatusTxt => Status.GetDescription();
 
     /// <summary>
     /// 来源