Browse Source

fix: 功能资源导入接口自测完成

huangjy 4 years ago
parent
commit
4f084fc16b

+ 21 - 7
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/service/impl/AppFunInfoService.java

@@ -324,18 +324,32 @@ public class AppFunInfoService extends BaseService<AppFunInfo, String> implement
             }else {
                 //循环每行的每一列
                 AppFunInfo entity = new AppFunInfo();
-                for (int i = 0; i < 8; i++) {
+                boolean isAllEmpty = true;
+                for (int i = 0; i < 8; i++){
                     Cell cell = r.getCell(i);
                     if (cell != null){
                         r.getCell(i).setCellType(Cell.CELL_TYPE_STRING);
                     }
-                    checkCellData(cell, i, r.getRowNum());
-                    checkCellDataValid(cell, i, r.getRowNum(), entity,codeList);
+                    if (cell != null && StringUtils.isNotBlank(cell.getStringCellValue())){
+                        isAllEmpty = false;
+                        break;
+                    }
+                }
+                if (!isAllEmpty){
+                    for (int i = 0; i < 8; i++) {
+                        Cell cell = r.getCell(i);
+                        if (cell != null){
+                            r.getCell(i).setCellType(Cell.CELL_TYPE_STRING);
+                        }
+                        checkCellData(cell, i, r.getRowNum());
+                        checkCellDataValid(cell, i, r.getRowNum(), entity,codeList);
+                    }
+                    entity.setCreateTime(new Date());
+                    entity.setModifiedTime(new Date());
+                    entity.setCreator(ContextUtils.getUserInfo() == null ? "" : ContextUtils.getUserInfo().getId());
+                    result.add(entity);
                 }
-                entity.setCreateTime(new Date());
-                entity.setModifiedTime(new Date());
-                entity.setCreator(ContextUtils.getUserInfo() == null ? "" : ContextUtils.getUserInfo().getId());
-                result.add(entity);
+
             }
 
         }