|
@@ -95,19 +95,19 @@ public class PersonDeviceRelationController {
|
|
|
//往设备库传输人脸信息
|
|
|
PersonInfo personInfo = personInfoService.get(personDeviceRelation.getPersonId());
|
|
|
//如果人员照片不为空
|
|
|
- if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())){
|
|
|
- List<LapiResult> lapiResults = lapiService.addPersonForDeviceIds(personDeviceRelation.getPersonId(),personDeviceRelation.getDeviceId());
|
|
|
- for (int i = 0; i < lapiResults.size(); i++) {
|
|
|
- LapiResult lapiMsgResult = lapiResults.get(i);
|
|
|
- if (lapiMsgResult.isSuccess()) {
|
|
|
- msgResult.setResult(true);
|
|
|
- }else{
|
|
|
- throw new Exception("添加失败:" + lapiMsgResult.getMsg());
|
|
|
+ //if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())){
|
|
|
+ List<LapiResult> lapiResults = lapiService.addPersonForDeviceIds(personDeviceRelation.getPersonId(),personDeviceRelation.getDeviceId());
|
|
|
+ for (int i = 0; i < lapiResults.size(); i++) {
|
|
|
+ LapiResult lapiMsgResult = lapiResults.get(i);
|
|
|
+ if (lapiMsgResult.isSuccess()) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ }else{
|
|
|
+ throw new Exception("添加失败:" + lapiMsgResult.getMsg());
|
|
|
}
|
|
|
- }
|
|
|
- }else{
|
|
|
- throw new Exception("添加失败:人员没有上传照片" );
|
|
|
}
|
|
|
+ //}else{
|
|
|
+ //throw new Exception("添加失败:人员没有上传照片" );
|
|
|
+ //}
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(personDeviceRelation);
|
|
|
} else {
|
|
@@ -167,39 +167,39 @@ public class PersonDeviceRelationController {
|
|
|
//往设备库传输人脸信息
|
|
|
PersonInfo personInfo = personInfoService.get(personId);
|
|
|
//如果人员照片不为空
|
|
|
- if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())) {
|
|
|
- List<LapiResult> lapiResults = lapiService.addPerson(personId);
|
|
|
- for (int i = 0; i < lapiResults.size(); i++) {
|
|
|
- LapiResult lapiResult = lapiResults.get(i);
|
|
|
- if (lapiResult.isSuccess()) {
|
|
|
- msgResult.setResult(true);
|
|
|
- } else {
|
|
|
- String personName = "";
|
|
|
- if (personInfo != null) {
|
|
|
- personName = personInfo.getName();
|
|
|
- }
|
|
|
- Map resultMap = (Map) lapiResult.getData();
|
|
|
- HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
|
|
|
- HSSFCell cell1 = row.createCell(0);
|
|
|
- cell1.setCellValue(personName);
|
|
|
- HSSFCell cell2 = row.createCell(1);
|
|
|
- cell2.setCellValue(resultMap.get("deviceAliasName").toString());
|
|
|
- HSSFCell cell3 = row.createCell(2);
|
|
|
- cell3.setCellValue("添加失败:");
|
|
|
- HSSFCell cell4 = row.createCell(3);
|
|
|
- cell4.setCellValue(lapiResult.getMsg());
|
|
|
-
|
|
|
- //删除绑定关系
|
|
|
- PersonDeviceRelation personDeviceRelation = personDeviceRelationService.findByDeviceIdAndPersonId(resultMap.get("deviceId").toString(), personId);
|
|
|
- personDeviceRelation.setDelFlag(true);
|
|
|
- personDeviceRelation.setUpdateBy(subject);
|
|
|
- personDeviceRelation.setUpdateTime(new Date());
|
|
|
-
|
|
|
- personDeviceRelationService.update(personDeviceRelation);
|
|
|
- addCount++;
|
|
|
+ //if(StringUtils.isNotEmpty(personInfo.getFaceImageUrl())) {
|
|
|
+ List<LapiResult> lapiResults = lapiService.addPerson(personId);
|
|
|
+ for (int i = 0; i < lapiResults.size(); i++) {
|
|
|
+ LapiResult lapiResult = lapiResults.get(i);
|
|
|
+ if (lapiResult.isSuccess()) {
|
|
|
+ msgResult.setResult(true);
|
|
|
+ } else {
|
|
|
+ String personName = "";
|
|
|
+ if (personInfo != null) {
|
|
|
+ personName = personInfo.getName();
|
|
|
}
|
|
|
+ Map resultMap = (Map) lapiResult.getData();
|
|
|
+ HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
|
|
|
+ HSSFCell cell1 = row.createCell(0);
|
|
|
+ cell1.setCellValue(personName);
|
|
|
+ HSSFCell cell2 = row.createCell(1);
|
|
|
+ cell2.setCellValue(resultMap.get("deviceAliasName").toString());
|
|
|
+ HSSFCell cell3 = row.createCell(2);
|
|
|
+ cell3.setCellValue("添加失败:");
|
|
|
+ HSSFCell cell4 = row.createCell(3);
|
|
|
+ cell4.setCellValue(lapiResult.getMsg());
|
|
|
+
|
|
|
+ //删除绑定关系
|
|
|
+ PersonDeviceRelation personDeviceRelation = personDeviceRelationService.findByDeviceIdAndPersonId(resultMap.get("deviceId").toString(), personId);
|
|
|
+ personDeviceRelation.setDelFlag(true);
|
|
|
+ personDeviceRelation.setUpdateBy(subject);
|
|
|
+ personDeviceRelation.setUpdateTime(new Date());
|
|
|
+
|
|
|
+ personDeviceRelationService.update(personDeviceRelation);
|
|
|
+ addCount++;
|
|
|
}
|
|
|
}
|
|
|
+ //}
|
|
|
//
|
|
|
|
|
|
|
|
@@ -276,26 +276,26 @@ public class PersonDeviceRelationController {
|
|
|
//往设备库传输人脸信息
|
|
|
//批量操作
|
|
|
|
|
|
- PersonInfo personInfo = personInfoService.get(personId);
|
|
|
- //如果人员照片为空
|
|
|
- if(StringUtils.isEmpty(personInfo.getFaceImageUrl())){
|
|
|
- HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
|
|
|
- HSSFCell cell1 = row.createCell(0);
|
|
|
- cell1.setCellValue(personInfo.getName());
|
|
|
- HSSFCell cell2 = row.createCell(1);
|
|
|
- cell2.setCellValue("");
|
|
|
- HSSFCell cell3 = row.createCell(2);
|
|
|
- cell3.setCellValue("添加失败:");
|
|
|
- HSSFCell cell4 = row.createCell(3);
|
|
|
- cell4.setCellValue("人员没有上传照片");
|
|
|
- addCount++;
|
|
|
- //删除绑定关系
|
|
|
- item.setDelFlag(true);
|
|
|
- item.setUpdateBy(subject);
|
|
|
- item.setUpdateTime(new Date());
|
|
|
- personDeviceRelationService.update(item);
|
|
|
- continue;
|
|
|
- }
|
|
|
+// PersonInfo personInfo = personInfoService.get(personId);
|
|
|
+// //如果人员照片为空
|
|
|
+// if(StringUtils.isEmpty(personInfo.getFaceImageUrl())){
|
|
|
+// HSSFRow row = sheet.createRow(sheet.getLastRowNum() + 1);
|
|
|
+// HSSFCell cell1 = row.createCell(0);
|
|
|
+// cell1.setCellValue(personInfo.getName());
|
|
|
+// HSSFCell cell2 = row.createCell(1);
|
|
|
+// cell2.setCellValue("");
|
|
|
+// HSSFCell cell3 = row.createCell(2);
|
|
|
+// cell3.setCellValue("添加失败:");
|
|
|
+// HSSFCell cell4 = row.createCell(3);
|
|
|
+// cell4.setCellValue("人员没有上传照片");
|
|
|
+// addCount++;
|
|
|
+// //删除绑定关系
|
|
|
+// item.setDelFlag(true);
|
|
|
+// item.setUpdateBy(subject);
|
|
|
+// item.setUpdateTime(new Date());
|
|
|
+// personDeviceRelationService.update(item);
|
|
|
+// continue;
|
|
|
+// }
|
|
|
|
|
|
List<LapiResult> lapiResults = lapiService.addPersonForDeviceIds(personId,deviceId);
|
|
|
|