| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | String personNumber = jsonParam.getString("personNumber"); |
| | | String day = jsonParam.getString("day"); |
| | | // 创建外呼任务 |
| | | Object result = outCallClient.createOutCallTaskJobHandler(isOver,taskScheduleTime,personNumber, day); |
| | | String[] split = result.toString().split(","); |
| | | if (split[0].equals("true")) { |
| | | // 获取任务id |
| | | String taskId = split[1]; |
| | | // 修改定时任务 |
| | | XxlJobInfo jobInfo = xxlJobInfoService.getById(11); |
| | | // 解析参数 |
| | | Map mapParams = (Map) jobInfo.getExecutorParam(); |
| | | String time = mapParams.get("time").toString(); |
| | | XxlJobInfoVO xxlJobInfo = new XxlJobInfoVO(); |
| | | xxlJobInfo.setId(11); |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | map.put("taskId", taskId); |
| | | map.put("time", time); |
| | | xxlJobInfo.setExecutorParam(map); |
| | | Object o = xxlJobInfoService.updateXxlJobById(xxlJobInfo); |
| | | if (Boolean.parseBoolean(o.toString())) { |
| | | XxlJobLogger.log("外呼未接通短信通知定时任务修改成功!任务ID:" + taskId); |
| | | }else { |
| | | XxlJobLogger.log("外呼未接通短信通知定时任务修改失败!任务ID:" + taskId); |
| | | } |
| | | } |
| | | List<String> result = outCallClient.createOutCallTaskJobHandler(isOver,taskScheduleTime,personNumber, day); |
| | | XxlJobLogger.log("任务响应结果..." + result); |
| | | // if (result.get(2).equals("true")) { |
| | | // // 获取任务id |
| | | // String taskId = result.get(1); |
| | | // // 修改定时任务 |
| | | // XxlJobInfo jobInfo = xxlJobInfoService.getById(11); |
| | | // // 解析参数 |
| | | // Map mapParams = (Map) jobInfo.getExecutorParam(); |
| | | // String time = mapParams.get("time").toString(); |
| | | // XxlJobInfoVO xxlJobInfo = new XxlJobInfoVO(); |
| | | // xxlJobInfo.setId(11); |
| | | // Map<String, Object> map = new HashMap<>(2); |
| | | // map.put("taskId", taskId); |
| | | // map.put("time", time); |
| | | // xxlJobInfo.setExecutorParam(map); |
| | | // Object o = xxlJobInfoService.updateXxlJobById(xxlJobInfo); |
| | | // if (Boolean.parseBoolean(o.toString())) { |
| | | // XxlJobLogger.log("外呼未接通短信通知定时任务修改成功!任务ID:" + taskId); |
| | | // }else { |
| | | // XxlJobLogger.log("外呼未接通短信通知定时任务修改失败!任务ID:" + taskId); |
| | | // } |
| | | // } |
| | | XxlJobLogger.log("结束自动创建任务..."); |
| | | return ReturnT.SUCCESS; |
| | | } |