|
|
@@ -39,8 +39,9 @@ class ImportStudentFaceNodeTest {
|
|
|
|
|
|
@Autowired
|
|
|
private FaceImportMapper faceImportMapper;
|
|
|
+
|
|
|
@Test
|
|
|
- void test(){
|
|
|
+ void test() {
|
|
|
String sql = "SELECT t1.* FROM xjr_user t1\n" +
|
|
|
"WHERE t1.delete_mark = 0 \n" +
|
|
|
"AND t1.id IN (" +
|
|
|
@@ -57,7 +58,7 @@ class ImportStudentFaceNodeTest {
|
|
|
sql = "SELECT * FROM stundent_face_process WHERE user_id = " + userId + " AND exam_status = 1 AND STATUS = 1 ORDER BY create_date DESC,modify_date DESC LIMIT 1";
|
|
|
Map<String, Object> process = SqlRunnerAdapter.db().selectOne(sql);
|
|
|
|
|
|
- if(process == null || process.isEmpty()){
|
|
|
+ if (process == null || process.isEmpty()) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -65,7 +66,7 @@ class ImportStudentFaceNodeTest {
|
|
|
String fileUrl = faceImportMapper.GetStudentHikvisionImgById(id);
|
|
|
// 数据处理
|
|
|
StundentFaceProcess dataObj = stundentFaceProcessService.getById(process.get("id").toString());
|
|
|
- if(dataObj == null){
|
|
|
+ if (dataObj == null) {
|
|
|
continue;
|
|
|
}
|
|
|
String apiUrl = "/api/resource/v1/person/condition/personInfo";
|
|
|
@@ -73,27 +74,27 @@ class ImportStudentFaceNodeTest {
|
|
|
paramsJson.addProperty("paramName", "personId");
|
|
|
JsonArray array = new JsonArray();
|
|
|
String hikvisionId = hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId());
|
|
|
- if(hikvisionId == null){
|
|
|
+ if (hikvisionId == null) {
|
|
|
hikvisionId = dataObj.getUserId().toString();
|
|
|
}
|
|
|
array.add(hikvisionId);
|
|
|
paramsJson.add("paramValue", array);
|
|
|
String personInfoRes = apiUtil.doPost(apiUrl, paramsJson.toString(), null);
|
|
|
- if(personInfoRes == null){
|
|
|
+ if (personInfoRes == null) {
|
|
|
continue;
|
|
|
}
|
|
|
JsonObject personInfoData = parser.parse(personInfoRes).getAsJsonObject();
|
|
|
String faceId = null;
|
|
|
- if("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())){
|
|
|
+ if ("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())) {
|
|
|
JsonObject dataJson = personInfoData.get("data").getAsJsonObject();
|
|
|
- if(dataJson.get("total").getAsInt() > 0){
|
|
|
+ if (dataJson.get("total").getAsInt() > 0) {
|
|
|
JsonArray personPhoto = dataJson.get("list").getAsJsonArray().get(0)
|
|
|
.getAsJsonObject().get("personPhoto").getAsJsonArray();
|
|
|
- if(personPhoto.size() == 0){
|
|
|
+ if (personPhoto.size() == 0) {
|
|
|
dataObj.setStatus(1);
|
|
|
dataObj.setExamStatus(1);
|
|
|
String studentHikvisionId = hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId());
|
|
|
- if(StrUtil.isEmpty(studentHikvisionId)){
|
|
|
+ if (StrUtil.isEmpty(studentHikvisionId)) {
|
|
|
studentHikvisionId = dataObj.getUserId().toString();
|
|
|
}
|
|
|
String result = FaceImportUtil.ImportStudentFace(studentHikvisionId, fileUrl);
|
|
|
@@ -108,7 +109,20 @@ class ImportStudentFaceNodeTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- void test2(){
|
|
|
+ void getPersonInfo() {
|
|
|
+ ApiUtil apiUtil = new ApiUtil();
|
|
|
+ String apiUrl = "/api/resource/v1/person/condition/personInfo";
|
|
|
+ JsonObject paramsJson = new JsonObject();
|
|
|
+ paramsJson.addProperty("paramName", "personId");
|
|
|
+ JsonArray array = new JsonArray();
|
|
|
+ array.add("1827234730185633794");
|
|
|
+ paramsJson.add("paramValue", array);
|
|
|
+ String personInfoRes = apiUtil.doPost(apiUrl, paramsJson.toString(), null);
|
|
|
+ System.out.println(personInfoRes);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void test2() {
|
|
|
|
|
|
String sql = "SELECT * FROM stundent_face_process WHERE id in (1802917291234996224, 1798295439057399810,1798295434271698945)";
|
|
|
List<Map<String, Object>> list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
@@ -121,7 +135,7 @@ class ImportStudentFaceNodeTest {
|
|
|
// 数据处理
|
|
|
StundentFaceProcess dataObj = stundentFaceProcessService.getById(process.get("id").toString());
|
|
|
|
|
|
- if(dataObj == null){
|
|
|
+ if (dataObj == null) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -130,7 +144,7 @@ class ImportStudentFaceNodeTest {
|
|
|
paramsJson.addProperty("paramName", "personId");
|
|
|
JsonArray array = new JsonArray();
|
|
|
String hikvisionId = hikvisionDataMapper.getStudentHikvisionId(dataObj.getUserId());
|
|
|
- if(hikvisionId == null){
|
|
|
+ if (hikvisionId == null) {
|
|
|
continue;
|
|
|
}
|
|
|
array.add(hikvisionId);
|
|
|
@@ -138,12 +152,12 @@ class ImportStudentFaceNodeTest {
|
|
|
String personInfoRes = apiUtil.doPost(apiUrl, paramsJson.toString(), null);
|
|
|
JsonObject personInfoData = parser.parse(personInfoRes).getAsJsonObject();
|
|
|
String faceId = null;
|
|
|
- if("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())){
|
|
|
+ if ("0".equals(personInfoData.get("code").getAsString()) && "success".equals(personInfoData.get("msg").getAsString())) {
|
|
|
JsonObject dataJson = personInfoData.get("data").getAsJsonObject();
|
|
|
- if(dataJson.get("total").getAsInt() > 0){
|
|
|
+ if (dataJson.get("total").getAsInt() > 0) {
|
|
|
JsonArray personPhoto = dataJson.get("list").getAsJsonArray().get(0)
|
|
|
.getAsJsonObject().get("personPhoto").getAsJsonArray();
|
|
|
- if(personPhoto.size() == 0){
|
|
|
+ if (personPhoto.size() == 0) {
|
|
|
ids.add(id);
|
|
|
}
|
|
|
}
|