fix 增加旧卡号返回

This commit is contained in:
2026-03-13 16:21:41 +08:00
parent f1cb0813db
commit d05bbf081d
2 changed files with 14 additions and 0 deletions

View File

@@ -10,6 +10,11 @@ public class ElevatorAcsDeviceTaskToDeviceByDeviceResponse
public string CardNo { get; set; }
/// <summary>
/// 老卡号,换卡时才有值
/// </summary>
public string OldCardNo { get; set; }
public List<long> TaskIds { get; set; }
public List<int> FloorAcsValues { get; set; }

View File

@@ -271,11 +271,20 @@ public class AssignmentService : IAssignmentService
.Select(x => new { UserId = x.Id, UserCode = x.Code, UserName = x.Name, x.CardNo })
.FirstAsync();
var oldCardNo = await _dbContext.Queryable<GainfoCardRecordEntity>()
.Where(x => x.UserNo == userInfo.UserCode)
.Where(x => x.CardNo != userInfo.CardNo)
.Where(x => SqlFunc.Subqueryable<GainfoEntity>().Where(p => !string.IsNullOrEmpty(p.CardNo) && p.CardNo == x.CardNo).NotAny())
.OrderByDescending(x => x.Id)
.Select(x => x.CardNo)
.FirstAsync();
return new ElevatorAcsDeviceTaskToDeviceByDeviceResponse
{
DeviceUniqueNo = deviceUniqueNo,
UserId = userInfo.UserId,
UserCode = userInfo.UserCode,
OldCardNo = oldCardNo,
CardNo = userInfo.CardNo,
UserName = userInfo.UserName,
FloorAcsValues = floorAcsValues,