|
@@ -169,34 +169,36 @@ public class LapiServiceImpl implements ILapiService {
|
|
JSONObject dataJson = jsonObject.getJSONObject("Response");
|
|
JSONObject dataJson = jsonObject.getJSONObject("Response");
|
|
JSONObject response = LApiUtil.getResponse(dataJson);
|
|
JSONObject response = LApiUtil.getResponse(dataJson);
|
|
List listData = response.getJSONArray("LibList");
|
|
List listData = response.getJSONArray("LibList");
|
|
- if (listData.size() <= 0) {
|
|
|
|
- throw new Exception(deviceInfo.getAliasName() + "设备没有配置人脸库");
|
|
|
|
- }
|
|
|
|
- for (int i = 0; i < listData.size(); i++) {
|
|
|
|
- JSONObject jsonObject1 = (JSONObject) JSONArray.toJSON(listData.get(i));
|
|
|
|
- String name = jsonObject1.getString("Name");
|
|
|
|
- if (StringUtils.isNotBlank(name) && companyName.equals(name)) {
|
|
|
|
- faceDbId = jsonObject1.getString("ID");
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- //人员所属的公司库不存在,保存到默认库
|
|
|
|
- if (StringUtils.isBlank(faceDbId)) {
|
|
|
|
|
|
+ if (listData.size() > 0) {
|
|
for (int i = 0; i < listData.size(); i++) {
|
|
for (int i = 0; i < listData.size(); i++) {
|
|
JSONObject jsonObject1 = (JSONObject) JSONArray.toJSON(listData.get(i));
|
|
JSONObject jsonObject1 = (JSONObject) JSONArray.toJSON(listData.get(i));
|
|
String name = jsonObject1.getString("Name");
|
|
String name = jsonObject1.getString("Name");
|
|
- if ("默认员工库".equals(name)) {
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(name) && companyName.equals(name)) {
|
|
faceDbId = jsonObject1.getString("ID");
|
|
faceDbId = jsonObject1.getString("ID");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (StringUtils.isBlank(faceDbId)){
|
|
|
|
- faceDbId = getDefaultLib(deviceInfo.getId());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ //人员所属的公司库不存在,保存到默认库
|
|
|
|
+ if (StringUtils.isBlank(faceDbId)) {
|
|
|
|
+ for (int i = 0; i < listData.size(); i++) {
|
|
|
|
+ JSONObject jsonObject1 = (JSONObject) JSONArray.toJSON(listData.get(i));
|
|
|
|
+ String name = jsonObject1.getString("Name");
|
|
|
|
+ if ("默认员工库".equals(name)) {
|
|
|
|
+ faceDbId = jsonObject1.getString("ID");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(faceDbId)) {
|
|
|
|
+ faceDbId = getDefaultLib(deviceInfo.getId());
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ faceDbId = getDefaultLib(deviceInfo.getId());
|
|
}
|
|
}
|
|
|
|
+
|
|
return faceDbId;
|
|
return faceDbId;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -429,7 +431,6 @@ public class LapiServiceImpl implements ILapiService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
HashMap map = new HashMap();
|
|
HashMap map = new HashMap();
|
|
map.put("BelongIndex", "");
|
|
map.put("BelongIndex", "");
|
|
map.put("LastChange", new Date().getTime());
|
|
map.put("LastChange", new Date().getTime());
|