Parcourir la source

部门查询筛选掉空部门

wanxl il y a 1 an
Parent
commit
1c5c1c555d

+ 3 - 1
src/main/java/com/template/controller/AdminController.java

@@ -101,7 +101,9 @@ public class AdminController implements AdminAPI {
                 List<String> checkOrg= Arrays.asList(record.getCheckOrg().split(","));
                 for(int i=0;i<checkOrg.size();i++){
                     Organization organization=organizationService.getById(checkOrg.get(i));
-                    checkOrgList.add(organization);
+                    if (organization!=null){
+                        checkOrgList.add(organization);
+                    }
                 }
                 adminVo.setCheckOrg(checkOrgList);
             }

+ 4 - 1
src/main/java/com/template/controller/LoginController.java

@@ -84,7 +84,10 @@ public class LoginController implements LoginControllerAPI {
         if (StringUtils.hasText(result.getCheckOrg())){
             String[] aa=result.getCheckOrg().replaceAll(" ","").split(",");
             for (int i = 0; i < aa.length; i++) {
-                organizationList.add(organizationService.getById(aa[i]));
+                Organization organization=organizationService.getById(aa[i]);
+                if(organization!=null){
+                    organizationList.add(organization);
+                }
             }
         }
         try {