package com.yiidata.intergration.web.task; import com.yiidata.intergration.web.config.IntenetProperties; import com.yiidata.intergration.web.config.TaskProperties; import com.yiidata.intergration.web.modules.dingtalk.service.DingTalkMessageService; import com.yiidata.intergration.web.modules.dingtalk.task.CzscAnalysisTask; import com.yiidata.intergration.web.modules.dingtalk.task.XGAnalysisTask; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; import java.util.HashMap; import java.util.Map; import java.util.Optional; /** *
* * Created by zhaopx. * User: zhaopx * Date: 2020/11/17 * Time: 12:54 * ** * @author zhaopx */ @Component @Slf4j public class DefaultTaskFactory { @Autowired TaskProperties taskProperties; @Autowired IntenetProperties intenetProperties; @Autowired DingTalkMessageService dingTalkMessageService; @Autowired JdbcTemplate jdbcTemplate; /** * 根据 TaskInfo 生成 Task,不同 Task 类型 * @param taskId TaskID * @param taskInfo * @return */ public SuperTask newTask(String taskId, Map