Переглянути джерело

sz 用户未上传照片 验证

xiao547607 5 роки тому
батько
коміт
9fd18316dd

+ 13 - 1
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonDeviceRelationController.java

@@ -105,6 +105,8 @@ public class PersonDeviceRelationController {
                             throw new Exception("添加失败:" + lapiMsgResult.getMsg());
                     }
                     }
+                }else{
+                    throw new Exception("添加失败:人员没有上传照片" );
                 }
                 msgResult.setResult(true);
                 msgResult.setData(personDeviceRelation);
@@ -277,6 +279,16 @@ 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++;
                             continue;
                         }
 
@@ -295,7 +307,7 @@ public class PersonDeviceRelationController {
                                 HSSFCell cell2 = row.createCell(1);
                                 cell2.setCellValue(resultMap.get("deviceAliasName").toString());
                                 HSSFCell cell3 = row.createCell(2);
-                                cell3.setCellValue("添加失败:" + lapiMsgResult.getMsg());
+                                cell3.setCellValue("添加失败:");
                                 HSSFCell cell4 = row.createCell(3);
                                 cell4.setCellValue(lapiMsgResult.getMsg());