feat 照片上传sap
This commit is contained in:
@@ -4,6 +4,8 @@ using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Dlhis.Scheduled.Api;
|
||||
using Dlhis.Scheduled.Api.Request;
|
||||
using Kurisu.AspNetCore.Authentication.Abstractions;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.Extensions;
|
||||
@@ -22,6 +24,7 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
private readonly ILogger<GainfoFaceService> _logger;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ICurrentUser _currentUser;
|
||||
private readonly IHangfireApi _hangfireApi;
|
||||
private readonly IDevicePermissionService _devicePermissionService;
|
||||
private readonly IDataProtectionProvider _dataProtectionProvider;
|
||||
|
||||
@@ -30,6 +33,7 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
ILogger<GainfoFaceService> logger,
|
||||
IConfiguration configuration,
|
||||
ICurrentUser currentUser,
|
||||
IHangfireApi hangfireApi,
|
||||
IDevicePermissionService devicePermissionService,
|
||||
IDataProtectionProvider dataProtectionProvider)
|
||||
{
|
||||
@@ -39,6 +43,7 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
_currentUser = currentUser;
|
||||
_hangfireApi = hangfireApi;
|
||||
_devicePermissionService = devicePermissionService;
|
||||
_dataProtectionProvider = dataProtectionProvider;
|
||||
}
|
||||
@@ -216,9 +221,21 @@ public class GainfoFaceService : IGainfoFaceService
|
||||
await _faceDbContext.UpdateAsync(face);
|
||||
}
|
||||
|
||||
var prefix = gainfo.Factory == "501" ? "jschuneng" : "jingke";
|
||||
var url = $"https://pay.aizhuhotel.com/{prefix}/api/face";
|
||||
try
|
||||
{
|
||||
await _hangfireApi.SyncFaceToSapAsync(new FaceUploadToSapRequest
|
||||
{
|
||||
UserCode = face.UserCode,
|
||||
Base64 = face.Face
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError(e, "上传face数据到sap失败:{message}", e.Message);
|
||||
}
|
||||
|
||||
// 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