海康的人脸评分改成url方式

This commit is contained in:
guoshengxiong 2024-05-20 14:19:43 +08:00
parent 34725b6e20
commit 8e1325c9e5
3 changed files with 8 additions and 3 deletions

View File

@ -15,7 +15,6 @@ 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;
@ -61,7 +60,8 @@ public class UfaceRecognitionController {
private HikvisionCall hikvisionCall;
@Autowired
private ProjectMapper projectMapper;
@Value("${upload.image.url.prefix:}")
private String imageUrlPrefix;
@ApiOperation(value = "检测人脸照片是否有人脸", notes = "列表查询人脸设备信息", httpMethod = "POST")
@ApiImplicitParams({
@ -121,7 +121,9 @@ public class UfaceRecognitionController {
if (StrUtil.isBlank(fileUrl)) {
throw new OpenAlertException("fileUrl不能为空");
}
param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl)));
//base64可能卡
//param.put("facePicBinaryData", Base64Util.convertFileToBase64(PathUtil.reviseSlash(basePath + "/" + fileUrl)));
param.put("facePicUrl", PathUtil.reviseSlash(imageUrlPrefix + "/" + fileUrl));
boolean b = hikvisionCall.faceScore(project, param);
if (b) {
data.put("checkType", "1");

View File

@ -80,6 +80,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http.authorizeRequests()
//请求路径允许访问
.antMatchers("/xmgl/xzEmergencyType/**").permitAll()
.antMatchers("/xmgl/xzEmergencyRecord/**").permitAll()
.antMatchers("/xmgl/xzDeductScoreRecord/**").permitAll()
.antMatchers("/xmgl/workerInfo/selectWorkerInfoByIdCard").permitAll()

View File

@ -96,3 +96,5 @@ xiwon.appSecret=b6162078-6f1c-4f2c-8cd5-0873f45199b2
magic-api.web=/xmgl/magic/web
#配置文件存储位置。当以classpath开头时为只读模式
magic-api.resource.location=C:/jxj/prod/backEnd/itbgpImage/data/magic-api
#上传的图片的url前缀
upload.image.url.prefix=http://192.168.34.221:11111/image/