|
|
@@ -53,6 +53,7 @@ public class IdentityComparisonRecordServiceImpl extends ServiceImpl<IdentityCom
|
|
|
try {
|
|
|
|
|
|
String s = taskID();
|
|
|
+ log.info("以图搜图任务id:{}",taskId);
|
|
|
target(s, url);
|
|
|
control(s);
|
|
|
// 获取进度
|
|
|
@@ -75,6 +76,15 @@ public class IdentityComparisonRecordServiceImpl extends ServiceImpl<IdentityCom
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(jsonArray.get(i).toString());
|
|
|
JSONObject targetInfo = jsonObject.getJSONObject("TargetInfo");
|
|
|
+// 获取通道id
|
|
|
+ ArrayList<String> libIdList = new ArrayList<>();
|
|
|
+ JSONArray belongLibIDList=targetInfo.getJSONArray("BelongLibIDList");
|
|
|
+ if (ObjectUtils.isNotEmpty(belongLibIDList)) {
|
|
|
+ for (int j = 0; j < belongLibIDList.size(); j++) {
|
|
|
+ String libID = belongLibIDList.get(j).toString();
|
|
|
+ libIdList.add(libID);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 获取姓名
|
|
|
String personName = targetInfo.getString("PersonName");
|
|
|
log.info("找到对比图片的姓名【{}】",personName);
|
|
|
@@ -88,7 +98,7 @@ public class IdentityComparisonRecordServiceImpl extends ServiceImpl<IdentityCom
|
|
|
if (data.getIdCard().equals(number)||data.getStudentNumber().equals(number)) {
|
|
|
comparisonRecord.setResults(0);
|
|
|
this.save(comparisonRecord);
|
|
|
- return BaseResponse.ok(StatusEnum.FACE_SUCCESS);
|
|
|
+ return BaseResponse.ok(StatusEnum.FACE_SUCCESS,libIdList);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -96,12 +106,23 @@ public class IdentityComparisonRecordServiceImpl extends ServiceImpl<IdentityCom
|
|
|
log.info("人脸对比成功");
|
|
|
comparisonRecord.setResults(0);
|
|
|
this.save(comparisonRecord);
|
|
|
- return BaseResponse.ok(StatusEnum.FACE_SUCCESS);
|
|
|
+ return BaseResponse.ok(StatusEnum.FACE_SUCCESS,libIdList);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.error("人脸对比报错");
|
|
|
+ Integer id = Integer.valueOf(taskId);
|
|
|
+ if (id>10) {
|
|
|
+ id=id-10;
|
|
|
+ }else {
|
|
|
+ id=0;
|
|
|
+ }
|
|
|
+ for (int i = id; i < id+10; i++) {
|
|
|
+ delect(id+"");
|
|
|
+ }
|
|
|
+ e.printStackTrace();
|
|
|
+ return BaseResponse.error(StatusEnum.FACE_FAIL,"系统繁忙请稍后重试");
|
|
|
} finally {
|
|
|
delect(taskId);
|
|
|
}
|
|
|
@@ -109,11 +130,26 @@ public class IdentityComparisonRecordServiceImpl extends ServiceImpl<IdentityCom
|
|
|
|
|
|
comparisonRecord.setResults(1);
|
|
|
log.info("人脸对比失败");
|
|
|
- this.save(comparisonRecord);
|
|
|
+ try {
|
|
|
+ this.save(comparisonRecord);
|
|
|
+ }catch (Exception e){
|
|
|
+ return BaseResponse.error(StatusEnum.FACE_FAIL,"参数不全");
|
|
|
+ }
|
|
|
+
|
|
|
return BaseResponse.error(StatusEnum.FACE_FAIL);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 根据身份证号查询人脸库信息
|
|
|
+ * @param idCard
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public BaseResponse personnel(String idCard) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 创建图搜任务
|
|
|
*
|
|
|
* @return
|