Explorar el Código

返回随手拍工单标签, 保存随手拍工单标签

qinchaoyue hace 4 meses
padre
commit
14df2d4cdc

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

@@ -567,6 +567,10 @@ public class OrderController : BaseController
         }
 
         string visitId = await _orderVisitRepository.AddAsync(orderVisit);
+        if (_systemSettingCacheManager.Snapshot && dto.SnapshotLabelId != null && dto.SnapshotLabelName != null)
+        {
+            await _orderSnapshotRepository.UpdateLabelAsync(order.Id, dto.SnapshotLabelId, dto.SnapshotLabelName);
+        }
 
         //新增回访信息
         var visitedDetail = new List<OrderVisitDetail>();
@@ -732,6 +736,7 @@ public class OrderController : BaseController
         if (_systemSettingCacheManager.Snapshot)
         {
             res.IsSnapshot = await _orderSnapshotRepository.AnyAsync(m => m.Id == order.Id);
+            res.SnapshotLabel = _sysDicDataCacheManager.SnapshotOrderLabel;
         }
         return res;
     }

+ 16 - 0
src/Hotline.Share/Dtos/Order/PublishedDto.cs

@@ -1,4 +1,5 @@
 using Hotline.Share.Dtos.File;
+using Hotline.Share.Dtos.Settings;
 using Hotline.Share.Enums.Order;
 using Hotline.Share.Requests;
 using XF.Utility.EnumExtensions;
@@ -178,6 +179,11 @@ public class PublishOrderPageBaseDto
     /// 是否随手拍工单
     /// </summary>
     public bool IsSnapshot { get; set; }
+
+    /// <summary>
+    /// 随手拍工单标签
+    /// </summary>
+    public IReadOnlyCollection<SystemDicDataOutDto> SnapshotLabel { get; set; }
 }
 
 public class PublishPublishOrderDto
@@ -364,6 +370,16 @@ public class PublishOrderDto
     /// 是否解决
     /// </summary>
     public bool? Resolve { get; set; }
+
+    /// <summary>
+    /// 随手拍工单标签
+    /// </summary>
+    public string? SnapshotLabelId { get; set; }
+
+    /// <summary>
+    /// 随手拍工单标签
+    /// </summary>
+    public string? SnapshotLabelName { get; set; }
 }
 
 

+ 5 - 0
src/Hotline/Caching/Interfaces/ISysDicDataCacheManager.cs

@@ -65,5 +65,10 @@ namespace Hotline.Caching.Interfaces
         /// 红包补充发放类型
         /// </summary>
         IReadOnlyCollection<SystemDicDataOutDto> SnapshotReplenishType { get; }
+
+        /// <summary>
+        /// 随手拍工单标签
+        /// </summary>
+        IReadOnlyCollection<SystemDicDataOutDto> SnapshotOrderLabel { get; }
     }
 }

+ 5 - 0
src/Hotline/Caching/Services/SysDicDataCacheManager.cs

@@ -127,6 +127,11 @@ namespace Hotline.Caching.Services
         /// </summary>
         public IReadOnlyCollection<SystemDicDataOutDto> SnapshotReplenishType => GetOrAdd(SysDicTypeConsts.SnapshotReplenishType);
 
+        /// <summary>
+        /// 随手拍工单标签
+        /// </summary>
+        public IReadOnlyCollection<SystemDicDataOutDto> SnapshotOrderLabel => GetOrAdd(SysDicTypeConsts.SnapshotOrderLabel)
+
         public void RemoveSysDicDataCache(string code)
         {
             _cacheSysDicData.Remove(code);

+ 23 - 0
src/Hotline/SeedData/SystemDicDataSeedData.cs

@@ -17,6 +17,25 @@ public class SystemDicDataSeedData : ISeedData<SystemDicData>
 
     public IEnumerable<SystemDicData> GetData(string dicTypeCode)
     {
+        if (dicTypeCode == SysDicTypeConsts.SnapshotOrderLabel)
+        {
+            return [
+                new() {  Id = "", DicDataValue = "bss", DicDataName = "不属实", Sort = 1},
+                new() {  Id = "", DicDataValue = "waqyh", DicDataName = "无安全隐患", Sort = 2},
+                new() {  Id = "", DicDataValue = "hg", DicDataName = "合规", Sort = 3},
+                new() {  Id = "", DicDataValue = "bhg", DicDataName = "不合规", Sort = 4},
+                new() {  Id = "", DicDataValue = "jdhfj", DicDataName = "阶段回复件", Sort = 5},
+                new() {  Id = "", DicDataValue = "lszg", DicDataName = "临时整改件", Sort = 6},
+                new() {  Id = "", DicDataValue = "ss", DicDataName = "属实", Sort = 7},
+                new() {  Id = "", DicDataValue = "yzg", DicDataName = "已整改", Sort = 8},
+                new() {  Id = "", DicDataValue = "wzg", DicDataName = "未整改", Sort = 9},
+                new() {  Id = "", DicDataValue = "cxj", DicDataName = "撤销件", Sort = 10},
+                new() {  Id = "", DicDataValue = "cfj", DicDataName = "重复件", Sort = 11},
+                new() {  Id = "", DicDataValue = "qt", DicDataName = "其它", Sort = 12},
+                new() {  Id = "", DicDataValue = "bmd", DicDataName = "白名单", Sort = 13},
+                new() {  Id = "", DicDataValue = "zdyh", DicDataName = "重大隐患", Sort = 14},
+                ];
+        }
         if (dicTypeCode == SysDicTypeConsts.SnapshotReplenishType)
         {
             return [
@@ -166,6 +185,10 @@ public class SystemDicDataSeedData : ISeedData<SystemDicData>
     public SystemDicType GetType(string dicTypeCode)
     {
         var dicType = new string[2];
+        if (dicTypeCode == SysDicTypeConsts.SnapshotOrderLabel)
+        {
+            dicType = ["08dd1fdb-4c32-4464-83a4-b61afa1e624a", "随手拍工单标签"];
+        }
         if (dicTypeCode == SysDicTypeConsts.Workplace)
         {
             dicType = ["08dc39be-d203-460c-868e-46b7132e35b5", "作业场所"];

+ 5 - 0
src/Hotline/Settings/SysDicTypeConsts.cs

@@ -306,4 +306,9 @@ public class SysDicTypeConsts
     /// 红包补充发放类型
     /// </summary>
     public const string SnapshotReplenishType = "SnapshotReplenishType";
+
+    /// <summary>
+    /// 随手拍工单标签
+    /// </summary>
+    public static string SnapshotOrderLabel = "SnapshotOrderLabel";
 }

+ 8 - 0
src/Hotline/Snapshot/Interfaces/IOrderSnapshotRepository.cs

@@ -16,4 +16,12 @@ public interface IOrderSnapshotRepository : IRepository<OrderSnapshot>
     /// <returns></returns>
     Task<OrderSnapshot> GetByNetworkENumberAsync(string appealNumber);
 
+    /// <summary>
+    /// 更新工单标签
+    /// </summary>
+    /// <param name="id"></param>
+    /// <param name="snapshotLabelId"></param>
+    /// <param name="snapshotLabelName"></param>
+    /// <returns></returns>
+    Task UpdateLabelAsync(string id, string snapshotLabelId, string snapshotLabelName);
 }