From 0db1332a24fd352ebb65149cfe0356ce44384742 Mon Sep 17 00:00:00 2001 From: zhaol <15900249928@163.com> Date: Tue, 21 Jan 2025 14:14:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E9=98=85=E8=A7=88=E4=BA=8B?= =?UTF-8?q?=E4=B8=9A=E9=83=A8=E5=90=8D=E7=A7=B0=E6=95=B0=E6=8D=AE=E6=88=AA?= =?UTF-8?q?=E5=8F=96=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublishExecuteListenerInterfaceImpl.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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","伊利集团总部"); } } }