diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java index 0e20f23e..3d2561d9 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java @@ -805,12 +805,22 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme if(isclosed==false){ String allpath = SDK.getORGAPI().getDepartmentById(applydepid).getPathNameOfCache(); if(allpath.contains("事业部")){ - String depname=allpath.substring(allpath.indexOf("/")+2,allpath.indexOf("事业部")+3); - if(depname!=null){ - bo.set("BUSINESS_DIVISION",depname); + //String depname=allpath.substring(allpath.indexOf("/")+2,allpath.indexOf("事业部")+3); + // 原始字符串 + String input = allpath; + if(input.contains("/")){ + // 使用split方法按"/"分割字符串 + String[] parts = input.split("/"); + // 检查是否分割成功且有数据 + if (parts.length > 0) { + String department = parts[0]; + bo.set("BUSINESS_DIVISION",department); + } } + + } else if(allpath.contains("伊利集团总部")){ - bo.set("BUSINESS_DIVISION","伊利集团总部"); + bo.set("BUSINESS_DIVISION","伊利集团总部"); } } }