From e63502f812fe8da5eed086fb393630d2edcbd5cf Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 15 Dec 2025 18:29:31 +0800 Subject: [PATCH] =?UTF-8?q?1.0.46=20=E9=80=9A=E8=BF=87=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E6=96=B9=E5=90=91=E8=8E=B7=E5=8F=96=E4=B8=9A=E5=8A=A1=E6=96=B9?= =?UTF-8?q?=E5=90=91=E8=B4=9F=E8=B4=A3=E4=BA=BAID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/rule/SpelRuleComponent.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/rule/SpelRuleComponent.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/rule/SpelRuleComponent.java index 059bbce1..b84a5850 100644 --- a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/rule/SpelRuleComponent.java +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/rule/SpelRuleComponent.java @@ -3,11 +3,19 @@ package org.dromara.workflow.rule; import cn.hutool.core.util.ObjectUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.config.annotation.DubboReference; import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.exception.user.UserException; +import org.dromara.common.tenant.helper.TenantHelper; import org.dromara.system.api.RemoteDeptService; +import org.dromara.system.api.RemoteUserService; +import org.dromara.system.api.model.LoginUser; import org.dromara.workflow.common.ConditionalOnEnable; import org.springframework.stereotype.Component; +import java.util.HashMap; +import java.util.Map; + /** * spel表达式规则组件 *

@@ -46,4 +54,38 @@ public class SpelRuleComponent { return vicePresidentId; } + /** + * 业务方向到负责人用户名的映射 + * 1智能轮胎 -> 董兰飞 + * 2轮胎工厂 -> 佟强 + * 3快递物流 -> 张东辉 + * 4锂电 -> 佟强 + * 5工业软件 -> 尹治丰 + * 6智能制造 -> 祁海波 + * 7新行业及零售 -> 张东辉 + */ + private static final Map BUSINESS_DIRECTION_TO_USERNAME = new HashMap() {{ + put(1, 1985254821554475009L); + put(2, 1985258519835889666L); + put(3, 1985251968270127105L); + put(4, 1985258519835889666L); + put(5, 1985254145713688578L); + put(6, 1985257496048226305L); + put(7, 1985251968270127105L); + }}; + + /** + * 通过业务方向获取业务方向负责人ID + * + * @param businessDirection 业务方向(1智能轮胎、2轮胎工厂、3快递物流、4锂电、5工业软件、6智能制造、7新行业及零售) + * @return 用户ID + */ + public Long selectBusinessDirectionLeaderById(Integer businessDirection) { + if (ObjectUtil.isNull(businessDirection)) { + throw new ServiceException("业务方向不能为空"); + } + return BUSINESS_DIRECTION_TO_USERNAME.get(businessDirection); + } + + }