Commit 3d8380ee authored by 18310373984@163.com's avatar 18310373984@163.com

上传标准照迁移到app项目

parent 050a3873
package com.hungraim.ltc.facelocation.api; package com.hungraim.ltc.facelocation.api;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp; import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpVo;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -10,8 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -10,8 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(value="CH-SERVICE",url = "${feign.client.appurl}") @FeignClient(value="CH-SERVICE",url = "${feign.client.appurl}")
public interface FaceService { public interface FaceService {
@PostMapping("/face/addFace") @PostMapping("/face/addFace")
Result addFace(@RequestBody ChSrvOrganEmp chSrvOrganEmp, Result addFace(@RequestBody SrvOrganEmpVo srvOrganEmpVo,
@RequestParam("filePath") String filePath,
@RequestParam("userId") Integer userId); @RequestParam("userId") Integer userId);
} }
...@@ -232,7 +232,9 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -232,7 +232,9 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chFndAttach=attachFeignService.selectAttachById(chFndAttach.getAttachId()).getData(); chFndAttach=attachFeignService.selectAttachById(chFndAttach.getAttachId()).getData();
} }
log.info("filePath2:"+chFndAttach.getFilePath()); log.info("filePath2:"+chFndAttach.getFilePath());
Result addResult=faceService.addFace(srvOrganEmpVo, chFndAttach.getFilePath(),userId); String filebase64=faceAuthUtil.imageToBase64(chFndAttach.getFilePath());
srvOrganEmpVo.setFilepathBase64(filebase64);//照片转换为base64格式
Result addResult=faceService.addFace(srvOrganEmpVo, userId);
log.info("调用新增人脸接口返回信息:" + addResult); log.info("调用新增人脸接口返回信息:" + addResult);
if (StrUtil.equals(addResult.getCode(),"0000")) {//返回成功 if (StrUtil.equals(addResult.getCode(),"0000")) {//返回成功
attachFeignService.updateAttachs(attachPhotoUpdateVo); attachFeignService.updateAttachs(attachPhotoUpdateVo);
......
...@@ -21,4 +21,6 @@ public class SrvOrganEmpVo extends ChSrvOrganEmp { ...@@ -21,4 +21,6 @@ public class SrvOrganEmpVo extends ChSrvOrganEmp {
//标准照片 //标准照片
private List<ChFndAttach> photoList; private List<ChFndAttach> photoList;
private String filepathBase64;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment