From 285c63ef650c835e896de0a93fe18c581f4b59ae Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Wed, 24 Jul 2024 09:53:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E8=84=B8=E6=AF=94=E5=AF=B9=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UfaceRecognitionController.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java b/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java index 6406f3145..25a420e72 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/controller/UfaceRecognitionController.java @@ -9,6 +9,7 @@ import com.arcsoft.face.toolkit.ImageInfo; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.execption.OpenAlertException; +import com.zhgd.jeecg.common.util.pass.HttpUtils; import com.zhgd.jeecg.upload.operation.FileOperation; import com.zhgd.xmgl.call.HikvisionCall; import com.zhgd.xmgl.modules.project.entity.Project; @@ -139,8 +140,17 @@ public class UfaceRecognitionController { } param.put("facePicUrl", PathUtil.reviseSlash(url + "/" + fileUrl)); } - boolean b = hikvisionCall.faceScore(project, param); - //boolean b = true; + boolean b = false; + try { + b = hikvisionCall.faceScore(project, param); + } catch (Exception e) { + log.error("" + e); + if (HttpUtils.isTimeOut(e)) { + throw new OpenAlertException("平台连接isc网络异常"); + } else { + throw new OpenAlertException("人脸评分异常"); + } + } if (b) { data.put("checkType", "1"); data.put("message", "成功");