Selaa lähdekoodia

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test
合并冲突

guqiang 1 viikko sitten
vanhempi
commit
f9a1dfa79e

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

@@ -190,7 +190,7 @@ public class SnapshotController : BaseController
     /// <returns></returns>
     [HttpGet("bulletions")]
     [AllowAnonymous]
-    public async Task<IReadOnlyList<BulletinOutDto>> QueryBulletinsAsync([FromQuery] BulletinInDto dto)
+    public async Task<IReadOnlyList<BulletinListOutDto>> QueryBulletinsAsync([FromQuery] BulletinInDto dto)
         => await _snapshotApplication.GetBulletinsAsync(dto, HttpContext.RequestAborted);
 
     /// <summary>

+ 1 - 1
src/Hotline.Application/Snapshot/Contracts/ISnapshotApplication.cs

@@ -29,7 +29,7 @@ public interface ISnapshotApplication
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
-    Task<IReadOnlyList<BulletinOutDto>> GetBulletinsAsync(BulletinInDto dto, CancellationToken cancellationToken);
+    Task<IReadOnlyList<BulletinListOutDto>> GetBulletinsAsync(BulletinInDto dto, CancellationToken cancellationToken);
     
     /// <summary>
     /// 获取工单列表

+ 2 - 2
src/Hotline.Application/Snapshot/SnapshotApplicationBase.cs

@@ -291,7 +291,7 @@ public abstract class SnapshotApplicationBase
     /// 获取随手拍小程序公告
     /// </summary>
     /// <returns></returns>
-    public async Task<IReadOnlyList<BulletinOutDto>> GetBulletinsAsync(BulletinInDto dto, CancellationToken cancellationToken)
+    public async Task<IReadOnlyList<BulletinListOutDto>> GetBulletinsAsync(BulletinInDto dto, CancellationToken cancellationToken)
     {
         var items = await _bulletinRepository.Queryable()
             .Where(m => m.BulletinState == EBulletinState.ReviewPass && m.IsArrive == true)
@@ -299,7 +299,7 @@ public abstract class SnapshotApplicationBase
             .Where((bulletin, industry) => industry.Id == dto.IndustryId)
             .ToFixedListAsync(dto, cancellationToken);
 
-        return items.Adapt<IReadOnlyList<BulletinOutDto>>();
+        return items.Adapt<IReadOnlyList<BulletinListOutDto>>();
     }
 
     /// <summary>

+ 14 - 8
src/Hotline.Application/Snapshot/SnapshotOrderApplication.cs

@@ -693,18 +693,24 @@ public class SnapshotOrderApplication : IOrderSnapshotApplication, IScopeDepende
     {
         if (_systemSettingCacheManager.Snapshot == false) return;
 
-        var sspSourceChannel = new List<string>() { "ZGSSP", "SJP12345"};
+        var sspSourceChannel = new List<string>() { "ZGSSP", "SJP12345" };
         if (sspSourceChannel.Any(m => m == dto.SourceChannelCode) == false)
         {
-            await _orderSnapshotRepository.Removeable()
+            await _orderSnapshotRepository.Updateable()
+                .SetColumns(m => m.IsDeleted, true)
                 .Where(m => m.Id == dto.Id)
                 .ExecuteCommandAsync(token);
-            return;
         }
-        await _orderSnapshotRepository.Updateable()
-            .SetColumns(m => m.IndustryId, dto.IndustryId)
-            .SetColumns(m => m.IndustryName, dto.IndustryName)
-            .Where(m => m.Id == dto.Id)
-            .ExecuteCommandAsync(token);
+        else
+        {
+            var snapshot = await _orderSnapshotRepository.Queryable(includeDeleted: true)
+                .Where(m => m.Id == dto.Id)
+                .FirstAsync(token);
+            snapshot.IsDeleted = false;
+            snapshot.IndustryId = dto.IndustryId;
+            snapshot.IndustryName = dto.IndustryName;
+
+            await _orderSnapshotRepository.UpdateAsync(snapshot, token);
+        }
     }
 }