fix external支持外包人员
This commit is contained in:
@@ -89,6 +89,9 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.External)
|
||||
.Where(x => x.IdNo == request.UserNo)
|
||||
.FirstAsync();
|
||||
gainfo ??= await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
|
||||
.Where(x => x.IdNo == request.UserNo)
|
||||
.FirstAsync();
|
||||
gainfo.ThrowIfNull("人员信息不存在");
|
||||
|
||||
var face = await _faceDbContext.Queryable<GainfoFaceEntity>().Where(x => x.UserCode == gainfo.Code).SingleAsync();
|
||||
@@ -111,6 +114,8 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
|
||||
await _faceDbContext.UpdateAsync(face);
|
||||
}
|
||||
|
||||
await _devicePermissionService.GenerateDeviceTasksAsync(gainfo.No, DeviceTaskEnumType.Add);
|
||||
}
|
||||
|
||||
public async Task<string> GetExternalFaceAsync(string idno)
|
||||
@@ -125,8 +130,11 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
throw new UserFriendlyException("凭证有误,无法获取人脸数");
|
||||
}
|
||||
|
||||
var code = await _dbContext.Queryable<GainfoEntity>().Where(x => x.IdNo == idno).Select(x => x.Code).FirstAsync();
|
||||
code ??= idno;
|
||||
|
||||
var face = await _faceDbContext.Queryable<GainfoFaceEntity>()
|
||||
.Where(x => x.UserCode == idno)
|
||||
.Where(x => x.UserCode == code)
|
||||
.SingleAsync();
|
||||
|
||||
face.ThrowIfNull("人脸照片尚未录入");
|
||||
@@ -208,7 +216,7 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
|
||||
var prefix = gainfo.Factory == "501" ? "jschuneng" : "jingke";
|
||||
var url = $"https://pay.aizhuhotel.com/{prefix}/api/face";
|
||||
|
||||
|
||||
|
||||
//生成任务
|
||||
await _devicePermissionService.GenerateDeviceTasksAsync(gainfo.No, taskType);
|
||||
|
||||
Reference in New Issue
Block a user