Commit e4494cd1 by xmh

完成人员更新功能

1 parent f198fc81
package com.viontech.match.entity.vo;
import com.viontech.keliu.model.FaceFeature;
import com.viontech.keliu.model.Person;
import com.viontech.match.enumeration.CommandEnum;
import lombok.Getter;
......@@ -42,6 +43,8 @@ public class RequestVo {
private String personPoolId;
private List<String> unionPersonPoolId;
private FaceFeature newFaceFeature;
public void setPoolId(String poolId) {
this.poolId = poolId.toLowerCase();
}
......
......@@ -9,7 +9,6 @@ import com.viontech.match.config.Constant;
import com.viontech.match.entity.vo.RequestVo;
import com.viontech.match.entity.vo.ResponseVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.FileUtils;
import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
......@@ -113,8 +112,21 @@ public class PersonService {
* 修改人员特征
*/
public ResponseVo updatePerson(RequestVo requestVo) {
return null;
String rid = requestVo.getRid();
Person person = requestVo.getPerson();
String personId = person.getPersonId();
String poolId = requestVo.getPoolId();
log.info("人员修改操作开始,poolId:[{}],personId:[{}]", poolId, personId);
// 先删除
try {
BulkByScrollResponse bulkByScrollResponse = deletePerson(poolId, personId);
BulkResponse bulkItemResponses = addPerson(poolId, Collections.singletonList(person));
} catch (IOException e) {
log.error("人员修改操作异常", e);
return ResponseVo.error(rid, "update failed");
}
log.info("人员修改操作完成,poolId:[{}],personId:[{}]", poolId, personId);
return ResponseVo.success(rid);
}
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!