人脸评分修改

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