|
|
|
|
@ -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表达式规则组件
|
|
|
|
|
* <p>
|
|
|
|
|
@ -46,4 +54,38 @@ public class SpelRuleComponent {
|
|
|
|
|
return vicePresidentId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 业务方向到负责人用户名的映射
|
|
|
|
|
* 1智能轮胎 -> 董兰飞
|
|
|
|
|
* 2轮胎工厂 -> 佟强
|
|
|
|
|
* 3快递物流 -> 张东辉
|
|
|
|
|
* 4锂电 -> 佟强
|
|
|
|
|
* 5工业软件 -> 尹治丰
|
|
|
|
|
* 6智能制造 -> 祁海波
|
|
|
|
|
* 7新行业及零售 -> 张东辉
|
|
|
|
|
*/
|
|
|
|
|
private static final Map<Integer, Long> BUSINESS_DIRECTION_TO_USERNAME = new HashMap<Integer, Long>() {{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|