fix 判断设备号是否存在进行下发和移除处理
This commit is contained in:
@@ -77,6 +77,8 @@ public class SapBusinessTripService : ISapBusinessTripService
|
||||
|
||||
var deviceCodes = await _dbContext.Queryable<DeviceGroupRelationshipEntity>().Where(x => x.GroupCode == tripGroup.Code).Select(x => x.DeviceCode).ToListAsync();
|
||||
|
||||
if (deviceCodes.Any())
|
||||
{
|
||||
var userCodes = tripInfos.Select(x => x.Code).Distinct().ToList();
|
||||
var gainfos = await _dbContext.Queryable<GainfoEntity>().Where(x => userCodes.Contains(x.Code)).Select(x => new { x.No, x.Code }).ToListAsync();
|
||||
|
||||
@@ -99,6 +101,8 @@ public class SapBusinessTripService : ISapBusinessTripService
|
||||
await _dbContext.UpdateAsync(todayTripInfo);
|
||||
|
||||
//下发
|
||||
await _gainfoPermissionService.ResetPermissionsAsync(gainfo.No, DeviceTaskEnumType.Add, null);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (yesterdayTripInfo != null)
|
||||
@@ -154,6 +158,7 @@ public class SapBusinessTripService : ISapBusinessTripService
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError(e, "处理{factory}出差数据失败:{message}", factory, e.Message);
|
||||
|
||||
Reference in New Issue
Block a user