Commit 1f3fd75a authored by 18310373984@163.com's avatar 18310373984@163.com

护理人员照片信息

parent 3b7a76b9
...@@ -288,6 +288,7 @@ public class SrvOrganController { ...@@ -288,6 +288,7 @@ public class SrvOrganController {
srvOrganEmpVoR.setEmpName(srvOrganEmpVo.getEmpName()); srvOrganEmpVoR.setEmpName(srvOrganEmpVo.getEmpName());
srvOrganEmpVoR.setGender(srvOrganEmpVo.getGender()); srvOrganEmpVoR.setGender(srvOrganEmpVo.getGender());
srvOrganEmpVoR.setCertifNum(srvOrganEmpVo.getCertifNum()); srvOrganEmpVoR.setCertifNum(srvOrganEmpVo.getCertifNum());
srvOrganEmpVoR.setFaceId(srvOrganEmpVo.getFaceId());
srvOrganEmpVoR.setPhotoList(srvOrganEmpVo.getPhotoList()); srvOrganEmpVoR.setPhotoList(srvOrganEmpVo.getPhotoList());
Integer userId = TokenParsingUtil.TokenParsing(token, "userId"); Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
return srvOrganEmpService.saveEmpFace(srvOrganEmpVoR,userId); return srvOrganEmpService.saveEmpFace(srvOrganEmpVoR,userId);
......
...@@ -40,6 +40,8 @@ public class FaceAuthUtil { ...@@ -40,6 +40,8 @@ public class FaceAuthUtil {
public Result<String> addFace(ChSrvOrganEmp faceAuthParam,String filePath,Integer userId){ public Result<String> addFace(ChSrvOrganEmp faceAuthParam,String filePath,Integer userId){
try { try {
log.info("filePath4:"+filePath);
//设置文件路径 //设置文件路径
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey // 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey
Credential cred = new Credential(faceAuthProperties.getSecretId(), faceAuthProperties.getSecretKey()); Credential cred = new Credential(faceAuthProperties.getSecretId(), faceAuthProperties.getSecretKey());
...@@ -106,9 +108,12 @@ public class FaceAuthUtil { ...@@ -106,9 +108,12 @@ public class FaceAuthUtil {
//同时将FileUtils类uploadFile方法注释打开 //同时将FileUtils类uploadFile方法注释打开
// File filePath=new File("D:/"); // File filePath=new File("D:/");
// File file = new File(filePath,imagePath); // File file = new File(filePath,imagePath);
log.info("imagePath:"+imagePath);
File file = new File(imagePath); File file = new File(imagePath);
log.info("imageToBase64:"+file.getPath());
try (FileInputStream fileInputStream = new FileInputStream(file)) { try (FileInputStream fileInputStream = new FileInputStream(file)) {
byte[] bytes = new byte[(int) file.length()]; byte[] bytes = new byte[(int) file.length()];
log.info("bytes:"+bytes.length);
fileInputStream.read(bytes); fileInputStream.read(bytes);
base64String = Base64.getEncoder().encodeToString(bytes); base64String = Base64.getEncoder().encodeToString(bytes);
} catch (IOException e) { } catch (IOException e) {
......
...@@ -238,6 +238,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -238,6 +238,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
return addResult; return addResult;
}else{ }else{
log.info("filePath3:"+chFndAttach.getFilePath());
//在新增人员信息 //在新增人员信息
Result addResult=faceAuthUtil.addFace(srvOrganEmpVo, chFndAttach.getFilePath(),userId); Result addResult=faceAuthUtil.addFace(srvOrganEmpVo, chFndAttach.getFilePath(),userId);
log.info("新增人脸信息:"+addResult); log.info("新增人脸信息:"+addResult);
......
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