人脸评分修改

This commit is contained in:
guoshengxiong 2024-05-29 19:05:03 +08:00
parent 428cecd3f6
commit 1ed9ec8f0a

View File

@ -15,6 +15,7 @@ import com.zhgd.xmgl.modules.project.entity.Project;
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoService;
import com.zhgd.xmgl.util.Base64Util;
import com.zhgd.xmgl.util.MessageUtil;
import com.zhgd.xmgl.util.PathUtil;
import io.swagger.annotations.Api;
@ -118,12 +119,15 @@ public class UfaceRecognitionController {
}
JSONObject param = new JSONObject();
String fileUrl = MapUtils.getString(map, "fileUrl");
if (StrUtil.isBlank(fileUrl)) {
throw new OpenAlertException("fileUrl不能为空");
String facePicBinaryData = MapUtils.getString(map, "facePicBinaryData");
if (StrUtil.isBlank(fileUrl) && StrUtil.isBlank(facePicBinaryData)) {
throw new OpenAlertException("fileUrl和facePicBinaryData不能同时为空");
}
//base64可能卡
//param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl)));
if (StrUtil.isNotBlank(fileUrl)) {
param.put("facePicUrl", PathUtil.reviseSlash(imageUrlPrefix + "/" + fileUrl));
} else {
param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl)));
}
boolean b = hikvisionCall.faceScore(project, param);
//boolean b = true;
if (b) {