|
@@ -4,6 +4,7 @@ using Hotline.Share.Dtos.Snapshot;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
using Hotline.Share.Enums.Snapshot;
|
|
|
using Hotline.Share.Tools;
|
|
|
+using Hotline.Snapshot;
|
|
|
using Hotline.Snapshot.IRepository;
|
|
|
using SqlSugar;
|
|
|
using System;
|
|
@@ -60,7 +61,6 @@ public class SnapshotPointsApplication : ISnapshotPointsApplication, IScopeDepen
|
|
|
|
|
|
public async Task UpdateIsSecurityMaxAsync(UpdateIsSecurityMaxAsync dto, CancellationToken token)
|
|
|
{
|
|
|
- // TODO 紧急
|
|
|
await _citizenRepository.Updateable()
|
|
|
.SetColumns(citizen => citizen.IsSecurityMax, dto.IsSecurityMax)
|
|
|
.Where(citizen => citizen.Id == dto.UserId)
|
|
@@ -73,11 +73,15 @@ public class SnapshotPointsApplication : ISnapshotPointsApplication, IScopeDepen
|
|
|
{
|
|
|
await _safetyTypeRepository.Queryable()
|
|
|
.Where(m => m.Name == "安全卫士")
|
|
|
- .Select(m => m.Id)
|
|
|
.FirstAsync(token)
|
|
|
- .Then(async id =>
|
|
|
+ .Then(async safetyType =>
|
|
|
{
|
|
|
- //citizen.
|
|
|
+ if (dto.IsSecurityMax)
|
|
|
+ citizen.SafetyTypes.Add(safetyType);
|
|
|
+ else
|
|
|
+ citizen.SafetyTypes.Remove(safetyType);
|
|
|
+ await _citizenRepository.UpdateNav(citizen).Include(m => m.SafetyTypes)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
});
|
|
|
});
|
|
|
}
|