package com.xjrsoft.module.liteflow.node;

import cn.hutool.core.convert.Convert;
import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
import com.yomahub.liteflow.core.NodeComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 教师请假流程结束处理
 */
@Component("wf_teacherleave_node")
public class WfTeacherleaveNode extends NodeComponent {
    @Autowired
    private IWfTeacherleaveService wfTeacherleaveService;

    @Override
    public void process() throws Exception {
        // 获取表单中数据编号
        Map<String, Object> params = this.getFirstContextBean();
        Object value = util.getFormDatKey(params,"id");
        Long formId = Convert.toLong(value);
        if (formId != null) {
            // 数据处理
            wfTeacherleaveService.dataHandle(formId);

            wfTeacherleaveService.hikvisionLeave(formId);
        }
    }
}
