Explorar el Código

解决因为文件加密等级报错的相关BUG。

wukai hace 1 año
padre
commit
aea6cb25f7

+ 3 - 0
doc-biz/src/main/java/com/doc/biz/service/impl/DocDirLevelServiceImpl.java

@@ -47,6 +47,9 @@ public class DocDirLevelServiceImpl implements IDocDirLevelService {
     }
 
     private void process(DocDirLevel l) {
+        if (l == null || l.getLevelRoles() == null) {
+            return;
+        }
         JSONObject obj = JSONObject.parse(l.getLevelRoles());
         if (obj != null && !obj.isEmpty()) {
             l.setRoles(obj.toJavaObject(LevelVO.class));

+ 6 - 4
doc-biz/src/main/java/com/doc/biz/service/impl/DocDirServiceImpl.java

@@ -61,10 +61,12 @@ public class DocDirServiceImpl implements IDocDirService {
         String yes = "Y";
         if (yes.equals(dir.getIsEncrypt())) {
             DocDirLevel level = levelService.selectDocDirLevelByLevelCode(dir.getEncryptLevel());
-            JSONObject obj = JSONObject.parse(level.getLevelRoles());
-            if (obj.getInteger(roleCode) == null || obj.getInteger(roleCode) != 1) {
-                //只有权限为选中状态才有滴
-                return false;
+            if (level != null && level.getLevelRoles() != null) {
+                JSONObject obj = JSONObject.parse(level.getLevelRoles());
+                if (obj.getInteger(roleCode) == null || obj.getInteger(roleCode) != 1) {
+                    //只有权限为选中状态才有滴
+                    return false;
+                }
             }
         }
         //如果不是加密目录,肯定是所有权限都有滴