package nckd.jxccl.wtc.workflow;

import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.workflow.api.AgentExecution;
import kd.bos.workflow.engine.extitf.IWorkflowPlugin;
import nckd.jxccl.base.wtc.helper.WTCHelper;

/**
 * 工作流插件
 * 获取人员的职务层级
 * 人员档案-党政职务变更履历-职务层级
 * 流程变量中需要配置employeeId和zwcj
 * @author Tyx
 */
public class GetZwcjWorkflowPlugin implements IWorkflowPlugin {

    private static final Log log = LogFactory.getLog(GetZwcjWorkflowPlugin.class);

    @Override
    public void notify(AgentExecution execution) {
        IWorkflowPlugin.super.notify(execution);
        Long employeeId = Long.valueOf(execution.getVariable("employeeId").toString());
        log.info("employeeId : " + employeeId);
        String zwcj = WTCHelper.getZwcjByEmployeeId(employeeId);
        log.info("zwcj : " + zwcj);
        execution.setVariable("zwcj",  zwcj);
    }
}