fix 更新照片时间间隔增加

This commit is contained in:
2025-05-13 15:13:20 +08:00
parent 9a61dd1318
commit 4d6167daa7

View File

@@ -227,12 +227,16 @@ public class GainfoFaceService : IGainfoFaceService
var gainfo = await _gainfoStore.Queryable().Where(x => x.No == request.UserNo || x.Code == request.UserNo).SingleAsync();
gainfo.ThrowIfNull("人员档案信息不存在");
var face = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync();
if (face != null)
{
((DateTime.Now - face.ModifiedTime).Seconds > 300).ThrowIfFalse("请勿频繁更新照片,请稍后重试");
}
var userId = _currentUser.GetIntSubjectId();
await DetectFaceImageQualityAsync(request.Face, gainfo.Factory);
var face = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync();
var taskType = face == null ? DeviceTaskEnumType.Add : DeviceTaskEnumType.Update;
if (face == null)
{