Commit 050a3873 authored by 18310373984@163.com's avatar 18310373984@163.com

上传标准照迁移到app项目

parent bd05fbe9
package com.hungraim.ltc.facelocation.api;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp;
import com.hungraim.ltc.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(value="CH-SERVICE",url = "${feign.client.appurl}")
public interface FaceService {
@PostMapping("/face/addFace")
Result addFace(@RequestBody ChSrvOrganEmp chSrvOrganEmp,
@RequestParam("filePath") String filePath,
@RequestParam("userId") Integer userId);
}
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.facelocation.api.FaceService;
import com.hungraim.ltc.facelocation.util.FaceAuthUtil;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts;
......@@ -73,6 +74,8 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
private final FaceAuthUtil faceAuthUtil;
private final FaceService faceService;
@Override
public Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType,Long srvOrganId) {
......@@ -198,7 +201,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
public Result saveEmpFace(SrvOrganEmpVo srvOrganEmpVo,Integer userId) {//修改护理人员需要将修改基本信息和标准照片保存分开
//上传标准照保存到人脸库
Result<String > faceReult=updatePhotoAttachs(srvOrganEmpVo,userId);
if (!StrUtil.equals(faceReult.getCode(), ResultCode.SUCCESS.getCode())) {
if (!StrUtil.equals(faceReult.getCode(), "0000")) {//是否成功
throw new RuntimeException(faceReult.getMsg());//人脸库上传失败,页面显示错误信息
}else{
String faceId = faceReult.getData();//上传标准照
......@@ -229,7 +232,13 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chFndAttach=attachFeignService.selectAttachById(chFndAttach.getAttachId()).getData();
}
log.info("filePath2:"+chFndAttach.getFilePath());
if(StringUtils.isNotEmpty(srvOrganEmpVo.getFaceId())) {
Result addResult=faceService.addFace(srvOrganEmpVo, chFndAttach.getFilePath(),userId);
log.info("调用新增人脸接口返回信息:" + addResult);
if (StrUtil.equals(addResult.getCode(),"0000")) {//返回成功
attachFeignService.updateAttachs(attachPhotoUpdateVo);
}
return addResult;
/*if(StringUtils.isNotEmpty(srvOrganEmpVo.getFaceId())) {
//先删除人员信息
Result<String> delresult = faceAuthUtil.deleteFace(srvOrganEmpVo,userId);
log.info("删除人脸信息:" + delresult);
......@@ -249,7 +258,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
attachFeignService.updateAttachs(attachPhotoUpdateVo);
}
return addResult;
}
}*/
}
}
return Result.success();
......
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