username@email.com
2024-08-27 f2f61fdb9a81fba256b1bd05330fbbac2633149a
cylsg/cylsg.Application/Orders/OrderWorkerAppService.cs
@@ -3,9 +3,11 @@
using cylsg.Core;
using cylsg.Model.OrderModel;
using cylsg.Model.UserModel;
using EzTencentCloud;
using Furion.LinqBuilder;
using MapsterMapper;
using Org.BouncyCastle.Asn1.X509;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -26,11 +28,13 @@
        private readonly ISystemService _systemService;
        private ISqlSugarClient _sqlSugarClient;
        private IMapper _mapper;
        public OrderWorkerAppService(ISystemService systemService, ISqlSugarClient sqlSugarClient, IMapper mapper)
        private readonly ITencentCloudService _tencentCloudService;
        public OrderWorkerAppService(ISystemService systemService, ISqlSugarClient sqlSugarClient, IMapper mapper,ITencentCloudService tencentCloudService)
        {
            _systemService = systemService;
            _sqlSugarClient = sqlSugarClient;
            _mapper = mapper;
            _tencentCloudService = tencentCloudService;
        }
@@ -176,6 +180,7 @@
            return result;
        }
@@ -420,6 +425,30 @@
            {
                throw Oops.Oh("该打卡记录已经审批,不能打卡!");
            }
            //人脸识别
            if (App.Configuration["VerifyFace:Enable"].ObjToBool())
            {
                if (string.IsNullOrWhiteSpace(dakaDto.FaceImg))
                {
                    throw Oops.Oh("未识别人脸");
                }
                var UserWorkRes = await new BaseRepository<UserWorker>().GetFirstAsync(x => x.UserId == userid);
                if (UserWorkRes == null)
                {
                    throw Oops.Oh("员工未注册成工人");
                }
                var faseres = _tencentCloudService.VerifyFace(dakaDto.FaceImg, UserWorkRes.IAIPersonId);
                if (faseres.IsMatch != true)
                {
                    throw Oops.Oh("不是本人");
                }
            }
            if(orderBiddingDetail == null)
            {
                orderBiddingDetail = new OrderBiddingDetail();