Commit f621ee75 authored by sml's avatar sml

代码提交

parent 1e9b432d
...@@ -460,7 +460,7 @@ public class AzkabanApiUtils2 { ...@@ -460,7 +460,7 @@ public class AzkabanApiUtils2 {
* @param projectDesc 项目描述 * @param projectDesc 项目描述
* @param uploadZipPath 上传zip包的全路径 * @param uploadZipPath 上传zip包的全路径
*/ */
public boolean loginCreateProjectuploadZipAndExecute(String projectName, String projectDesc, String uploadZipPath, String flowName) { public Integer loginCreateProjectuploadZipAndExecute(String projectName, String projectDesc, String uploadZipPath, String flowName) {
//登录 //登录
String sessionId = login(); String sessionId = login();
...@@ -469,12 +469,12 @@ public class AzkabanApiUtils2 { ...@@ -469,12 +469,12 @@ public class AzkabanApiUtils2 {
Map<String, Object> map = uploadZip(sessionId, projectName, uploadZipPath); Map<String, Object> map = uploadZip(sessionId, projectName, uploadZipPath);
if (map.containsKey("error")) { if (map.containsKey("error")) {
return false; return null;
} }
//立即执行 //立即执行
executeFlow(sessionId, projectName, flowName); Integer execId = executeFlow(sessionId, projectName, flowName);
return true; return execId;
} }
/** /**
......
...@@ -170,18 +170,18 @@ public class DmpDevelopTaskController { ...@@ -170,18 +170,18 @@ public class DmpDevelopTaskController {
@RequestMapping(method = RequestMethod.GET, value = "/taskAzkabanRun") @RequestMapping(method = RequestMethod.GET, value = "/taskAzkabanRun")
@ApiOperation(value = "任务立即运行接口", notes = "任务立即运行接口") @ApiOperation(value = "任务立即运行接口", notes = "任务立即运行接口")
@ApiImplicitParam(name = "treeId", value = "任务树主键") @ApiImplicitParam(name = "treeId", value = "任务树主键")
public BaseResponse taskAzkabanRun(@RequestParam(value = "treeId", required = true) Long treeId, HttpServletRequest httpRequest){ public BaseBeanResponse<Integer> taskAzkabanRun(@RequestParam(value = "treeId", required = true) Long treeId, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse(); BaseBeanResponse<Integer> baseBeanResponse = new BaseBeanResponse<Integer>();
try { try {
baseResponse = dmpDevelopTaskService.taskAzkabanRun(treeId, httpRequest); baseBeanResponse = dmpDevelopTaskService.taskAzkabanRun(treeId, httpRequest);
} catch (Exception e) { } catch (Exception e) {
baseResponse.setMessage("任务运行失败"); baseBeanResponse.setMessage("任务运行失败");
baseResponse.setCode(StatuConstant.FAILURE_CODE); baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
e.printStackTrace(); e.printStackTrace();
} }
return baseResponse; return baseBeanResponse;
} }
/**任务立即运行停止 /**任务立即运行停止
......
...@@ -118,12 +118,12 @@ public interface DmpDevelopTaskService { ...@@ -118,12 +118,12 @@ public interface DmpDevelopTaskService {
* @param @param httpRequest * @param @param httpRequest
* @param @return * @param @return
* @param @throws Exception 参数 * @param @throws Exception 参数
* @return BaseResponse 返回类型 * @return BaseBeanResponse 返回类型
* @throws * @throws
* @Title: taskAzkabanRun * @Title: taskAzkabanRun
* @Description: TODO(运行任务) * @Description: TODO(运行任务)
*/ */
public BaseResponse taskAzkabanRun(Long treeId, HttpServletRequest httpRequest) throws Exception; public BaseBeanResponse<Integer> taskAzkabanRun(Long treeId, HttpServletRequest httpRequest) throws Exception;
/** /**
* @param @param treeId * @param @param treeId
......
...@@ -1445,29 +1445,30 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop ...@@ -1445,29 +1445,30 @@ public class DmpDevelopTaskServiceImpl extends BaseService implements DmpDevelop
* 运行任务 * 运行任务
*/ */
@Override @Override
public BaseResponse taskAzkabanRun(Long treeId, HttpServletRequest httpRequest) throws Exception { public BaseBeanResponse<Integer> taskAzkabanRun(Long treeId, HttpServletRequest httpRequest) throws Exception {
BaseResponse baseResponse = new BaseResponse(); BaseBeanResponse<Integer> baseBeanResponse = new BaseBeanResponse<Integer>();
DmpDevelopTask developTask = dmpDevelopTaskDao.get(treeId); DmpDevelopTask developTask = dmpDevelopTaskDao.get(treeId);
//先发布任务 //先发布任务
boolean flag = publishAndExecute(developTask); Integer execId = publishAndExecute(developTask);
if (flag) { if (execId!=null) {
baseResponse.setCode(StatuConstant.SUCCESS_CODE); baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE);
baseResponse.setMessage("立即运行成功"); baseBeanResponse.setMessage("立即运行成功");
baseBeanResponse.setData(execId);
} else { } else {
baseResponse.setCode(StatuConstant.FAILURE_CODE); baseBeanResponse.setCode(StatuConstant.FAILURE_CODE);
baseResponse.setMessage("立即运行失败"); baseBeanResponse.setMessage("立即运行失败");
} }
return baseResponse; return baseBeanResponse;
} }
/** /**
* 发布流程 * 发布流程
*/ */
private boolean publishAndExecute(DmpDevelopTask dmpDevelopTask) throws Exception { private Integer publishAndExecute(DmpDevelopTask dmpDevelopTask) throws Exception {
Integer taskId = dmpDevelopTask.getId(); //任务id Integer taskId = dmpDevelopTask.getId(); //任务id
Integer projectId = dmpDevelopTask.getProjectId(); //项目id Integer projectId = dmpDevelopTask.getProjectId(); //项目id
String treeName = dmpDevelopTask.getName(); //任务流程名称 String treeName = dmpDevelopTask.getName(); //任务流程名称
......
...@@ -171,7 +171,11 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -171,7 +171,11 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
//根据任务id,查询DMP资源导航树和DW系统配置信息 //根据任务id,查询DMP资源导航树和DW系统配置信息
Map<String, Object> map = offlineSynchDao.selectNavigationTreeByTaskId(taskId); Map<String, Object> map = offlineSynchDao.selectNavigationTreeByTaskId(taskId);
if (map.size() > 0 && map != null) { if (map.size() > 0 && map != null) {
flag = this.publish(map); Integer execId = this.publish(map);
if (execId!=null) {
flag = true;
}
if (flag) { if (flag) {
return new JsonResult(ResultCode.SUCCESS, flag); return new JsonResult(ResultCode.SUCCESS, flag);
} else { } else {
...@@ -185,7 +189,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService { ...@@ -185,7 +189,7 @@ public class OfflineSynchServiceImpl implements OfflineSynchService {
/** /**
* 发布流程 * 发布流程
*/ */
private boolean publish(Map<String, Object> map) throws Exception { private Integer publish(Map<String, Object> map) throws Exception {
String taskId = map.get("taskId").toString(); //任务id String taskId = map.get("taskId").toString(); //任务id
String projectId = map.get("projectId").toString(); //项目id String projectId = map.get("projectId").toString(); //项目id
String treeName = map.get("treeName").toString(); //任务流程名称 String treeName = map.get("treeName").toString(); //任务流程名称
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment