|
@@ -1,5 +1,6 @@
|
|
|
package com.jpsoft.smart.modules.lapi.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.gson.JsonObject;
|
|
@@ -787,6 +788,47 @@ public class LapiServiceImpl implements ILapiService {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean isPersonImageExist(PersonInfo personInfo, DeviceInfo deviceInfo, String faceDbId) {
|
|
|
+ HashMap map = new HashMap();
|
|
|
+ map.put("Num", 1);
|
|
|
+ map.put("Limit", 3);
|
|
|
+ map.put("Offset", 0);
|
|
|
+ List list = new ArrayList();
|
|
|
+ HashMap map1 = new HashMap();
|
|
|
+ map1.put("QryType", 27);
|
|
|
+ map1.put("QryCondition", 0);
|
|
|
+ map1.put("QryData", personInfo.getId().toString());
|
|
|
+ list.add(map1);
|
|
|
+ map.put("QueryInfos", list);
|
|
|
+ try {
|
|
|
+
|
|
|
+ JSONObject jsonObject = lapiRequest.send(deviceInfo.getDeviceNo(),LApiConstant.ADDPERSON + faceDbId + "/People/Info",HttpMethod.POST, map);
|
|
|
+
|
|
|
+ JSONObject dataJson = jsonObject.getJSONObject("Response");
|
|
|
+ JSONObject response = LApiUtil.getResponse(dataJson);
|
|
|
+ Integer num = response.getInteger("Total");
|
|
|
+ if (num > 0) {
|
|
|
+ JSONObject personList = response.getJSONObject("PersonList");
|
|
|
+
|
|
|
+ JSONArray personInfoList = personList.getJSONArray("PersonInfoList");
|
|
|
+ Map map2 = (Map) personInfoList.get(0);
|
|
|
+
|
|
|
+ Integer imageNum = (Integer) map2.get("ImageNum");
|
|
|
+ if (imageNum>0){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, Object> getDeviceRule(String deviceInfoId) throws Exception {
|
|
|
|