fix 修复已知问题
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
using System.Text;
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using HttpUtil;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
@@ -19,12 +16,10 @@ namespace Dlhis.Basic.Organization.Controllers;
|
||||
public class GainfoFacesController : ControllerBase
|
||||
{
|
||||
private readonly IGainfoFaceService _gainfoFaceService;
|
||||
private readonly IHttpClientFactory _httpClientFactory;
|
||||
|
||||
public GainfoFacesController(IGainfoFaceService gainfoFaceService, IHttpClientFactory httpClientFactory)
|
||||
public GainfoFacesController(IGainfoFaceService gainfoFaceService)
|
||||
{
|
||||
_gainfoFaceService = gainfoFaceService;
|
||||
_httpClientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -48,31 +43,4 @@ public class GainfoFacesController : ControllerBase
|
||||
{
|
||||
return await _gainfoFaceService.GetUploadPageRecordsAsync(request);
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost("test")]
|
||||
public async Task<HikResponse<SimilarityData>> TestAsync(GainfoFaceValidateRequest request)
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient("hik-openapi");
|
||||
var body = request.ToJson(JsonExtensions.DefaultSetting);
|
||||
var url = "/artemis/api/frs/v1/application/oneToOne";
|
||||
var key = "27390082";
|
||||
var secret = "MLl7Dv7p5Pgc9XYI3r4O";
|
||||
|
||||
HttpUtillib.SetPlatformInfo(key, secret, "10.32.0.10");
|
||||
var r = HttpUtillib.HttpPost(url, body, 15);
|
||||
return Encoding.UTF8.GetString(r).ToObject<HikResponse<SimilarityData>>();
|
||||
|
||||
// var headers = InitRequest(url, body, key, secret);
|
||||
// client.DefaultRequestHeaders.Accept.Clear();
|
||||
// client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(headers["Accept"]));
|
||||
// var content = new StringContent(body, Encoding.UTF8, "application/json");
|
||||
// foreach (var item in headers.Where(x => x.Key != "Accept").Where(x => x.Key != "Content-Type"))
|
||||
// {
|
||||
// content.Headers.Add(item.Key, item.Value);
|
||||
// }
|
||||
//
|
||||
// var r = await client.PostAsync(url, content);
|
||||
// return await r.Content.ReadAsStringAsync();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@ namespace Dlhis.Basic.Organization.Request
|
||||
{
|
||||
public class FaceValidationRequest : PageDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 显示成功与否.null全部
|
||||
/// </summary>
|
||||
public bool? IsSuccess { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,6 @@ public class GainfoResignRequest : IValidatableObject
|
||||
|
||||
public DateTime Date { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 是否外包
|
||||
/// </summary>
|
||||
public bool IsOutsource { get; set; } = true;
|
||||
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (Date < DateTime.Now.Date)
|
||||
|
||||
@@ -150,8 +150,7 @@ public class GainfoOutsourceService : IGainfoOutsourceService
|
||||
{
|
||||
Id = outsource.Id,
|
||||
Reason = $"{setting.NoRecordAutoResignOutsourceDays}天无通行记录",
|
||||
Date = DateTime.Now,
|
||||
IsOutsource = true
|
||||
Date = DateTime.Now
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -267,15 +267,13 @@ public class GainfoService : IGainfoService
|
||||
|
||||
if (gainfo.Type == GainfoUserTypeEnumType.External)
|
||||
{
|
||||
//获取人员所有的访客申请
|
||||
var visitorAppointmentDetails = await _dbContext.Queryable<VisitorAppointmentDetailEntity>()
|
||||
.Where(x => x.UserNo == gainfo.No)
|
||||
.Where(x => x.DoorStatus == VisitorAppointmentDetailStatusEnumType.Wait
|
||||
|| x.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Wait
|
||||
|| x.DoorStatus == VisitorAppointmentDetailStatusEnumType.Arrived
|
||||
|| x.WorkplaceStatus == VisitorAppointmentDetailStatusEnumType.Arrived)
|
||||
.Where(x => (x.IsEnterDoorArea && x.DoorStatus != VisitorAppointmentDetailStatusEnumType.Leave)
|
||||
|| (x.IsEnterWorkplace && x.WorkplaceStatus != VisitorAppointmentDetailStatusEnumType.Leave))
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
foreach (var visitorAppointment in visitorAppointmentDetails)
|
||||
{
|
||||
await _appointmentService.FocusLeaveAsync(visitorAppointment.Id, request.Reason);
|
||||
|
||||
Reference in New Issue
Block a user