| | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.xxl.job.core.log.XxlJobLogger; |
| | | import io.swagger.models.auth.In; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.List; |
| | |
| | | @XxlJob("createTaskJobHandler") |
| | | public ReturnT<String> createTaskJobHandler(String param){ |
| | | XxlJobLogger.log("开始自动创建任务..."); |
| | | XxlJobLogger.log("参数:" + param); |
| | | XxlJobLogger.log("..."); |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | String processDefinitionId = jsonParam.getString("processDefinitionId"); |
| | | String taskType = jsonParam.getString("taskType"); |
| | | String title = jsonParam.getString("title"); |
| | | String content = jsonParam.getString("content"); |
| | | String typeStr = jsonParam.getString("type"); |
| | | int type = 0; |
| | | if (!StringUtil.isBlank(typeStr)) |
| | | type = Integer.parseInt(typeStr); |
| | | // 远程调用 |
| | | List<Integer> taskJobHandler = patrolTasClient.createTaskJobHandler(processDefinitionId, taskType, title, content); |
| | | List<Integer> taskJobHandler = patrolTasClient.createTaskJobHandler(processDefinitionId, taskType, title, content, type); |
| | | // 打印响应数据 |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | XxlJobLogger.log("总数量:<span style='color:red'>" + taskJobHandler.get(0) + "</span> ... 失败数量:<span style='color:red'>" + taskJobHandler.get(1) + "</span> "); |