liurunyu
2025-05-22 a156726f9823a6d690c31da7d0114db718a89867
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java
@@ -45,12 +45,10 @@
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            /*
            if(!this.existPrivileges()){
                this.init(event);
            }
            */
            this.init(event);
            //this.init(event);
        }
    }
@@ -65,11 +63,29 @@
            Document doc = configXml.createDom(configFileURL) ;
            this.doInit(configXml, doc);
        } catch (Exception e) {
            System.out.println("系统启动时,初始化配置出错 !");
            System.out.println("系统启动时,初始化权限配置出错 !");
            System.out.println(e.getMessage());
            e.printStackTrace();
        }
    }
    private void doInit(ConfigXml configXml, Document doc) throws Exception{
        if(configXml != null && doc != null){
            Element prs = configXml.getElement(doc, "config.privileges") ;
            if(prs != null){
                List<Element> list = prs.getChildren() ;
                if(list != null){
                    for(Element ele : list){
                        String num = ele.getAttributeValue("num") ;
                        String name = ele.getAttributeValue("name") ;
                        String type = ele.getAttributeValue("type") ;
                        String typeName = ele.getAttributeValue("typeName") ;
                        this.savePrivilege(num, name, type,typeName);
                    }
                }
            }
        }
    }
    /*
    private void doInit(ConfigXml configXml, Document doc) throws Exception{
        if(configXml != null && doc != null){
            Element prs = configXml.getElement(doc, "config.privileges") ;
@@ -91,7 +107,7 @@
            }
        }
    }
    *
    /**
     * 数据库中是否存在相关数据