feat 梯控相关

This commit is contained in:
2026-03-13 15:42:36 +08:00
parent 9d0600ebb8
commit f1cb0813db
34 changed files with 1112 additions and 320 deletions

View File

@@ -29,13 +29,23 @@ public class GainfoCardService : IGainfoCardService
public async Task ChangeCardAsync(GainfoChangeCardRequest request)
{
if (await _gainfoStore.Queryable().Where(x => x.CardNo == request.CardNo).AnyAsync())
{
true.ThrowIfTrue("卡号已分配");
}
var gainfo = await _gainfoStore.Queryable().Where(x => x.No == request.UserNo).FirstAsync();
gainfo.ThrowIfNull("档案不存在");
gainfo.CardNo = request.CardNo;
await _gainfoStore.UpdateAsync(gainfo);
await _dbContext.InsertAsync(request.Adapt<GainfoCardRecordEntity>());
var cardRecord = request.Adapt<GainfoCardRecordEntity>();
cardRecord.TenantId = gainfo.Factory;
await _dbContext.InsertAsync(cardRecord);
await _gainfoPermissionService.ResetPermissionsAsync(gainfo.No, DeviceTaskEnumType.Update, null, null, "更新卡号下发");
}
public async Task<List<ChangeCardResponse>> GetChangeRecordsAsync(string userNo)