fix 人脸检测问题,数据查询
This commit is contained in:
@@ -81,7 +81,8 @@ public class GainfoService : IGainfoService
|
||||
ISugarQueryable<GainfoPageResponse> queryable = request.IsSearchAll
|
||||
? _gainfoStore.Queryable(request.Status)
|
||||
.WhereIF(request.DepartmentSelections?.Any() == true, where)
|
||||
.WhereIF(request.DepartmentSelections?.Any() == false, gainfo => factories.Contains(gainfo.Factory))
|
||||
.WhereIF(request.DepartmentSelections?.Any() == false, gainfo => factories.Contains(gainfo.Factory) ||
|
||||
SqlFunc.Subqueryable<BusinessTripEntity>().Where(p => p.Code == gainfo.Code && factories.Contains(p.Destination) && SqlFunc.DateIsSame(p.BeginDate, today)).Any())
|
||||
.LeftJoin<DepartmentEntity>((gainfo, department) => gainfo.DepartmentNo == department.No)
|
||||
.LeftJoin<BasicTypeEntity>((gainfo, department, type) => type.Code == SqlFunc.ToString(gainfo.CardType) && type.Type == "timeperiod")
|
||||
.WhereIF(request.Search.IsPresent(), gainfo =>
|
||||
|
||||
@@ -6,6 +6,7 @@ using ViewFaceCore;
|
||||
using ViewFaceCore.Configs;
|
||||
using Dlhis.InfoCheck.Request;
|
||||
using Dlhis.InfoCheck.Response;
|
||||
using Kurisu.AspNetCore.UnifyResultAndValidation.Aop;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.InfoCheck.Controllers;
|
||||
@@ -19,6 +20,7 @@ public class FaceController : ControllerBase
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[DisableApiLog]
|
||||
[HttpPost("detection")]
|
||||
public IEnumerable<string> FacialDetection(FaceDetectRequest request)
|
||||
{
|
||||
@@ -32,7 +34,13 @@ public class FaceController : ControllerBase
|
||||
MarkType = MarkType.Light
|
||||
});
|
||||
|
||||
var info = faceDetector.Detect(bitmap).First();
|
||||
var faces = faceDetector.Detect(bitmap);
|
||||
if (faces.Length == 0)
|
||||
{
|
||||
return new List<string> { "未检测到人脸" };
|
||||
}
|
||||
|
||||
var info = faces.First();
|
||||
var markPoints = faceMark.Mark(bitmap, info);
|
||||
|
||||
using var faceQuality = new FaceQuality();
|
||||
|
||||
Reference in New Issue
Block a user